aotrautils-srv 0.0.51 → 0.0.54

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils SERVER library associated with aotra version : «1.0.0.000 (11/07/2022-21:13:03)»*/
3
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (11/07/2022-23:45:39)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -140,59 +140,60 @@ if(typeof(fs)==="undefined"){
140
140
 
141
141
  // -Server :
142
142
 
143
- getServerParams=function(portParam,isSecureParam,certPathParam,keyPathParam){
144
-
145
- // Node dependencies :
146
- // https=require("https");
147
- // fs=require("fs");
148
-
149
- if(!https){
150
- // TRACE
151
- console.log("WARN : Could not find the nodejs dependency «https», aborting SSL setup.");
152
- return null;
153
- }
154
- if(!fs){
155
- // TRACE
156
- console.log("WARN : Could not find the nodejs dependency «fs», aborting SSL setup.");
157
- return null;
158
- }
159
-
160
- var result={};
161
-
162
- // We read the command-line arguments if needed :
163
- var argCLPort;
164
- var argCLCertPath;
165
- var argCLKeyPath;
166
- process.argv.forEach(function (val, i){
167
- if(i<=1) return;
168
- else if(i==2) argCLPort=val;
169
- else if(i==3) argCLCertPath=val;
170
- else if(i==4) argCLKeyPath=val;
171
- });
172
-
173
- // Console, command-line arguments OVERRIDE parameters values :
174
-
175
- result.port=nonull(argCLPort,portParam);
176
- result.certPath=null;
177
- result.keyPath=null;
178
- result.isSecure=isSecureParam;
179
-
180
- if(isSecureParam){
181
- result.certPath=nonull(argCLCertPath,certPathParam);
182
- result.keyPath=nonull(argCLKeyPath,keyPathParam);
183
- }
184
-
185
- // Eventual encryption options :
186
- result.sslOptions=null;
187
- if(isSecureParam){
188
- result.sslOptions={
189
- cert: fs.readFileSync(certPath),
190
- key: fs.readFileSync(keyPath),
191
- };
192
- }
193
-
194
- return result;
195
- }
143
+ // UNUSED : (BUT KEEP CODE!!)
144
+ //getServerParams=function(portParam,isSecureParam,certPathParam,keyPathParam){
145
+ //
146
+ // // Node dependencies :
147
+ // // https=require("https");
148
+ // // fs=require("fs");
149
+ //
150
+ // if(!https){
151
+ // // TRACE
152
+ // console.log("WARN : Could not find the nodejs dependency «https», aborting SSL setup.");
153
+ // return null;
154
+ // }
155
+ // if(!fs){
156
+ // // TRACE
157
+ // console.log("WARN : Could not find the nodejs dependency «fs», aborting SSL setup.");
158
+ // return null;
159
+ // }
160
+ //
161
+ // var result={};
162
+ //
163
+ // // We read the command-line arguments if needed :
164
+ // var argCLPort;
165
+ // var argCLCertPath;
166
+ // var argCLKeyPath;
167
+ // process.argv.forEach(function (val, i){
168
+ // if(i<=1) return;
169
+ // else if(i==2) argCLPort=val;
170
+ // else if(i==3) argCLCertPath=val;
171
+ // else if(i==4) argCLKeyPath=val;
172
+ // });
173
+ //
174
+ // // Console, command-line arguments OVERRIDE parameters values :
175
+ //
176
+ // result.port=nonull(argCLPort,portParam);
177
+ // result.certPath=null;
178
+ // result.keyPath=null;
179
+ // result.isSecure=isSecureParam;
180
+ //
181
+ // if(isSecureParam){
182
+ // result.certPath=nonull(argCLCertPath,certPathParam);
183
+ // result.keyPath=nonull(argCLKeyPath,keyPathParam);
184
+ // }
185
+ //
186
+ // // Eventual encryption options :
187
+ // result.sslOptions=null;
188
+ // if(isSecureParam){
189
+ // result.sslOptions={
190
+ // cert: fs.readFileSync(certPath),
191
+ // key: fs.readFileSync(keyPath),
192
+ // };
193
+ // }
194
+ //
195
+ // return result;
196
+ //}
196
197
 
197
198
 
198
199
  // NODE ONLY SERVER / CLIENTS :
@@ -1008,14 +1009,9 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
1008
1009
  argCLPort=jsonConf.port;
1009
1010
  argCLCertPath=jsonConf.sslCertPath;
1010
1011
  argCLKeyPath=jsonConf.sslKeyPath;
1011
- try{
1012
- serverConfig=nonull({},JSON.parse(jsonConf.serverConfig));
1013
- }catch(err1){
1014
- lognow("ERROR : Cannot parse JSON string «"+jsonConf.serverConfig+"».",err1);
1015
- }
1016
- }catch(err2){
1017
- lognow("ERROR : Cannot parse JSON string «"+val+"».",err2);
1018
- isHashAsked=true;
1012
+ serverConfig=nonull({},jsonConf.serverConfig);
1013
+ }catch(err1){
1014
+ lognow("ERROR : Cannot parse argument JSON string «"+val+"».",err1);
1019
1015
  }
1020
1016
  } else persisterId=val;
1021
1017
  }else if(i==4){
@@ -1303,7 +1299,7 @@ function getListManager(config){
1303
1299
 
1304
1300
 
1305
1301
 
1306
- /*utils COMMONS library associated with aotra version : «1.0.0.000 (11/07/2022-21:13:03)»*/
1302
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (11/07/2022-23:45:39)»*/
1307
1303
  /*-----------------------------------------------------------------------------*/
1308
1304
 
1309
1305
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.51",
3
+ "version": "0.0.54",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",