@@ -83,6 +83,8 @@ export class Config {
8383 public static db : DatabaseConnection = null ;
8484 public static version : string = Config . getversion ( ) ;
8585 public static logpath : string = Config . getEnv ( "logpath" , __dirname ) ;
86+ public static log_queries : boolean = Config . parseBoolean ( Config . getEnv ( "log_queries" , "false" ) ) ;
87+
8688
8789 public static NODE_ENV : string = Config . getEnv ( "NODE_ENV" , "development" ) ;
8890
@@ -123,10 +125,6 @@ export class Config {
123125 public static amqp_requeue_time : number = parseInt ( Config . getEnv ( "amqp_requeue_time" , "1000" ) ) ; // 1 seconds
124126 public static amqp_dlx : string = Config . getEnv ( "amqp_dlx" , "openflow-dlx" ) ; // Dead letter exchange, used to pickup dead or timeout messages
125127
126- // public static amqp_default_expiration: number = parseInt(Config.getEnv("amqp_default_expiration", (60 * 1000).toString())); // 1 min
127- // public static deadLetterExchange: string = Config.getEnv("deadletterexchange", "openflow-dlx"); // queue used to handle messages, that was not picked up.
128- // public static dlxmessagettl: number = parseInt(Config.getEnv("dlxmessagettl", "2000")); // time to live for messages in miliseconds
129- // public static dlxmessageexpires: number = parseInt(Config.getEnv("dlxmessageexpires", "1500")); // expire messages after this amount of miliseconds
130128 public static mongodb_url : string = Config . getEnv ( "mongodb_url" , "mongodb://localhost:27017" ) ;
131129 public static mongodb_db : string = Config . getEnv ( "mongodb_db" , "openflow" ) ;
132130
@@ -142,23 +140,13 @@ export class Config {
142140 public static downloadtoken_expires_in : string = Config . getEnv ( "downloadtoken_expires_in" , "15m" ) ;
143141 public static personalnoderedtoken_expires_in : string = Config . getEnv ( "personalnoderedtoken_expires_in" , "365d" ) ;
144142
145- // Used to configure personal nodered's
146- // public static force_queue_prefix: boolean = Config.parseBoolean(Config.getEnv("force_queue_prefix", "true"));
147143 public static nodered_image : string = Config . getEnv ( "nodered_image" , "cloudhack/openflownodered:edge" ) ;
148144 public static saml_federation_metadata : string = Config . getEnv ( "saml_federation_metadata" , "" ) ;
149145 public static api_ws_url : string = Config . getEnv ( "api_ws_url" , "ws://localhost:3000" ) ;
150146 public static namespace : string = Config . getEnv ( "namespace" , "" ) ; // also sent to website
151147 public static nodered_domain_schema : string = Config . getEnv ( "nodered_domain_schema" , "" ) ; // also sent to website
152148 public static nodered_initial_liveness_delay : number = parseInt ( Config . getEnv ( "nodered_initial_liveness_delay" , "60" ) ) ;
153149
154- // Environment variables to set a prefix for RabbitMQs Dead Letter Exchange, Dead Letter Routing Key,
155- // Dead Letter Queue, and Message Time to Live - to enable timeouts for RabbitMQ messages
156- // These values must be the same for OpenFlowNodeRED and OpenFlow, or will cause errors when asserting queues
157- // public static amqp_dlx_prefix: string = Config.getEnv("amqp_dlx_prefix", "DLX.");
158- // public static amqp_dlrk_prefix: string = Config.getEnv("amqp_dlrk_prefix", "dlx.");
159- // public static amqp_dlq_prefix: string = Config.getEnv("amqp_dlq_prefix", "dlq.");
160- // public static amqp_message_ttl: number = parseInt(Config.getEnv("amqp_message_ttl", "20000"));
161-
162150 public static baseurl ( ) : string {
163151 var result : string = "" ;
164152 if ( Config . tls_crt != '' && Config . tls_key != '' ) {
@@ -171,13 +159,6 @@ export class Config {
171159 } else { result = result + "/" ; }
172160 return result ;
173161 }
174- // public static async get_login_providers():Promise<void> {
175- // this.login_providers = await Config.db.query<Provider>({_type: "provider"}, null, 1, 0, null, "config", Crypt.rootToken());
176- // // if(this.login_providers.length > 0) { return; }
177- // if(fs.existsSync("config/login_providers.json")) {
178- // // this.login_providers = JSON.parse(fs.readFileSync("config/login_providers.json", "utf8"));
179- // }
180- // }
181162 public static getEnv ( name : string , defaultvalue : string ) : string {
182163 var value : any = process . env [ name ] ;
183164 if ( ! value || value === "" ) { value = defaultvalue ; }
0 commit comments