Move default configuration

main
Jan Dittberner 10 months ago
parent c727bc39d7
commit d23290b13b

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- change default configuration to use files recommended in README.md
- separate server name and bind address to allow binding to a local address
but publish a different public name
- move default configuration to internal/services/configuration.go
## [0.1.3] - 2023-07-24
### Fixed

@ -46,7 +46,6 @@ const (
TimeoutThirty = 30 * time.Second
TimeoutTwenty = 20 * time.Second
DefaultCSRFMaxAge = 600
DefaultServerPort = 3000
)
var (
@ -58,19 +57,7 @@ var (
func main() {
logger := log.New()
config, err := services.ConfigureApplication(
logger,
"IDP",
map[string]interface{}{
"server.bind_address": "",
"server.name": "idp.cacert.localhost",
"server.port": DefaultServerPort,
"server.key": "idp.cacert.localhost+1-key.pem",
"server.certificate": "idp.cacert.localhost+1.pem",
"security.client.ca-file": "client_ca.pem",
"admin.url": "https://hydra.cacert.localhost:4445/",
"i18n.languages": []string{"en", "de"},
})
config, err := services.ConfigureApplication(logger, "IDP", services.DefaultConfig)
if err != nil {
log.Fatalf("error loading configuration: %v", err)
}

@ -32,6 +32,19 @@ import (
"github.com/spf13/pflag"
)
const defaultServerPort = 3000
var DefaultConfig = map[string]interface{}{
"server.bind_address": "",
"server.name": "idp.cacert.localhost",
"server.port": defaultServerPort,
"server.key": "idp.cacert.localhost+1-key.pem",
"server.certificate": "idp.cacert.localhost+1.pem",
"security.client.ca-file": "client_ca.pem",
"admin.url": "https://hydra.cacert.localhost:4445/",
"i18n.languages": []string{"en", "de"},
}
func ConfigureApplication(
logger *logrus.Logger,
appName string,

Loading…
Cancel
Save