mirror of
https://github.com/whyour/qinglong.git
synced 2025-08-24 04:36:08 +08:00
修改 schedule 服务代理环境变量
This commit is contained in:
parent
95afcbc9dd
commit
be1d68c0d1
|
@ -8,10 +8,12 @@ async function linkToNodeModule(src: string, dst?: string) {
|
||||||
const target = path.join(config.rootPath, 'node_modules', dst || src);
|
const target = path.join(config.rootPath, 'node_modules', dst || src);
|
||||||
const source = path.join(config.rootPath, src);
|
const source = path.join(config.rootPath, src);
|
||||||
|
|
||||||
|
try {
|
||||||
const stats = await fs.lstat(target);
|
const stats = await fs.lstat(target);
|
||||||
if (!stats) {
|
if (!stats) {
|
||||||
await fs.symlink(source, target, 'dir');
|
await fs.symlink(source, target, 'dir');
|
||||||
}
|
}
|
||||||
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function linkCommand() {
|
async function linkCommand() {
|
||||||
|
|
|
@ -8,6 +8,7 @@ const app = express();
|
||||||
const client = new HealthClient(
|
const client = new HealthClient(
|
||||||
`0.0.0.0:${config.cronPort}`,
|
`0.0.0.0:${config.cronPort}`,
|
||||||
credentials.createInsecure(),
|
credentials.createInsecure(),
|
||||||
|
{ 'grpc.enable_http_proxy': 0 },
|
||||||
);
|
);
|
||||||
|
|
||||||
app.get('/api/health', (req, res) => {
|
app.get('/api/health', (req, res) => {
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Client {
|
||||||
private client = new CronClient(
|
private client = new CronClient(
|
||||||
`0.0.0.0:${config.cronPort}`,
|
`0.0.0.0:${config.cronPort}`,
|
||||||
credentials.createInsecure(),
|
credentials.createInsecure(),
|
||||||
|
{ 'grpc.enable_http_proxy': 0 },
|
||||||
);
|
);
|
||||||
|
|
||||||
addCron(request: AddCronRequest['crons']): Promise<AddCronResponse> {
|
addCron(request: AddCronRequest['crons']): Promise<AddCronResponse> {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { check } from './health';
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
import Logger from '../loaders/logger';
|
import Logger from '../loaders/logger';
|
||||||
|
|
||||||
const server = new Server();
|
const server = new Server({ 'grpc.enable_http_proxy': 0 });
|
||||||
server.addService(HealthService, { check });
|
server.addService(HealthService, { check });
|
||||||
server.addService(CronService, { addCron, delCron });
|
server.addService(CronService, { addCron, delCron });
|
||||||
server.bindAsync(
|
server.bindAsync(
|
||||||
|
|
|
@ -9,6 +9,14 @@ module.exports = {
|
||||||
source_map_support: true,
|
source_map_support: true,
|
||||||
time: true,
|
time: true,
|
||||||
script: 'static/build/schedule/index.js',
|
script: 'static/build/schedule/index.js',
|
||||||
|
env: {
|
||||||
|
http_proxy: '',
|
||||||
|
https_proxy: '',
|
||||||
|
HTTP_PROXY: '',
|
||||||
|
HTTPS_PROXY: '',
|
||||||
|
all_proxy: '',
|
||||||
|
ALL_PROXY: '',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'public',
|
name: 'public',
|
||||||
|
|
|
@ -71,6 +71,7 @@ import_config() {
|
||||||
ql_port=${QlPort:-"5700"}
|
ql_port=${QlPort:-"5700"}
|
||||||
command_timeout_time=${CommandTimeoutTime:-""}
|
command_timeout_time=${CommandTimeoutTime:-""}
|
||||||
file_extensions=${RepoFileExtensions:-"js py"}
|
file_extensions=${RepoFileExtensions:-"js py"}
|
||||||
|
proxy_url=${ProxyUrl:-""}
|
||||||
current_branch=${QL_BRANCH}
|
current_branch=${QL_BRANCH}
|
||||||
|
|
||||||
if [[ -n "${DefaultCronRule}" ]]; then
|
if [[ -n "${DefaultCronRule}" ]]; then
|
||||||
|
@ -87,6 +88,9 @@ import_config() {
|
||||||
set_proxy() {
|
set_proxy() {
|
||||||
local proxy="$1"
|
local proxy="$1"
|
||||||
if [[ $proxy ]]; then
|
if [[ $proxy ]]; then
|
||||||
|
proxy_url="$proxy"
|
||||||
|
fi
|
||||||
|
if [[ $proxy_url ]]; then
|
||||||
export http_proxy="${proxy_url}"
|
export http_proxy="${proxy_url}"
|
||||||
export https_proxy="${proxy_url}"
|
export https_proxy="${proxy_url}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user