Skip to content

Fix permissions for config files and introduce entrypoint testing #451

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

Peter-Sh
Copy link

Fixes: #446

This PR attempts to address permissions and ownership issues in the Redis config and data directories, but only for simple, default cases where it's safe to assume we won't overwrite or alter user-specific files (e.g., if a user's home directory is mistakenly mounted).

Key Changes:

  • Fixes config file and directory permissions when they are insufficient for server startup.
  • Introduces the SKIP_FIX_PERMS environment variable to completely skip permission fixes, if desired.
  • Introduces the SKIP_DROP_PRIVS environment variable to optionally disable privilege dropping. This is not recommended, but may be necessary for compatibility with older image versions.
  • Adds a comprehensive entrypoint test suite that simulates a wide range of real-world scenarios.

Breaking Change Notice:

Users who previously relied on automatic permission fixes in the data directory but have non-standard configurations (e.g., a custom appendonlydir) or unrelated files in the data volume may find that these fixes no longer apply. We've chosen to err on the side of caution to avoid unintended data loss or misconfiguration caused by overly aggressive permission handling.

This PR attempts to address permissions and ownership issues in the Redis config and data directories, but only for simple, default cases where it's safe to assume we won't overwrite or alter user-specific files (e.g., if a user's home directory is mistakenly mounted).

**Key Changes:**

* Fixes config file and directory permissions when they are insufficient for server startup.
* Introduces the `SKIP_FIX_PERMS` environment variable to completely skip permission fixes, if desired.
* Introduces the `SKIP_DROP_PRIVS` environment variable to optionally disable privilege dropping. This is not recommended, but may be necessary for compatibility with older image versions.
* Adds a comprehensive entrypoint test suite that simulates a wide range of real-world scenarios.

**Breaking Change Notice:**

Users who previously relied on automatic permission fixes in the data directory but have non-standard configurations (e.g., a custom `appendonlydir`) or unrelated files in the data volume may find that these fixes no longer apply. We've chosen to err on the side of caution to avoid unintended data loss or misconfiguration caused by overly aggressive permission handling.

Fixes: redis#446
@Peter-Sh Peter-Sh force-pushed the RED-159320_fix_permissions branch from 464631a to d5a41c5 Compare May 29, 2025 13:30
@adobrzhansky adobrzhansky merged commit d6d0c31 into redis:release/8.0 May 29, 2025
16 checks passed
adamiBs pushed a commit to adamiBs/docker-library-redis that referenced this pull request Jun 26, 2025
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.

2 participants