Skip to content

feat(redis): Eliminate runtime-generated redis-session.ini#2550

Draft
joshtrichards wants to merge 5 commits intomasterfrom
jtr/feat-redis-session-env-pure
Draft

feat(redis): Eliminate runtime-generated redis-session.ini#2550
joshtrichards wants to merge 5 commits intomasterfrom
jtr/feat-redis-session-env-pure

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Mar 23, 2026

Fixes #763

  • avoids stale redis-session.ini
  • reduces mutable filesystem state
  • makes PHP config more declearative
  • aligns Redis PHP session config with the existing env-substitution pattner already used for other PHP settings like PHP_MEMORY_LIMIT
  • eliminates incompatibility of Redis session handler configuration with "rootless" scenarios (Introduced redis session handler does not work with non-root images #763)

Requirements:

  • Existing container-level REDIS_* image configuration variables remain as they exist today
  • Redis is enabled only when configured

For standard environments (i.e. those that already work today with the existing implementation), the result should be:

  • No change

For environments running containers w/o root:

  • They should start working (i.e. using the specified REDIS_HOST as the PHP session handler... instead of generating an error about being unable to write to the ini file and falling back on file-based session storage)

This is a prototype in its current state.

Key things to confirm:

  • What happens when the env vars are unset?

P.S. If the empty values being always passed through is problematic.... This tests the full “drop redis-session.ini entirely” idea. If this runs into challenges, we could generate a separate ini file (only when Redis is configured) in the entrypoint, but still source values from env. That would test the env-based composition separately from the fallback problem.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Fixes #763 

Implements part I of #763 (comment)

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added 2. developing feature: auto config (environment variables) Auto configuring via environment variables rootless Running in Docker w/o root enhancement labels Mar 23, 2026
@joshtrichards joshtrichards changed the title feat(php): configure Redis session handling via environment variables feat(redis): Eliminate runtime-generated redis-session.ini Mar 23, 2026
Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing enhancement feature: auto config (environment variables) Auto configuring via environment variables rootless Running in Docker w/o root

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduced redis session handler does not work with non-root images

1 participant