summaryrefslogtreecommitdiff
path: root/config.js
diff options
context:
space:
mode:
authorWu Cheng-Han2015-05-15 12:58:13 +0800
committerWu Cheng-Han2015-05-15 12:58:13 +0800
commit4e64583a0b6175d2c9a6729ffde1472dd55d389c (patch)
tree75253f2425f2e4f5906ed4fd30eca29a906ee47a /config.js
parent2d36d7ce84c636faac17cef3d3a7c22568df38fe (diff)
Marked as 0.2.8
Diffstat (limited to 'config.js')
-rw-r--r--config.js55
1 files changed, 40 insertions, 15 deletions
diff --git a/config.js b/config.js
index 3a5c764c..03764fef 100644
--- a/config.js
+++ b/config.js
@@ -1,11 +1,33 @@
//config
var path = require('path');
+var domain = process.env.DOMAIN;
+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
+
var config = {
debug: true,
- version: '0.2.7',
- domain: 'http://localhost:3000',
- testport: '3000',
+ version: '0.2.8',
+ domain: domain,
+ alloworigin: ['add here to allow origin to cross'],
+ testport: testport,
+ testsslport: testsslport,
+ port: port,
+ sslport: sslport,
+ sslkeypath: 'change this',
+ sslcertpath: 'change this',
+ sslcapath: ['change this'],
+ usessl: usessl,
+ getserverurl: function() {
+ if(usessl)
+ return 'https://' + domain + (sslport == 443 || !urladdport ? '' : ':' + sslport);
+ else
+ return 'http://' + domain + (port == 80 || !urladdport ? '' : ':' + port);
+ },
//path
tmppath: "./tmp/",
defaultnotepath: path.join(__dirname, '/public', "default.md"),
@@ -14,36 +36,39 @@ var config = {
errorpath: path.join(__dirname, '/public/views', "error.ejs"),
prettypath: path.join(__dirname, '/public/views', 'pretty.ejs'),
//db string
- postgresqlstring: "postgresql://localhost:5432/hackmd",
- mongodbstring: "mongodb://localhost/hackmd",
+ postgresqlstring: "change this",
+ mongodbstring: "change this",
//constants
featuresnotename: "features",
- sessionname: 'please set this',
- sessionsecret: 'please set this',
+ sessionname: 'change this',
+ sessionsecret: 'change this',
sessionlife: 14 * 24 * 60 * 60 * 1000, //14 days
sessiontouch: 1 * 3600, //1 hour
heartbeatinterval: 5000,
heartbeattimeout: 10000,
//auth
facebook: {
- clientID: 'get yourself one',
- clientSecret: 'get yourself one',
+ clientID: 'change this',
+ clientSecret: 'change this',
callbackPath: '/auth/facebook/callback'
},
twitter: {
- consumerKey: 'get yourself one',
- consumerSecret: 'get yourself one',
+ consumerKey: 'change this',
+ consumerSecret: 'change this',
callbackPath: '/auth/twitter/callback'
},
github: {
- clientID: 'get yourself one',
- clientSecret: 'get yourself one',
+ clientID: 'change this',
+ clientSecret: 'change this',
callbackPath: '/auth/github/callback'
},
dropbox: {
- clientID: 'get yourself one',
- clientSecret: 'get yourself one',
+ clientID: 'change this',
+ clientSecret: 'change this',
callbackPath: '/auth/dropbox/callback'
+ },
+ imgur: {
+ clientID: 'change this'
}
};