0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-19 18:36:09 +02:00

feature: configurable user ids

Signed-off-by: realies <5107843+realies@users.noreply.github.com>
This commit is contained in:
realies 2025-02-18 03:07:11 +00:00
parent 4daafc8d20
commit 447389a542
8 changed files with 49 additions and 1 deletions

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then

View file

@ -172,7 +172,13 @@ The `--private` flag can also be specified, in order to output all configuration
## Auto configuration via environment variables ## Auto configuration via environment variables
The Nextcloud image supports auto configuration of the Nextcloud Server installation via environment variables. You can preconfigure everything that would otherwise be prompted for by the Nextcloud Installation Wizard (as well as a few other key parameters relevant to initial installation). The Nextcloud image supports auto configuration via environment variables. You can preconfigure everything that would otherwise be prompted for by the Nextcloud Installation Wizard (as well as a few other key parameters relevant to initial installation).
### User/Group Identifiers
- `UID` - Set user ID for www-data user (optional)
- `GID` - Set group ID for www-data group (optional)
These optional variables allow you to match the container's www-data user/group IDs with your host system's user/group IDs for better file permission handling.
### Database parameters ### Database parameters

View file

@ -83,6 +83,12 @@ if expr "$1" : "apache" 1>/dev/null; then
fi fi
if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
if [ -n "${UID}" ] && [ -n "${GID}" ]; then
echo "Updating www-data user/group IDs..."
groupmod -o -g "${GID}" www-data
usermod -o -u "${UID}" www-data
fi
uid="$(id -u)" uid="$(id -u)"
gid="$(id -g)" gid="$(id -g)"
if [ "$uid" = '0' ]; then if [ "$uid" = '0' ]; then