mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-08 12:30:39 -05:00
Move reva transfer secret to shared.Commons
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -57,8 +57,9 @@ type Config struct {
|
||||
|
||||
Registry string `yaml:"registry,omitempty"`
|
||||
TokenManager *shared.TokenManager `yaml:"token_manager,omitempty"`
|
||||
MachineAuthAPIKey string
|
||||
Runtime Runtime `yaml:"runtime,omitempty"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
TransferSecret string `yaml:"transfer_secret,omitempty"`
|
||||
Runtime Runtime `yaml:"runtime,omitempty"`
|
||||
|
||||
Audit *audit.Config `yaml:"audit,omitempty"`
|
||||
Accounts *accounts.Config `yaml:"accounts,omitempty"`
|
||||
|
||||
@@ -57,6 +57,12 @@ func ParseConfig(cfg *config.Config) error {
|
||||
log.Fatalf("machine auth api key is not set up properly, bailing out (ocis)")
|
||||
}
|
||||
|
||||
if cfg.TransferSecret != "" {
|
||||
cfg.Commons.TransferSecret = cfg.TransferSecret
|
||||
} else {
|
||||
log.Fatalf("reva transfer secret not properly set, bailing out (ocis)")
|
||||
}
|
||||
|
||||
// load all env variables relevant to the config in the current context.
|
||||
if err := envdecode.Decode(cfg); err != nil {
|
||||
// no environment variable set for this config is an expected "error"
|
||||
|
||||
@@ -37,4 +37,5 @@ type Commons struct {
|
||||
OcisURL string `yaml:"ocis_url" env:"OCIS_URL"`
|
||||
TokenManager *TokenManager `yaml:"token_manager"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
TransferSecret string `yaml:"transfer_secret,omitempty" env:"REVA_TRANSFER_SECRET"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user