2023-04-24 20:52:12 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
type AdminServerConfig struct {
|
2023-06-30 18:26:27 +02:00
|
|
|
HTTP HTTPConfig `yaml:"http"`
|
|
|
|
CORS CORSConfig `yaml:"cors"`
|
|
|
|
Auth AuthConfig `yaml:"auth"`
|
|
|
|
Metrics MetricsConfig `yaml:"metrics"`
|
2023-07-05 20:05:30 +02:00
|
|
|
Sentry SentryConfig `yaml:"sentry"`
|
2023-04-24 20:52:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultAdminServerConfig() AdminServerConfig {
|
|
|
|
return AdminServerConfig{
|
2023-06-30 18:26:27 +02:00
|
|
|
HTTP: NewHTTPConfig("127.0.0.1", 8081),
|
|
|
|
CORS: NewDefaultCORSConfig(),
|
|
|
|
Auth: NewDefaultAuthConfig(),
|
|
|
|
Metrics: NewDefaultMetricsConfig(),
|
2023-07-05 20:05:30 +02:00
|
|
|
Sentry: NewDefaultSentryConfig(),
|
2023-04-24 20:52:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type AuthConfig struct {
|
|
|
|
Issuer InterpolatedString `yaml:"issuer"`
|
|
|
|
PrivateKey InterpolatedString `yaml:"privateKey"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultAuthConfig() AuthConfig {
|
|
|
|
return AuthConfig{
|
|
|
|
Issuer: "http://127.0.0.1:8081",
|
|
|
|
PrivateKey: "admin-key.json",
|
|
|
|
}
|
|
|
|
}
|