Skip to content

Commit d6d0c31

Browse files
authored
Fix permissions for config files and introduce entrypoint testing (#451)
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: #446
1 parent fe864e3 commit d6d0c31

File tree

5 files changed

+2515
-26
lines changed

5 files changed

+2515
-26
lines changed

.github/actions/build-and-tag-locally/action.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,26 @@ runs:
204204
exit 1
205205
fi
206206
207+
- name: Test the entrypoint
208+
id: test_entrypoint
209+
if: ${{ contains(fromJSON('["amd64", "i386"]'), steps.platform.outputs.display_name) }}
210+
shell: bash
211+
run: >
212+
cd test && env
213+
PLATFORM=${{ steps.platform.outputs.display_name }}
214+
REDIS_IMG=${{ github.sha }}:${{ steps.platform.outputs.display_name }}
215+
./run-entrypoint-tests.sh
216+
-- --output-junit-xml=report-entrypoint.xml
217+
218+
- name: Test Report
219+
uses: dorny/test-reporter@v2
220+
# run this step even if previous step failed, but not if it was skipped
221+
if: ${{ !cancelled() && steps.test_entrypoint.conclusion != 'skipped' }}
222+
with:
223+
name: Entrypoint Tests
224+
path: test/report-entrypoint.xml
225+
reporter: java-junit
226+
207227
- name: Push image
208228
uses: docker/build-push-action@v6
209229
if: ${{ inputs.publish_image == 'true' && contains(fromJSON('["amd64"]'), steps.platform.outputs.display_name) }}
@@ -212,4 +232,4 @@ runs:
212232
push: true
213233
tags: ${{ inputs.registry_repository }}:${{ github.sha }}-${{ inputs.distribution }}
214234
cache-from: type=gha
215-
cache-to: type=gha,mode=max
235+
cache-to: type=gha,mode=max

alpine/docker-entrypoint.sh

Lines changed: 116 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

debian/docker-entrypoint.sh

Lines changed: 117 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)