diff --git a/back/loaders/deps.ts b/back/loaders/deps.ts index f8b43860..34738f48 100644 --- a/back/loaders/deps.ts +++ b/back/loaders/deps.ts @@ -8,10 +8,12 @@ async function linkToNodeModule(src: string, dst?: string) { const target = path.join(config.rootPath, 'node_modules', dst || src); const source = path.join(config.rootPath, src); - const stats = await fs.lstat(target); - if (!stats) { - await fs.symlink(source, target, 'dir'); - } + try { + const stats = await fs.lstat(target); + if (!stats) { + await fs.symlink(source, target, 'dir'); + } + } catch (error) {} } async function linkCommand() { diff --git a/back/public.ts b/back/public.ts index 2cc7174d..d8ff6ba9 100644 --- a/back/public.ts +++ b/back/public.ts @@ -8,6 +8,7 @@ const app = express(); const client = new HealthClient( `0.0.0.0:${config.cronPort}`, credentials.createInsecure(), + { 'grpc.enable_http_proxy': 0 }, ); app.get('/api/health', (req, res) => { diff --git a/back/schedule/client.ts b/back/schedule/client.ts index ab70dba0..183841c2 100644 --- a/back/schedule/client.ts +++ b/back/schedule/client.ts @@ -12,6 +12,7 @@ class Client { private client = new CronClient( `0.0.0.0:${config.cronPort}`, credentials.createInsecure(), + { 'grpc.enable_http_proxy': 0 }, ); addCron(request: AddCronRequest['crons']): Promise { diff --git a/back/schedule/index.ts b/back/schedule/index.ts index caea567c..1160153e 100644 --- a/back/schedule/index.ts +++ b/back/schedule/index.ts @@ -7,7 +7,7 @@ import { check } from './health'; import config from '../config'; import Logger from '../loaders/logger'; -const server = new Server(); +const server = new Server({ 'grpc.enable_http_proxy': 0 }); server.addService(HealthService, { check }); server.addService(CronService, { addCron, delCron }); server.bindAsync( diff --git a/ecosystem.config.js b/ecosystem.config.js index 2fd5b70f..0a48440c 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -9,6 +9,14 @@ module.exports = { source_map_support: true, time: true, script: 'static/build/schedule/index.js', + env: { + http_proxy: '', + https_proxy: '', + HTTP_PROXY: '', + HTTPS_PROXY: '', + all_proxy: '', + ALL_PROXY: '', + }, }, { name: 'public', diff --git a/shell/share.sh b/shell/share.sh index 1d440236..320b8ff0 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -71,6 +71,7 @@ import_config() { ql_port=${QlPort:-"5700"} command_timeout_time=${CommandTimeoutTime:-""} file_extensions=${RepoFileExtensions:-"js py"} + proxy_url=${ProxyUrl:-""} current_branch=${QL_BRANCH} if [[ -n "${DefaultCronRule}" ]]; then @@ -87,6 +88,9 @@ import_config() { set_proxy() { local proxy="$1" if [[ $proxy ]]; then + proxy_url="$proxy" + fi + if [[ $proxy_url ]]; then export http_proxy="${proxy_url}" export https_proxy="${proxy_url}" fi