-
Notifications
You must be signed in to change notification settings - Fork 1
fix: normalize line endings in docker-entrypoint.sh and update Docker… #125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| *.sh text eol=lf | ||
| *.bash text eol=lf | ||
| *.ps1 text eol=crlf |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,17 +1,10 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| # JWT secret handling | |
| # ------------------- | |
| # By default, we DO NOT generate a random DEVBITS_JWT_SECRET. When | |
| # DEVBITS_JWT_SECRET is unset, the backend falls back to a stable built‑in | |
| # development secret. This is intentional: it preserves dev sessions across | |
| # container restarts so that restarting the backend does not log out all | |
| # developers. | |
| # | |
| # If you want this entrypoint to generate a random secret at startup, set: | |
| # | |
| # DEVBITS_FORCE_RANDOM_JWT_SECRET=1 | |
| # | |
| # When DEVBITS_FORCE_RANDOM_JWT_SECRET=1 and DEVBITS_JWT_SECRET is empty, | |
| # we generate a random value (using openssl if available, otherwise | |
| # /dev/urandom) and export it as DEVBITS_JWT_SECRET for this container. | |
| # | |
| # IMPORTANT: | |
| # - For production, you SHOULD explicitly set a strong DEVBITS_JWT_SECRET and | |
| # NOT rely on the built‑in development default or this random‑generation | |
| # helper. | |
| # - Changing how/when a random secret is generated can break expectations | |
| # about session persistence; please update this comment if you modify the | |
| # behavior below. |
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback secret generation uses an unquoted command substitution. Even though the output is expected to be hex, quoting avoids any risk of word-splitting/globbing and keeps shell style consistent with the openssl branch.
| export DEVBITS_JWT_SECRET=$(head -c 32 /dev/urandom | od -An -v -tx1 | tr -d ' \n') | |
| export DEVBITS_JWT_SECRET="$(head -c 32 /dev/urandom | od -An -v -tx1 | tr -d ' \n')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that .gitattributes enforces LF for *.sh, the Docker build-time CRLF stripping via sed is likely redundant and can hide repository normalization issues. Consider relying on git normalization (and renormalizing the repo if needed) and keeping this step to just setting executable permissions, unless you have a specific non-git build context to support.