Skip to content

Commit

Permalink
Password
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait committed Nov 15, 2024
1 parent 541edde commit e0b1aa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fi
echo "# === Randomly generated secrets ===" >>.env
echo "APP_SECRET=$(openssl rand -base64 32)" >>.env
echo "" >>.env
echo "PGPASSWORD_SUPERUSER=$(openssl rand -hex 16)" >>.env
echo "PGPASSWORD_SUPERUSER=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9')" >>.env

echo -e "\t• .env configuration completed"

Expand Down
7 changes: 4 additions & 3 deletions packages/twenty-docker/twenty/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/docker-data/db_status ]
# Creating the database if it doesn't exist
PGUSER=$(echo $PG_DATABASE_URL | awk -F '//' '{print $2}' | awk -F ':' '{print $1}')
PGPASS=$(echo $PG_DATABASE_URL | awk -F ':' '{print $3}' | awk -F '@' '{print $1}')
PGHOST=$(echo $PG_DATABASE_URL | awk -F '@' '{print $2}' | awk -F '/' '{print $1}')
PGPASSWORD=${PGPASSWORD_SUPERUSER} psql -h ${PGHOST} -p 5432 -U ${PGUSER_SUPERUSER} -d postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'default'" | grep -q 1 || \
PGPASSWORD=${PGPASSWORD_SUPERUSER} psql -h ${PGHOST} -p 5432 -U ${PGUSER_SUPERUSER} -d postgres -c "CREATE DATABASE \"default\""
PGHOST=$(echo $PG_DATABASE_URL | awk -F '@' '{print $2}' | awk -F ':' '{print $1}')
PGPORT=$(echo $PG_DATABASE_URL | awk -F ':' '{print $4}' | awk -F '/' '{print $1}')
PGPASSWORD=${PGPASSWORD_SUPERUSER} psql -h ${PGHOST} -p ${PGPORT} -U ${PGUSER_SUPERUSER} -d postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'default'" | grep -q 1 || \
PGPASSWORD=${PGPASSWORD_SUPERUSER} psql -h ${PGHOST} -p ${PGPORT} -U ${PGUSER_SUPERUSER} -d postgres -c "CREATE DATABASE \"default\""

# Run setup and migration scripts
NODE_OPTIONS="--max-old-space-size=1500" tsx ./scripts/setup-db.ts
Expand Down

0 comments on commit e0b1aa9

Please sign in to comment.