HackMD/config.js

85 lines
2.5 KiB
JavaScript
Raw Normal View History

2015-05-04 07:53:29 +00:00
//config
var path = require('path');
2015-05-15 04:58:13 +00:00
var domain = process.env.DOMAIN;
var urlpath = process.env.URL_PATH;
2015-05-15 04:58:13 +00:00
var testport = '3000';
var testsslport = '3001';
var port = process.env.PORT || testport;
var sslport = process.env.SSLPORT || testsslport;
var usessl = false;
var urladdport = true; //add port on getserverurl
2015-05-04 07:53:29 +00:00
var config = {
debug: true,
2015-10-06 10:26:00 +00:00
usecdn: false,
2016-01-19 16:06:22 +00:00
version: '0.3.4',
2015-05-15 04:58:13 +00:00
domain: domain,
alloworigin: ['add here to allow origin to cross'],
urlpath: urlpath,
2015-05-15 04:58:13 +00:00
testport: testport,
testsslport: testsslport,
port: port,
sslport: sslport,
sslkeypath: 'change this',
sslcertpath: 'change this',
sslcapath: ['change this'],
usessl: usessl,
getserverurl: function() {
var url = domain;
if (usessl)
url = 'https://' + url + (sslport == 443 || !urladdport ? '' : ':' + sslport);
2015-05-15 04:58:13 +00:00
else
url = 'http://' + url + (port == 80 || !urladdport ? '' : ':' + port);
if (urlpath)
url = url + '/' + urlpath;
return url;
2015-05-15 04:58:13 +00:00
},
2015-05-04 07:53:29 +00:00
//path
tmppath: "./tmp/",
defaultnotepath: path.join(__dirname, '/public', "default.md"),
defaultfeaturespath: path.join(__dirname, '/public', "features.md"),
indexpath: path.join(__dirname, '/public/', "index.ejs"),
2015-05-04 07:53:29 +00:00
hackmdpath: path.join(__dirname, '/public/views', "index.ejs"),
errorpath: path.join(__dirname, '/public/views', "error.ejs"),
prettypath: path.join(__dirname, '/public/views', 'pretty.ejs'),
//db string
2015-05-15 04:58:13 +00:00
postgresqlstring: "change this",
mongodbstring: "change this",
2015-05-04 07:53:29 +00:00
//constants
featuresnotename: "features",
2015-05-15 04:58:13 +00:00
sessionname: 'change this',
sessionsecret: 'change this',
2015-05-04 07:53:29 +00:00
sessionlife: 14 * 24 * 60 * 60 * 1000, //14 days
sessiontouch: 1 * 3600, //1 hour
heartbeatinterval: 5000,
heartbeattimeout: 10000,
documentmaxlength: 100000,
2015-05-04 07:53:29 +00:00
//auth
facebook: {
2015-05-15 04:58:13 +00:00
clientID: 'change this',
clientSecret: 'change this',
2015-05-04 07:53:29 +00:00
callbackPath: '/auth/facebook/callback'
},
twitter: {
2015-05-15 04:58:13 +00:00
consumerKey: 'change this',
consumerSecret: 'change this',
2015-05-04 07:53:29 +00:00
callbackPath: '/auth/twitter/callback'
},
github: {
2015-05-15 04:58:13 +00:00
clientID: 'change this',
clientSecret: 'change this',
2015-05-04 07:53:29 +00:00
callbackPath: '/auth/github/callback'
},
dropbox: {
2015-05-15 04:58:13 +00:00
clientID: 'change this',
clientSecret: 'change this',
2015-05-04 07:53:29 +00:00
callbackPath: '/auth/dropbox/callback'
2015-05-15 04:58:13 +00:00
},
imgur: {
clientID: 'change this'
2015-05-04 07:53:29 +00:00
}
};
2015-10-06 10:26:00 +00:00
module.exports = config;