Add Gitea restart workflow and link-style "Run again" for the public view
Test and deploy enrollment demo / test (push) Successful in 36s
Test and deploy enrollment demo / deploy (push) Successful in 1m13s

The server deployment cannot mount the Docker socket safely, so the web
view's button now opens the Gitea page for a workflow_dispatch workflow
that recreates the stack and replays the demo. Gitea handles who may run it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 21:54:24 +03:30
co-authored by Claude Sonnet 5.5
parent bf40b92c52
commit 37ca9d4da1
7 changed files with 49 additions and 8 deletions
+5 -2
View File
@@ -45,7 +45,10 @@ var (
logDir = "/logs"
// The restart button needs the Docker socket; it is only enabled when the deployment says so.
restartEnabled = os.Getenv("RESTART_ENABLED") == "1"
re = regexp.MustCompile(`^(\d\d:\d\d:\d\d\.\d{3}) \[([a-z-]+)\] (.*)$`)
// Without the Docker socket the page can still offer "Run again" as a link to this URL (the
// Gitea page that runs the restart workflow); Gitea then does the authentication.
restartURL = os.Getenv("RESTART_URL")
re = regexp.MustCompile(`^(\d\d:\d\d:\d\d\.\d{3}) \[([a-z-]+)\] (.*)$`)
)
// tail remembers how far a file has been read and any incomplete last line.
@@ -294,7 +297,7 @@ func main() {
json.NewEncoder(w).Encode(lines)
})
http.HandleFunc("/api/config", func(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(map[string]bool{"restart": restartEnabled})
json.NewEncoder(w).Encode(map[string]any{"restart": restartEnabled, "restartUrl": restartURL})
})
http.HandleFunc("/api/restart", func(w http.ResponseWriter, r *http.Request) {
if !restartEnabled {