diff --git a/Dockerfile b/Dockerfile index 891f293..987ebad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM alpine:3.20 as rootfs-stage +FROM alpine:3.20 AS rootfs-stage # environment ENV REL=noble @@ -66,9 +66,9 @@ ARG LSIOWN_VERSION="v1" LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="TheLamer" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" +ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" +ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" +ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" # set environment variables ARG DEBIAN_FRONTEND="noninteractive" diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 7e4be14..c126176 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM alpine:3.20 as rootfs-stage +FROM alpine:3.20 AS rootfs-stage # environment ENV REL=noble @@ -66,9 +66,9 @@ ARG LSIOWN_VERSION="v1" LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="TheLamer" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" -ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" +ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods" +ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run" +ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown" # set environment variables ARG DEBIAN_FRONTEND="noninteractive" diff --git a/root/etc/s6-overlay/s6-rc.d/init-adduser/run b/root/etc/s6-overlay/s6-rc.d/init-adduser/run index 687a920..9e0122b 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-adduser/run +++ b/root/etc/s6-overlay/s6-rc.d/init-adduser/run @@ -4,10 +4,16 @@ PUID=${PUID:-911} PGID=${PGID:-911} -groupmod -o -g "$PGID" abc -usermod -o -u "$PUID" abc +if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then + groupmod -o -g "$PGID" abc + usermod -o -u "$PUID" abc +fi -cat /etc/s6-overlay/s6-rc.d/init-adduser/branding +if { [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; } || [[ ! ${LSIO_FIRST_PARTY} = "true" ]]; then + cat /etc/s6-overlay/s6-rc.d/init-adduser/branding +else + cat /run/branding +fi if [[ -f /donate.txt ]]; then echo ' @@ -21,10 +27,17 @@ https://www.linuxserver.io/donate/ ─────────────────────────────────────── GID/UID ───────────────────────────────────────' +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then echo " User UID: $(id -u abc) User GID: $(id -g abc) ───────────────────────────────────────" +else +echo " +User UID: $(stat /run -c %u) +User GID: $(stat /run -c %g) +───────────────────────────────────────" +fi if [[ -f /build_version ]]; then cat /build_version echo ' @@ -32,6 +45,8 @@ if [[ -f /build_version ]]; then ' fi -lsiown abc:abc /app -lsiown abc:abc /config -lsiown abc:abc /defaults +if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then + lsiown abc:abc /app + lsiown abc:abc /config + lsiown abc:abc /defaults +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run index 3b51d5a..45a4e88 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run @@ -2,9 +2,11 @@ # shellcheck shell=bash for cron_user in abc root; do - if [[ -f "/etc/crontabs/${cron_user}" ]]; then - lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}" - crontab -u "${cron_user}" "/etc/crontabs/${cron_user}" + if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then + if [[ -f "/etc/crontabs/${cron_user}" ]]; then + lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}" + crontab -u "${cron_user}" "/etc/crontabs/${cron_user}" + fi fi if [[ -f "/defaults/crontabs/${cron_user}" ]]; then