Skip to content

Commit a5e278e

Browse files
authored
Fix log permissions, HASHIDS env var generation, and the two errors that have been showing up since the v1.12.0 update (#5324)
1 parent 51bbd10 commit a5e278e

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.github/docker/entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ else
2626
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
2727
fi
2828

29+
## generate a random salt for hashids if not provided
30+
if [ -z $HASHIDS_SALT ]; then
31+
echo -e "Generating hashids salt."
32+
HASHIDS_SALT=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*()_+?><~' | fold -w 20 | head -n 1)
33+
echo -e "Generated hashids salt: $HASHIDS_SALT"
34+
echo -e "HASHIDS_SALT=$HASHIDS_SALT" >> /app/var/.env
35+
else
36+
echo -e "HASHIDS_SALT exists in environment, using that."
37+
echo -e "HASHIDS_SALT=$HASHIDS_SALT" >> /app/var/.env
38+
fi
39+
2940
ln -s /app/var/.env /app/
3041
fi
3142

@@ -60,6 +71,13 @@ if [[ -z $DB_PORT ]]; then
6071
DB_PORT=3306
6172
fi
6273

74+
## check log folder permissions
75+
echo "Checking log folder permissions."
76+
if [ "$(stat -c %U:%G /app/storage/logs)" != "nginx" ]; then
77+
echo "Fixing log folder permissions."
78+
chown -R nginx: /app/storage/logs/
79+
fi
80+
6381
## check for DB up before starting the panel
6482
echo "Checking database status."
6583
until nc -z -v -w30 $DB_HOST $DB_PORT

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine
1414
WORKDIR /app
1515
COPY . ./
1616
COPY --from=0 /app/public/assets ./public/assets
17-
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot certbot-nginx \
17+
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 \
1818
&& docker-php-ext-configure zip \
1919
&& docker-php-ext-install bcmath gd pdo_mysql zip \
2020
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

docker-compose.example.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ x-common:
3333
#
3434
services:
3535
database:
36-
image: mariadb:10.5
36+
image: mariadb:11
3737
restart: always
3838
command: --default-authentication-plugin=mysql_native_password
3939
volumes:
@@ -70,6 +70,7 @@ services:
7070
REDIS_HOST: "cache"
7171
DB_HOST: "database"
7272
DB_PORT: "3306"
73+
HASHIDS_LENGTH: 8
7374
networks:
7475
default:
7576
ipam:

0 commit comments

Comments
 (0)