Skip to content

Commit

Permalink
Account (#22)
Browse files Browse the repository at this point in the history
* initial

* Add working sign in / sign up logic

* Set expire jwt token in 7 days

* Use a JWT secret that is not the encryption secret

* Add basic sign in page

* Add user verification

* Add account page

* Add simple api docs

* Update basic auth account page

* Add more prerender urls

* Remove logged in pages

* Add basic auth check

* Rename SECRET_HOSTNAME to SECRET_LOCAL_HOSTNAME as this is what is defined for fastify

* update to localHostname

* Add comments

* Move account data to its own controller

* Minor styling
  • Loading branch information
bjarneo authored Jun 18, 2021
1 parent b2eb50a commit 3960047
Show file tree
Hide file tree
Showing 26 changed files with 1,005 additions and 52 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
# ------------------------------
#
# $ docker run -p 3000:3000 -d --name=hemmelig \
# -e SECRET_HOSTNAME=example.com \
# -e SECRET_LOCAL_HOSTNAME=0.0.0.0 \
# -e SECRET_PORT=3000 \
# -e SECRET_HOST=example.com \
# -e SECRET_MASTER_KEY=11111222223333344444555556666677 \
# -e SECRET_REDIS_HOST=the_redis_host_name \
# -e SECRET_REDIS_PORT=6379 \
# -e SECRET_REDIS_TLS=true \
# -e SECRET_REDIS_USER=username \
# -e SECRET_REDIS_PASSWORD=glhf \
# -e SECRET_JWT_SECRET=good_luck_have_fun \
# hemmeligapp/hemmelig:latest

FROM node:lts-alpine
Expand Down
10 changes: 8 additions & 2 deletions config/default.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const {
SECRET_HOSTNAME = '0.0.0.0',
SECRET_LOCAL_HOSTNAME = '0.0.0.0',
SECRET_PORT = '3000',
SECRET_HOST = '',
SECRET_MASTER_KEY = '11111222223333344444555556666677', // has to be 32 in length
SECRET_REDIS_HOST = '0.0.0.0',
SECRET_REDIS_PORT = 6379,
SECRET_REDIS_USER = null,
SECRET_REDIS_PASSWORD = null,
SECRET_REDIS_TLS = false,
SECRET_JWT_SECRET = 'good_luck_have_fun',
} = process.env;

module.exports = {
hostname: SECRET_HOSTNAME,
localHostname: SECRET_LOCAL_HOSTNAME,
host: SECRET_HOST,
port: SECRET_PORT,
secret_key: SECRET_MASTER_KEY,
redis: {
Expand All @@ -20,6 +23,9 @@ module.exports = {
password: SECRET_REDIS_PASSWORD,
tls: SECRET_REDIS_TLS === 'true',
},
jwt: {
secret: SECRET_JWT_SECRET,
},
logger: true,
cors: '*',
__client_config: {
Expand Down
Loading

0 comments on commit 3960047

Please sign in to comment.