mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-15 16:50:22 -06:00
fix machine auth api key for frontend
This commit is contained in:
@@ -207,7 +207,7 @@ func frontendConfigFromStruct(c *cli.Context, cfg *config.Config, filesCfg map[s
|
||||
"resource_info_cache_ttl": cfg.OCS.ResourceInfoCacheTTL,
|
||||
"prefix": cfg.OCS.Prefix,
|
||||
"additional_info_attribute": cfg.OCS.AdditionalInfoAttribute,
|
||||
"machine_auth_apikey": cfg.AuthMachine.APIKey,
|
||||
"machine_auth_apikey": cfg.MachineAuthAPIKey,
|
||||
"cache_warmup_driver": cfg.OCS.CacheWarmupDriver,
|
||||
"cache_warmup_drivers": map[string]interface{}{
|
||||
"cbox": map[string]interface{}{
|
||||
|
||||
@@ -16,8 +16,9 @@ type Config struct {
|
||||
|
||||
TransferSecret string `yaml:"transfer_secret" env:"STORAGE_TRANSFER_SECRET"`
|
||||
|
||||
TokenManager *TokenManager `yaml:"token_manager"`
|
||||
Reva *Reva `yaml:"reva"`
|
||||
TokenManager *TokenManager `yaml:"token_manager"`
|
||||
Reva *Reva `yaml:"reva"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;FRONTEND_MACHINE_AUTH_API_KEY"`
|
||||
|
||||
SkipUserGroupsInToken bool `yaml:"skip_users_groups_in_token"`
|
||||
|
||||
@@ -33,7 +34,6 @@ type Config struct {
|
||||
AppProvider AppProvider `yaml:"app_provider"`
|
||||
DataGateway DataGateway `yaml:"data_gateway"`
|
||||
OCS OCS `yaml:"ocs"`
|
||||
AuthMachine AuthMachine `yaml:"auth_machine"`
|
||||
Checksums Checksums `yaml:"checksums"`
|
||||
|
||||
Middleware Middleware `yaml:"middleware"`
|
||||
@@ -124,10 +124,6 @@ type CBOXDriver struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
type AuthMachine struct {
|
||||
APIKey string `env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
}
|
||||
|
||||
type Checksums struct {
|
||||
SupportedTypes []string `yaml:"supported_types"`
|
||||
PreferredUploadType string `yaml:"preferred_upload_type"`
|
||||
|
||||
@@ -112,6 +112,11 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
if cfg.TransferSecret == "" && cfg.Commons != nil && cfg.Commons.TransferSecret != "" {
|
||||
cfg.TransferSecret = cfg.Commons.TransferSecret
|
||||
}
|
||||
|
||||
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func Sanitize(cfg *config.Config) {
|
||||
|
||||
Reference in New Issue
Block a user