From 05f66b7bdb7e200410a30c92cc71fa4205338334 Mon Sep 17 00:00:00 2001 From: Dan Seripap Date: Wed, 27 Jan 2016 18:15:27 -0500 Subject: [PATCH 1/2] Added .secret file for sessions x --- .gitignore | 3 ++- src/app.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1cad67b..f918f96 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -src/public/main.js \ No newline at end of file +src/public/main.js +src/.secret diff --git a/src/app.js b/src/app.js index f006755..06da948 100644 --- a/src/app.js +++ b/src/app.js @@ -9,6 +9,7 @@ import _ from 'underscore'; import Room from './room'; import favicon from 'serve-favicon'; import compression from 'compression'; +import fs from 'fs'; const app = express(); const server = http.createServer(app); @@ -20,7 +21,7 @@ const sessionMiddleware = session({ port: 6379, db: 2 }), - secret: 'hay', + secret: fs.readFileSync(__dirname + '/.secret', 'UTF-8'), resave: true, saveUninitialized: true }); From fab6549dac32c23d53e17500b7405804aec2306d Mon Sep 17 00:00:00 2001 From: Dan Seripap Date: Wed, 27 Jan 2016 18:18:43 -0500 Subject: [PATCH 2/2] Readme update --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index a0d7bcb..e2aa33e 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,8 @@ Simple encrypted web chat. Powered by [socket.io](http://socket.io) and the [web npm install gulp start +Create a **.secret** file in **/src** folder with a your session secret. It doesn't matter what it is- just keep it private. + Darkwire is now running on `http://localhost:3000` ### Deployment @@ -42,4 +44,4 @@ Darkwire uses [socket.io](http://socket.io) to transmit encrypted information us Rooms are stored in memory on the server until all participants have left, at which point the room is destroyed. Only public keys are stored in server memory for the duration of the room's life. -Chat history is stored in each participant's browser, so it is effectively erased (for that user) when their window is closed. \ No newline at end of file +Chat history is stored in each participant's browser, so it is effectively erased (for that user) when their window is closed.