feat(web): service page, manual update, jobs list and live job log (#7)

Also publishes the jobs topic on agent revoke and updates the agent
snippet to mount stacks read-write at the same path.
This commit is contained in:
2026-10-12 18:41:46 +02:00
parent 9d3a6f808c
commit 574f425267
11 changed files with 526 additions and 23 deletions
+6 -1
View File
@@ -157,7 +157,7 @@ func (a *Auth) Require(next http.Handler) http.Handler {
return
}
}
next.ServeHTTP(w, r.WithContext(context.WithValue(r.Context(), sessionKey{}, sess)))
next.ServeHTTP(w, r.WithContext(WithSession(r.Context(), sess)))
})
}
@@ -171,6 +171,11 @@ func (a *Auth) session(r *http.Request) (model.Session, error) {
type sessionKey struct{}
// WithSession returns ctx carrying sess, as Require does.
func WithSession(ctx context.Context, sess model.Session) context.Context {
return context.WithValue(ctx, sessionKey{}, sess)
}
// SessionFrom returns the session Require stored in ctx.
func SessionFrom(ctx context.Context) (model.Session, bool) {
s, ok := ctx.Value(sessionKey{}).(model.Session)