Upgrade node version past 20 to get easy ENV variables so session secret can be removed from source code.

This commit is contained in:
Jody 2024-09-22 18:09:05 -04:00
parent 4825ebb10f
commit ec95ba46a5
3 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/node_modules/* /node_modules/*
/tmp/* /tmp/*
.vimrc .vimrc
.env

View File

@ -1,4 +1,4 @@
FROM node:18.18.2-alpine FROM node:22.9.0-alpine3.20
EXPOSE 3000 EXPOSE 3000
@ -20,4 +20,4 @@ RUN npm install
#RUN cd /usr/src/app/CodeMirror && npm run build #RUN cd /usr/src/app/CodeMirror && npm run build
# Use nodemon to start app. # Use nodemon to start app.
CMD [ "nodemon" ] CMD [ "nodemon", "--env-file=.env", "server.js" ]

View File

@ -19,7 +19,7 @@ var db = require('./db');
var Session = require('express-session'); var Session = require('express-session');
var SessionStore = require('session-file-store')(Session); var SessionStore = require('session-file-store')(Session);
var session = Session({ var session = Session({
secret: 'here kitty kitty', secret: process.env.SESSION_SECRET,
resave: false, resave: false,
saveUninitialized: false, saveUninitialized: false,
cookie: { sameSite: true, secure: true }, cookie: { sameSite: true, secure: true },