feat: persist immutable Bell events and receipts (#17)

This commit is contained in:
QiuSW
2026-08-12 17:48:48 +08:00
parent a5fc8f5490
commit 64a1d82db4
11 changed files with 376 additions and 1 deletions
+4 -1
View File
@@ -14,6 +14,7 @@ import (
"git.ilapage.cn/ila/yovision/Bell/server/app/audit"
"git.ilapage.cn/ila/yovision/Bell/server/app/auth"
"git.ilapage.cn/ila/yovision/Bell/server/app/event"
"git.ilapage.cn/ila/yovision/Bell/server/config"
"git.ilapage.cn/ila/yovision/Bell/server/internal/platform"
"git.ilapage.cn/ila/yovision/Bell/server/migrations"
@@ -63,7 +64,9 @@ func Run(ctx context.Context, args []string) error {
return authService.BootstrapAdministrator(ctx, username, displayName, password)
}
app := platform.NewHTTPApp(db)
auth.HTTP{Service: authService, Store: authStore, Audit: auditStore, SecureCookie: cfg.CookieSecure}.Register(app.Router())
authHTTP := auth.HTTP{Service: authService, Store: authStore, Audit: auditStore, SecureCookie: cfg.CookieSecure}
authHTTP.Register(app.Router())
event.HTTP{Service: event.Service{DB: db}, Auth: authHTTP}.Register(app.Router())
server := &http.Server{Addr: cfg.HTTPAddress, Handler: app.Handler()}
serverCtx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM)
defer stop()