Get rid of duplicated Reva config struct

Consolidate all services to use the Reva config struct for the shared package.
This works because all services (except 'notifications', 'thumbnails' and
'webdav') where using the same config keys and environment variables for
setting the reva gateway.
This commit is contained in:
Ralf Haferkamp
2022-10-25 11:50:08 +02:00
committed by Ralf Haferkamp
parent 0f507e7aab
commit e373e48383
71 changed files with 130 additions and 206 deletions
+4 -5
View File
@@ -18,9 +18,8 @@ type Config struct {
HTTP HTTP `yaml:"http"`
OcisPublicURL string `yaml:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL" desc:"URL, where oCIS is reachable for users."`
WebdavNamespace string `yaml:"webdav_namespace" env:"WEBDAV_WEBDAV_NAMESPACE" desc:"CS3 path layout to use when forwarding /webdav requests"`
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY" desc:"The CS3 gateway endpoint."`
Context context.Context `yaml:"-"`
OcisPublicURL string `yaml:"ocis_public_url" env:"OCIS_URL;OCIS_PUBLIC_URL" desc:"URL, where oCIS is reachable for users."`
WebdavNamespace string `yaml:"webdav_namespace" env:"WEBDAV_WEBDAV_NAMESPACE" desc:"CS3 path layout to use when forwarding /webdav requests"`
Reva shared.Reva `yaml:"reva"`
Context context.Context `yaml:"-"`
}
@@ -3,6 +3,7 @@ package defaults
import (
"strings"
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
"github.com/owncloud/ocis/v2/services/webdav/pkg/config"
)
@@ -37,7 +38,9 @@ func DefaultConfig() *config.Config {
},
OcisPublicURL: "https://127.0.0.1:9200",
WebdavNamespace: "/users/{{.Id.OpaqueId}}",
RevaGateway: "127.0.0.1:9142",
Reva: shared.Reva{
Address: "127.0.0.1:9142",
},
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ func NewService(opts ...Option) (Service, error) {
// chi.RegisterMethod("REPORT")
m.Use(options.Middleware...)
gwc, err := pool.GetGatewayServiceClient(conf.RevaGateway)
gwc, err := pool.GetGatewayServiceClient(conf.Reva.Address)
if err != nil {
return nil, err
}