Fixed up the .gitignore

More push to move towards a deployment stage
This commit is contained in:
2025-08-21 20:57:23 -04:00
parent 9502d1b1be
commit e2651456da
12 changed files with 379 additions and 265 deletions

View File

@@ -48,33 +48,42 @@ func main() {
},
)
// Serve the client if enabled
if cfg.UI.Enable {
srv.MountStatic(cfg.UI.Path, cfg.UI.BaseURL)
}
// Optional: also mount static under API mux (subpath) if you later want that.
// srv.MountStatic(cfg.UI.Path, "/app")
// listeners
if cfg.Listen.HTTP != "" {
go func() { log.Fatal(srv.ListenHTTP(cfg.Listen.HTTP)) }()
}
if cfg.TLS.Enable && cfg.Listen.HTTPS != "" {
go func() { log.Fatal(srv.ListenHTTPS(cfg.Listen.HTTPS, cfg.TLS.CertFile, cfg.TLS.KeyFile)) }()
}
// Start federation mTLS (if enabled)
if cfg.Federation.MTLSEnable {
tlsCfg, err := federation.ServerTLSConfig(cfg.Federation.CertFile, cfg.Federation.KeyFile, cfg.Federation.ClientCAFile)
tlsCfg, err := federation.ServerTLSConfig(
cfg.Federation.CertFile,
cfg.Federation.KeyFile,
cfg.Federation.ClientCAFile,
)
if err != nil {
log.Fatalf("federation tls config error: %v", err)
}
go func() { log.Fatal(srv.ListenMTLS(cfg.Federation.Listen, tlsCfg)) }()
go func() {
if err := srv.ListenMTLS(cfg.Federation.Listen, tlsCfg); err != nil {
log.Fatalf("federation mTLS listener error: %v", err)
}
}()
}
// foreground
// Start FRONTEND listener (separate port) if enabled
if cfg.UI.Enable && cfg.UI.FrontendHTTP != "" {
go func() {
if err := srv.ListenFrontendHTTP(cfg.UI.FrontendHTTP, cfg.UI.Path, cfg.UI.BaseURL); err != nil {
log.Fatalf("frontend listener error: %v", err)
}
}()
}
// Choose ONE foreground listener for API: HTTPS if enabled, else HTTP.
if cfg.TLS.Enable && cfg.Listen.HTTPS != "" {
log.Fatal(srv.ListenHTTPS(cfg.Listen.HTTPS, cfg.TLS.CertFile, cfg.TLS.KeyFile))
return
}
if cfg.Listen.HTTP == "" {
log.Fatal("no listeners configured (set listen.http or listen.https)")
log.Fatal("no API listeners configured (set listen.http or listen.https)")
}
log.Fatal(srv.ListenHTTP(cfg.Listen.HTTP))
}