@@ -7,13 +7,31 @@ import { DatabaseConnection } from "./DatabaseConnection";
77import { Crypt } from "./Crypt" ;
88import { Config } from "./Config" ;
99import { amqpwrapper , QueueMessageOptions } from "./amqpwrapper" ;
10- import { WellknownIds , Role , Rights , User , Base } from "@openiap/openflow-api" ;
10+ import { WellknownIds , Role , Rights , User , Base , NoderedUtil } from "@openiap/openflow-api" ;
1111import { DBHelper } from "./DBHelper" ;
1212import { OAuthProvider } from "./OAuthProvider" ;
1313import { Span } from "@opentelemetry/api" ;
1414
1515Logger . configure ( ) ;
1616
17+ let _lic_require : any = null ;
18+ try {
19+ _lic_require = require ( "./license-file" ) ;
20+ } catch ( error ) {
21+ }
22+ if ( _lic_require != null ) {
23+ Logger . License = new _lic_require . LicenseFile ( ) ;
24+ } else {
25+ Logger . License = { } as any ;
26+ Logger . License . ofid = function ( ) {
27+ if ( ! NoderedUtil . IsNullEmpty ( this . _ofid ) ) return this . _ofid ;
28+ var crypto = require ( 'crypto' ) ;
29+ const openflow_uniqueid = Config . openflow_uniqueid || crypto . createHash ( 'md5' ) . update ( Config . domain ) . digest ( "hex" ) ;
30+ Config . openflow_uniqueid = openflow_uniqueid ;
31+ this . _ofid = openflow_uniqueid ;
32+ return openflow_uniqueid ;
33+ } ;
34+ }
1735let _otel_require : any = null ;
1836try {
1937 _otel_require = require ( "./otel" ) ;
@@ -49,7 +67,6 @@ if (_otel_require != null) {
4967 }
5068 } as any ;
5169}
52-
5370Config . db = new DatabaseConnection ( Config . mongodb_url , Config . mongodb_db ) ;
5471
5572
0 commit comments