Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ services:
REDIS_HOST: "cache"
DB_HOST: "database"
DB_PORT: "3306"
HASHIDS_LENGTH: 8
networks:
default:
ipam:
Expand Down