add CHMOD option

This commit is contained in:
2025-06-23 11:35:38 -04:00
parent 78f86ed0f3
commit cc72ccda91
2 changed files with 7 additions and 10 deletions

View File

@ -43,6 +43,7 @@ services:
- PUID=1001 - PUID=1001
- PGID=1001 - PGID=1001
- PORT=6969 - PORT=6969
- CHMOD=771 # /var/www/html/4get
volumes: volumes:
# Optional, for custom banners and home.html # Optional, for custom banners and home.html
- ./4get/banner:/var/www/html/4get/banner - ./4get/banner:/var/www/html/4get/banner

View File

@ -1,15 +1,11 @@
#!/bin/sh #!/bin/sh
set -e set -e
# Default PUID and PGID
DEFAULT_PUID=1001
DEFAULT_PGID=1001
DEFAULT_PORT=80
# Use provided PUID and PGID or fall back to defaults # Use provided PUID and PGID or fall back to defaults
PUID=${PUID:-$DEFAULT_PUID} PUID=${PUID:-1001}
PGID=${PGID:-$DEFAULT_PGID} PGID=${PGID:-1001}
PORT=${PORT:-$DEFAULT_PORT} PORT=${PORT:-80}
CHMOD=${CHMOD:-771}
echo "Creating container user & group \"abc\" with UID: ${PUID} and GID: ${PGID}..." echo "Creating container user & group \"abc\" with UID: ${PUID} and GID: ${PGID}..."
groupadd -g $PGID abc groupadd -g $PGID abc
@ -20,7 +16,7 @@ php /gen_config.php
echo "Setting 4get file permissions..." echo "Setting 4get file permissions..."
chown -R abc:abc /var/www/html/4get chown -R abc:abc /var/www/html/4get
chmod -R 771 /var/www/html/4get chmod -R $CHMOD /var/www/html/4get
echo "Changing port in /etc/apache2/httpd.conf to ${PORT}..." echo "Changing port in /etc/apache2/httpd.conf to ${PORT}..."
sed -i "s/^Listen .*/Listen ${PORT}/" /etc/apache2/httpd.conf sed -i "s/^Listen .*/Listen ${PORT}/" /etc/apache2/httpd.conf