mirror of https://github.com/status-im/codimd.git
Added protocol use ssl option in config
This commit is contained in:
parent
526f5c7e2e
commit
ef1436c7d6
|
@ -97,6 +97,7 @@ Server-side config.js settings
|
||||||
| testport | `3000` | debug web port, fallback to this when not set in environment |
|
| testport | `3000` | debug web port, fallback to this when not set in environment |
|
||||||
| testsslport | `3001` | debug web ssl port, fallback to this when not set in environment |
|
| testsslport | `3001` | debug web ssl port, fallback to this when not set in environment |
|
||||||
| usessl | `true` or `false` | set to use ssl |
|
| usessl | `true` or `false` | set to use ssl |
|
||||||
|
| protocolusessl | `true` or `false` | set to use ssl protocol |
|
||||||
| urladdport | `true` or `false` | set to add port on oauth callback url |
|
| urladdport | `true` or `false` | set to add port on oauth callback url |
|
||||||
| debug | `true` or `false` | set debug mode, show more logs |
|
| debug | `true` or `false` | set debug mode, show more logs |
|
||||||
| usecdn | `true` or `false` | set to use CDN resources or not |
|
| usecdn | `true` or `false` | set to use CDN resources or not |
|
||||||
|
|
11
config.js
11
config.js
|
@ -7,11 +7,12 @@ var testport = '3000';
|
||||||
var testsslport = '3001';
|
var testsslport = '3001';
|
||||||
var port = process.env.PORT || testport;
|
var port = process.env.PORT || testport;
|
||||||
var sslport = process.env.SSLPORT || testsslport;
|
var sslport = process.env.SSLPORT || testsslport;
|
||||||
var usessl = false;
|
var usessl = false; // use node https server
|
||||||
|
var protocolusessl = false; // use ssl protocol
|
||||||
var urladdport = true; //add port on getserverurl
|
var urladdport = true; //add port on getserverurl
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
debug: true,
|
debug: false,
|
||||||
usecdn: false,
|
usecdn: false,
|
||||||
version: '0.3.4',
|
version: '0.3.4',
|
||||||
domain: domain,
|
domain: domain,
|
||||||
|
@ -26,12 +27,14 @@ var config = {
|
||||||
sslcapath: ['change this'],
|
sslcapath: ['change this'],
|
||||||
dhparampath: 'change this',
|
dhparampath: 'change this',
|
||||||
usessl: usessl,
|
usessl: usessl,
|
||||||
|
protocolusessl: protocolusessl,
|
||||||
getserverurl: function() {
|
getserverurl: function() {
|
||||||
|
var protocol = protocolusessl ? 'https://' : 'http://';
|
||||||
var url = domain;
|
var url = domain;
|
||||||
if (usessl)
|
if (usessl)
|
||||||
url = 'https://' + url + (sslport == 443 || !urladdport ? '' : ':' + sslport);
|
url = protocol + url + (sslport == 443 || !urladdport ? '' : ':' + sslport);
|
||||||
else
|
else
|
||||||
url = 'http://' + url + (port == 80 || !urladdport ? '' : ':' + port);
|
url = protocol + url + (port == 80 || !urladdport ? '' : ':' + port);
|
||||||
if (urlpath)
|
if (urlpath)
|
||||||
url = url + '/' + urlpath;
|
url = url + '/' + urlpath;
|
||||||
return url;
|
return url;
|
||||||
|
|
Loading…
Reference in New Issue