add missing commands and unify service / namespace options

This commit is contained in:
Willy Kloucek
2022-01-03 07:49:23 +01:00
parent de87f3160d
commit 6206fe2398
66 changed files with 515 additions and 218 deletions
+12 -12
View File
@@ -24,16 +24,16 @@ type CORS struct {
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
CORS CORS `ocisConfig:"cors"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
Namespace string `ocisConfig:"namespace"`
CORS CORS `ocisConfig:"cors"`
}
// Service defines the available service configuration.
type Service struct {
Name string `ocisConfig:"name"`
Namespace string `ocisConfig:"namespace"`
Version string `ocisConfig:"version"`
Name string `ocisConfig:"name"`
Version string `ocisConfig:"version"`
}
// Tracing defines the available tracing configuration.
@@ -98,8 +98,9 @@ func DefaultConfig() *Config {
Zpages: false,
},
HTTP: HTTP{
Addr: "127.0.0.1:9110",
Root: "/ocs",
Addr: "127.0.0.1:9110",
Root: "/ocs",
Namespace: "com.owncloud.web",
CORS: CORS{
AllowedOrigins: []string{"*"},
AllowedMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"},
@@ -107,6 +108,9 @@ func DefaultConfig() *Config {
AllowCredentials: true,
},
},
Service: Service{
Name: "ocs",
},
Tracing: Tracing{
Enabled: false,
Type: "jaeger",
@@ -117,10 +121,6 @@ func DefaultConfig() *Config {
TokenManager: TokenManager{
JWTSecret: "Pive-Fumkiu4",
},
Service: Service{
Name: "ocs",
Namespace: "com.owncloud.web",
},
AccountBackend: "accounts",
Reva: Reva{Address: "127.0.0.1:9142"},
StorageUsersDriver: "ocis",
+3 -3
View File
@@ -84,11 +84,11 @@ func structMappings(cfg *Config) []shared.EnvBinding {
Destination: &cfg.HTTP.Addr,
},
{
EnvVars: []string{"OCS_NAMESPACE"},
Destination: &cfg.Service.Namespace,
EnvVars: []string{"OCS_HTTP_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
{
EnvVars: []string{"OCS_NAME"},
EnvVars: []string{"OCS_SERVICE_NAME"},
Destination: &cfg.Service.Name,
},
{