add missing commands and unify service / namespace options

This commit is contained in:
Willy Kloucek
2021-11-24 18:30:20 +01:00
parent de87f3160d
commit 6206fe2398
66 changed files with 515 additions and 218 deletions

View File

@@ -26,18 +26,18 @@ type Debug struct {
// HTTP defines the available http configuration.
type HTTP struct {
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
TLSCert string `ocisConfig:"tls_cert"`
TLSKey string `ocisConfig:"tls_key"`
TLS bool `ocisConfig:"tls"`
Addr string `ocisConfig:"addr"`
Root string `ocisConfig:"root"`
Namespace string `ocisConfig:"namespace"`
TLSCert string `ocisConfig:"tls_cert"`
TLSKey string `ocisConfig:"tls_key"`
TLS bool `ocisConfig:"tls"`
}
// 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.
@@ -207,15 +207,15 @@ func DefaultConfig() *Config {
Token: "",
},
HTTP: HTTP{
Addr: "0.0.0.0:9200",
Root: "/",
TLSCert: path.Join(defaults.BaseDataPath(), "proxy", "server.crt"),
TLSKey: path.Join(defaults.BaseDataPath(), "proxy", "server.key"),
TLS: true,
Addr: "0.0.0.0:9200",
Root: "/",
Namespace: "com.owncloud.web",
TLSCert: path.Join(defaults.BaseDataPath(), "proxy", "server.crt"),
TLSKey: path.Join(defaults.BaseDataPath(), "proxy", "server.key"),
TLS: true,
},
Service: Service{
Name: "proxy",
Namespace: "com.owncloud.web",
Name: "proxy",
},
Tracing: Tracing{
Type: "jaeger",

View File

@@ -101,15 +101,9 @@ func structMappings(cfg *Config) []shared.EnvBinding {
EnvVars: []string{"PROXY_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
// Service
{
EnvVars: []string{"PROXY_SERVICE_NAMESPACE"},
Destination: &cfg.Service.Namespace,
},
{
EnvVars: []string{"PROXY_SERVICE_NAME"},
Destination: &cfg.Service.Name,
EnvVars: []string{"PROXY_HTTP_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
{
EnvVars: []string{"PROXY_TRANSPORT_TLS_CERT"},
@@ -123,6 +117,14 @@ func structMappings(cfg *Config) []shared.EnvBinding {
EnvVars: []string{"PROXY_TLS"},
Destination: &cfg.HTTP.TLS,
},
// Service
{
EnvVars: []string{"PROXY_SERVICE_NAME"},
Destination: &cfg.Service.Name,
},
// Other
{
EnvVars: []string{"OCIS_JWT_SECRET", "PROXY_JWT_SECRET"},
Destination: &cfg.TokenManager.JWTSecret,