deploy configuration
This commit is contained in:
parent
9ba3c47d82
commit
dac02c61c3
45 changed files with 1405 additions and 582 deletions
|
|
@ -7,10 +7,11 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/danyel/go-cms/internal/config"
|
||||
"github.com/danyel/go-cms/internal/security"
|
||||
"github.com/danyel/go-cms/internal/service"
|
||||
"github.com/danyel/go-cms/internal/web"
|
||||
"github.com/danyel/go-tell/internal/config"
|
||||
"github.com/danyel/go-tell/internal/golooseauth"
|
||||
"github.com/danyel/go-tell/internal/security"
|
||||
"github.com/danyel/go-tell/internal/service"
|
||||
"github.com/danyel/go-tell/internal/web"
|
||||
)
|
||||
|
||||
// web/dist holds the compiled React app. A placeholder file is committed so the
|
||||
|
|
@ -33,6 +34,10 @@ func main() {
|
|||
}
|
||||
|
||||
sso := security.NewSSOTokenVerifier(cfg.SSOHeader, cfg.SSOToken, cfg.SSOCookie)
|
||||
browser, err := golooseauth.New(cfg.GoLoose)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
var demo *service.DemoAuth
|
||||
if cfg.Profile == "demo" {
|
||||
demo = service.NewDemoAuth()
|
||||
|
|
@ -40,9 +45,14 @@ func main() {
|
|||
} else {
|
||||
log.Printf("CMS profile: %s (SSO identity required; PostgreSQL URL configured: %t)", cfg.Profile, cfg.PostgresURL != "")
|
||||
}
|
||||
if browser != nil {
|
||||
log.Printf("Go Loose login enabled for tenant %q", cfg.GoLoose.Tenant)
|
||||
} else {
|
||||
log.Print("Go Loose login disabled: set GO_LOOSE_CLIENT_ID and GO_LOOSE_CLIENT_SECRET to enable it")
|
||||
}
|
||||
server := &http.Server{
|
||||
Addr: cfg.HTTPAddr,
|
||||
Handler: web.NewHandler(content, assets, sso, demo).Routes(cfg.AllowedOrigins),
|
||||
Handler: web.NewHandler(content, assets, sso, browser, demo).Routes(cfg.AllowedOrigins),
|
||||
ReadHeaderTimeout: 10 * time.Second,
|
||||
}
|
||||
log.Printf("CMS listening on %s", cfg.HTTPAddr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue