Allow custom binding for trust center

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-10-10 11:43:31 +02:00
parent 1b987ee394
commit 3856dba38c

View File

@@ -67,6 +67,7 @@ type (
Api apiConfig `json:"api"` Api apiConfig `json:"api"`
Auth authConfig `json:"auth"` Auth authConfig `json:"auth"`
TrustAuth trustAuthConfig `json:"trust-auth"` TrustAuth trustAuthConfig `json:"trust-auth"`
TrustCenter trustCenterConfig `json:"trust-center"`
AWS awsConfig `json:"aws"` AWS awsConfig `json:"aws"`
Mailer mailerConfig `json:"mailer"` Mailer mailerConfig `json:"mailer"`
Connectors []connectorConfig `json:"connectors"` Connectors []connectorConfig `json:"connectors"`
@@ -74,6 +75,11 @@ type (
ChromeDPAddr string `json:"chrome-dp-addr"` ChromeDPAddr string `json:"chrome-dp-addr"`
CustomDomains customDomainsConfig `json:"custom-domains"` CustomDomains customDomainsConfig `json:"custom-domains"`
} }
trustCenterConfig struct {
HTTPAddr string `json:"http-addr"`
HTTPSAddr string `json:"https-addr"`
}
) )
var ( var (
@@ -120,6 +126,10 @@ func New() *Implm {
Scope: "trust_center_readonly", Scope: "trust_center_readonly",
TokenType: "trust_center_access", TokenType: "trust_center_access",
}, },
TrustCenter: trustCenterConfig{
HTTPAddr: ":80",
HTTPSAddr: ":443",
},
AWS: awsConfig{ AWS: awsConfig{
Region: "us-east-1", Region: "us-east-1",
Bucket: "probod", Bucket: "probod",
@@ -557,7 +567,7 @@ func (impl *Implm) runTrustCenterServer(
) )
httpServer := httpserver.NewServer( httpServer := httpserver.NewServer(
":80", impl.cfg.TrustCenter.HTTPAddr,
httpACMEHandler.Handle(http.NotFoundHandler()), httpACMEHandler.Handle(http.NotFoundHandler()),
httpserver.WithLogger(l), httpserver.WithLogger(l),
httpserver.WithRegisterer(r), httpserver.WithRegisterer(r),
@@ -591,7 +601,7 @@ func (impl *Implm) runTrustCenterServer(
handler := acmeHandler.Handle(trustRouter) handler := acmeHandler.Handle(trustRouter)
httpsServer := httpserver.NewServer( httpsServer := httpserver.NewServer(
":443", impl.cfg.TrustCenter.HTTPSAddr,
handler, handler,
httpserver.WithLogger(l), httpserver.WithLogger(l),
httpserver.WithRegisterer(r), httpserver.WithRegisterer(r),