fix(ols): Fix OLS permission issue caused by binding to uid 1000#19
fix(ols): Fix OLS permission issue caused by binding to uid 1000#19alaminfirdows merged 8 commits intoflywp:mainfrom
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes update the OpenLiteSpeed Docker build process. The Dockerfile now installs Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Entrypoint Script
participant OS
User->>Entrypoint Script: Start container
Entrypoint Script->>OS: Get current www-data UID/GID
Entrypoint Script->>Entrypoint Script: Read PUID and PGID env vars (default 1000)
Entrypoint Script->>Entrypoint Script: Print current and target UID/GID
Entrypoint Script->>OS: Change www-data GID to PGID
Entrypoint Script->>OS: Change www-data UID to PUID
Entrypoint Script->>OS: Adjust permissions on /var/www/html
Entrypoint Script->>OS: Start OpenLiteSpeed service
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
openlitespeed/entrypoint.sh (1)
17-17: Fix log message variable mix-up
The echo swaps and mislabels UID/GID. It should be:echo "setting GID to $PGID and UID to $PUID"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
openlitespeed/Dockerfile(3 hunks)openlitespeed/build.sh(1 hunks)openlitespeed/entrypoint.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: build-php (8.4)
- GitHub Check: build-php (8.1)
- GitHub Check: build-php (8.0)
- GitHub Check: build-php (8.3)
- GitHub Check: build-php (8.2)
- GitHub Check: build-openlitespeed (7.4, lsphp74)
- GitHub Check: build-php (7.4)
- GitHub Check: build-openlitespeed (8.2, lsphp82)
- GitHub Check: build-openlitespeed (8.1, lsphp81)
- GitHub Check: build-openlitespeed (8.3, lsphp83)
🔇 Additional comments (7)
openlitespeed/Dockerfile (2)
14-14: Install mysql-client alongside existing utilities
Addingmysql-clientenables in-container database tooling. Ensure this aligns with your image size and security requirements.
51-52: Release GID 1000 by remappinglsadmto 999
Verify that thelsadmgroup exists at this point and that GID 999 isn’t already in use on the base image to preventgroupmodfrom failing.openlitespeed/build.sh (1)
6-6: Bump OpenLiteSpeed version to 1.8.3
Version bump looks correct; confirm that the 1.8.3 binaries are available and pass your smoke tests.openlitespeed/entrypoint.sh (4)
4-5: Print currentwww-dataUID/GID at startup
Helpful for debugging; no issues spotted here.
6-10: Separate PGID fallback logic
Explicitly defaultsPGIDto 1000 when unset. Consider quoting the variable in the test ([ -z "$PGID" ]).
12-15: Separate PUID fallback logic
Mirrors the PGID check—defaultsPUIDto 1000 when unset. Good consistency.
19-20: Apply runtime UID/GID adjustments
Modifyingwww-data’s group and user IDs perPGID/PUIDis correct. Ensure this runs before any chown operations.
Fixes #49
Proposed changes
Add support for two environment variables, PUID and PGID, that allows FlyWP to override the user and group IDs used inside the container.
set these variables in docker-compose.yml, if no variables exist, use the default 1000
Update /entrypoint.sh to read PUID and PGID (defaulting to 1000 when they are not provided) and run chown so that file permissions match the requested UID / GID before the main process starts.
With this change, the container no longer assumes that the default fly user has UID 1000, making it compatible with hosts that map container users to different IDs.
Sample docker-compose.yml
Summary by CodeRabbit
New Features
Chores
mysql-clientto the installed packages in the container.