Merge branch 'master' into update-bridge-docs

This commit is contained in:
A.Unger
2021-09-29 12:09:29 +02:00
511 changed files with 12687 additions and 17566 deletions
+144
View File
@@ -0,0 +1,144 @@
package flagset
import (
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// AppProviderWithConfig applies cfg to the root flagset
func AppProviderWithConfig(cfg *config.Config) []cli.Flag {
flags := []cli.Flag{
// debug ports are the odd ports
&cli.StringFlag{
Name: "debug-addr",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.DebugAddr, "0.0.0.0:9165"),
Usage: "Address to bind debug server",
EnvVars: []string{"APP_PROVIDER_BASIC_DEBUG_ADDR"},
Destination: &cfg.Reva.AppProvider.DebugAddr,
},
// Auth
// Services
// AppProvider
&cli.StringFlag{
Name: "network",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.GRPCNetwork, "tcp"),
Usage: "Network to use for the storage auth-basic service, can be 'tcp', 'udp' or 'unix'",
EnvVars: []string{"APP_PROVIDER_BASIC_GRPC_NETWORK"},
Destination: &cfg.Reva.AppProvider.GRPCNetwork,
},
&cli.StringFlag{
Name: "addr",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.GRPCAddr, "0.0.0.0:9164"),
Usage: "Address to bind storage service",
EnvVars: []string{"APP_PROVIDER_BASIC_GRPC_ADDR"},
Destination: &cfg.Reva.AppProvider.GRPCAddr,
},
&cli.StringFlag{
Name: "external-addr",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.ExternalAddr, "127.0.0.1:9164"),
Usage: "Address to connect to the storage service for other services",
EnvVars: []string{"APP_PROVIDER_BASIC_EXTERNAL_ADDR"},
Destination: &cfg.Reva.AppProvider.ExternalAddr,
},
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("appprovider"),
Usage: "--service appprovider [--service otherservice]",
EnvVars: []string{"APP_PROVIDER_BASIC_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.Driver, ""),
Usage: "Driver to use for app provider",
EnvVars: []string{"APP_PROVIDER_DRIVER"},
Destination: &cfg.Reva.AppProvider.Driver,
},
// WOPI driver
&cli.StringFlag{
Name: "wopi-driver-app-apikey",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.AppAPIKey, ""),
Usage: "The API key used by the app, if applicable.",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_APP_API_KEY"},
Destination: &cfg.Reva.AppProvider.WopiDriver.AppAPIKey,
},
&cli.BoolFlag{
Name: "wopi-driver-app-desktop-only",
Value: flags.OverrideDefaultBool(cfg.Reva.AppProvider.WopiDriver.AppDesktopOnly, false),
Usage: "Whether the app can be opened only on desktop",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_APP_DESKTOP_ONLY"},
Destination: &cfg.Reva.AppProvider.WopiDriver.AppDesktopOnly,
},
&cli.StringFlag{
Name: "wopi-driver-app-icon-uri",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.AppIconURI, ""),
Usage: "IOP Secret (Shared with WOPI server)",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI"},
Destination: &cfg.Reva.AppProvider.WopiDriver.AppIconURI,
},
&cli.StringFlag{
Name: "wopi-driver-app-internal-url",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.AppInternalURL, ""),
Usage: "The internal app URL in case of dockerized deployments. Defaults to AppURL",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_APP_INTERNAL_URL"},
Destination: &cfg.Reva.AppProvider.WopiDriver.AppInternalURL,
},
&cli.StringFlag{
Name: "wopi-driver-app-name",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.AppName, ""),
Usage: "The App user-friendly name.",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_APP_NAME"},
Destination: &cfg.Reva.AppProvider.WopiDriver.AppName,
},
&cli.StringFlag{
Name: "wopi-driver-app-url",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.AppURL, ""),
Usage: "App server URL",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_APP_URL"},
Destination: &cfg.Reva.AppProvider.WopiDriver.AppURL,
},
&cli.BoolFlag{
Name: "wopi-driver-insecure",
Value: flags.OverrideDefaultBool(cfg.Reva.AppProvider.WopiDriver.Insecure, false),
Usage: "Disable SSL certificate verification of WOPI server and WOPI bridge",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_INSECURE"},
Destination: &cfg.Reva.AppProvider.WopiDriver.Insecure,
},
&cli.StringFlag{
Name: "wopi-driver-iopsecret",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.IopSecret, ""),
Usage: "IOP Secret (Shared with WOPI server)",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_IOP_SECRET"},
Destination: &cfg.Reva.AppProvider.WopiDriver.IopSecret,
},
&cli.StringFlag{
Name: "wopi-driver-wopiurl",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.WopiDriver.WopiURL, ""),
Usage: "WOPI server URL",
EnvVars: []string{"APP_PROVIDER_WOPI_DRIVER_WOPI_URL"},
Destination: &cfg.Reva.AppProvider.WopiDriver.WopiURL,
},
// Gateway
&cli.StringFlag{
Name: "gateway-url",
Value: flags.OverrideDefaultString(cfg.Reva.Gateway.Endpoint, "localhost:9142"),
Usage: "URL to use for the storage gateway service",
EnvVars: []string{"STORAGE_GATEWAY_ENDPOINT"},
Destination: &cfg.Reva.Gateway.Endpoint,
},
}
flags = append(flags, TracingWithConfig(cfg)...)
flags = append(flags, DebugWithConfig(cfg)...)
flags = append(flags, SecretWithConfig(cfg)...)
return flags
}
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// AuthBasicWithConfig applies cfg to the root flagset
+20 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// AuthBearerWithConfig applies cfg to the root flagset
@@ -19,6 +19,15 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
Destination: &cfg.Reva.AuthBearer.DebugAddr,
},
// Driver
&cli.StringFlag{
Name: "auth-driver",
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearerConfig.Driver, "oidc"),
Usage: "bearer auth driver: 'oidc' or 'machine'",
EnvVars: []string{"STORAGE_AUTH_BEARER_DRIVER"},
Destination: &cfg.Reva.AuthBearerConfig.Driver,
},
// OIDC
&cli.StringFlag{
@@ -63,6 +72,16 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
Destination: &cfg.Reva.OIDC.GIDClaim,
},
// Machine Auth
&cli.StringFlag{
Name: "machine-auth-api-key",
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearerConfig.MachineAuthAPIKey, "change-me-please"),
Usage: "the API key to be used for the machine auth driver in reva",
EnvVars: []string{"STORAGE_AUTH_BEARER_MACHINE_AUTH_API_KEY", "OCIS_MACHINE_AUTH_API_KEY"},
Destination: &cfg.Reva.AuthBearerConfig.MachineAuthAPIKey,
},
// Services
// AuthBearer
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DebugWithConfig applies common debug config cfg to the flagset
+1 -1
View File
@@ -5,8 +5,8 @@ import (
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DriverEOSWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DriverLocalWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DriverOCISWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DriverOwnCloudWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DriverOwnCloudSQLWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// DriverS3NGWithConfig applies cfg to the root flagset
+60 -4
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// FrontendWithConfig applies cfg to the root flagset
@@ -57,6 +57,23 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Destination: &cfg.Reva.OCDav.DavFilesNamespace,
},
// Archiver
&cli.Int64Flag{
Name: "archiver-max-num-files",
Value: flags.OverrideDefaultInt64(cfg.Reva.Archiver.MaxNumFiles, 10000),
Usage: "Maximum number of files to be included in the archiver",
EnvVars: []string{"STORAGE_ARCHIVER_MAX_NUM_FILES"},
Destination: &cfg.Reva.Archiver.MaxNumFiles,
},
&cli.Int64Flag{
Name: "archiver-max-size",
Value: flags.OverrideDefaultInt64(cfg.Reva.Archiver.MaxSize, 1073741824), // 1GB
Usage: "Maximum size for the sum of the sizes of all the files included in the archive",
EnvVars: []string{"STORAGE_ARCHIVER_MAX_SIZE"},
Destination: &cfg.Reva.Archiver.MaxSize,
},
// Services
// Frontend
@@ -87,10 +104,24 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("datagateway", "ocdav", "ocs"),
Value: cli.NewStringSlice("datagateway", "ocdav", "ocs", "appprovider"),
Usage: "--service ocdav [--service ocs]",
EnvVars: []string{"STORAGE_FRONTEND_SERVICES"},
},
&cli.StringFlag{
Name: "approvider-prefix",
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.AppProviderPrefix, ""),
Usage: "approvider prefix",
EnvVars: []string{"STORAGE_FRONTEND_APPPROVIDER_PREFIX"},
Destination: &cfg.Reva.Frontend.AppProviderPrefix,
},
&cli.StringFlag{
Name: "archiver-prefix",
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.ArchiverPrefix, "archiver"),
Usage: "archiver prefix",
EnvVars: []string{"STORAGE_FRONTEND_ARCHIVER_PREFIX"},
Destination: &cfg.Reva.Frontend.ArchiverPrefix,
},
&cli.StringFlag{
Name: "datagateway-prefix",
Value: flags.OverrideDefaultString(cfg.Reva.Frontend.DatagatewayPrefix, "data"),
@@ -173,9 +204,9 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Destination: &cfg.Reva.UploadHTTPMethodOverride,
},
&cli.StringSliceFlag{
Name: "checksum-suppored-type",
Name: "checksum-supported-type",
Value: cli.NewStringSlice("sha1", "md5", "adler32"),
Usage: "--checksum-suppored-type sha1 [--checksum-suppored-type adler32]",
Usage: "--checksum-supported-type sha1 [--checksum-supported-type adler32]",
EnvVars: []string{"STORAGE_FRONTEND_CHECKSUM_SUPPORTED_TYPES"},
},
&cli.StringFlag{
@@ -186,6 +217,31 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Destination: &cfg.Reva.ChecksumPreferredUploadType,
},
// Archiver
&cli.StringFlag{
Name: "archiver-url",
Value: flags.OverrideDefaultString(cfg.Reva.Archiver.ArchiverURL, "/archiver"),
Usage: "URL where the archiver is reachable",
EnvVars: []string{"STORAGE_FRONTEND_ARCHIVER_URL"},
Destination: &cfg.Reva.Archiver.ArchiverURL,
},
// App Provider
&cli.StringFlag{
Name: "appprovider-apps-url",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.AppsURL, "/app/list"),
Usage: "URL where the app listing of the app provider is reachable",
EnvVars: []string{"STORAGE_FRONTEND_APP_PROVIDER_APPS_URL"},
Destination: &cfg.Reva.AppProvider.AppsURL,
},
&cli.StringFlag{
Name: "appprovider-open-url",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.OpenURL, "/app/open"),
Usage: "URL where files can be handed over to an application from the app provider",
EnvVars: []string{"STORAGE_FRONTEND_APP_PROVIDER_OPEN_URL"},
Destination: &cfg.Reva.AppProvider.OpenURL,
},
// Reva Middlewares Config
&cli.StringSliceFlag{
Name: "user-agent-whitelist-lock-in",
+9 -2
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// GatewayWithConfig applies cfg to the root flagset
@@ -62,7 +62,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("gateway", "authregistry", "storageregistry"), // TODO appregistry
Value: cli.NewStringSlice("gateway", "authregistry", "storageregistry", "appregistry"),
Usage: "--service gateway [--service authregistry]",
EnvVars: []string{"STORAGE_GATEWAY_SERVICES"},
},
@@ -193,6 +193,13 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"STORAGE_SHARING_ENDPOINT"},
Destination: &cfg.Reva.Sharing.Endpoint,
},
&cli.StringFlag{
Name: "appprovider-endpoint",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.Endpoint, "localhost:9164"),
Usage: "endpoint to use for the app provider",
EnvVars: []string{"STORAGE_APPPROVIDER_ENDPOINT"},
Destination: &cfg.Reva.AppProvider.Endpoint,
},
// register home storage
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// GroupsWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// HealthWithConfig applies cfg to the health flagset
+18 -1
View File
@@ -1,9 +1,12 @@
package flagset
import (
"github.com/micro/cli/v2"
"path"
"github.com/owncloud/ocis/ocis-pkg/flags"
pkgos "github.com/owncloud/ocis/ocis-pkg/os"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// LDAPWithConfig applies LDAP cfg to the flagset
@@ -23,6 +26,20 @@ func LDAPWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"STORAGE_LDAP_PORT"},
Destination: &cfg.Reva.LDAP.Port,
},
&cli.StringFlag{
Name: "ldap-cacert",
Value: flags.OverrideDefaultString(cfg.Reva.LDAP.CACert, path.Join(pkgos.MustUserConfigDir("ocis", "ldap"), "ldap.crt")),
Usage: "Path to a trusted Certificate file (in PEM format) for the LDAP Connection",
EnvVars: []string{"STORAGE_LDAP_CACERT"},
Destination: &cfg.Reva.LDAP.CACert,
},
&cli.BoolFlag{
Name: "ldap-insecure",
Value: flags.OverrideDefaultBool(cfg.Reva.LDAP.Insecure, false),
Usage: "Disable TLS certificate and hostname validation",
EnvVars: []string{"STORAGE_LDAP_INSECURE"},
Destination: &cfg.Reva.LDAP.Insecure,
},
&cli.StringFlag{
Name: "ldap-base-dn",
Value: flags.OverrideDefaultString(cfg.Reva.LDAP.BaseDN, "dc=ocis,dc=test"),
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// RestWithConfig applies REST user/group provider cfg to the flagset
+1 -1
View File
@@ -1,8 +1,8 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// RootWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// SecretWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// SharingWithConfig applies cfg to the root flagset
+2 -2
View File
@@ -1,12 +1,12 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// SharingSQLWithConfig applies the Shring SQL driver cfg to the flagset
// SharingSQLWithConfig applies the Sharing SQL driver cfg to the flagset
func SharingSQLWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// StorageHomeWithConfig applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// StorageMetadata applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// StoragePublicLink applies cfg to the root flagset
+1 -1
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// StorageUsersWithConfig applies cfg to the root flagset
+5 -5
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// TracingWithConfig applies cfg to the root flagset
@@ -13,28 +13,28 @@ func TracingWithConfig(cfg *config.Config) []cli.Flag {
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVars: []string{"STORAGE_TRACING_ENABLED"},
EnvVars: []string{"STORAGE_TRACING_ENABLED", "OCIS_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: flags.OverrideDefaultString(cfg.Tracing.Type, "jaeger"),
Usage: "Tracing backend type",
EnvVars: []string{"STORAGE_TRACING_TYPE"},
EnvVars: []string{"STORAGE_TRACING_TYPE", "OCIS_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: flags.OverrideDefaultString(cfg.Tracing.Endpoint, ""),
Usage: "Endpoint for the agent",
EnvVars: []string{"STORAGE_TRACING_ENDPOINT"},
EnvVars: []string{"STORAGE_TRACING_ENDPOINT", "OCIS_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: flags.OverrideDefaultString(cfg.Tracing.Collector, ""),
Usage: "Endpoint for the collector",
EnvVars: []string{"STORAGE_TRACING_COLLECTOR"},
EnvVars: []string{"STORAGE_TRACING_COLLECTOR", "OCIS_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
+75 -2
View File
@@ -1,9 +1,9 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
)
// UsersWithConfig applies cfg to the root flagset
@@ -54,7 +54,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
&cli.StringFlag{
Name: "driver",
Value: flags.OverrideDefaultString(cfg.Reva.Users.Driver, "ldap"),
Usage: "user driver: 'demo', 'json', 'ldap', or 'rest'",
Usage: "user driver: 'demo', 'json', 'ldap', 'owncloudsql' or 'rest'",
EnvVars: []string{"STORAGE_USERPROVIDER_DRIVER"},
Destination: &cfg.Reva.Users.Driver,
},
@@ -72,6 +72,79 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"STORAGE_USER_CACHE_EXPIRATION"},
Destination: &cfg.Reva.Users.UserGroupsCacheExpiration,
},
// user owncloudsql
&cli.StringFlag{
Name: "owncloudsql-dbhost",
Value: flags.OverrideDefaultString(cfg.Reva.UserOwnCloudSQL.DBHost, "mysql"),
Usage: "hostname of the mysql db",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_DBHOST"},
Destination: &cfg.Reva.UserOwnCloudSQL.DBHost,
},
&cli.IntFlag{
Name: "owncloudsql-dbport",
Value: flags.OverrideDefaultInt(cfg.Reva.UserOwnCloudSQL.DBPort, 3306),
Usage: "port of the mysql db",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_DBPORT"},
Destination: &cfg.Reva.UserOwnCloudSQL.DBPort,
},
&cli.StringFlag{
Name: "owncloudsql-dbname",
Value: flags.OverrideDefaultString(cfg.Reva.UserOwnCloudSQL.DBName, "owncloud"),
Usage: "database name of the owncloud db",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_DBNAME"},
Destination: &cfg.Reva.UserOwnCloudSQL.DBName,
},
&cli.StringFlag{
Name: "owncloudsql-dbuser",
Value: flags.OverrideDefaultString(cfg.Reva.UserOwnCloudSQL.DBUsername, "owncloud"),
Usage: "user name to use when connecting to the mysql owncloud db",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_DBUSER"},
Destination: &cfg.Reva.UserOwnCloudSQL.DBUsername,
},
&cli.StringFlag{
Name: "owncloudsql-dbpass",
Value: flags.OverrideDefaultString(cfg.Reva.UserOwnCloudSQL.DBPassword, "secret"),
Usage: "password to use when connecting to the mysql owncloud db",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_DBPASS"},
Destination: &cfg.Reva.UserOwnCloudSQL.DBPassword,
},
&cli.StringFlag{
Name: "owncloudsql-idp",
Value: flags.OverrideDefaultString(cfg.Reva.UserOwnCloudSQL.Idp, "https://localhost:9200"),
Usage: "Identity provider to use for users",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_IDP", "OCIS_URL"},
Destination: &cfg.Reva.UserOwnCloudSQL.Idp,
},
&cli.Int64Flag{
Name: "owncloudsql-nobody",
Value: flags.OverrideDefaultInt64(cfg.Reva.UserOwnCloudSQL.Nobody, 99),
Usage: "fallback user id to use when user has no id",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_NOBODY"},
Destination: &cfg.Reva.UserOwnCloudSQL.Nobody,
},
&cli.BoolFlag{
Name: "owncloudsql-join-username",
Value: flags.OverrideDefaultBool(cfg.Reva.UserOwnCloudSQL.JoinUsername, false),
Usage: "join the username from the oc_preferences table",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_JOIN_USERNAME"},
Destination: &cfg.Reva.UserOwnCloudSQL.JoinUsername,
},
&cli.BoolFlag{
Name: "owncloudsql-join-ownclouduuid",
Value: flags.OverrideDefaultBool(cfg.Reva.UserOwnCloudSQL.JoinOwnCloudUUID, false),
Usage: "join the ownclouduuid from the oc_preferences table",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_JOIN_OWNCLOUDUUID"},
Destination: &cfg.Reva.UserOwnCloudSQL.JoinOwnCloudUUID,
},
&cli.BoolFlag{
Name: "owncloudsql-enable-medial-search",
Value: flags.OverrideDefaultBool(cfg.Reva.UserOwnCloudSQL.EnableMedialSearch, false),
Usage: "enable medial search when finding users",
EnvVars: []string{"STORAGE_USERPROVIDER_OWNCLOUDSQL_ENABLE_MEDIAL_SEARCH"},
Destination: &cfg.Reva.UserOwnCloudSQL.EnableMedialSearch,
},
}
flags = append(flags, TracingWithConfig(cfg)...)