diff --git a/install/slink-install.sh b/install/slink-install.sh index e0a739ac..d98f8a09 100644 --- a/install/slink-install.sh +++ b/install/slink-install.sh @@ -41,7 +41,8 @@ cd /opt/slink/services/api APP_SECRET=$(openssl rand -hex 16) sed -i "s|^APP_SECRET=.*|APP_SECRET=${APP_SECRET}|" .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} $STD php bin/console cache:warm --no-optional-warmers 2>/dev/null || true msg_ok "Set up API" diff --git a/install/trek-install.sh b/install/trek-install.sh index 0d938cd5..f587a912 100644 --- a/install/trek-install.sh +++ b/install/trek-install.sh @@ -69,6 +69,28 @@ EOF systemctl enable -q --now trek 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 customize cleanup_lxc