Merge branch 'master' into reenable-parallel-deployment-in-ci

This commit is contained in:
Willy Kloucek
2022-05-06 08:48:37 +02:00
15 changed files with 291 additions and 134 deletions
+6 -6
View File
@@ -45,15 +45,15 @@ type Policy struct {
// Route defines forwarding routes
type Route struct {
Type RouteType `yaml:"type"`
Type RouteType `yaml:"type,omitempty"`
// Method optionally limits the route to this HTTP method
Method string `yaml:"method"`
Endpoint string `yaml:"endpoint"`
Method string `yaml:"method,omitempty"`
Endpoint string `yaml:"endpoint,omitempty"`
// Backend is a static URL to forward the request to
Backend string `yaml:"backend"`
Backend string `yaml:"backend,omitempty"`
// Service name to look up in the registry
Service string `yaml:"service"`
ApacheVHost bool `yaml:"apache_vhost"`
Service string `yaml:"service,omitempty"`
ApacheVHost bool `yaml:"apache_vhost,omitempty"`
}
// RouteType defines the type of a route
@@ -106,6 +106,16 @@ func DefaultPolicies() []config.Policy {
Endpoint: "/remote.php/dav/",
Backend: "http://localhost:9115", // TODO use registry?
},
{
Type: config.QueryRoute,
Endpoint: "/dav/?preview=1",
Backend: "http://localhost:9115",
},
{
Type: config.QueryRoute,
Endpoint: "/webdav/?preview=1",
Backend: "http://localhost:9115",
},
{
Endpoint: "/remote.php/",
Service: "ocdav",
@@ -115,9 +115,11 @@ func (m basicAuth) isPublicLink(req *http.Request) bool {
}
publicPaths := []string{
"/dav/public-files/",
"/remote.php/dav/public-files/",
"/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected",
"/ocs/v1.php/cloud/capabilities",
"/data",
}
isPublic := false