How to set SESSION_SECURE_COOKIE=true via docker env file? #543
|
Hi All, How do enable session secure cookies within my docker compose stack? As I couldn't find mention to it in the docker repo docs I'm wondering if we need to set this somewhere else. Please can someone point me to the correct resource? (Ideally I'd like to have this configuration managed via the compose files but I'll settle for a live configuration change if it's possible) I've also asked this question in #427 |
Replies: 1 comment
|
On current LibreNMS Docker setups, this can be passed as an environment variable to the main librenms container. For example: services:
librenms:
environment:
APP_URL: "https://librenms.example.com"
SESSION_SECURE_COOKIE: "true"Then recreate the container so it receives the updated environment: docker compose up -d --force-recreate librenmsand rebuild the LibreNMS config cache: docker compose exec librenms lnms config:cacheSESSION_SECURE_COOKIE=true should normally be used together with an HTTPS APP_URL; otherwise the browser will not send a cookie marked Secure over plain HTTP. You can verify the container received it with: docker compose exec librenms printenv SESSION_SECURE_COOKIEwhich should return:
If validation still complains after that, I'd first check whether an old cached Laravel configuration is still being used. |
On current LibreNMS Docker setups, this can be passed as an environment variable to the main librenms container.
For example:
Then recreate the container so it receives the updated environment:
docker compose up -d --force-recreate librenmsand rebuild the LibreNMS config cache:
docker compose exec librenms lnms config:cacheSESSION_SECURE_COOKIE=true should normally be used together with an HTTPS APP_URL; otherwise the browser will not send a cookie marked Secure over plain HTTP.
You can verify the container received it with:
docker compose exec librenms printenv SESSI…