@nsshunt/stsconfig 1.10.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env-default +249 -0
- package/.env-test-file-1 +0 -0
- package/.env-test-file-2 +103 -0
- package/package.json +3 -4
- package/stsconfig-01.test.js +173 -0
- package/stsconfig-02.test.js +173 -0
- package/stsconfig-default.test.js +173 -0
- package/stsconfig.js +165 -112
- package/testpasswordfile +1 -0
- package/stsconfig.test.js +0 -20
package/.env-default
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# ==================================================================================================
|
|
2
|
+
# Default configuration settings
|
|
3
|
+
# ==================================================================================================
|
|
4
|
+
# Log error messages to the console within the microservice
|
|
5
|
+
CONSOLE_LOG_ERRORS=false
|
|
6
|
+
# Database username.
|
|
7
|
+
DB_USER=postgres
|
|
8
|
+
# Database password.
|
|
9
|
+
DB_PASSWORD=password
|
|
10
|
+
# Database password file
|
|
11
|
+
#DB_PASSWORD_FILE
|
|
12
|
+
# Database host
|
|
13
|
+
DB_HOST=localhost
|
|
14
|
+
# Database port
|
|
15
|
+
DB_PORT=5432
|
|
16
|
+
# Database name.
|
|
17
|
+
DB_DATABASE=stsrestmsdb01
|
|
18
|
+
# Database connection string to be used in production mode
|
|
19
|
+
#DATABASE_URL=
|
|
20
|
+
# Database script(s) folder
|
|
21
|
+
DB_SCRIPT_FOLDER=/var/lib/sts/stsglobalresources/db-scripts
|
|
22
|
+
|
|
23
|
+
# The maximum pool size for pg. There will be one pool per thread.
|
|
24
|
+
POOL_SIZE=500
|
|
25
|
+
# Maximum number of CPUs (incl. logical processors) to use within the Microservice.
|
|
26
|
+
# Use -1 to use all available within the runtime container. Each CPU will spawn a node work thread.
|
|
27
|
+
MAX_CPU=-1
|
|
28
|
+
# Automatically re-spawn a worker thread if one dies.
|
|
29
|
+
RESPAWN=false
|
|
30
|
+
# Default number of entries to create for a fresh database.
|
|
31
|
+
DEFAULT_DB_ENTRIES=10000
|
|
32
|
+
# Microservice listen port.
|
|
33
|
+
USE_REDIS=false
|
|
34
|
+
# Use redis for Microservice.
|
|
35
|
+
USE_L1_REDIS=false
|
|
36
|
+
# Automatically flush the redis cache when terminating the Microservice.
|
|
37
|
+
REDIS_END_FLUSH=false
|
|
38
|
+
# Redis server port.
|
|
39
|
+
REDIS_PORT=6379
|
|
40
|
+
# Redis server endpoint.
|
|
41
|
+
REDIS_SERVER=localhost
|
|
42
|
+
# Default K6 test script path
|
|
43
|
+
K6SCRIPTPATH=.
|
|
44
|
+
# Default number of entries to create for a fresh database.
|
|
45
|
+
DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE=0
|
|
46
|
+
# Default number of entries to create for a fresh database.
|
|
47
|
+
DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE=2000
|
|
48
|
+
|
|
49
|
+
# STSREST01 Server endpoint
|
|
50
|
+
REST01_ENDPOINT=http://localhost
|
|
51
|
+
# STSREST01 Server port (listen port for the service)
|
|
52
|
+
REST01_HOST_PORT=3003
|
|
53
|
+
# STSREST01 Server port (client port to access the service)
|
|
54
|
+
REST01_PORT=3003
|
|
55
|
+
# STSREST01 Server endpoint
|
|
56
|
+
REST01_APIROOT=/stsrest01/v1
|
|
57
|
+
# STSREST01 Prometheus metric support
|
|
58
|
+
REST01_PROM_SUPPORT=true
|
|
59
|
+
# STSREST01 Cluster Server port (port used for cluster prometheus scrapes). Service will listen on this port at mount point /metrics
|
|
60
|
+
REST01_PROM_CLUSTER_PORT=3013
|
|
61
|
+
# STSREST01 Service Name
|
|
62
|
+
REST01_SERVICE_NAME=STSRest01
|
|
63
|
+
# STSREST01 Service Version
|
|
64
|
+
REST01_SERVICE_VERSION=1.0.0
|
|
65
|
+
# STSREST01 Service Credentials
|
|
66
|
+
# -----------------------------
|
|
67
|
+
# STSREST01 Server username email
|
|
68
|
+
REST01_EMAIL=STSREST01ServiceUser@stsmda.com
|
|
69
|
+
# STSREST01 Server username password
|
|
70
|
+
REST01_PASSWORD=STSREST01ServiceUserPassword
|
|
71
|
+
# STSREST01 Server username password file
|
|
72
|
+
#REST01_PASSWORD_FILE
|
|
73
|
+
|
|
74
|
+
# STS Instrument Manager Service endpoint
|
|
75
|
+
IM_ENDPOINT=http://localhost
|
|
76
|
+
# STS Instrument Manager Service listen port (listen port for the service)
|
|
77
|
+
IM_HOST_PORT=3001
|
|
78
|
+
# STS Instrument Manager Service client access port (client port to access the service)
|
|
79
|
+
IM_PORT=3001
|
|
80
|
+
# STS Instrument Manager Service endpoint
|
|
81
|
+
IM_APIROOT=/stsinstrumentmanager/v1
|
|
82
|
+
# STS Instrument Manager Prometheus metric support
|
|
83
|
+
IM_PROM_SUPPORT=true
|
|
84
|
+
# STS Instrument Manager Cluster Server port (port used for cluster prometheus scrapes)
|
|
85
|
+
IM_PROM_CLUSTER_PORT=3011
|
|
86
|
+
# STS Instrument Manager Service Name
|
|
87
|
+
IM_SERVICE_NAME=STSInstrumentManager
|
|
88
|
+
# STS Instrument Manager Service Version
|
|
89
|
+
IM_SERVICE_VERSION=1.0.0
|
|
90
|
+
# STS Instrument Manager Service Credentials
|
|
91
|
+
# ------------------------------------------
|
|
92
|
+
# STS Instrument Manager Service username email
|
|
93
|
+
IM_EMAIL=STSInstrumentManagerServiceUser@stsmda.com
|
|
94
|
+
# STS Instrument Manager Service username password
|
|
95
|
+
IM_PASSWORD=STSInstrumentManagerServiceUserPassword
|
|
96
|
+
# STS Instrument Manager Service username password file
|
|
97
|
+
#IM_PASSWORD_FILE
|
|
98
|
+
|
|
99
|
+
# STS Test Orchestrator Service endpoint
|
|
100
|
+
TO_ENDPOINT=http://localhost
|
|
101
|
+
# STS Test Orchestrator Service listen port (listen port for the service)
|
|
102
|
+
TO_HOST_PORT=3004
|
|
103
|
+
# STS Test Orchestrator Service client access port (client port to access the service)
|
|
104
|
+
TO_PORT=3004
|
|
105
|
+
# STS Test Orchestrator Service endpoint
|
|
106
|
+
TO_APIROOT=/ststestorchestrator/v1
|
|
107
|
+
# STS Test Orchestrator Prometheus metric support
|
|
108
|
+
TO_PROM_SUPPORT=true
|
|
109
|
+
# STS Test Orchestrator Cluster Server port (port used for cluster prometheus scrapes)
|
|
110
|
+
TO_PROM_CLUSTER_PORT=3014
|
|
111
|
+
# STS Test Orchestrator Service Name
|
|
112
|
+
TO_SERVICE_NAME=STSTestOrchestrator
|
|
113
|
+
# STS Test Orchestrator Service Version
|
|
114
|
+
TO_SERVICE_VERSION=1.0.0
|
|
115
|
+
# STS Test Orchestrator Service Credentials
|
|
116
|
+
# ------------------------------------------
|
|
117
|
+
# STS Test Orchestrator Service username email
|
|
118
|
+
TO_EMAIL=STSTestOrchestratorServiceUser@stsmda.com
|
|
119
|
+
# STS Test Orchestrator Service username password
|
|
120
|
+
TO_PASSWORD=STSTestOrchestratorServiceUserPassword
|
|
121
|
+
# STS Test Orchestrator Service username password file
|
|
122
|
+
#TO_PASSWORD_FILE
|
|
123
|
+
|
|
124
|
+
# Auth Server endpoint
|
|
125
|
+
AS_ENDPOINT=http://localhost
|
|
126
|
+
# Auth Server host port (listen port for the service)
|
|
127
|
+
AS_HOST_PORT=3002
|
|
128
|
+
# Auth Server port (client port to access the service)
|
|
129
|
+
AS_PORT=3002
|
|
130
|
+
# Auth Server endpoint
|
|
131
|
+
AS_APIROOT=/stsauth/v1
|
|
132
|
+
# Auth Server Prometheus metric support
|
|
133
|
+
AS_PROM_SUPPORT=true
|
|
134
|
+
# Auth Prometheus Cluster Server port (port used for cluster prometheus scrapes)
|
|
135
|
+
AS_PROM_CLUSTER_PORT=3012
|
|
136
|
+
# STSAuth Service Name
|
|
137
|
+
AS_SERVICE_NAME=STSAuth
|
|
138
|
+
# STSAuth Service Version
|
|
139
|
+
AS_SERVICE_VERSION=1.0.0
|
|
140
|
+
# STS Auth Service Credentials
|
|
141
|
+
# ----------------------------
|
|
142
|
+
# Auth Server username email
|
|
143
|
+
AS_EMAIL=STSAuthServiceUser@stsmda.com
|
|
144
|
+
# Auth Server username password
|
|
145
|
+
AS_PASSWORD=STSAuthServiceUserPassword
|
|
146
|
+
# Auth Server username password file
|
|
147
|
+
#AS_PASSWORD_FILE
|
|
148
|
+
# Auth Server - Private Key (when using JWT)
|
|
149
|
+
AS_PRIVATE_KEY_PATH=/var/lib/sts/stsglobalresources/keys/private.key
|
|
150
|
+
# Auth Server - Public Key (when using JWT)
|
|
151
|
+
AS_PUBLIC_KEY_PATH=/var/lib/sts/stsglobalresources/keys/public.key
|
|
152
|
+
|
|
153
|
+
# STS Test Runner Prometheus metric support
|
|
154
|
+
TR_PROM_SUPPORT=true
|
|
155
|
+
# STS Test Runner Cluster Server port (port used for cluster prometheus scrapes)
|
|
156
|
+
TR_PROM_CLUSTER_PORT=3015
|
|
157
|
+
# STS Test Runner Service Name
|
|
158
|
+
TR_SERVICE_NAME=STSRestRunner
|
|
159
|
+
# STS Test Runner Service Version
|
|
160
|
+
TR_SERVICE_VERSION=1.0.0
|
|
161
|
+
# STS Test Runner Credentials
|
|
162
|
+
# ----------------------------
|
|
163
|
+
# STS Test Runner username email
|
|
164
|
+
TR_EMAIL=STSTestRunnerServiceUser@stsmda.com
|
|
165
|
+
# STS Test Runner password
|
|
166
|
+
TR_PASSWORD=STSTestRunnerServiceUserPassword
|
|
167
|
+
# STS Test Runner password file
|
|
168
|
+
#TR_PASSWORD_FILE
|
|
169
|
+
|
|
170
|
+
# Duration (in ms) between each publish event.
|
|
171
|
+
PUBLISH_INTERVAL=1000
|
|
172
|
+
|
|
173
|
+
# The maximum time (in ms) to wait before timeout error when publishing instruments. Ideally, this should always be lower than the publishinterval frequency
|
|
174
|
+
# to avoid cascading http build up errors.
|
|
175
|
+
PUBLISH_TIMEOUT=750
|
|
176
|
+
|
|
177
|
+
# If true, instrument publish failures will be logged to debug output.
|
|
178
|
+
PUBLISH_DEBUG=false
|
|
179
|
+
|
|
180
|
+
# Transport(s) to use for sending instrumentation data to the instrumentation server
|
|
181
|
+
TRANSPORT=RESTAPI
|
|
182
|
+
|
|
183
|
+
# Use secure cookies option when passing back cookies from STS services (such as STSAuth service).
|
|
184
|
+
# This setting will be ignore for production mode. In production mode services will always use secure cookies.
|
|
185
|
+
USE_SECURE_COOKIES=false
|
|
186
|
+
|
|
187
|
+
# keepAlive <boolean> Keep sockets around even when there are no outstanding requests, so they can be used for future requests without having to reestablish a
|
|
188
|
+
# TCP connection. Not to be confused with the keep-alive value of the Connection header. The Connection: keep-alive header is always sent when using an agent
|
|
189
|
+
# except when the Connection header is explicitly specified or when the keepAlive and maxSockets options are respectively set to false and Infinity, in which
|
|
190
|
+
# case Connection: close will be used. Default: false.
|
|
191
|
+
# Reference: https://nodejs.org/api/http.html#class-httpagent
|
|
192
|
+
KEEP_ALIVE=true
|
|
193
|
+
|
|
194
|
+
# maxSockets <number> Maximum number of sockets to allow per host. If the same host opens multiple concurrent connections, each request will use new socket until the
|
|
195
|
+
# maxSockets value is reached. If the host attempts to open more connections than maxSockets, the additional requests will enter into a pending request queue, and will
|
|
196
|
+
# enter active connection state when an existing connection terminates. This makes sure there are at most maxSockets active connections at any point in time,
|
|
197
|
+
# from a given host. Default: Infinity.
|
|
198
|
+
# Reference: https://nodejs.org/api/http.html#class-httpagent
|
|
199
|
+
MAX_SOCKETS=10
|
|
200
|
+
|
|
201
|
+
# maxTotalSockets <number> Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
|
|
202
|
+
# Reference: https://nodejs.org/api/http.html#class-httpagent
|
|
203
|
+
MAX_TOTAL_SOCKETS=20
|
|
204
|
+
|
|
205
|
+
# maxFreeSockets <number> Maximum number of sockets per host to leave open in a free state. Only relevant if keepAlive is set to true. Default: 256.
|
|
206
|
+
# Reference: https://nodejs.org/api/http.html#class-httpagent
|
|
207
|
+
MAX_FREE_SOCKETS=256
|
|
208
|
+
|
|
209
|
+
# timeout <number> Socket timeout in milliseconds. This will set the timeout when the socket is created.
|
|
210
|
+
# Reference: https://nodejs.org/api/http.html#class-httpagent
|
|
211
|
+
TIMEOUT=10000
|
|
212
|
+
|
|
213
|
+
# Maximum payload size allowed for express server calls
|
|
214
|
+
MAX_PAYLOAD_SIZE='50mb'
|
|
215
|
+
|
|
216
|
+
# Instrumentation Config Settings
|
|
217
|
+
# -------------------------------
|
|
218
|
+
# Generic interval (ms) to make on observation for instrumentation objects.
|
|
219
|
+
INSTRUMENTATION_OBSERVATION_INTERVAL=1000
|
|
220
|
+
|
|
221
|
+
# Generic sliding time window (seconds) for instrumentation objects that process telemetry over time (e.g. P(x) instruments).
|
|
222
|
+
INSTRUMENTATION_TIME_WINDOW=600
|
|
223
|
+
|
|
224
|
+
# Service Specific Config Settings
|
|
225
|
+
# --------------------------------
|
|
226
|
+
# STSAuth
|
|
227
|
+
# -------
|
|
228
|
+
# Define the valid age for a JWT access token (in ms). Default 10 minutes.
|
|
229
|
+
AUTH_JWT_ACCESS_TOKEN_TIMEOUT=600
|
|
230
|
+
|
|
231
|
+
# Define the valid age for a JWT refresh token (in ms). Default 24 hours.
|
|
232
|
+
AUTH_JWT_REFRESH_TOKEN_TIMEOUT=86400
|
|
233
|
+
|
|
234
|
+
# Define the valid age for an authentication/session cookie. Default 24 hours.
|
|
235
|
+
AUTH_COOKIE_TIMEOUT=86400
|
|
236
|
+
|
|
237
|
+
# STSAppFramework (library)
|
|
238
|
+
# -------------------------
|
|
239
|
+
# Define the time (ms) to wait prior to exiting the application (using process.exit(0))
|
|
240
|
+
MASTER_PROCESS_EXIT_TIME=500
|
|
241
|
+
|
|
242
|
+
# Define the time (ms) to wait prior to exiting the application (using process.exit(0))
|
|
243
|
+
CHILD_PROCESS_EXIT_TIME=500
|
|
244
|
+
|
|
245
|
+
# Define the interval (ms) to collect system information for instrumentation purposes
|
|
246
|
+
SYSTEM_INFORMATION_INTERVAL=1000
|
|
247
|
+
|
|
248
|
+
# Ignore socket.io REST api calls and/or WebSocket calls when collecting telemetry for instrumentation purposes.
|
|
249
|
+
IGNORE_SOCKETIO=true
|
package/.env-test-file-1
ADDED
|
File without changes
|
package/.env-test-file-2
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
NODE_ENV=production
|
|
2
|
+
CONSOLE_LOG_ERRORS=true
|
|
3
|
+
DB_USER=postgres-c
|
|
4
|
+
DB_PASSWORD=password-c
|
|
5
|
+
DB_PASSWORD_FILE=testpasswordfile
|
|
6
|
+
DB_HOST=localhost-c
|
|
7
|
+
DB_PORT=54320
|
|
8
|
+
DB_DATABASE=stsrestmsdb01-c
|
|
9
|
+
DATABASE_URL=-c
|
|
10
|
+
DB_SCRIPT_FOLDER=/var/lib/sts/stsglobalresources/db-scripts-c
|
|
11
|
+
|
|
12
|
+
POOL_SIZE=5000
|
|
13
|
+
MAX_CPU=-10
|
|
14
|
+
RESPAWN=true
|
|
15
|
+
DEFAULT_DB_ENTRIES=100000
|
|
16
|
+
USE_REDIS=true
|
|
17
|
+
USE_L1_REDIS=true
|
|
18
|
+
REDIS_END_FLUSH=true
|
|
19
|
+
REDIS_PORT=63790
|
|
20
|
+
REDIS_SERVER=localhost-c
|
|
21
|
+
K6SCRIPTPATH=.-c
|
|
22
|
+
DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE=1
|
|
23
|
+
DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE=20000
|
|
24
|
+
|
|
25
|
+
REST01_ENDPOINT=http://localhost-c
|
|
26
|
+
REST01_HOST_PORT=30030
|
|
27
|
+
REST01_PORT=30030
|
|
28
|
+
REST01_APIROOT=/stsrest01/v1-c
|
|
29
|
+
REST01_PROM_SUPPORT=false
|
|
30
|
+
REST01_PROM_CLUSTER_PORT=30130
|
|
31
|
+
REST01_SERVICE_NAME=STSRest01-c
|
|
32
|
+
REST01_SERVICE_VERSION=1.0.0-c
|
|
33
|
+
REST01_EMAIL=K6TestUser@sts-c
|
|
34
|
+
REST01_PASSWORD=K6TestUserPassword-c
|
|
35
|
+
REST01_PASSWORD_FILE=testpasswordfile
|
|
36
|
+
|
|
37
|
+
IM_ENDPOINT=http://localhost-c
|
|
38
|
+
IM_HOST_PORT=30010
|
|
39
|
+
IM_PORT=30010
|
|
40
|
+
IM_APIROOT=/stsinstrumentmanager/v1-c
|
|
41
|
+
IM_PROM_SUPPORT=false
|
|
42
|
+
IM_PROM_CLUSTER_PORT=30110
|
|
43
|
+
IM_SERVICE_NAME=STSInstrumentManager-c
|
|
44
|
+
IM_SERVICE_VERSION=1.0.0-c
|
|
45
|
+
IM_EMAIL=K6TestUser@sts-c
|
|
46
|
+
IM_PASSWORD=K6TestUserPassword-c
|
|
47
|
+
IM_PASSWORD_FILE=testpasswordfile
|
|
48
|
+
|
|
49
|
+
TO_ENDPOINT=http://localhost-c
|
|
50
|
+
TO_HOST_PORT=30040
|
|
51
|
+
TO_PORT=30040
|
|
52
|
+
TO_APIROOT=/ststestorchestrator/v1-c
|
|
53
|
+
TO_PROM_SUPPORT=false
|
|
54
|
+
TO_PROM_CLUSTER_PORT=30140
|
|
55
|
+
TO_SERVICE_NAME=STSTestOrchestrator-c
|
|
56
|
+
TO_SERVICE_VERSION=1.0.0-c
|
|
57
|
+
TO_EMAIL=K6TestUser@sts-c
|
|
58
|
+
TO_PASSWORD=K6TestUserPassword-c
|
|
59
|
+
TO_PASSWORD_FILE=testpasswordfile
|
|
60
|
+
|
|
61
|
+
AS_ENDPOINT=http://localhost-c
|
|
62
|
+
AS_HOST_PORT=30020
|
|
63
|
+
AS_PORT=30020
|
|
64
|
+
AS_APIROOT=/stsauth/v1-c
|
|
65
|
+
AS_PROM_SUPPORT=false
|
|
66
|
+
AS_PROM_CLUSTER_PORT=30120
|
|
67
|
+
AS_SERVICE_NAME=STSAuth-c
|
|
68
|
+
AS_SERVICE_VERSION=1.0.0-c
|
|
69
|
+
AS_EMAIL=K6TestUser@sts-c
|
|
70
|
+
AS_PASSWORD=K6TestUserPassword-c
|
|
71
|
+
AS_PASSWORD_FILE=testpasswordfile
|
|
72
|
+
AS_PRIVATE_KEY_PATH=/var/lib/sts/stsglobalresources/keys/private.key-c
|
|
73
|
+
AS_PUBLIC_KEY_PATH=/var/lib/sts/stsglobalresources/keys/public.key-c
|
|
74
|
+
|
|
75
|
+
TR_PROM_SUPPORT=false
|
|
76
|
+
TR_PROM_CLUSTER_PORT=30150
|
|
77
|
+
TR_SERVICE_NAME=STSRestRunner-c
|
|
78
|
+
TR_SERVICE_VERSION=1.0.0-c
|
|
79
|
+
TR_EMAIL=K6TestUser@sts-c
|
|
80
|
+
TR_PASSWORD=K6TestUserPassword-c
|
|
81
|
+
TR_PASSWORD_FILE=testpasswordfile
|
|
82
|
+
|
|
83
|
+
PUBLISH_INTERVAL=10000
|
|
84
|
+
PUBLISH_TIMEOUT=7500
|
|
85
|
+
PUBLISH_DEBUG=true
|
|
86
|
+
TRANSPORT=RESTAPI-c
|
|
87
|
+
USE_SECURE_COOKIES=true
|
|
88
|
+
KEEP_ALIVE=false
|
|
89
|
+
MAX_SOCKETS=100
|
|
90
|
+
MAX_TOTAL_SOCKETS=200
|
|
91
|
+
MAX_FREE_SOCKETS=2560
|
|
92
|
+
TIMEOUT=100000
|
|
93
|
+
MAX_PAYLOAD_SIZE=50mb-c
|
|
94
|
+
INSTRUMENTATION_OBSERVATION_INTERVAL=10000
|
|
95
|
+
INSTRUMENTATION_TIME_WINDOW=6000
|
|
96
|
+
AUTH_JWT_ACCESS_TOKEN_TIMEOUT=6000
|
|
97
|
+
AUTH_JWT_REFRESH_TOKEN_TIMEOUT=864000
|
|
98
|
+
AUTH_COOKIE_TIMEOUT=864000
|
|
99
|
+
MASTER_PROCESS_EXIT_TIME=5000
|
|
100
|
+
CHILD_PROCESS_EXIT_TIME=5000
|
|
101
|
+
SYSTEM_INFORMATION_INTERVAL=10000
|
|
102
|
+
IGNORE_SOCKETIO=false
|
|
103
|
+
MODEL_PURGE_UPDATE_TIMEOUT=50000
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsconfig",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "stsconfig.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"colors": "^1.4.0",
|
|
8
8
|
"debug": "^4.3.3",
|
|
9
|
-
"dotenv": "^16.0.0"
|
|
10
|
-
"yaml": "^1.10.2"
|
|
9
|
+
"dotenv": "^16.0.0"
|
|
11
10
|
},
|
|
12
11
|
"standard": {
|
|
13
12
|
"parser": "@babel/eslint-parser"
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
"@babel/eslint-parser": "^7.17.0",
|
|
18
17
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
19
18
|
"@babel/plugin-proposal-private-methods": "^7.16.11",
|
|
20
|
-
"eslint": "^8.
|
|
19
|
+
"eslint": "^8.10.0",
|
|
21
20
|
"jest": "^27.5.1"
|
|
22
21
|
},
|
|
23
22
|
"scripts": {
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
|
|
2
|
+
describe("Test implicit config settings", () =>
|
|
3
|
+
{
|
|
4
|
+
beforeAll(async () =>
|
|
5
|
+
{
|
|
6
|
+
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
afterAll(async () =>
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('Checking default config items', async () =>
|
|
15
|
+
{
|
|
16
|
+
expect.assertions(22);
|
|
17
|
+
|
|
18
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
19
|
+
let goptions = require('./stsconfig.js').$options;
|
|
20
|
+
|
|
21
|
+
expect(goptions.isProduction).toEqual(false);
|
|
22
|
+
expect(goptions.isTest).toEqual(true);
|
|
23
|
+
expect(goptions.consoleLogErrors).toEqual(false);
|
|
24
|
+
expect(goptions.dbuser).toEqual('postgres');
|
|
25
|
+
expect(goptions.dbpassword).toEqual('password');
|
|
26
|
+
expect(goptions.dbpasswordfile).toEqual(undefined);
|
|
27
|
+
expect(goptions.dbhost).toEqual('localhost');
|
|
28
|
+
expect(goptions.dbport).toEqual('5432');
|
|
29
|
+
expect(goptions.database).toEqual('stsrestmsdb01');
|
|
30
|
+
expect(goptions.databaseUrl).toEqual(undefined);
|
|
31
|
+
expect(goptions.databasescriptfolder).toEqual('/var/lib/sts/stsglobalresources/db-scripts');
|
|
32
|
+
|
|
33
|
+
expect(goptions.poolSize).toEqual(500);
|
|
34
|
+
expect(goptions.useCPUs).toEqual(-1);
|
|
35
|
+
expect(goptions.respawnOnFail).toEqual(false);
|
|
36
|
+
expect(goptions.defaultDatabaseEntries).toEqual(10000);
|
|
37
|
+
expect(goptions.useRedis).toEqual(false);
|
|
38
|
+
expect(goptions.endFlush).toEqual(false);
|
|
39
|
+
expect(goptions.redisPort).toEqual('6379');
|
|
40
|
+
expect(goptions.redisServer).toEqual('localhost');
|
|
41
|
+
expect(goptions.k6ScriptPath).toEqual('.');
|
|
42
|
+
expect(goptions.defaultDatabaseMinExtraDataSize).toEqual(0);
|
|
43
|
+
expect(goptions.defaultDatabaseMaxExtraDataSize).toEqual(2000);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('Checking default rest01 service config', async () =>
|
|
47
|
+
{
|
|
48
|
+
expect.assertions(11);
|
|
49
|
+
|
|
50
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
51
|
+
let goptions = require('./stsconfig.js').$options;
|
|
52
|
+
|
|
53
|
+
expect(goptions.rest01endpoint).toEqual('http://localhost');
|
|
54
|
+
expect(goptions.rest01hostport).toEqual('3003');
|
|
55
|
+
expect(goptions.rest01port).toEqual('3003');
|
|
56
|
+
expect(goptions.rest01apiroot).toEqual('/stsrest01/v1');
|
|
57
|
+
expect(goptions.rest01prometheussupport).toEqual(true);
|
|
58
|
+
expect(goptions.rest01prometheusclusterport).toEqual('3013');
|
|
59
|
+
expect(goptions.rest01servicename).toEqual('STSRest01');
|
|
60
|
+
expect(goptions.rest01serviceversion).toEqual('1.0.0');
|
|
61
|
+
expect(goptions.rest01email).toEqual('STSREST01ServiceUser@stsmda.com');
|
|
62
|
+
expect(goptions.rest01password).toEqual('STSREST01ServiceUserPassword');
|
|
63
|
+
expect(goptions.rest01passwordfile).toEqual(undefined);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('Checking default instrument manager service config', async () =>
|
|
67
|
+
{
|
|
68
|
+
expect.assertions(11);
|
|
69
|
+
|
|
70
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
71
|
+
let goptions = require('./stsconfig.js').$options;
|
|
72
|
+
|
|
73
|
+
expect(goptions.imendpoint).toEqual('http://localhost');
|
|
74
|
+
expect(goptions.imhostport).toEqual('3001');
|
|
75
|
+
expect(goptions.import).toEqual('3001');
|
|
76
|
+
expect(goptions.imapiroot).toEqual('/stsinstrumentmanager/v1');
|
|
77
|
+
expect(goptions.imprometheussupport).toEqual(true);
|
|
78
|
+
expect(goptions.imprometheusclusterport).toEqual('3011');
|
|
79
|
+
expect(goptions.imservicename).toEqual('STSInstrumentManager');
|
|
80
|
+
expect(goptions.imserviceversion).toEqual('1.0.0');
|
|
81
|
+
expect(goptions.imemail).toEqual('STSInstrumentManagerServiceUser@stsmda.com');
|
|
82
|
+
expect(goptions.impassword).toEqual('STSInstrumentManagerServiceUserPassword');
|
|
83
|
+
expect(goptions.impasswordfile).toEqual(undefined);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('Checking default test orchestrator service config', async () =>
|
|
87
|
+
{
|
|
88
|
+
expect.assertions(11);
|
|
89
|
+
|
|
90
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
91
|
+
let goptions = require('./stsconfig.js').$options;
|
|
92
|
+
|
|
93
|
+
expect(goptions.toendpoint).toEqual('http://localhost');
|
|
94
|
+
expect(goptions.tohostport).toEqual('3004');
|
|
95
|
+
expect(goptions.toport).toEqual('3004');
|
|
96
|
+
expect(goptions.toapiroot).toEqual('/ststestorchestrator/v1');
|
|
97
|
+
expect(goptions.toprometheussupport).toEqual(true);
|
|
98
|
+
expect(goptions.toprometheusclusterport).toEqual('3014');
|
|
99
|
+
expect(goptions.toservicename).toEqual('STSTestOrchestrator');
|
|
100
|
+
expect(goptions.toserviceversion).toEqual('1.0.0');
|
|
101
|
+
expect(goptions.toemail).toEqual('STSTestOrchestratorServiceUser@stsmda.com');
|
|
102
|
+
expect(goptions.topassword).toEqual('STSTestOrchestratorServiceUserPassword');
|
|
103
|
+
expect(goptions.topasswordfile).toEqual(undefined);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test('Checking default authentication service config', async () =>
|
|
107
|
+
{
|
|
108
|
+
expect.assertions(13);
|
|
109
|
+
|
|
110
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
111
|
+
let goptions = require('./stsconfig.js').$options;
|
|
112
|
+
|
|
113
|
+
expect(goptions.asendpoint).toEqual('http://localhost');
|
|
114
|
+
expect(goptions.ashostport).toEqual('3002');
|
|
115
|
+
expect(goptions.asport).toEqual('3002');
|
|
116
|
+
expect(goptions.asapiroot).toEqual('/stsauth/v1');
|
|
117
|
+
expect(goptions.asprometheussupport).toEqual(true);
|
|
118
|
+
expect(goptions.asprometheusclusterport).toEqual('3012');
|
|
119
|
+
expect(goptions.asservicename).toEqual('STSAuth');
|
|
120
|
+
expect(goptions.asserviceversion).toEqual('1.0.0');
|
|
121
|
+
expect(goptions.asemail).toEqual('STSAuthServiceUser@stsmda.com');
|
|
122
|
+
expect(goptions.aspassword).toEqual('STSAuthServiceUserPassword');
|
|
123
|
+
expect(goptions.aspasswordfile).toEqual(undefined);
|
|
124
|
+
expect(goptions.asprivatekeypath).toEqual('/var/lib/sts/stsglobalresources/keys/private.key');
|
|
125
|
+
expect(goptions.aspublickeypath).toEqual('/var/lib/sts/stsglobalresources/keys/public.key');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('Checking default test runner service config', async () =>
|
|
129
|
+
{
|
|
130
|
+
expect.assertions(7);
|
|
131
|
+
|
|
132
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
133
|
+
let goptions = require('./stsconfig.js').$options;
|
|
134
|
+
|
|
135
|
+
expect(goptions.trprometheussupport).toEqual(true);
|
|
136
|
+
expect(goptions.trprometheusclusterport).toEqual('3015');
|
|
137
|
+
expect(goptions.trservicename).toEqual('STSRestRunner');
|
|
138
|
+
expect(goptions.trserviceversion).toEqual('1.0.0');
|
|
139
|
+
expect(goptions.tremail).toEqual('STSTestRunnerServiceUser@stsmda.com');
|
|
140
|
+
expect(goptions.trpassword).toEqual('STSTestRunnerServiceUserPassword');
|
|
141
|
+
expect(goptions.trpasswordfile).toEqual(undefined);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test('Checking default additional config items', async () =>
|
|
145
|
+
{
|
|
146
|
+
expect.assertions(20);
|
|
147
|
+
|
|
148
|
+
process.env.STSENVFILE = './.env-test-file-1'; // Empty environment file
|
|
149
|
+
let goptions = require('./stsconfig.js').$options;
|
|
150
|
+
|
|
151
|
+
expect(goptions.publishinterval).toEqual(1000);
|
|
152
|
+
expect(goptions.publishtimeout).toEqual(750);
|
|
153
|
+
expect(goptions.publishdebug).toEqual(false);
|
|
154
|
+
expect(goptions.transport).toEqual('RESTAPI');
|
|
155
|
+
expect(goptions.useSecureCookies).toEqual(false);
|
|
156
|
+
expect(goptions.keepAlive).toEqual(true);
|
|
157
|
+
expect(goptions.maxSockets).toEqual(10);
|
|
158
|
+
expect(goptions.maxTotalSockets).toEqual(20);
|
|
159
|
+
expect(goptions.maxFreeSockets).toEqual(256);
|
|
160
|
+
expect(goptions.timeout).toEqual(10000);
|
|
161
|
+
expect(goptions.maxPayloadSize).toEqual('50mb');
|
|
162
|
+
expect(goptions.instrumentationObservationInterval).toEqual(1000);
|
|
163
|
+
expect(goptions.instrumentationTimeWindow).toEqual(600);
|
|
164
|
+
expect(goptions.authJWTAccessTokenTimeout).toEqual(600);
|
|
165
|
+
expect(goptions.authJWTRefreshTokenTimeout).toEqual(3600 * 24);
|
|
166
|
+
expect(goptions.authCookieTimeout).toEqual(3600 * 24);
|
|
167
|
+
expect(goptions.masterProcessExitTime).toEqual(500);
|
|
168
|
+
expect(goptions.childProcessExitTime).toEqual(500);
|
|
169
|
+
expect(goptions.systemInformationInterval).toEqual(1000);
|
|
170
|
+
expect(goptions.ignoresocketio).toEqual(true);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
|