Adding more practical bootstrap.sh behaviour does not overwrite if exists

This commit is contained in:
2026-04-11 16:21:47 +02:00
parent a086899ea4
commit 35d0700e54
+26 -6
View File
@@ -40,24 +40,46 @@ info "Prerequisites OK"
# ── Credentials (collected upfront before any private repo clones) ───────────── # ── Credentials (collected upfront before any private repo clones) ─────────────
section "Credentials" section "Credentials"
# Load previously saved values from .env if it exists
if [[ -f "${REPO_DIR}/.env" ]]; then
source "${REPO_DIR}/.env"
fi
if [[ -n "${CONTENT_API_KEY:-}" ]]; then
info "CONTENT_API_KEY already set: ${CONTENT_API_KEY}"
else
echo "" echo ""
prompt "Enter CONTENT_API_KEY for glitch.university (find it in the VPS .env): " prompt "Enter CONTENT_API_KEY for glitch.university (find it in the VPS .env): "
read -r -s CONTENT_API_KEY read -r -s CONTENT_API_KEY
echo "" echo ""
fi
if [[ -n "${GITEA_TOKEN_BOOTSTRAP:-}" ]]; then
info "Gitea token already set: ${GITEA_TOKEN_BOOTSTRAP}"
else
echo "" echo ""
prompt "Enter Gitea personal access token (needs repo read access — create at https://${GITEA_HOST}/user/settings/applications): " prompt "Enter Gitea personal access token (needs repo read access — create at https://${GITEA_HOST}/user/settings/applications): "
read -r -s GITEA_TOKEN_BOOTSTRAP read -r -s GITEA_TOKEN_BOOTSTRAP
echo "" echo ""
fi
if [[ -n "${AUTH_LOGIN:-}" ]]; then
info "Agent0 login already set: ${AUTH_LOGIN}"
else
echo "" echo ""
prompt "Enter Agent0 login username: " prompt "Enter Agent0 login username: "
read -r AUTH_LOGIN read -r AUTH_LOGIN
fi
if [[ -n "${AUTH_PASSWORD:-}" ]]; then
info "Agent0 password already set"
else
prompt "Enter Agent0 login password: " prompt "Enter Agent0 login password: "
read -r -s AUTH_PASSWORD read -r -s AUTH_PASSWORD
echo "" echo ""
fi
info "Credentials collected" info "Credentials ready"
# ── Ollama ──────────────────────────────────────────────────────────────────── # ── Ollama ────────────────────────────────────────────────────────────────────
section "Ollama" section "Ollama"
@@ -239,15 +261,13 @@ section "Docker containers"
cd "$REPO_DIR" cd "$REPO_DIR"
if [[ ! -f "${REPO_DIR}/.env" ]]; then
cat > "${REPO_DIR}/.env" << EOF cat > "${REPO_DIR}/.env" << EOF
AUTH_LOGIN=${AUTH_LOGIN} AUTH_LOGIN=${AUTH_LOGIN}
AUTH_PASSWORD=${AUTH_PASSWORD} AUTH_PASSWORD=${AUTH_PASSWORD}
CONTENT_API_KEY=${CONTENT_API_KEY}
GITEA_TOKEN_BOOTSTRAP=${GITEA_TOKEN_BOOTSTRAP}
EOF EOF
info "Agent0 .env created" info "Agent0 .env written"
else
info "Agent0 .env already exists"
fi
info "Building glitch-tunnel image..." info "Building glitch-tunnel image..."
docker compose build --quiet docker compose build --quiet