forked from tungstenfabric/tf-webui-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkue_0.5.0_4.patch
42 lines (39 loc) · 1.35 KB
/
kue_0.5.0_4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- node_modules/kue/lib/http/index.js 2015-11-11 09:17:16.000000000 +0530
+++ node_modules/kue/lib/http/index.js 2015-11-11 09:20:49.000000000 +0530
@@ -11,13 +11,37 @@
var express = require('express');
var fs = require('fs');
+var path = require('path');
var corePath = process.mainModule.exports['corePath'];
var contrailConfig = process.mainModule.exports.config;
var userList = contrailConfig.staticAuth;
+var keyFile = './keys/cs-key.pem';
+var certFile = './keys/cs-cert.pem';
+if (contrailConfig.server_options) {
+ keyFile = contrailConfig.server_options.key_file;
+ if (null != keyFile) {
+ keyFile = path.normalize(keyFile);
+ if (false == fs.existsSync(keyFile)) {
+ keyFile = './keys/cs-key.pem';
+ }
+ } else {
+ keyFile = './keys/cs-key.pem';
+ }
+ certFile = contrailConfig.server_options.cert_file;
+ if (null != certFile) {
+ certFile = path.normalize(certFile);
+ if (false == fs.existsSync(certFile)) {
+ certFile = './keys/cs-cert.pem';
+ }
+ } else {
+ certFile = './keys/cs-cert.pem';
+ }
+}
+
var options = {
- key:fs.readFileSync(corePath + '/keys/cs-key.pem'),
- cert:fs.readFileSync(corePath + '/keys/cs-cert.pem')
+ key:fs.readFileSync(keyFile),
+ cert:fs.readFileSync(certFile)
};
var app = express.createServer(options);