Skip to content

fix: secure Django secret generation - #4706

Merged
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:token
Aug 15, 2026
Merged

fix: secure Django secret generation#4706
nijel merged 1 commit into
WeblateOrg:mainfrom
nijel:token

Conversation

@nijel

@nijel nijel commented Aug 15, 2026

Copy link
Copy Markdown
Member

Prevent the signing key from inheriting permissive umasks or being replaced by competing replicas. Let the migration owner create and repair it while dependent services wait.

Prevent the signing key from inheriting permissive umasks or being replaced by competing replicas. Let the migration owner create and repair it while dependent services wait.
@nijel nijel self-assigned this Aug 15, 2026
@nijel
nijel enabled auto-merge (rebase) August 15, 2026 17:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d6d7c6d27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread start
fi

# Repair secrets created by older container versions or copied into the volume.
chmod 600 "$secret_file"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Repair readable secrets without requiring file ownership

When an existing nonempty secret is readable but owned by root or by a previous arbitrary runtime UID, the data directory can still be writable while this chmod is forbidden. Under set -e, upgrading the container then aborts startup even though the previous entrypoint could use the secret; this also contradicts the stated goal of repairing secrets copied into the volume. Preserve the value by rewriting it through an owned temporary file and atomic rename rather than requiring ownership of the existing inode.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It should be owned by correct user, there is runtime check for that in Weblate AFAIK.

@nijel
nijel merged commit e8874c5 into WeblateOrg:main Aug 15, 2026
47 checks passed
@nijel
nijel deleted the token branch August 15, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant