This commit is contained in:
GitHub Merge Button 2011-09-14 03:37:35 -07:00
commit 928f91c7f7
4 changed files with 44 additions and 1 deletions

View file

@ -420,6 +420,8 @@ async.waterfall([
//this is only a workaround to ensure it works with all browers behind a proxy
//we should remove this when the new socket.io version is more stable
io.set('transports', ['xhr-polling']);
io.set('polling duration', settings.pollingDuration)
var socketIOLogger = log4js.getLogger("socket.io");
io.set('logger', {

View file

@ -57,6 +57,11 @@ exports.abiword = null;
*/
exports.loglevel = "INFO";
/**
* xhr-polling duration
*/
exports.pollingDuration = 20;
//read the settings sync
var settingsStr = fs.readFileSync("../settings.json").toString();
@ -97,3 +102,31 @@ for(var i in settings)
console.warn("This setting doesn't exist or it was removed");
}
}
// If deployed in CloudFoundry
if(process.env.VCAP_APP_PORT) {
exports.port = process.env.VCAP_APP_PORT
}
// use mysql if provided.
var vcap_services = process.env.VCAP_SERVICES;
if(vcap_services) {
var svcs = JSON.parse(vcap_services)
for(var key in svcs ) {
var svc = svcs[key]
console.log("service:" + svc)
if( key.match(/^mysql/) ) {
exports.dbType= "mysql";
var cred = svc[0].credentials
exports.dbSettings = {
"user" : cred.user ,
"host" : cred.host ,
"password" : cred.password ,
"database" : cred.name ,
};
}
console.debug("database setup:" + console.dir(exports.dbSettings))
}
}

5
server.js Normal file
View file

@ -0,0 +1,5 @@
// Entry point for etherpad running on cloudfoundry
var path = require('path')
process.chdir( path.join( process.cwd(), 'node'))
var s = require("./node/server")

View file

@ -37,5 +37,8 @@
"abiword" : null,
/* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
"loglevel": "INFO"
"loglevel": "INFO",
/* The xhr-polling duration, default value is 20. */
"pollingDuration" : 20
}