Commit 3f0d9e91 authored by Fintan Mc Gee's avatar Fintan Mc Gee

Added https SSL certificates folder and functionality to app.js to use them

The actual certs should be uploaded manually as i did not want  to check them in to the git instance ( too easy for them to be disseminated)
parent b38b99d9
......@@ -14,3 +14,6 @@
/R/*.RData
/neo4J_start.bat
/neo4J_stop.bat
/https_certs/blizaar_list_lu.crt
/https_certs/blizaar_list_lu.key
/https_certs/DigiCertCA.crt
......@@ -8,6 +8,8 @@
/*jslint node: true, nomen: true, unparam: true */
"use strict";
var express = require("express"), // a web application framework
http = require("http"),
https = require("https"),
cfg = require('app-config'), // used to parse json line config files
/* declaring cfg parameters as namespaces, as webstorm was identifying
them as unresolved variable even thought they exist
......@@ -34,6 +36,16 @@ var express = require("express"), // a web application framework
//require('array.prototype.find');
//r = require('request'); // the request module applies nice syntactic sugar and functionality on top of HTTP module
var key = fs.readFileSync('https_certs/blizaar_list_lu.key');
var cert = fs.readFileSync( 'https_certs/blizaar_list_lu.crt' );
var ca = fs.readFileSync( 'https_certs/DigiCertCA.crt' );
var HTTPSCertOptions = {
key: key,
cert: cert,
ca: ca
};
function logger(req, res, next) {
......@@ -84,7 +96,6 @@ function serveStaticFile(filename, res) {
});
}
/*
* Login, authentication and user Functionality
*/
......@@ -1014,7 +1025,11 @@ simple_serve.get('/getTSVData', blizaarSystem.ensureAuthenticated,function(req,
console .log("removing any temporary labels (of form \"tmp_...\") from the Neo4j DB.");
graphDB.removeAllTempTagLabel();
simple_serve.listen(cfg.http.port_dynamic, function () {
sLog.debug_log('Test Express server listening on port ' + simple_serve.get('port'));
});
sLog.log('* Serving dynamic content at http://localhost:' + cfg.http.port_dynamic + '/',"APPLICATION START UP");
//http.createServer(simple_serve).listen(cfg.http.port_dynamic)// only if we want to want to connect via http
https.createServer(HTTPSCertOptions, simple_serve).listen(cfg.http.port_dynamic); // accept http copnnects ( HTTPSCertOptions maust be correctly set up at start of file)
// simple_serve.listen(cfg.http.port_dynamic, function () {
// sLog.debug_log('Test Express server listening on port ' + simple_serve.get('port'));
// });
sLog.log('* Serving dynamic content at https://localhost:' + cfg.http.port_dynamic + '/',"APPLICATION START UP");
this folder should contain the certification files necessary for running the server over https.
this includes the cert file for the server, the cert file for the authorithy, and the key.
Namely these are:
blizaar_list_lu.crt
DigiCertCA.crt
blizaar_list_lu.key
For security reasons, these files are not checked into the GIT repsoitory (to stop them being disseminated where there should not be),
They should be manually loaded into this folder on the server.
If new certs are required please raise a request with LIST service desk
Readme file created by: Fintan McGee ( 24/06/2019 ) fintan.mcgee@list.lu
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using npm@3.10.10
3 info using node@v6.11.4
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 silly loadCurrentTree Finishing
9 silly loadIdealTree Starting
10 silly install loadIdealTree
11 silly cloneCurrentTree Starting
12 silly install cloneCurrentTreeToIdealTree
13 silly cloneCurrentTree Finishing
14 silly loadShrinkwrap Starting
15 silly install loadShrinkwrap
16 silly loadShrinkwrap Finishing
17 silly loadAllDepsIntoIdealTree Starting
18 silly install loadAllDepsIntoIdealTree
19 silly fetchNamedPackageData lodash.assign
20 silly mapToRegistry name lodash.assign
21 silly mapToRegistry using default registry
22 silly mapToRegistry registry https://registry.npmjs.org/
23 silly mapToRegistry data Result {
23 silly mapToRegistry raw: 'lodash.assign',
23 silly mapToRegistry scope: null,
23 silly mapToRegistry escapedName: 'lodash.assign',
23 silly mapToRegistry name: 'lodash.assign',
23 silly mapToRegistry rawSpec: '',
23 silly mapToRegistry spec: 'latest',
23 silly mapToRegistry type: 'tag' }
24 silly mapToRegistry uri https://registry.npmjs.org/lodash.assign
25 verbose request uri https://registry.npmjs.org/lodash.assign
26 verbose request no auth needed
27 info attempt registry request try #1 at 6:17:48 PM
28 verbose request id a7b494760de93296
29 http request GET https://registry.npmjs.org/lodash.assign
30 info retry will retry, error on last attempt: Error: connect ETIMEDOUT 104.16.19.35:443
31 info attempt registry request try #2 at 6:20:05 PM
32 http request GET https://registry.npmjs.org/lodash.assign
33 info retry will retry, error on last attempt: Error: connect ETIMEDOUT 104.16.26.35:443
34 info attempt registry request try #3 at 6:23:13 PM
35 http request GET https://registry.npmjs.org/lodash.assign
36 silly fetchPackageMetaData Error: connect ETIMEDOUT 104.16.17.35:443
36 silly fetchPackageMetaData at Object.exports._errnoException (util.js:1020:11)
36 silly fetchPackageMetaData at exports._exceptionWithHostPort (util.js:1043:20)
36 silly fetchPackageMetaData at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
36 silly fetchPackageMetaData error for lodash.assign@^4.2.0 { Error: connect ETIMEDOUT 104.16.17.35:443
36 silly fetchPackageMetaData at Object.exports._errnoException (util.js:1020:11)
36 silly fetchPackageMetaData at exports._exceptionWithHostPort (util.js:1043:20)
36 silly fetchPackageMetaData at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
36 silly fetchPackageMetaData code: 'ETIMEDOUT',
36 silly fetchPackageMetaData errno: 'ETIMEDOUT',
36 silly fetchPackageMetaData syscall: 'connect',
36 silly fetchPackageMetaData address: '104.16.17.35',
36 silly fetchPackageMetaData port: 443 }
37 silly rollbackFailedOptional Starting
38 silly rollbackFailedOptional Finishing
39 silly runTopLevelLifecycles Finishing
40 silly install printInstalled
41 verbose stack Error: connect ETIMEDOUT 104.16.17.35:443
41 verbose stack at Object.exports._errnoException (util.js:1020:11)
41 verbose stack at exports._exceptionWithHostPort (util.js:1043:20)
41 verbose stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
42 verbose cwd /home/blizaartest/blizaar_platform
43 error Linux 3.16.0-30-generic
44 error argv "/usr/bin/node" "/usr/bin/npm" "install"
45 error node v6.11.4
46 error npm v3.10.10
47 error code ETIMEDOUT
48 error errno ETIMEDOUT
49 error syscall connect
50 error network connect ETIMEDOUT 104.16.17.35:443
51 error network This is most likely not a problem with npm itself
51 error network and is related to network connectivity.
51 error network In most cases you are behind a proxy or have bad network settings.
51 error network
51 error network If you are behind a proxy, please make sure that the
51 error network 'proxy' config is set properly. See: 'npm help config'
52 verbose exit [ 1, true ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment