Skip to content

Commit

Permalink
Merge pull request #3 from marciogranzotto/auth_default_roles
Browse files Browse the repository at this point in the history
Add AUTH_DEFAULT_ROLES to the configuration
  • Loading branch information
marciogranzotto committed Sep 25, 2020
2 parents 222c7a3 + 3b1f0b7 commit f0d7ca2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nightscout/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN \
&& NODEJS="nodejs=8.17.0-1nodesource1"; \
else \
NODEURL="https://deb.nodesource.com/setup_10.x" \
&& NODEJS="nodejs=10.22.0-1nodesource1"; \
&& NODEJS="nodejs=10.22.1-1nodesource1"; \
fi \
&& curl -sL $NODEURL | bash - \
&& apt-get update \
Expand Down
3 changes: 3 additions & 0 deletions nightscout/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
},
"map": ["ssl", "config:rw"],
"options": {
"log_level": "info",
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"api_key": "",
"auth_default_roles": "readable",
"plugins": [
"careportal",
"boluscalc",
Expand All @@ -47,6 +49,7 @@
"certfile": "str",
"keyfile": "str",
"api_key": "str",
"auth_default_roles": "list(readable|denied|status-only)?",
"plugins": ["str"]
}
}
7 changes: 7 additions & 0 deletions nightscout/rootfs/etc/services.d/nightscout/run
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export API_SECRET="${api_key}"
export HOSTNAME="127.0.0.1"
export PORT=1337
export MONGO_CONNECTION="mongodb://127.0.0.1:27017/admin"
export INSECURE_USE_HTTP=true
export SECURE_HSTS_HEADER=false

if bashio::config.has_value 'auth_default_roles'; then
readonly auth_default_roles=$(bashio::config 'auth_default_roles')
export AUTH_DEFAULT_ROLES="${auth_default_roles}"
fi

# Enable plugins
readonly plugins=$(bashio::config 'plugins')
Expand Down

0 comments on commit f0d7ca2

Please sign in to comment.