File tree Expand file tree Collapse file tree 7 files changed +15
-15
lines changed Expand file tree Collapse file tree 7 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 3
3
import yargs from 'yargs' ;
4
4
import { hideBin } from 'yargs/helpers' ;
5
5
import * as fs from 'fs' ;
6
- import config from './src/config/file' ;
6
+ import { configFile , setConfigFile , validate } from './src/config/file' ;
7
7
import proxy from './src/proxy' ;
8
8
import service from './src/service' ;
9
9
@@ -28,22 +28,22 @@ const argv = yargs(hideBin(process.argv))
28
28
. strict ( )
29
29
. parseSync ( ) ;
30
30
31
- config . configFile = argv . c ? argv . c : undefined ;
31
+ setConfigFile ( argv . c as string || "" ) ;
32
32
33
33
if ( argv . v ) {
34
- if ( ! fs . existsSync ( config . configFile as string ) ) {
34
+ if ( ! fs . existsSync ( configFile ) ) {
35
35
console . error (
36
- `Config file ${ config . configFile } doesn't exist, nothing to validate! Did you forget -c/--config?` ,
36
+ `Config file ${ configFile } doesn't exist, nothing to validate! Did you forget -c/--config?` ,
37
37
) ;
38
38
process . exit ( 1 ) ;
39
39
}
40
40
41
- config . validate ( ) ;
42
- console . log ( `${ config . configFile } is valid` ) ;
41
+ validate ( ) ;
42
+ console . log ( `${ configFile } is valid` ) ;
43
43
process . exit ( 0 ) ;
44
44
}
45
45
46
- config . validate ( ) ;
46
+ validate ( ) ;
47
47
48
48
proxy . start ( ) ;
49
49
service . start ( ) ;
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ const util = require('util');
7
7
8
8
const GIT_PROXY_COOKIE_FILE = 'git-proxy-cookie' ;
9
9
// GitProxy UI HOST and PORT (configurable via environment variable)
10
- const { GIT_PROXY_UI_HOST : uiHost = 'http://localhost' } = process . env ;
11
- const { GIT_PROXY_UI_PORT : uiPort } = require ( '@finos/git-proxy/src/config/env' ) . Vars ;
10
+ const { GIT_PROXY_UI_HOST : uiHost , GIT_PROXY_UI_PORT : uiPort } =
11
+ require ( '@finos/git-proxy/src/config/env' ) . serverConfig ;
12
12
const baseUrl = `${ uiHost } :${ uiPort } ` ;
13
13
14
14
axios . defaults . timeout = 30000 ;
Original file line number Diff line number Diff line change 1
1
import fs from 'fs' ;
2
2
import Datastore from '@seald-io/nedb'
3
- import { Action } from '../../proxy/actions/Action' ;
4
3
import { Repo } from '../types' ;
5
4
6
5
if ( ! fs . existsSync ( './.data' ) ) fs . mkdirSync ( './.data' ) ;
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ const config = require('../config');
9
9
const db = require ( '../db' ) ;
10
10
const { PluginLoader } = require ( '../plugin' ) ;
11
11
const chain = require ( './chain' ) ;
12
- const { GIT_PROXY_SERVER_PORT : proxyHttpPort } = require ( '../config/env' ) . Vars ;
13
- const { GIT_PROXY_HTTPS_SERVER_PORT : proxyHttpsPort } = require ( '../config/env' ) . Vars ;
12
+ const { GIT_PROXY_SERVER_PORT : proxyHttpPort , GIT_PROXY_HTTPS_SERVER_PORT : proxyHttpsPort } =
13
+ require ( '../config/env' ) . serverConfig ;
14
14
15
15
const options = {
16
16
inflate : true ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const limiter = rateLimit({
14
14
max : 100 , // limit each IP to 100 requests per windowMs
15
15
} ) ;
16
16
17
- const { GIT_PROXY_UI_PORT : uiPort } = require ( '../config/env' ) . Vars ;
17
+ const { GIT_PROXY_UI_PORT : uiPort } = require ( '../config/env' ) . serverConfig ;
18
18
19
19
const _httpServer = http . createServer ( app ) ;
20
20
Original file line number Diff line number Diff line change 1
1
const { GIT_PROXY_SERVER_PORT : PROXY_HTTP_PORT , GIT_PROXY_UI_PORT : UI_PORT } =
2
- require ( '../config/env' ) . Vars ;
2
+ require ( '../config/env' ) . serverConfig ;
3
3
const config = require ( '../config' ) ;
4
4
5
5
module . exports = {
Original file line number Diff line number Diff line change 12
12
"isolatedModules" : true ,
13
13
"module" : " CommonJS" ,
14
14
"esModuleInterop" : true ,
15
- "allowSyntheticDefaultImports" : true
15
+ "allowSyntheticDefaultImports" : true ,
16
+ "resolveJsonModule" : true
16
17
},
17
18
"include" : [" src" ]
18
19
}
You can’t perform that action at this time.
0 commit comments