Introduced redis session handler does not work with non-root images
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 7.4k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
In commit 83ea69d54bea72e1df9a2647ee101c73deb86d44, a redis session handler was intrododuced. But the file /usr/local/etc/php/conf.d/redis-session.ini can not be written when using a non-root image, because the folder is owned by root and the default www-data user does not have write permission.
/var/www/html # ls -lha /usr/local/etc/php/conf.d
total 72
drwxr-xr-x 1 root root 4.0K Feb 26 08:50 .
drwxr-xr-x 1 root root 4.0K Feb 26 07:34 ..
-rw-r--r-- 1 root root 35 Feb 26 08:50 docker-php-ext-apcu.ini
-rw-r--r-- 1 root root 18 Feb 26 08:47 docker-php-ext-exif.ini
-rw-r--r-- 1 root root 16 Feb 26 08:47 docker-php-ext-gd.ini
-rw-r--r-- 1 root root 21 Feb 26 08:50 docker-php-ext-imagick.ini
-rw-r--r-- 1 root root 18 Feb 26 08:48 docker-php-ext-intl.ini
-rw-r--r-- 1 root root 18 Feb 26 08:48 docker-php-ext-ldap.ini
-rw-r--r-- 1 root root 23 Feb 26 08:50 docker-php-ext-memcached.ini
-rw-r--r-- 1 root root 82 Feb 26 08:48 docker-php-ext-opcache.ini
-rw-r--r-- 1 root root 19 Feb 26 08:48 docker-php-ext-pcntl.ini
-rw-r--r-- 1 root root 23 Feb 26 08:49 docker-php-ext-pdo_mysql.ini
-rw-r--r-- 1 root root 23 Feb 26 08:49 docker-php-ext-pdo_pgsql.ini
-rw-r--r-- 1 root root 19 Feb 26 08:50 docker-php-ext-redis.ini
-rw-r--r-- 1 root root 20 Feb 26 07:34 docker-php-ext-sodium.ini
-rw-r--r-- 1 root root 17 Feb 26 08:49 docker-php-ext-zip.ini
-rw-r--r-- 1 root root 18 Feb 26 08:50 memory-limit.ini
-rw-r--r-- 1 root root 189 Feb 26 08:50 opcache-recommended.ini
For running my nextcloud image, I use the default non-privileged user www-data.
/var/www/html $ id
uid=82(www-data) gid=82(www-data) groups=82(www-data)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting commit 83ea69d54bea72e1df9a2647ee101c73deb86d44 and how /usr/local/etc/php/conf.d/redis-session.ini is created. Reproduce the image using the non-root www-data user and verify that the Redis session handler can be configured without a permission error. Done means the image works with www-data and the Redis session handler remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php, redis, shell
- Domain
- backend, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100