Repository navigation
🐛 fix(demo): headless Forgejo 11 bootstrap (INSTALL_LOCK) - #255
Merged
Merged
Conversation
/api/v1/install is gone; web wizard blocked hero smoke and GIF recording. Set INSTALL_LOCK + sqlite via env, probe /api/v1/version, create admin with forgejo CLI.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the hero demo Forgejo deployment and bootstrap flow to support Forgejo v11 by running headless (INSTALL_LOCK) and avoiding the removed /api/v1/install endpoint.
Changes:
- Configure Forgejo to run headless via
INSTALL_LOCKand update probes to use/api/v1/version. - Update bootstrap script to wait on the version endpoint and create the admin user via
forgejo admin. - Update smoke test assertions to validate the new headless/bootstrap approach.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| hack/test/demo_03_hero_smoke_test.sh | Adjusts smoke checks to enforce headless INSTALL_LOCK setup and v11-compatible bootstrap behavior. |
| hack/demo/hero/manifests/forgejo.yaml | Enables headless Forgejo via env vars and switches readiness/startup probes to /api/v1/version. |
| hack/demo/hero/bootstrap-forgejo.sh | Removes web-install step and creates the admin user via Forgejo CLI after waiting for the API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+37
to
+43
| - name: FORGEJO__security__INSTALL_LOCK | ||
| value: "true" | ||
| # Demo-only; not a production secret. Required when INSTALL_LOCK=true. | ||
| - name: FORGEJO__security__SECRET_KEY | ||
| value: "kollect-hero-demo-secret-key-not-for-prod" | ||
| - name: FORGEJO__security__INTERNAL_TOKEN | ||
| value: "kollect-hero-demo-internal-token-not-for-prod" |
Comment on lines
+169
to
+170
| awk '/^_wait_forgejo\(\)/,/^}/' "${BOOTSTRAP}" | grep -v '^[[:space:]]*#' | grep -Eq 'api/v1/version' || | ||
| fail "_wait_forgejo must curl /api/v1/version once INSTALL_LOCK serves the API" |
Comment on lines
+160
to
+161
| grep -Eq 'FORGEJO__security__INSTALL_LOCK' "${FORGEJO_MANIFEST}" || | ||
| fail "forgejo manifest must set INSTALL_LOCK (skip web wizard; /api/v1/install removed)" |
Comment on lines
+34
to
51
| _ensure_admin() { | ||
| if kubectl exec -n "$HERO_FORGEJO_NS" deploy/forgejo -- \ | ||
| curl -fsS "${_internal_url}/api/v1/settings/api" >/dev/null 2>&1; then | ||
| _hero_log "Forgejo already installed." | ||
| curl -fsS -u "${HERO_FORGEJO_USER}:${HERO_FORGEJO_PASS}" \ | ||
| "${_internal_url}/api/v1/user" >/dev/null 2>&1; then | ||
| _hero_log "Admin user ${HERO_FORGEJO_USER} already exists." | ||
| return 0 | ||
| fi | ||
|
|
||
| _hero_log "Running Forgejo first-time install..." | ||
| kubectl exec -n "$HERO_FORGEJO_NS" deploy/forgejo -- curl -fsS -X POST \ | ||
| "${_internal_url}/api/v1/install" \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d "$(cat <<EOF | ||
| { | ||
| "db_type": "sqlite3", | ||
| "db_host": "localhost:3306", | ||
| "db_user": "", | ||
| "db_passwd": "", | ||
| "db_name": "gitea", | ||
| "ssl_mode": "disable", | ||
| "db_path": "/data/gitea.db", | ||
| "app_name": "Forgejo", | ||
| "repo_root_path": "/data/git/repositories", | ||
| "lfs_root_path": "/data/git/lfs", | ||
| "run_user": "git", | ||
| "domain": "forgejo.forgejo.svc.cluster.local", | ||
| "ssh_domain": "forgejo.forgejo.svc.cluster.local", | ||
| "port": 3000, | ||
| "http_port": 3000, | ||
| "root_url": "${_internal_url}/", | ||
| "log_level": "Info", | ||
| "admin_name": "${HERO_FORGEJO_USER}", | ||
| "admin_passwd": "${HERO_FORGEJO_PASS}", | ||
| "admin_confirm_passwd": "${HERO_FORGEJO_PASS}", | ||
| "admin_email": "[email protected]" | ||
| } | ||
| EOF | ||
| )" | ||
| _hero_log "Creating Forgejo admin user ${HERO_FORGEJO_USER}..." | ||
| # forgejo admin speaks to the sqlite DB; config is generated from env by the entrypoint. | ||
| kubectl exec -n "$HERO_FORGEJO_NS" deploy/forgejo -- \ | ||
| forgejo admin user create \ | ||
| --admin \ | ||
| --username "${HERO_FORGEJO_USER}" \ | ||
| --password "${HERO_FORGEJO_PASS}" \ | ||
| --email "[email protected]" \ | ||
| --must-change-password=false | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
/api/v1/install— hero bootstrap + GIFdemo-upfailed after the wait fixINSTALL_LOCK+ demo SECRET_KEY/INTERNAL_TOKEN + sqlite; probe/api/v1/versionforgejo admin user create, then repo/token as beforeTest plan
bash hack/test/demo_03_hero_smoke_test.shtask demo-up+ GIF recordhero-demo-smoke