Revert backwards incompatible reva config changes
The commit of unifying the Reva Client config introduced some backwards incompatible changes to the config structures and yaml config tags. For the "thumbnails", "webdav" and "notifications" service. This reverts the changes on the service and introduces TLS options in a backwards compatible manner.
This commit is contained in:
committed by
Ralf Haferkamp
parent
8cead4557f
commit
fbb3382a42
@@ -18,8 +18,10 @@ 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"`
|
||||
Reva shared.Reva `yaml:"reva"`
|
||||
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"`
|
||||
RevaGateway string `yaml:"reva_gateway" env:"REVA_GATEWAY" desc:"CS3 gateway used to look up user metadata"`
|
||||
RevaGatewayTLSMode string `yaml:"reva_gateway_tls_mode" env:"REVA_GATEWAY_TLS_MODE"`
|
||||
RevaGatewayTLSCACert string `yaml:"reva_gateway_tls_cacert" env:"REVA_GATEWAY_TLS_CACERT"`
|
||||
Context context.Context `yaml:"-"`
|
||||
}
|
||||
|
||||
@@ -36,9 +36,11 @@ func DefaultConfig() *config.Config {
|
||||
Service: config.Service{
|
||||
Name: "webdav",
|
||||
},
|
||||
OcisPublicURL: "https://127.0.0.1:9200",
|
||||
WebdavNamespace: "/users/{{.Id.OpaqueId}}",
|
||||
Reva: *shared.DefaultRevaConfig(),
|
||||
OcisPublicURL: "https://127.0.0.1:9200",
|
||||
WebdavNamespace: "/users/{{.Id.OpaqueId}}",
|
||||
RevaGateway: shared.DefaultRevaConfig().Address,
|
||||
RevaGatewayTLSMode: shared.DefaultRevaConfig().TLSMode,
|
||||
RevaGatewayTLSCACert: shared.DefaultRevaConfig().TLSCACert,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,14 @@ func NewService(opts ...Option) (Service, error) {
|
||||
// chi.RegisterMethod("REPORT")
|
||||
m.Use(options.Middleware...)
|
||||
|
||||
gwc, err := pool.GetGatewayServiceClient(conf.Reva.Address, conf.Reva.GetRevaOptions()...)
|
||||
tm, err := pool.StringToTLSMode(conf.RevaGatewayTLSMode)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
gwc, err := pool.GetGatewayServiceClient(conf.RevaGateway,
|
||||
pool.WithTLSCACert(conf.RevaGatewayTLSCACert),
|
||||
pool.WithTLSMode(tm),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user