mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
use machine auth secret from common config
This commit is contained in:
@@ -117,7 +117,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.TransferSecret == "" && cfg.Commons != nil && cfg.Commons.TransferSecret != "" {
|
||||
cfg.TransferSecret = cfg.Commons.TransferSecret
|
||||
} else {
|
||||
} else if cfg.TransferSecret == "" {
|
||||
log.Fatalf("reva transfer secret is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.TransferSecret == "" && cfg.Commons != nil && cfg.Commons.TransferSecret != "" {
|
||||
cfg.TransferSecret = cfg.Commons.TransferSecret
|
||||
} else {
|
||||
} else if cfg.TransferSecret == "" {
|
||||
log.Fatalf("reva transfer secret is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.Notifications.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.Notifications.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
} else {
|
||||
} else if cfg.Notifications.MachineAuthAPIKey == "" {
|
||||
log.Fatalf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
} else {
|
||||
} else if cfg.MachineAuthAPIKey == "" {
|
||||
log.Fatalf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
} else {
|
||||
} else if cfg.MachineAuthAPIKey == "" {
|
||||
log.Fatalf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.Metadata.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
} else {
|
||||
} else if cfg.MachineAuthAPIKey == "" {
|
||||
log.Fatalf("machine auth api key is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package defaults
|
||||
|
||||
import (
|
||||
"log"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/sharing/pkg/config"
|
||||
@@ -114,13 +115,25 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
cfg.Reva = &config.Reva{}
|
||||
}
|
||||
|
||||
if cfg.TokenManager == nil && cfg.Commons != nil && cfg.Commons.TokenManager != nil {
|
||||
if cfg.TokenManager == nil && cfg.Commons != nil && cfg.Commons.TokenManager != nil {
|
||||
cfg.TokenManager = &config.TokenManager{
|
||||
JWTSecret: cfg.Commons.TokenManager.JWTSecret,
|
||||
}
|
||||
} else if cfg.TokenManager == nil {
|
||||
cfg.TokenManager = &config.TokenManager{}
|
||||
}
|
||||
|
||||
if cfg.UserSharingDrivers.CS3.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.UserSharingDrivers.CS3.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
} else if cfg.UserSharingDrivers.CS3.MachineAuthAPIKey == "" {
|
||||
log.Fatalf("machine auth api key for the cs3 user sharing driver is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
|
||||
if cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
} else if cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey == "" {
|
||||
log.Fatalf("machine auth api key for the cs3 public sharing driver is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func Sanitize(cfg *config.Config) {
|
||||
|
||||
@@ -76,7 +76,7 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
|
||||
if cfg.Thumbnail.TransferSecret == "" && cfg.Commons != nil && cfg.Commons.TransferSecret != "" {
|
||||
cfg.Thumbnail.TransferSecret = cfg.Commons.TransferSecret
|
||||
} else {
|
||||
} else if cfg.TransferSecret == "" {
|
||||
log.Fatalf("reva transfer secret is not set up properly, bailing out (%s)", cfg.Service.Name)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user