aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-08-08 11:19:11 -0700
committerAdam Soltys <[email protected]>2014-08-08 11:33:24 -0700
commit6d5c3a56067b96bb5d97cca4a80bacbf78395b2c (patch)
treef7b4b8d7aed2fec54b16f7294cfaff2867e33557
parent163f681ff6d4d4eb2b111a6cdfa0e0133f6840ad (diff)
downloadcoinos-server-6d5c3a56067b96bb5d97cca4a80bacbf78395b2c.tar.gz
coinos-server-6d5c3a56067b96bb5d97cca4a80bacbf78395b2c.zip
Move session secret into unversioned config file
-rw-r--r--.gitignore3
-rw-r--r--app.js12
-rw-r--r--src/app.coffee7
-rw-r--r--src/config.coffee.sample0
4 files changed, 13 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 112d5e7d..21623d60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,9 @@
public/bitcoins.pdf
node_modules
-config.js
builtAssets
database.json
sequelize.coffee
npm-debug.log
public/js/rates.json
+src/config.coffee
+config.js
diff --git a/app.js b/app.js
index bd282be5..1e8cb145 100644
--- a/app.js
+++ b/app.js
@@ -1,5 +1,5 @@
(function() {
- var RedisStore, app, authorize, bodyParser, calculator, cookieParser, express, passport, path, session, sessionStore, sessions, transactions, users;
+ var RedisStore, app, authorize, bodyParser, calculator, config, cookieParser, express, passport, path, session, sessionStore, sessions, transactions, users;
express = require('express');
@@ -11,6 +11,8 @@
passport = require('./passport');
+ config = require('./config');
+
calculator = require("./routes/calculator");
sessions = require("./routes/sessions")(passport);
@@ -49,12 +51,12 @@
type: 'application/vnd.api+json'
}));
- app.use(cookieParser('weareallmadeofstars'));
+ app.use(cookieParser(config.secret));
app.use(session({
resave: true,
saveUninitialized: true,
- secret: 'weareallmadeofstars',
+ secret: config.secret,
store: sessionStore,
cookie: {
maxAge: 1209600000
@@ -102,10 +104,10 @@
app.get('/:user/report', authorize, transactions.index);
- app.get('/:user', authorize, users.show);
-
app.get('/:user.json', authorize, users.json);
+ app.get('/:user', authorize, users.show);
+
app.use(require('connect-assets')({
src: 'public',
servePath: '/'
diff --git a/src/app.coffee b/src/app.coffee
index 94e0e4b3..538dfa05 100644
--- a/src/app.coffee
+++ b/src/app.coffee
@@ -3,6 +3,7 @@ bodyParser = require('body-parser')
cookieParser = require('cookie-parser')
path = require('path')
passport = require('./passport')
+config = require('./config')
calculator = require("./routes/calculator")
sessions = require("./routes/sessions")(passport)
@@ -23,8 +24,8 @@ app.use(express.static(__dirname + '/public'))
app.use(bodyParser.urlencoded({ extended: true}))
app.use(bodyParser.json())
app.use(bodyParser.json({ type: 'application/vnd.api+json' }))
-app.use(cookieParser('weareallmadeofstars'))
-app.use(session(resave: true, saveUninitialized: true, secret: 'weareallmadeofstars', store: sessionStore, cookie: { maxAge: 1209600000 }, key: 'vanbtc.sid'))
+app.use(cookieParser(config.secret))
+app.use(session(resave: true, saveUninitialized: true, secret: config.secret, store: sessionStore, cookie: { maxAge: 1209600000 }, key: 'vanbtc.sid'))
app.use(passport.initialize())
app.use(passport.session())
@@ -53,8 +54,8 @@ app.get('/:user/transactions.json', authorize, transactions.json)
app.post('/:user/transactions', authorize, transactions.create)
app.get('/:user/report', authorize, transactions.index)
-app.get('/:user', authorize, users.show)
app.get('/:user.json', authorize, users.json)
+app.get('/:user', authorize, users.show)
app.use(require('connect-assets')(src: 'public', servePath: '/'))
diff --git a/src/config.coffee.sample b/src/config.coffee.sample
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/config.coffee.sample