fix(trek): extract admin creds from log; fix(slink): export APP_ENV=prod for all symfony commands
This commit is contained in:
@@ -41,7 +41,8 @@ cd /opt/slink/services/api
|
|||||||
APP_SECRET=$(openssl rand -hex 16)
|
APP_SECRET=$(openssl rand -hex 16)
|
||||||
sed -i "s|^APP_SECRET=.*|APP_SECRET=${APP_SECRET}|" .env
|
sed -i "s|^APP_SECRET=.*|APP_SECRET=${APP_SECRET}|" .env
|
||||||
sed -i "s|^APP_ENV=.*|APP_ENV=prod|" .env
|
sed -i "s|^APP_ENV=.*|APP_ENV=prod|" .env
|
||||||
APP_ENV=prod $STD composer install --no-dev --optimize-autoloader --no-interaction
|
export APP_ENV=prod
|
||||||
|
$STD composer install --no-dev --optimize-autoloader --no-interaction
|
||||||
mkdir -p /opt/slink/{data,images}
|
mkdir -p /opt/slink/{data,images}
|
||||||
$STD php bin/console cache:warm --no-optional-warmers 2>/dev/null || true
|
$STD php bin/console cache:warm --no-optional-warmers 2>/dev/null || true
|
||||||
msg_ok "Set up API"
|
msg_ok "Set up API"
|
||||||
|
|||||||
@@ -69,6 +69,28 @@ EOF
|
|||||||
systemctl enable -q --now trek
|
systemctl enable -q --now trek
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
msg_info "Waiting for initial setup"
|
||||||
|
for i in $(seq 1 15); do
|
||||||
|
if journalctl -u trek --no-pager -q 2>/dev/null | grep -q "Admin Account Created"; then
|
||||||
|
TREK_PW=$(journalctl -u trek --no-pager -q 2>/dev/null | grep "Password:" | tail -1 | sed 's/.*Password: *//;s/ *║.*//')
|
||||||
|
TREK_EMAIL=$(journalctl -u trek --no-pager -q 2>/dev/null | grep "Email:" | tail -1 | sed 's/.*Email: *//;s/ *║.*//')
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
msg_ok "Initial setup complete"
|
||||||
|
|
||||||
|
if [[ -n "${TREK_PW:-}" ]]; then
|
||||||
|
{
|
||||||
|
echo ""
|
||||||
|
echo "TREK Admin Credentials"
|
||||||
|
echo "Email: ${TREK_EMAIL}"
|
||||||
|
echo "Password: ${TREK_PW}"
|
||||||
|
echo "(Change password after first login)"
|
||||||
|
echo ""
|
||||||
|
} >>~/trek.creds
|
||||||
|
fi
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
cleanup_lxc
|
cleanup_lxc
|
||||||
|
|||||||
Reference in New Issue
Block a user