fix: APP_KEY generation on setup script

This commit is contained in:
Víctor Falcón 2026-01-16 19:06:56 +01:00
parent 2607861fce
commit 44f2efab87
1 changed files with 10 additions and 9 deletions

View File

@ -586,15 +586,6 @@ install() {
echo -e "${GREEN}.env file already exists.${NC}"
fi
# Generate APP_KEY if not set
if ! grep -q "APP_KEY=base64:" .env 2>/dev/null || grep -q "APP_KEY=$" .env 2>/dev/null; then
echo -e "${YELLOW}Generating application key...${NC}"
php artisan key:generate --no-interaction
echo -e "${GREEN}Application key generated.${NC}"
else
echo -e "${GREEN}Application key already exists.${NC}"
fi
# Update APP_URL if needed
if grep -q "APP_URL=https://whispermoney.test" .env 2>/dev/null || grep -q "APP_URL=$" .env 2>/dev/null; then
echo -e "${YELLOW}Updating APP_URL to https://whisper.money.local...${NC}"
@ -643,6 +634,16 @@ install() {
echo -e "${GREEN}Composer dependencies installed.${NC}"
echo ""
# Generate APP_KEY if not set (after Composer dependencies are installed)
if ! grep -q "APP_KEY=base64:" .env 2>/dev/null || grep -q "APP_KEY=$" .env 2>/dev/null; then
echo -e "${YELLOW}Generating application key...${NC}"
php artisan key:generate --no-interaction
echo -e "${GREEN}Application key generated.${NC}"
else
echo -e "${GREEN}Application key already exists.${NC}"
fi
echo ""
# Now start PHP service (after dependencies are installed)
echo -e "${BLUE}Starting PHP service...${NC}"
if ! docker compose up -d php; then