Skip to content

Commit f6ba253

Browse files
committed
chore: seperate port envs for master and enclave
Ticket: WP-4663
1 parent 6257667 commit f6ba253

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ Configuration is done via environment variables:
2727

2828
### Network Settings
2929

30-
- `PORT` - Port to listen on (default: 3080)
31-
- `BIND` - Address to bind to (default: localhost)
32-
- `TIMEOUT` - Request timeout in milliseconds (default: 305000)
30+
#### Enclaved Mode
31+
32+
- `ENCLAVED_EXPRESS_PORT` - Port to listen on (default: 3080)
33+
- `MASTER_BITGO_EXPRESS_BIND` - Address to bind to (default: localhost)
34+
- `MASTER_BITGO_EXPRESS_TIMEOUT` - Request timeout in milliseconds (default: 305000)
35+
36+
#### Master Express Mode
37+
38+
- `MASTER_EXPRESS_PORT` - Port to listen on (default: 3081)
39+
- `BITGO_BIND` - Address to bind to (default: localhost)
40+
- `BITGO_TIMEOUT` - Request timeout in milliseconds (default: 305000)
3341

3442
### TLS Settings
3543

@@ -42,8 +50,6 @@ Configuration is done via environment variables:
4250

4351
### Master Express Settings
4452

45-
- `BITGO_PORT` - Port to listen on (default: 3080)
46-
- `BITGO_BIND` - Address to bind to (default: localhost)
4753
- `BITGO_ENV` - Environment name (default: test)
4854
- `BITGO_ENABLE_SSL` - Enable SSL and certificate verification (default: true)
4955
- `BITGO_ENABLE_PROXY` - Enable proxy (default: true)
@@ -69,7 +75,7 @@ For testing purposes, you can use self-signed certificates with relaxed verifica
6975

7076
```bash
7177
APP_MODE=enclaved \
72-
MASTER_BITGO_EXPRESS_PORT=3080 \
78+
ENCLAVED_EXPRESS_PORT=3080 \
7379
MASTER_BITGO_EXPRESS_BIND=localhost \
7480
MASTER_BITGO_EXPRESS_KEYPATH=./test-ssl-key.pem \
7581
MASTER_BITGO_EXPRESS_CRTPATH=./test-ssl-cert.pem \
@@ -85,12 +91,12 @@ To connect to Enclaved Express from the Master Express server:
8591

8692
```bash
8793
APP_MODE=master-express \
88-
BITGO_PORT=3080 \
94+
MASTER_EXPRESS_PORT=3081 \
8995
BITGO_BIND=localhost \
9096
BITGO_ENV=test \
9197
BITGO_KEYPATH=./test-ssl-key.pem \
9298
BITGO_CRTPATH=./test-ssl-cert.pem \
93-
ENCLAVED_EXPRESS_URL=https://localhost:4000 \
99+
ENCLAVED_EXPRESS_URL=https://localhost:3080 \
94100
ENCLAVED_EXPRESS_SSL_CERT=./enclaved-express-cert.pem \
95101
BITGO_ENABLE_SSL=false \
96102
yarn start

src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function enclavedEnvConfig(): Partial<EnclavedConfig> {
7474

7575
return {
7676
appMode: AppMode.ENCLAVED,
77-
port: Number(readEnvVar('MASTER_BITGO_EXPRESS_PORT')),
77+
port: Number(readEnvVar('ENCLAVED_EXPRESS_PORT')),
7878
bind: readEnvVar('MASTER_BITGO_EXPRESS_BIND'),
7979
ipc: readEnvVar('MASTER_BITGO_EXPRESS_IPC'),
8080
debugNamespace: (readEnvVar('MASTER_BITGO_EXPRESS_DEBUG_NAMESPACE') || '')
@@ -161,7 +161,7 @@ function configureEnclavedMode(): EnclavedConfig {
161161

162162
const defaultMasterExpressConfig: MasterExpressConfig = {
163163
appMode: AppMode.MASTER_EXPRESS,
164-
port: 3080,
164+
port: 3081,
165165
bind: 'localhost',
166166
timeout: 305 * 1000,
167167
logFile: '',
@@ -198,7 +198,7 @@ function masterExpressEnvConfig(): Partial<MasterExpressConfig> {
198198

199199
return {
200200
appMode: AppMode.MASTER_EXPRESS,
201-
port: Number(readEnvVar('BITGO_PORT')),
201+
port: Number(readEnvVar('MASTER_EXPRESS_PORT')),
202202
bind: readEnvVar('BITGO_BIND'),
203203
ipc: readEnvVar('BITGO_IPC'),
204204
debugNamespace: (readEnvVar('BITGO_DEBUG_NAMESPACE') || '').split(',').filter(Boolean),

0 commit comments

Comments
 (0)