Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache the fernet key in the /config volume #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jchonig
Copy link

@jchonig jchonig commented Nov 13, 2024

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

When the fernet key is not provided in an environment variable, cache the generated key in /config/fernet.key. If this is a persistent volume, the key will be reused on container restarts.

This change will also accept a fernet key with or w/o enclosing "b'" and "'". This avoids confusion as /app/fernet-key.py prints it with the byte-string quotes.

Benefits of this PR and context:

This is an easier method to preserve the key to prevent issues when the container restarts. Even on occasional container restarts I was having problems getting the login page w/o clearing cookies.

How Has This Been Tested?

I've been running this change for several days in several docker compose container stacks on x86_64 with a /config volume mounted and FERNETKEY not defined and a volume mounted. My gateway errors on the login page have gone away.

I also switched between defining FERNETKEY (to one generated by and cached in /config) and mounting the /config volume to ensure that the same key was being used (by reloading the web page and watching for tracebacks in the container logs).

Source / References:

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/ldap-auth/3.4.4-pkg-213d9213-dev-bc3357c0460341d94d809e004e1493e8a8c24d90-pr-55/index.html
https://ci-tests.linuxserver.io/lspipepr/ldap-auth/3.4.4-pkg-213d9213-dev-bc3357c0460341d94d809e004e1493e8a8c24d90-pr-55/shellcheck-result.xml

Tag Passed
amd64-3.4.4-pkg-213d9213-dev-bc3357c0460341d94d809e004e1493e8a8c24d90-pr-55
arm64v8-3.4.4-pkg-213d9213-dev-bc3357c0460341d94d809e004e1493e8a8c24d90-pr-55

@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/ldap-auth/3.4.4-pkg-213d9213-dev-85980e86daa7eaa4f791b18a9d79b8741cbe77f4-pr-55/index.html
https://ci-tests.linuxserver.io/lspipepr/ldap-auth/3.4.4-pkg-213d9213-dev-85980e86daa7eaa4f791b18a9d79b8741cbe77f4-pr-55/shellcheck-result.xml

Tag Passed
amd64-3.4.4-pkg-213d9213-dev-85980e86daa7eaa4f791b18a9d79b8741cbe77f4-pr-55
arm64v8-3.4.4-pkg-213d9213-dev-85980e86daa7eaa4f791b18a9d79b8741cbe77f4-pr-55

@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/ldap-auth/3.4.4-pkg-213d9213-dev-5a0c2ee4f4b9540412a2a0677311ebe2e12855f6-pr-55/index.html
https://ci-tests.linuxserver.io/lspipepr/ldap-auth/3.4.4-pkg-213d9213-dev-5a0c2ee4f4b9540412a2a0677311ebe2e12855f6-pr-55/shellcheck-result.xml

Tag Passed
amd64-3.4.4-pkg-213d9213-dev-5a0c2ee4f4b9540412a2a0677311ebe2e12855f6-pr-55
arm64v8-3.4.4-pkg-213d9213-dev-5a0c2ee4f4b9540412a2a0677311ebe2e12855f6-pr-55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants