@@ -43,9 +43,11 @@ const { SemaphoreMonitor } = require('../server/bg_services/semaphore_monitor');
43
43
const prom_reporting = require ( '../server/analytic_services/prometheus_reporting' ) ;
44
44
const { PersistentLogger } = require ( '../util/persistent_logger' ) ;
45
45
const { get_notification_logger } = require ( '../util/notifications_util' ) ;
46
+ const ldap_client = require ( '../util/ldap_client' ) . instance ( ) ;
46
47
const NoobaaEvent = require ( '../manage_nsfs/manage_nsfs_events_utils' ) . NoobaaEvent ;
47
48
const cluster = /** @type {import('node:cluster').Cluster } */ (
48
- /** @type {unknown } */ ( require ( 'node:cluster' ) )
49
+ /** @type {unknown } */
50
+ ( require ( 'node:cluster' ) )
49
51
) ;
50
52
51
53
if ( process . env . NOOBAA_LOG_LEVEL ) {
@@ -116,16 +118,16 @@ async function main(options = {}) {
116
118
const http_metrics_port = options . http_metrics_port || config . EP_METRICS_SERVER_PORT ;
117
119
const https_metrics_port = options . https_metrics_port || config . EP_METRICS_SERVER_SSL_PORT ;
118
120
/**
119
- * Please notice that we can run the main in 2 states:
120
- * 1. Only the primary process runs the main (fork is 0 or undefined) - everything that
121
- * is implemented here would be run by this process.
122
- * 2. A primary process with multiple forks (IMPORTANT) - if there is implementation that
123
- * in only relevant to the primary process it should be implemented in
124
- * fork_utils.start_workers because the primary process returns after start_workers
125
- * and the forks will continue executing the code lines in this function
126
- * */
121
+ * Please notice that we can run the main in 2 states:
122
+ * 1. Only the primary process runs the main (fork is 0 or undefined) - everything that
123
+ * is implemented here would be run by this process.
124
+ * 2. A primary process with multiple forks (IMPORTANT) - if there is implementation that
125
+ * in only relevant to the primary process it should be implemented in
126
+ * fork_utils.start_workers because the primary process returns after start_workers
127
+ * and the forks will continue executing the code lines in this function
128
+ * */
127
129
const is_workers_started_from_primary = await fork_utils . start_workers ( http_metrics_port , https_metrics_port ,
128
- options . nsfs_config_root , fork_count ) ;
130
+ options . nsfs_config_root , fork_count ) ;
129
131
if ( is_workers_started_from_primary ) return ;
130
132
131
133
const endpoint_group_id = process . env . ENDPOINT_GROUP_ID || 'default-endpoint-group' ;
@@ -198,8 +200,14 @@ async function main(options = {}) {
198
200
const https_port_sts = options . https_port_sts || config . ENDPOINT_SSL_STS_PORT ;
199
201
const https_port_iam = options . https_port_iam || config . ENDPOINT_SSL_IAM_PORT ;
200
202
201
- await start_endpoint_server_and_cert ( SERVICES_TYPES_ENUM . S3 , init_request_sdk ,
202
- { ...options , https_port : https_port_s3 , http_port : http_port_s3 , virtual_hosts, bucket_logger, notification_logger } ) ;
203
+ await start_endpoint_server_and_cert ( SERVICES_TYPES_ENUM . S3 , init_request_sdk , {
204
+ ...options ,
205
+ https_port : https_port_s3 ,
206
+ http_port : http_port_s3 ,
207
+ virtual_hosts,
208
+ bucket_logger,
209
+ notification_logger
210
+ } ) ;
203
211
await start_endpoint_server_and_cert ( SERVICES_TYPES_ENUM . STS , init_request_sdk , { https_port : https_port_sts , virtual_hosts } ) ;
204
212
await start_endpoint_server_and_cert ( SERVICES_TYPES_ENUM . IAM , init_request_sdk , { https_port : https_port_iam } ) ;
205
213
@@ -227,6 +235,10 @@ async function main(options = {}) {
227
235
object_io : object_io ,
228
236
} ) ) ;
229
237
}
238
+
239
+ if ( ldap_client . is_ldap_configured ( ) ) {
240
+ ldap_client . connect ( ) ;
241
+ }
230
242
//noobaa started
231
243
new NoobaaEvent ( NoobaaEvent . NOOBAA_STARTED ) . create_event ( undefined , undefined , undefined ) ;
232
244
// Start a monitor to send periodic endpoint reports about endpoint usage.
0 commit comments