mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
initial https version fix #1148
This commit is contained in:
parent
1899e3f48d
commit
eed6b752d4
4 changed files with 43 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,3 +12,5 @@ src/static/js/jquery.js
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
.ep_initialized
|
.ep_initialized
|
||||||
|
*.crt
|
||||||
|
*.key
|
||||||
|
|
|
@ -14,7 +14,18 @@
|
||||||
//Ip and port which etherpad should bind at
|
//Ip and port which etherpad should bind at
|
||||||
"ip": "0.0.0.0",
|
"ip": "0.0.0.0",
|
||||||
"port" : 9001,
|
"port" : 9001,
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Node native SSL support
|
||||||
|
// make sure to have the correct file access permissions set
|
||||||
|
|
||||||
|
"ssl" : {
|
||||||
|
"key" : "/path-to-your/server.key",
|
||||||
|
"cert" : "/path-to-your/server.crt"
|
||||||
|
},
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
//The Type of the database. You can choose between dirty, postgres, sqlite and mysql
|
//The Type of the database. You can choose between dirty, postgres, sqlite and mysql
|
||||||
//You shouldn't use "dirty" for for anything else than testing or development
|
//You shouldn't use "dirty" for for anything else than testing or development
|
||||||
"dbType" : "dirty",
|
"dbType" : "dirty",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
||||||
var http = require('http');
|
|
||||||
var express = require('express');
|
var express = require('express');
|
||||||
var settings = require('../utils/Settings');
|
var settings = require('../utils/Settings');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
@ -50,7 +49,28 @@ exports.restartServer = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
var app = express(); // New syntax for express v3
|
var app = express(); // New syntax for express v3
|
||||||
server = http.createServer(app);
|
|
||||||
|
if (settings.ssl) {
|
||||||
|
|
||||||
|
console.log( "SSL -- enabled");
|
||||||
|
console.log( "SSL -- server key file: " + settings.ssl.key );
|
||||||
|
console.log( "SSL -- Certificate Authority's certificate file: " + settings.ssl.cert );
|
||||||
|
|
||||||
|
options = {
|
||||||
|
key: fs.readFileSync( settings.ssl.key ),
|
||||||
|
cert: fs.readFileSync( settings.ssl.cert )
|
||||||
|
};
|
||||||
|
|
||||||
|
var https = require('https');
|
||||||
|
server = https.createServer(options, app);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
console.log( "SSL -- not enabled!" );
|
||||||
|
|
||||||
|
var http = require('http');
|
||||||
|
server = http.createServer(app);
|
||||||
|
}
|
||||||
|
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
res.header("Server", serverName);
|
res.header("Server", serverName);
|
||||||
|
|
|
@ -48,6 +48,13 @@ exports.ip = "0.0.0.0";
|
||||||
* The Port ep-lite should listen to
|
* The Port ep-lite should listen to
|
||||||
*/
|
*/
|
||||||
exports.port = process.env.PORT || 9001;
|
exports.port = process.env.PORT || 9001;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The SSL signed server key and the Certificate Authority's own certificate
|
||||||
|
* default case: ep-lite does *not* use SSL. A signed server key is not required in this case.
|
||||||
|
*/
|
||||||
|
exports.ssl = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The Type of the database
|
* The Type of the database
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue