1
1
import { join } from 'path' ;
2
2
import * as os from 'os' ;
3
+ import { trim } from 'lodash' ;
3
4
import { version } from '../package.json' ;
4
5
5
6
const homedir = join ( __dirname , '..' ) ;
@@ -15,15 +16,17 @@ const defaultsDir = process.env.RI_BUILD_TYPE === 'ELECTRON' && process['resourc
15
16
? join ( process [ 'resourcesPath' ] , 'defaults' )
16
17
: join ( __dirname , '..' , 'defaults' ) ;
17
18
18
- const customPluginsUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /plugins` : '/plugins' ;
19
- const staticUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /static` : '/static' ;
20
- const tutorialsUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /static/tutorials` : '/static/tutorials' ;
21
- const customTutorialsUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /static/custom-tutorials` : '/static/custom-tutorials' ;
22
- const contentUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /static/content` : '/static/content' ;
23
- const defaultPluginsUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /static/plugins` : '/static/plugins' ;
24
- const pluginsAssetsUri = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /static/resources/plugins` : '/static/resources/plugins' ;
19
+ const proxyPath = trim ( process . env . RI_PROXY_PATH , '/' ) ;
25
20
26
- const socketPath = process . env . RI_PROXY_PATH ? `/${ process . env . RI_PROXY_PATH } /socket.io` : '/socket.io' ;
21
+ const customPluginsUri = join ( '/' , proxyPath , 'plugins' ) ;
22
+ const staticUri = join ( '/' , proxyPath , 'static' ) ;
23
+ const tutorialsUri = join ( '/' , proxyPath , 'static' , 'tutorials' ) ;
24
+ const customTutorialsUri = join ( '/' , proxyPath , 'static' , 'custom-tutorials' ) ;
25
+ const contentUri = join ( '/' , proxyPath , 'static' , 'content' ) ;
26
+ const defaultPluginsUri = join ( '/' , proxyPath , 'static' , 'plugins' ) ;
27
+ const pluginsAssetsUri = join ( '/' , proxyPath , 'static' , 'resources' , 'plugins' ) ;
28
+
29
+ const socketPath = join ( '/' , proxyPath , 'socket.io' ) ;
27
30
const dataDir = process . env . RI_BUILD_TYPE === 'ELECTRON' && process [ 'resourcesPath' ]
28
31
? join ( process [ 'resourcesPath' ] , 'data' )
29
32
: join ( __dirname , '..' , 'data' ) ;
@@ -65,7 +68,7 @@ export default {
65
68
defaultPluginsUri,
66
69
pluginsAssetsUri,
67
70
base : process . env . RI_BASE || '/' ,
68
- proxyPath : process . env . RI_PROXY_PATH || '' ,
71
+ proxyPath,
69
72
secretStoragePassword : process . env . RI_SECRET_STORAGE_PASSWORD ,
70
73
encryptionKey : process . env . RI_ENCRYPTION_KEY ,
71
74
tlsCert : process . env . RI_SERVER_TLS_CERT ,
0 commit comments