Adding more practical bootstrap.sh behaviour does not overwrite if exists
This commit is contained in:
+41
-21
@@ -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"
|
||||||
|
|
||||||
echo ""
|
# Load previously saved values from .env if it exists
|
||||||
prompt "Enter CONTENT_API_KEY for glitch.university (find it in the VPS .env): "
|
if [[ -f "${REPO_DIR}/.env" ]]; then
|
||||||
read -r -s CONTENT_API_KEY
|
source "${REPO_DIR}/.env"
|
||||||
echo ""
|
fi
|
||||||
|
|
||||||
echo ""
|
if [[ -n "${CONTENT_API_KEY:-}" ]]; then
|
||||||
prompt "Enter Gitea personal access token (needs repo read access — create at https://${GITEA_HOST}/user/settings/applications): "
|
info "CONTENT_API_KEY already set: ${CONTENT_API_KEY}"
|
||||||
read -r -s GITEA_TOKEN_BOOTSTRAP
|
else
|
||||||
echo ""
|
echo ""
|
||||||
|
prompt "Enter CONTENT_API_KEY for glitch.university (find it in the VPS .env): "
|
||||||
|
read -r -s CONTENT_API_KEY
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
if [[ -n "${GITEA_TOKEN_BOOTSTRAP:-}" ]]; then
|
||||||
prompt "Enter Agent0 login username: "
|
info "Gitea token already set: ${GITEA_TOKEN_BOOTSTRAP}"
|
||||||
read -r AUTH_LOGIN
|
else
|
||||||
prompt "Enter Agent0 login password: "
|
echo ""
|
||||||
read -r -s AUTH_PASSWORD
|
prompt "Enter Gitea personal access token (needs repo read access — create at https://${GITEA_HOST}/user/settings/applications): "
|
||||||
echo ""
|
read -r -s GITEA_TOKEN_BOOTSTRAP
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
info "Credentials collected"
|
if [[ -n "${AUTH_LOGIN:-}" ]]; then
|
||||||
|
info "Agent0 login already set: ${AUTH_LOGIN}"
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
prompt "Enter Agent0 login username: "
|
||||||
|
read -r AUTH_LOGIN
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${AUTH_PASSWORD:-}" ]]; then
|
||||||
|
info "Agent0 password already set"
|
||||||
|
else
|
||||||
|
prompt "Enter Agent0 login password: "
|
||||||
|
read -r -s AUTH_PASSWORD
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user