Skip to content

fix: Add php session path for OLS#34

Merged
itsrafsanjani merged 2 commits into
flywp:mainfrom
ma-04:fix/ols_php_session_path_missing
Jun 2, 2026
Merged

fix: Add php session path for OLS#34
itsrafsanjani merged 2 commits into
flywp:mainfrom
ma-04:fix/ols_php_session_path_missing

Conversation

@ma-04

@ma-04 ma-04 commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Enhanced Docker container configuration and startup process to properly initialize the PHP session storage directory with correct ownership and permissions. Updates to both the container image and startup script ensure session data is reliably created and maintained throughout the container lifecycle, improving application stability and session management consistency.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ma-04, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: efb46a62-a471-452e-9d5f-fcd04536438d

📥 Commits

Reviewing files that changed from the base of the PR and between 3ea59d9 and 5c019f9.

📒 Files selected for processing (1)
  • openlitespeed/Dockerfile

Walkthrough

The pull request adds initialization for a PHP session storage directory in the OpenLiteSpeed Docker container. The Dockerfile creates /var/lib/php/sessions with ownership assigned to www-data and permissions set to 1733. The entrypoint script ensures that the directory ownership is correctly set to www-data:www-data when the container starts.

Changes

PHP Session Directory Setup

Layer / File(s) Summary
Build and runtime session directory configuration
openlitespeed/Dockerfile, openlitespeed/entrypoint.sh
Dockerfile creates /var/lib/php/sessions with www-data ownership and 1733 permissions during image build. Entrypoint explicitly sets www-data:www-data ownership for the directory at container startup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A session home, so neat and tidy,
www-data owns it all day Friday,
Sticky bits and permissions tight,
PHP writes its state each night,
Docker builds and starts just right! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: adding a PHP session path configuration for OpenLiteSpeed (OLS). It directly relates to the modifications in both Dockerfile and entrypoint.sh.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
openlitespeed/entrypoint.sh (1)

24-24: ⚡ Quick win

Consider resetting permissions in addition to ownership.

The ownership is correctly reset after the UID/GID changes, but the permissions set in the Dockerfile (chmod 1733 on line 61) are not re-applied here. If the directory is volume-mounted or permissions change, the intended permission mode may not be maintained.

🔧 Suggested addition
 chown www-data:www-data /var/lib/php/sessions
+chmod 1733 /var/lib/php/sessions

Note: If you accept the recommendation to change the permission mode from 1733 to 1730 or 0700 in the Dockerfile, update this accordingly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openlitespeed/entrypoint.sh` at line 24, The entrypoint currently only resets
ownership with the chown command for /var/lib/php/sessions; add a permissions
reset immediately after that to re-apply the intended mode (e.g. run chmod 1733
/var/lib/php/sessions or the chosen alternative like 1730 or 0700) so mounted
volumes or UID/GID changes keep the correct permission bits; update the chmod
call in entrypoint.sh where the existing chown www-data:www-data
/var/lib/php/sessions appears and ensure the mode value matches whatever you
decide to standardize in the Dockerfile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openlitespeed/Dockerfile`:
- Line 61: The Dockerfile currently sets /var/lib/php/sessions to mode 1733
which makes the directory world-writable; change the chmod invocation that
targets /var/lib/php/sessions so it uses a more secure mode (e.g. 0700 if only
the container user (www-data) needs access, or 1730 if you need sticky bit +
group access but no others). Locate the chmod line that says "chmod 1733
/var/lib/php/sessions" and replace the mode accordingly and ensure ownership
(chown to www-data) matches the intended user.

---

Nitpick comments:
In `@openlitespeed/entrypoint.sh`:
- Line 24: The entrypoint currently only resets ownership with the chown command
for /var/lib/php/sessions; add a permissions reset immediately after that to
re-apply the intended mode (e.g. run chmod 1733 /var/lib/php/sessions or the
chosen alternative like 1730 or 0700) so mounted volumes or UID/GID changes keep
the correct permission bits; update the chmod call in entrypoint.sh where the
existing chown www-data:www-data /var/lib/php/sessions appears and ensure the
mode value matches whatever you decide to standardize in the Dockerfile.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7f8115a-8d58-4b26-8410-712dafd60b90

📥 Commits

Reviewing files that changed from the base of the PR and between 942d474 and 3ea59d9.

📒 Files selected for processing (2)
  • openlitespeed/Dockerfile
  • openlitespeed/entrypoint.sh

Comment thread openlitespeed/Dockerfile Outdated
@itsrafsanjani itsrafsanjani merged commit e7589e1 into flywp:main Jun 2, 2026
13 checks passed
@ma-04 ma-04 deleted the fix/ols_php_session_path_missing branch June 3, 2026 03:40
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