mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-18 11:28:48 -06:00
make storage metadata config similar to other services
This commit is contained in:
@@ -6,16 +6,16 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/ocis-pkg/sync"
|
||||
"github.com/owncloud/ocis/ocis-pkg/tracing"
|
||||
|
||||
"github.com/cs3org/reva/v2/cmd/revad/runtime"
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/oklog/run"
|
||||
"github.com/owncloud/ocis/extensions/storage/pkg/command/storagedrivers"
|
||||
"github.com/owncloud/ocis/extensions/storage/pkg/config"
|
||||
"github.com/owncloud/ocis/extensions/storage-metadata/pkg/config"
|
||||
"github.com/owncloud/ocis/extensions/storage/pkg/server/debug"
|
||||
"github.com/owncloud/ocis/extensions/storage/pkg/service/external"
|
||||
"github.com/owncloud/ocis/extensions/storage/pkg/tracing"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/version"
|
||||
"github.com/thejerf/suture/v4"
|
||||
@@ -27,22 +27,25 @@ import (
|
||||
// It provides a ocis-specific storage store metadata (shares,account,settings...)
|
||||
func StorageMetadata(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "storage-metadata",
|
||||
Usage: "start storage-metadata service",
|
||||
Before: func(c *cli.Context) error {
|
||||
return ParseConfig(c, cfg, "storage-metadata")
|
||||
},
|
||||
Name: "storage-metadata",
|
||||
Usage: "start storage-metadata service",
|
||||
Category: "extensions",
|
||||
Action: func(c *cli.Context) error {
|
||||
logger := NewLogger(cfg)
|
||||
tracing.Configure(cfg, logger)
|
||||
logCfg := cfg.Logging
|
||||
logger := log.NewLogger(
|
||||
log.Level(logCfg.Level),
|
||||
log.File(logCfg.File),
|
||||
log.Pretty(logCfg.Pretty),
|
||||
log.Color(logCfg.Color),
|
||||
)
|
||||
tracing.Configure(cfg.Tracing.Enabled, cfg.Tracing.Type, logger)
|
||||
|
||||
gr := run.Group{}
|
||||
ctx, cancel := func() (context.Context, context.CancelFunc) {
|
||||
if cfg.Reva.StorageMetadata.Context == nil {
|
||||
if cfg.Context == nil {
|
||||
return context.WithCancel(context.Background())
|
||||
}
|
||||
return context.WithCancel(cfg.Reva.StorageMetadata.Context)
|
||||
return context.WithCancel(cfg.Context)
|
||||
}()
|
||||
|
||||
defer cancel()
|
||||
@@ -67,10 +70,12 @@ func StorageMetadata(cfg *config.Config) *cli.Command {
|
||||
|
||||
debugServer, err := debug.Server(
|
||||
debug.Name(c.Command.Name+"-debug"),
|
||||
debug.Addr(cfg.Reva.StorageMetadata.DebugAddr),
|
||||
debug.Addr(cfg.Debug.Addr),
|
||||
debug.Logger(logger),
|
||||
debug.Context(ctx),
|
||||
debug.Config(cfg),
|
||||
debug.Pprof(cfg.Debug.Pprof),
|
||||
debug.Zpages(cfg.Debug.Zpages),
|
||||
debug.Token(cfg.Debug.Token),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
@@ -89,7 +94,7 @@ func StorageMetadata(cfg *config.Config) *cli.Command {
|
||||
cancel()
|
||||
})
|
||||
|
||||
if !cfg.Reva.StorageMetadata.Supervised {
|
||||
if !cfg.Supervised {
|
||||
sync.Trap(&gr, cancel)
|
||||
}
|
||||
|
||||
@@ -97,7 +102,7 @@ func StorageMetadata(cfg *config.Config) *cli.Command {
|
||||
ctx,
|
||||
"com.owncloud.storage.metadata",
|
||||
uuid.Must(uuid.NewV4()).String(),
|
||||
cfg.Reva.StorageMetadata.GRPCAddr,
|
||||
cfg.GRPC.Addr,
|
||||
version.String,
|
||||
logger,
|
||||
); err != nil {
|
||||
@@ -113,43 +118,42 @@ func StorageMetadata(cfg *config.Config) *cli.Command {
|
||||
func storageMetadataFromStruct(c *cli.Context, cfg *config.Config) map[string]interface{} {
|
||||
rcfg := map[string]interface{}{
|
||||
"core": map[string]interface{}{
|
||||
"max_cpus": cfg.Reva.StorageMetadata.MaxCPUs,
|
||||
"tracing_enabled": cfg.Tracing.Enabled,
|
||||
"tracing_endpoint": cfg.Tracing.Endpoint,
|
||||
"tracing_collector": cfg.Tracing.Collector,
|
||||
"tracing_service_name": c.Command.Name,
|
||||
},
|
||||
"shared": map[string]interface{}{
|
||||
"jwt_secret": cfg.Reva.JWTSecret,
|
||||
"gatewaysvc": cfg.Reva.Gateway.Endpoint,
|
||||
"skip_user_groups_in_token": cfg.Reva.SkipUserGroupsInToken,
|
||||
"jwt_secret": cfg.JWTSecret,
|
||||
"gatewaysvc": cfg.GatewayEndpoint,
|
||||
"skip_user_groups_in_token": cfg.SkipUserGroupsInToken,
|
||||
},
|
||||
"grpc": map[string]interface{}{
|
||||
"network": cfg.Reva.StorageMetadata.GRPCNetwork,
|
||||
"address": cfg.Reva.StorageMetadata.GRPCAddr,
|
||||
"network": cfg.GRPC.Protocol,
|
||||
"address": cfg.GRPC.Addr,
|
||||
"interceptors": map[string]interface{}{
|
||||
"log": map[string]interface{}{},
|
||||
},
|
||||
"services": map[string]interface{}{
|
||||
"storageprovider": map[string]interface{}{
|
||||
"driver": cfg.Reva.StorageMetadata.Driver,
|
||||
"drivers": storagedrivers.MetadataDrivers(cfg),
|
||||
"data_server_url": cfg.Reva.StorageMetadata.DataServerURL,
|
||||
"tmp_folder": cfg.Reva.StorageMetadata.TempFolder,
|
||||
"driver": cfg.Driver,
|
||||
"drivers": config.MetadataDrivers(cfg),
|
||||
"data_server_url": cfg.DataServerURL,
|
||||
"tmp_folder": cfg.TempFolder,
|
||||
},
|
||||
},
|
||||
},
|
||||
"http": map[string]interface{}{
|
||||
"network": cfg.Reva.StorageMetadata.HTTPNetwork,
|
||||
"address": cfg.Reva.StorageMetadata.HTTPAddr,
|
||||
"network": cfg.HTTP.Protocol,
|
||||
"address": cfg.HTTP.Addr,
|
||||
// TODO build services dynamically
|
||||
"services": map[string]interface{}{
|
||||
"dataprovider": map[string]interface{}{
|
||||
"prefix": "data",
|
||||
"driver": cfg.Reva.StorageMetadata.Driver,
|
||||
"drivers": storagedrivers.MetadataDrivers(cfg),
|
||||
"driver": cfg.Driver,
|
||||
"drivers": config.MetadataDrivers(cfg),
|
||||
"timeout": 86400,
|
||||
"insecure": cfg.Reva.StorageMetadata.DataProvider.Insecure,
|
||||
"insecure": cfg.DataProviderInsecure,
|
||||
"disable_tus": true,
|
||||
},
|
||||
},
|
||||
@@ -165,14 +169,14 @@ type MetadataSutureService struct {
|
||||
|
||||
// NewSutureService creates a new storagemetadata.SutureService
|
||||
func NewStorageMetadata(cfg *ociscfg.Config) suture.Service {
|
||||
cfg.Storage.Commons = cfg.Commons
|
||||
cfg.StorageMetadata.Commons = cfg.Commons
|
||||
return MetadataSutureService{
|
||||
cfg: cfg.Storage,
|
||||
cfg: cfg.StorageMetadata,
|
||||
}
|
||||
}
|
||||
|
||||
func (s MetadataSutureService) Serve(ctx context.Context) error {
|
||||
s.cfg.Reva.StorageMetadata.Context = ctx
|
||||
s.cfg.Context = ctx
|
||||
f := &flag.FlagSet{}
|
||||
cmdFlags := StorageMetadata(s.cfg).Flags
|
||||
for k := range cmdFlags {
|
||||
147
extensions/storage-metadata/pkg/config/config.go
Normal file
147
extensions/storage-metadata/pkg/config/config.go
Normal file
@@ -0,0 +1,147 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
*shared.Commons `yaml:"-"`
|
||||
Service Service `yaml:"-"`
|
||||
Tracing *Tracing `yaml:"tracing"`
|
||||
Logging *Logging `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
Supervised bool
|
||||
|
||||
GRPC GRPCConfig `yaml:"grpc"`
|
||||
HTTP HTTPConfig `yaml:"http"`
|
||||
|
||||
Context context.Context
|
||||
JWTSecret string
|
||||
GatewayEndpoint string
|
||||
SkipUserGroupsInToken bool
|
||||
Driver string `yaml:"driver" env:"STORAGE_METADATA_AUTH_PROVIDER" desc:"The auth provider which should be used by the service"`
|
||||
Drivers Drivers `yaml:"drivers"`
|
||||
DataServerURL string
|
||||
TempFolder string
|
||||
DataProviderInsecure bool
|
||||
}
|
||||
type Tracing struct {
|
||||
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;STORAGE_METADATA_TRACING_ENABLED" desc:"Activates tracing."`
|
||||
Type string `yaml:"type" env:"OCIS_TRACING_TYPE;STORAGE_METADATA_TRACING_TYPE"`
|
||||
Endpoint string `yaml:"endpoint" env:"OCIS_TRACING_ENDPOINT;STORAGE_METADATA_TRACING_ENDPOINT" desc:"The endpoint to the tracing collector."`
|
||||
Collector string `yaml:"collector" env:"OCIS_TRACING_COLLECTOR;STORAGE_METADATA_TRACING_COLLECTOR"`
|
||||
}
|
||||
|
||||
type Logging struct {
|
||||
Level string `yaml:"level" env:"OCIS_LOG_LEVEL;STORAGE_METADATA_LOG_LEVEL" desc:"The log level."`
|
||||
Pretty bool `yaml:"pretty" env:"OCIS_LOG_PRETTY;STORAGE_METADATA_LOG_PRETTY" desc:"Activates pretty log output."`
|
||||
Color bool `yaml:"color" env:"OCIS_LOG_COLOR;STORAGE_METADATA_LOG_COLOR" desc:"Activates colorized log output."`
|
||||
File string `yaml:"file" env:"OCIS_LOG_FILE;STORAGE_METADATA_LOG_FILE" desc:"The target log file."`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
type Debug struct {
|
||||
Addr string `yaml:"addr" env:"STORAGE_METADATA_DEBUG_ADDR"`
|
||||
Token string `yaml:"token" env:"STORAGE_METADATA_DEBUG_TOKEN"`
|
||||
Pprof bool `yaml:"pprof" env:"STORAGE_METADATA_DEBUG_PPROF"`
|
||||
Zpages bool `yaml:"zpages" env:"STORAGE_METADATA_DEBUG_ZPAGES"`
|
||||
}
|
||||
|
||||
type GRPCConfig struct {
|
||||
Addr string `yaml:"addr" env:"STORAGE_METADATA_GRPC_ADDR" desc:"The address of the grpc service."`
|
||||
Protocol string `yaml:"protocol" env:"STORAGE_METADATA_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."`
|
||||
}
|
||||
|
||||
type HTTPConfig struct {
|
||||
Addr string `yaml:"addr" env:"STORAGE_METADATA_GRPC_ADDR" desc:"The address of the grpc service."`
|
||||
Protocol string `yaml:"protocol" env:"STORAGE_METADATA_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."`
|
||||
}
|
||||
|
||||
type Drivers struct {
|
||||
EOS EOSDriver
|
||||
Local LocalDriver
|
||||
OCIS OCISDriver
|
||||
S3 S3Driver
|
||||
S3NG S3NGDriver
|
||||
}
|
||||
|
||||
type EOSDriver struct {
|
||||
// Root is the absolute path to the location of the data
|
||||
Root string `yaml:"root"`
|
||||
// ShadowNamespace for storing shadow data
|
||||
ShadowNamespace string `yaml:"shadow_namespace"`
|
||||
// UploadsNamespace for storing upload data
|
||||
UploadsNamespace string `yaml:"uploads_namespace"`
|
||||
// Location of the eos binary.
|
||||
// Default is /usr/bin/eos.
|
||||
EosBinary string `yaml:"eos_binary"`
|
||||
// Location of the xrdcopy binary.
|
||||
// Default is /usr/bin/xrdcopy.
|
||||
XrdcopyBinary string `yaml:"xrd_copy_binary"`
|
||||
// URL of the Master EOS MGM.
|
||||
// Default is root://eos-example.org
|
||||
MasterURL string `yaml:"master_url"`
|
||||
// URL of the Slave EOS MGM.
|
||||
// Default is root://eos-example.org
|
||||
SlaveURL string `yaml:"slave_url"`
|
||||
// Location on the local fs where to store reads.
|
||||
// Defaults to os.TempDir()
|
||||
CacheDirectory string `yaml:"cache_directory"`
|
||||
// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
|
||||
SecProtocol string `yaml:"sec_protocol"`
|
||||
// Keytab specifies the location of the keytab to use to authenticate to EOS.
|
||||
Keytab string `yaml:"keytab"`
|
||||
// SingleUsername is the username to use when SingleUserMode is enabled
|
||||
SingleUsername string `yaml:"single_username"`
|
||||
// Enables logging of the commands executed
|
||||
// Defaults to false
|
||||
EnableLogging bool `yaml:"enable_logging"`
|
||||
// ShowHiddenSysFiles shows internal EOS files like
|
||||
// .sys.v# and .sys.a# files.
|
||||
ShowHiddenSysFiles bool `yaml:"shadow_hidden_files"`
|
||||
// ForceSingleUserMode will force connections to EOS to use SingleUsername
|
||||
ForceSingleUserMode bool `yaml:"force_single_user_mode"`
|
||||
// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
|
||||
UseKeytab bool `yaml:"user_keytab"`
|
||||
// gateway service to use for uid lookups
|
||||
GatewaySVC string `yaml:"gateway_svc"`
|
||||
GRPCURI string
|
||||
UserLayout string
|
||||
}
|
||||
|
||||
type LocalDriver struct {
|
||||
// Root is the absolute path to the location of the data
|
||||
Root string `yaml:"root"`
|
||||
}
|
||||
|
||||
type OCISDriver struct {
|
||||
// Root is the absolute path to the location of the data
|
||||
Root string `yaml:"root"`
|
||||
UserLayout string
|
||||
PermissionsEndpoint string
|
||||
}
|
||||
|
||||
type S3Driver struct {
|
||||
Region string `yaml:"region"`
|
||||
AccessKey string `yaml:"access_key"`
|
||||
SecretKey string `yaml:"secret_key"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
Bucket string `yaml:"bucket"`
|
||||
}
|
||||
|
||||
type S3NGDriver struct {
|
||||
// Root is the absolute path to the location of the data
|
||||
Root string `yaml:"root"`
|
||||
UserLayout string
|
||||
PermissionsEndpoint string
|
||||
Region string `yaml:"region"`
|
||||
AccessKey string `yaml:"access_key"`
|
||||
SecretKey string `yaml:"secret_key"`
|
||||
Endpoint string `yaml:"endpoint"`
|
||||
Bucket string `yaml:"bucket"`
|
||||
}
|
||||
106
extensions/storage-metadata/pkg/config/defaults/defaultconfig.go
Normal file
106
extensions/storage-metadata/pkg/config/defaults/defaultconfig.go
Normal file
@@ -0,0 +1,106 @@
|
||||
package defaults
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/owncloud/ocis/extensions/storage-metadata/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
cfg := DefaultConfig()
|
||||
|
||||
EnsureDefaults(cfg)
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
||||
func DefaultConfig() *config.Config {
|
||||
return &config.Config{
|
||||
Debug: config.Debug{
|
||||
Addr: "127.0.0.1:9217",
|
||||
Token: "",
|
||||
Pprof: false,
|
||||
Zpages: false,
|
||||
},
|
||||
GRPC: config.GRPCConfig{
|
||||
Addr: "127.0.0.1:9215",
|
||||
Protocol: "tcp",
|
||||
},
|
||||
HTTP: config.HTTPConfig{
|
||||
Addr: "127.0.0.1:9216",
|
||||
Protocol: "tcp",
|
||||
},
|
||||
Service: config.Service{
|
||||
Name: "storage-metadata",
|
||||
},
|
||||
GatewayEndpoint: "127.0.0.1:9142",
|
||||
JWTSecret: "Pive-Fumkiu4",
|
||||
TempFolder: filepath.Join(defaults.BaseDataPath(), "tmp", "metadata"),
|
||||
DataServerURL: "http://localhost:9216/data",
|
||||
Driver: "ocis",
|
||||
Drivers: config.Drivers{
|
||||
EOS: config.EOSDriver{
|
||||
Root: "/eos/dockertest/reva",
|
||||
UserLayout: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
ShadowNamespace: "",
|
||||
UploadsNamespace: "",
|
||||
EosBinary: "/usr/bin/eos",
|
||||
XrdcopyBinary: "/usr/bin/xrdcopy",
|
||||
MasterURL: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
GRPCURI: "",
|
||||
SlaveURL: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
CacheDirectory: os.TempDir(),
|
||||
EnableLogging: false,
|
||||
ShowHiddenSysFiles: false,
|
||||
ForceSingleUserMode: false,
|
||||
UseKeytab: false,
|
||||
SecProtocol: "",
|
||||
Keytab: "",
|
||||
SingleUsername: "",
|
||||
GatewaySVC: "127.0.0.1:9142",
|
||||
},
|
||||
Local: config.LocalDriver{
|
||||
Root: filepath.Join(defaults.BaseDataPath(), "storage", "local", "metadata"),
|
||||
},
|
||||
S3: config.S3Driver{
|
||||
Region: "default",
|
||||
},
|
||||
S3NG: config.S3NGDriver{
|
||||
Root: filepath.Join(defaults.BaseDataPath(), "storage", "metadata"),
|
||||
UserLayout: "{{.Id.OpaqueId}}",
|
||||
Region: "default",
|
||||
},
|
||||
OCIS: config.OCISDriver{
|
||||
Root: filepath.Join(defaults.BaseDataPath(), "storage", "metadata"),
|
||||
UserLayout: "{{.Id.OpaqueId}}",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func EnsureDefaults(cfg *config.Config) {
|
||||
// provide with defaults for shared logging, since we need a valid destination address for BindEnv.
|
||||
if cfg.Logging == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
||||
cfg.Logging = &config.Logging{
|
||||
Level: cfg.Commons.Log.Level,
|
||||
Pretty: cfg.Commons.Log.Pretty,
|
||||
Color: cfg.Commons.Log.Color,
|
||||
File: cfg.Commons.Log.File,
|
||||
}
|
||||
} else if cfg.Logging == nil {
|
||||
cfg.Logging = &config.Logging{}
|
||||
}
|
||||
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
|
||||
if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil {
|
||||
cfg.Tracing = &config.Tracing{
|
||||
Enabled: cfg.Commons.Tracing.Enabled,
|
||||
Type: cfg.Commons.Tracing.Type,
|
||||
Endpoint: cfg.Commons.Tracing.Endpoint,
|
||||
Collector: cfg.Commons.Tracing.Collector,
|
||||
}
|
||||
} else if cfg.Tracing == nil {
|
||||
cfg.Tracing = &config.Tracing{}
|
||||
}
|
||||
}
|
||||
75
extensions/storage-metadata/pkg/config/metadata.go
Normal file
75
extensions/storage-metadata/pkg/config/metadata.go
Normal file
@@ -0,0 +1,75 @@
|
||||
package config
|
||||
|
||||
func MetadataDrivers(cfg *Config) map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"eos": map[string]interface{}{
|
||||
"namespace": cfg.Drivers.EOS.Root,
|
||||
"shadow_namespace": cfg.Drivers.EOS.ShadowNamespace,
|
||||
"uploads_namespace": cfg.Drivers.EOS.UploadsNamespace,
|
||||
"eos_binary": cfg.Drivers.EOS.EosBinary,
|
||||
"xrdcopy_binary": cfg.Drivers.EOS.XrdcopyBinary,
|
||||
"master_url": cfg.Drivers.EOS.MasterURL,
|
||||
"slave_url": cfg.Drivers.EOS.SlaveURL,
|
||||
"cache_directory": cfg.Drivers.EOS.CacheDirectory,
|
||||
"sec_protocol": cfg.Drivers.EOS.SecProtocol,
|
||||
"keytab": cfg.Drivers.EOS.Keytab,
|
||||
"single_username": cfg.Drivers.EOS.SingleUsername,
|
||||
"enable_logging": cfg.Drivers.EOS.EnableLogging,
|
||||
"show_hidden_sys_files": cfg.Drivers.EOS.ShowHiddenSysFiles,
|
||||
"force_single_user_mode": cfg.Drivers.EOS.ForceSingleUserMode,
|
||||
"use_keytab": cfg.Drivers.EOS.UseKeytab,
|
||||
"gatewaysvc": cfg.Drivers.EOS.GatewaySVC,
|
||||
"enable_home": false,
|
||||
},
|
||||
"eosgrpc": map[string]interface{}{
|
||||
"namespace": cfg.Drivers.EOS.Root,
|
||||
"shadow_namespace": cfg.Drivers.EOS.ShadowNamespace,
|
||||
"eos_binary": cfg.Drivers.EOS.EosBinary,
|
||||
"xrdcopy_binary": cfg.Drivers.EOS.XrdcopyBinary,
|
||||
"master_url": cfg.Drivers.EOS.MasterURL,
|
||||
"master_grpc_uri": cfg.Drivers.EOS.GRPCURI,
|
||||
"slave_url": cfg.Drivers.EOS.SlaveURL,
|
||||
"cache_directory": cfg.Drivers.EOS.CacheDirectory,
|
||||
"sec_protocol": cfg.Drivers.EOS.SecProtocol,
|
||||
"keytab": cfg.Drivers.EOS.Keytab,
|
||||
"single_username": cfg.Drivers.EOS.SingleUsername,
|
||||
"user_layout": cfg.Drivers.EOS.UserLayout,
|
||||
"enable_logging": cfg.Drivers.EOS.EnableLogging,
|
||||
"show_hidden_sys_files": cfg.Drivers.EOS.ShowHiddenSysFiles,
|
||||
"force_single_user_mode": cfg.Drivers.EOS.ForceSingleUserMode,
|
||||
"use_keytab": cfg.Drivers.EOS.UseKeytab,
|
||||
"enable_home": false,
|
||||
"gatewaysvc": cfg.Drivers.EOS.GatewaySVC,
|
||||
},
|
||||
"local": map[string]interface{}{
|
||||
"root": cfg.Drivers.Local.Root,
|
||||
},
|
||||
"ocis": map[string]interface{}{
|
||||
"root": cfg.Drivers.OCIS.Root,
|
||||
"user_layout": cfg.Drivers.OCIS.UserLayout,
|
||||
"treetime_accounting": false,
|
||||
"treesize_accounting": false,
|
||||
"permissionssvc": cfg.Drivers.OCIS.PermissionsEndpoint,
|
||||
},
|
||||
"s3": map[string]interface{}{
|
||||
"region": cfg.Drivers.S3.Region,
|
||||
"access_key": cfg.Drivers.S3.AccessKey,
|
||||
"secret_key": cfg.Drivers.S3.SecretKey,
|
||||
"endpoint": cfg.Drivers.S3.Endpoint,
|
||||
"bucket": cfg.Drivers.S3.Bucket,
|
||||
},
|
||||
"s3ng": map[string]interface{}{
|
||||
"root": cfg.Drivers.S3NG.Root,
|
||||
"enable_home": false,
|
||||
"user_layout": cfg.Drivers.S3NG.UserLayout,
|
||||
"treetime_accounting": false,
|
||||
"treesize_accounting": false,
|
||||
"permissionssvc": cfg.Drivers.S3NG.PermissionsEndpoint,
|
||||
"s3.region": cfg.Drivers.S3NG.Region,
|
||||
"s3.access_key": cfg.Drivers.S3NG.AccessKey,
|
||||
"s3.secret_key": cfg.Drivers.S3NG.SecretKey,
|
||||
"s3.endpoint": cfg.Drivers.S3NG.Endpoint,
|
||||
"s3.bucket": cfg.Drivers.S3NG.Bucket,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ func GetCommands(cfg *config.Config) cli.Commands {
|
||||
StoragePublicLink(cfg),
|
||||
StorageShares(cfg),
|
||||
StorageUsers(cfg),
|
||||
StorageMetadata(cfg),
|
||||
// StorageMetadata(cfg),
|
||||
Health(cfg),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
proxy "github.com/owncloud/ocis/extensions/proxy/pkg/config"
|
||||
settings "github.com/owncloud/ocis/extensions/settings/pkg/config"
|
||||
sharing "github.com/owncloud/ocis/extensions/sharing/pkg/config"
|
||||
storagemetadata "github.com/owncloud/ocis/extensions/storage-metadata/pkg/config"
|
||||
storage "github.com/owncloud/ocis/extensions/storage/pkg/config"
|
||||
store "github.com/owncloud/ocis/extensions/store/pkg/config"
|
||||
thumbnails "github.com/owncloud/ocis/extensions/thumbnails/pkg/config"
|
||||
@@ -65,27 +66,28 @@ type Config struct {
|
||||
TokenManager TokenManager `yaml:"token_manager"`
|
||||
Runtime Runtime `yaml:"runtime"`
|
||||
|
||||
Audit *audit.Config `yaml:"audit"`
|
||||
Accounts *accounts.Config `yaml:"accounts"`
|
||||
GLAuth *glauth.Config `yaml:"glauth"`
|
||||
Graph *graph.Config `yaml:"graph"`
|
||||
GraphExplorer *graphExplorer.Config `yaml:"graph_explorer"`
|
||||
IDP *idp.Config `yaml:"idp"`
|
||||
IDM *idm.Config `yaml:"idm"`
|
||||
Nats *nats.Config `yaml:"nats"`
|
||||
Notifications *notifications.Config `yaml:"notifications"`
|
||||
OCS *ocs.Config `yaml:"ocs"`
|
||||
Web *web.Config `yaml:"web"`
|
||||
Proxy *proxy.Config `yaml:"proxy"`
|
||||
Settings *settings.Config `yaml:"settings"`
|
||||
Storage *storage.Config `yaml:"storage"`
|
||||
AuthBasic *authbasic.Config `yaml:"auth_basic"`
|
||||
AuthBearer *authbearer.Config `yaml:"auth_bearer"`
|
||||
User *user.Config `yaml:"user"`
|
||||
Group *group.Config `yaml:"group"`
|
||||
AppProvider *appprovider.Config `yaml:"app_provider"`
|
||||
Sharing *sharing.Config `yaml:"app_provider"`
|
||||
Store *store.Config `yaml:"store"`
|
||||
Thumbnails *thumbnails.Config `yaml:"thumbnails"`
|
||||
WebDAV *webdav.Config `yaml:"webdav"`
|
||||
Audit *audit.Config `yaml:"audit"`
|
||||
Accounts *accounts.Config `yaml:"accounts"`
|
||||
GLAuth *glauth.Config `yaml:"glauth"`
|
||||
Graph *graph.Config `yaml:"graph"`
|
||||
GraphExplorer *graphExplorer.Config `yaml:"graph_explorer"`
|
||||
IDP *idp.Config `yaml:"idp"`
|
||||
IDM *idm.Config `yaml:"idm"`
|
||||
Nats *nats.Config `yaml:"nats"`
|
||||
Notifications *notifications.Config `yaml:"notifications"`
|
||||
OCS *ocs.Config `yaml:"ocs"`
|
||||
Web *web.Config `yaml:"web"`
|
||||
Proxy *proxy.Config `yaml:"proxy"`
|
||||
Settings *settings.Config `yaml:"settings"`
|
||||
Storage *storage.Config `yaml:"storage"`
|
||||
AuthBasic *authbasic.Config `yaml:"auth_basic"`
|
||||
AuthBearer *authbearer.Config `yaml:"auth_bearer"`
|
||||
User *user.Config `yaml:"user"`
|
||||
Group *group.Config `yaml:"group"`
|
||||
AppProvider *appprovider.Config `yaml:"app_provider"`
|
||||
Sharing *sharing.Config `yaml:"app_provider"`
|
||||
StorageMetadata *storagemetadata.Config `yaml:"storage_metadata"`
|
||||
Store *store.Config `yaml:"store"`
|
||||
Thumbnails *thumbnails.Config `yaml:"thumbnails"`
|
||||
WebDAV *webdav.Config `yaml:"webdav"`
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
proxy "github.com/owncloud/ocis/extensions/proxy/pkg/config/defaults"
|
||||
settings "github.com/owncloud/ocis/extensions/settings/pkg/config/defaults"
|
||||
sharing "github.com/owncloud/ocis/extensions/sharing/pkg/config/defaults"
|
||||
storagemetadata "github.com/owncloud/ocis/extensions/storage-metadata/pkg/config/defaults"
|
||||
storage "github.com/owncloud/ocis/extensions/storage/pkg/config/defaults"
|
||||
store "github.com/owncloud/ocis/extensions/store/pkg/config/defaults"
|
||||
thumbnails "github.com/owncloud/ocis/extensions/thumbnails/pkg/config/defaults"
|
||||
@@ -35,28 +36,29 @@ func DefaultConfig() *Config {
|
||||
Port: "9250",
|
||||
Host: "localhost",
|
||||
},
|
||||
Audit: audit.DefaultConfig(),
|
||||
Accounts: accounts.DefaultConfig(),
|
||||
GLAuth: glauth.DefaultConfig(),
|
||||
Graph: graph.DefaultConfig(),
|
||||
IDP: idp.DefaultConfig(),
|
||||
IDM: idm.DefaultConfig(),
|
||||
Nats: nats.DefaultConfig(),
|
||||
Notifications: notifications.DefaultConfig(),
|
||||
Proxy: proxy.DefaultConfig(),
|
||||
GraphExplorer: graphExplorer.DefaultConfig(),
|
||||
OCS: ocs.DefaultConfig(),
|
||||
Settings: settings.DefaultConfig(),
|
||||
Web: web.DefaultConfig(),
|
||||
Store: store.DefaultConfig(),
|
||||
Thumbnails: thumbnails.DefaultConfig(),
|
||||
WebDAV: webdav.DefaultConfig(),
|
||||
Storage: storage.DefaultConfig(),
|
||||
AuthBasic: authbasic.FullDefaultConfig(),
|
||||
AuthBearer: authbearer.FullDefaultConfig(),
|
||||
User: user.FullDefaultConfig(),
|
||||
Group: group.FullDefaultConfig(),
|
||||
Sharing: sharing.FullDefaultConfig(),
|
||||
AppProvider: appprovider.FullDefaultConfig(),
|
||||
Audit: audit.DefaultConfig(),
|
||||
Accounts: accounts.DefaultConfig(),
|
||||
GLAuth: glauth.DefaultConfig(),
|
||||
Graph: graph.DefaultConfig(),
|
||||
IDP: idp.DefaultConfig(),
|
||||
IDM: idm.DefaultConfig(),
|
||||
Nats: nats.DefaultConfig(),
|
||||
Notifications: notifications.DefaultConfig(),
|
||||
Proxy: proxy.DefaultConfig(),
|
||||
GraphExplorer: graphExplorer.DefaultConfig(),
|
||||
OCS: ocs.DefaultConfig(),
|
||||
Settings: settings.DefaultConfig(),
|
||||
Web: web.DefaultConfig(),
|
||||
Store: store.DefaultConfig(),
|
||||
Thumbnails: thumbnails.DefaultConfig(),
|
||||
WebDAV: webdav.DefaultConfig(),
|
||||
Storage: storage.DefaultConfig(),
|
||||
AuthBasic: authbasic.FullDefaultConfig(),
|
||||
AuthBearer: authbearer.FullDefaultConfig(),
|
||||
User: user.FullDefaultConfig(),
|
||||
Group: group.FullDefaultConfig(),
|
||||
Sharing: sharing.FullDefaultConfig(),
|
||||
StorageMetadata: storagemetadata.FullDefaultConfig(),
|
||||
AppProvider: appprovider.FullDefaultConfig(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/extensions/storage/pkg/command"
|
||||
"github.com/owncloud/ocis/extensions/storage-metadata/pkg/command"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||
"github.com/urfave/cli/v2"
|
||||
@@ -13,11 +13,11 @@ func StorageMetadataCommand(cfg *config.Config) *cli.Command {
|
||||
Name: "storage-metadata",
|
||||
Usage: "start storage and data service for metadata",
|
||||
Category: "extensions",
|
||||
Before: func(ctx *cli.Context) error {
|
||||
return ParseStorageCommon(ctx, cfg)
|
||||
},
|
||||
// Before: func(ctx *cli.Context) error {
|
||||
// return ParseStorageCommon(ctx, cfg)
|
||||
// },
|
||||
Action: func(c *cli.Context) error {
|
||||
origCmd := command.StorageMetadata(cfg.Storage)
|
||||
origCmd := command.StorageMetadata(cfg.StorageMetadata)
|
||||
return handleOriginalAction(c, origCmd)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import (
|
||||
proxy "github.com/owncloud/ocis/extensions/proxy/pkg/command"
|
||||
settings "github.com/owncloud/ocis/extensions/settings/pkg/command"
|
||||
sharing "github.com/owncloud/ocis/extensions/sharing/pkg/command"
|
||||
storagemetadata "github.com/owncloud/ocis/extensions/storage-metadata/pkg/command"
|
||||
storage "github.com/owncloud/ocis/extensions/storage/pkg/command"
|
||||
store "github.com/owncloud/ocis/extensions/store/pkg/command"
|
||||
thumbnails "github.com/owncloud/ocis/extensions/thumbnails/pkg/command"
|
||||
@@ -101,7 +102,7 @@ func NewService(options ...Option) (*Service, error) {
|
||||
|
||||
s.ServicesRegistry["settings"] = settings.NewSutureService
|
||||
s.ServicesRegistry["nats"] = nats.NewSutureService
|
||||
s.ServicesRegistry["storage-metadata"] = storage.NewStorageMetadata
|
||||
s.ServicesRegistry["storage-metadata"] = storagemetadata.NewStorageMetadata
|
||||
s.ServicesRegistry["glauth"] = glauth.NewSutureService
|
||||
s.ServicesRegistry["graph"] = graph.NewSutureService
|
||||
s.ServicesRegistry["graph-explorer"] = graphExplorer.NewSutureService
|
||||
|
||||
Reference in New Issue
Block a user