mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
define ocis_url as a shared option in ocis-pkg/config
This commit is contained in:
@@ -52,6 +52,14 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
cfg.PreSignedURL.AllowedHTTPMethods = ctx.StringSlice("presignedurl-allow-method")
|
||||
}
|
||||
|
||||
// we need a starting point to compare the default config values to determine if the outcome of ParseConfig
|
||||
// modified a value that should be shared just because it is present in the ocis.yaml file.
|
||||
defaultConfig := config.DefaultConfig()
|
||||
|
||||
if cfg.OcisURL != "" && cfg.OIDC.Issuer == defaultConfig.OIDC.Issuer {
|
||||
cfg.OIDC.Issuer = cfg.OcisURL
|
||||
}
|
||||
|
||||
if err := loadUserAgent(ctx, cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ type Cache struct {
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
OcisURL string
|
||||
|
||||
File string `mapstructure:"file"`
|
||||
Log Log `mapstructure:"log"`
|
||||
Debug Debug `mapstructure:"debug"`
|
||||
|
||||
@@ -123,7 +123,7 @@ func structMappings(cfg *Config) []mapping {
|
||||
Destination: &cfg.InsecureBackends,
|
||||
},
|
||||
{
|
||||
EnvVars: []string{"PROXY_OIDC_ISSUER", "OCIS_URL"}, // PROXY_OIDC_ISSUER takes precedence over OCIS_URL
|
||||
EnvVars: []string{"PROXY_OIDC_ISSUER"},
|
||||
Destination: &cfg.OIDC.Issuer,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user