From a5e278e078634e2de7976bee02b9e207ad8ba8ea Mon Sep 17 00:00:00 2001 From: Loki <59907407+Loki-101@users.noreply.github.com> Date: Thu, 26 Mar 2026 16:26:15 -0700 Subject: [PATCH] Fix log permissions, HASHIDS env var generation, and the two errors that have been showing up since the v1.12.0 update (#5324) --- .github/docker/entrypoint.sh | 18 ++++++++++++++++++ Dockerfile | 2 +- docker-compose.example.yml | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/docker/entrypoint.sh b/.github/docker/entrypoint.sh index 9cd4c9b0f..858a6fd12 100644 --- a/.github/docker/entrypoint.sh +++ b/.github/docker/entrypoint.sh @@ -26,6 +26,17 @@ else echo -e "APP_KEY=$APP_KEY" > /app/var/.env fi + ## generate a random salt for hashids if not provided + if [ -z $HASHIDS_SALT ]; then + echo -e "Generating hashids salt." + HASHIDS_SALT=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*()_+?><~' | fold -w 20 | head -n 1) + echo -e "Generated hashids salt: $HASHIDS_SALT" + echo -e "HASHIDS_SALT=$HASHIDS_SALT" >> /app/var/.env + else + echo -e "HASHIDS_SALT exists in environment, using that." + echo -e "HASHIDS_SALT=$HASHIDS_SALT" >> /app/var/.env + fi + ln -s /app/var/.env /app/ fi @@ -60,6 +71,13 @@ if [[ -z $DB_PORT ]]; then DB_PORT=3306 fi +## check log folder permissions +echo "Checking log folder permissions." +if [ "$(stat -c %U:%G /app/storage/logs)" != "nginx" ]; then + echo "Fixing log folder permissions." + chown -R nginx: /app/storage/logs/ +fi + ## check for DB up before starting the panel echo "Checking database status." until nc -z -v -w30 $DB_HOST $DB_PORT diff --git a/Dockerfile b/Dockerfile index 3eed8ae45..d7ddd49b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine WORKDIR /app COPY . ./ COPY --from=0 /app/public/assets ./public/assets -RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot certbot-nginx \ +RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot certbot-nginx mysql-client \ && docker-php-ext-configure zip \ && docker-php-ext-install bcmath gd pdo_mysql zip \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ diff --git a/docker-compose.example.yml b/docker-compose.example.yml index f5b264056..e585c7413 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -33,7 +33,7 @@ x-common: # services: database: - image: mariadb:10.5 + image: mariadb:11 restart: always command: --default-authentication-plugin=mysql_native_password volumes: @@ -70,6 +70,7 @@ services: REDIS_HOST: "cache" DB_HOST: "database" DB_PORT: "3306" + HASHIDS_LENGTH: 8 networks: default: ipam: