@@ -84,6 +84,8 @@ export class Config {
8484 Config . amqp_force_sender_has_read = Config . parseBoolean ( Config . getEnv ( "amqp_force_sender_has_read" , "true" ) ) ;
8585 Config . amqp_enabled_exchange = Config . parseBoolean ( Config . getEnv ( "amqp_enabled_exchange" , "false" ) ) ;
8686 Config . amqp_url = Config . getEnv ( "amqp_url" , "amqp://localhost" ) ; // used to register queues and by personal nodered
87+ Config . amqp_username = Config . getEnv ( "amqp_username" , "guest" ) ; // used to talk wth rabbitmq api, used if not present in amqp_url
88+ Config . amqp_password = Config . getEnv ( "amqp_password" , "guest" ) ; // used to talk wth rabbitmq api, used if not present in amqp_url
8789 Config . amqp_check_for_consumer = Config . parseBoolean ( Config . getEnv ( "amqp_check_for_consumer" , "true" ) ) ;
8890 Config . amqp_check_for_consumer_count = Config . parseBoolean ( Config . getEnv ( "amqp_check_for_consumer_count" , "false" ) ) ;
8991 Config . amqp_default_expiration = parseInt ( Config . getEnv ( "amqp_default_expiration" , "10000" ) ) ; // 10 seconds
@@ -107,7 +109,6 @@ export class Config {
107109 Config . downloadtoken_expires_in = Config . getEnv ( "downloadtoken_expires_in" , "15m" ) ;
108110 Config . personalnoderedtoken_expires_in = Config . getEnv ( "personalnoderedtoken_expires_in" , "365d" ) ;
109111
110- // Config.nodered_image = Config.getEnv("nodered_image", "openiap/nodered");
111112 Config . nodered_images = JSON . parse ( Config . getEnv ( "nodered_images" , "[{\"name\":\"Latest Plain Nodered\", \"image\":\"openiap/nodered\"}]" ) ) ;
112113 Config . saml_federation_metadata = Config . getEnv ( "saml_federation_metadata" , "" ) ;
113114 Config . api_ws_url = Config . getEnv ( "api_ws_url" , "" ) ;
@@ -214,6 +215,9 @@ export class Config {
214215 public static amqp_force_sender_has_read : boolean = Config . parseBoolean ( Config . getEnv ( "amqp_force_sender_has_read" , "true" ) ) ;
215216 public static amqp_enabled_exchange : boolean = Config . parseBoolean ( Config . getEnv ( "amqp_enabled_exchange" , "false" ) ) ;
216217 public static amqp_url : string = Config . getEnv ( "amqp_url" , "amqp://localhost" ) ; // used to register queues and by personal nodered
218+ public static amqp_username : string = Config . getEnv ( "amqp_username" , "guest" ) ; // used to talk wth rabbitmq api
219+ public static amqp_password : string = Config . getEnv ( "amqp_password" , "guest" ) ; // used to talk wth rabbitmq api
220+
217221 public static amqp_check_for_consumer : boolean = Config . parseBoolean ( Config . getEnv ( "amqp_check_for_consumer" , "true" ) ) ;
218222 public static amqp_check_for_consumer_count : boolean = Config . parseBoolean ( Config . getEnv ( "amqp_check_for_consumer_count" , "false" ) ) ;
219223 public static amqp_default_expiration : number = parseInt ( Config . getEnv ( "amqp_default_expiration" , ( 60 * 1000 ) . toString ( ) ) ) ; // 1 min
@@ -239,7 +243,7 @@ export class Config {
239243 public static personalnoderedtoken_expires_in : string = Config . getEnv ( "personalnoderedtoken_expires_in" , "365d" ) ;
240244
241245 // public static nodered_image: string = Config.getEnv("nodered_image", "openiap/nodered");
242- public static nodered_images : nodered_image [ ] = JSON . parse ( Config . getEnv ( "nodered_images" , "[{\"name\":\"Latest Plain Nodered\", \"image\":\"openiap/nodered\"}]" ) ) ;
246+ public static nodered_images : NoderedImage [ ] = JSON . parse ( Config . getEnv ( "nodered_images" , "[{\"name\":\"Latest Plain Nodered\", \"image\":\"openiap/nodered\"}]" ) ) ;
243247 public static saml_federation_metadata : string = Config . getEnv ( "saml_federation_metadata" , "" ) ;
244248 public static api_ws_url : string = Config . getEnv ( "api_ws_url" , "" ) ;
245249 public static nodered_ws_url : string = Config . getEnv ( "nodered_ws_url" , "" ) ;
@@ -300,7 +304,7 @@ export class Config {
300304 }
301305 public static async parse_federation_metadata ( url : string ) : Promise < any > {
302306 // if anything throws, we retry
303- const metadata : any = await retry ( async bail => {
307+ return retry ( async bail => {
304308 const reader : any = await fetch ( { url } ) ;
305309 if ( NoderedUtil . IsNullUndefinded ( reader ) ) { bail ( new Error ( "Failed getting result" ) ) ; return ; }
306310 const config : any = toPassportConfig ( reader ) ;
@@ -315,7 +319,6 @@ export class Config {
315319 Logger . instanse . warn ( "retry " + count + " error " + error . message + " getting " + url ) ;
316320 }
317321 } ) ;
318- return metadata ;
319322 }
320323 public static parseArray ( s : string ) : string [ ] {
321324 let arr = s . split ( "," ) ;
@@ -342,7 +345,7 @@ export class Config {
342345 }
343346
344347}
345- export class nodered_image {
348+ export class NoderedImage {
346349 public name : string ;
347350 public image : string ;
348351}
0 commit comments