mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-24 14:50:39 -05:00
Compare commits
5 Commits
replaceCII
...
ocdav-to-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f19839486 | ||
|
|
1fdd76b683 | ||
|
|
f12feeb440 | ||
|
|
64244e0056 | ||
|
|
01946503c3 |
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -36,7 +36,7 @@
|
||||
// demo users
|
||||
"IDM_CREATE_DEMO_USERS": "true",
|
||||
// OC_RUN_SERVICES allows to start a subset of services even in the supervised mode
|
||||
//"OC_RUN_SERVICES": "settings,storage-system,graph,idp,idm,ocs,store,thumbnails,web,webdav,frontend,gateway,users,groups,auth-basic,storage-authmachine,storage-users,storage-shares,storage-publiclink,storage-system,app-provider,sharing,proxy,ocdav",
|
||||
//"OC_RUN_SERVICES": "settings,storage-system,graph,idp,idm,ocs,store,thumbnails,web,webdav,frontend,gateway,users,groups,auth-basic,storage-authmachine,storage-users,storage-shares,storage-publiclink,storage-system,app-provider,sharing,proxy",
|
||||
|
||||
/*
|
||||
* Keep secrets and passwords in one block to allow easy uncommenting
|
||||
@@ -129,8 +129,6 @@
|
||||
"IDP_HTTP_ADDR": "127.0.0.1:10130",
|
||||
"NATS_DEBUG_ADDR": "127.0.0.1:10234",
|
||||
"NATS_NATS_PORT": "10233",
|
||||
"OCDAV_HTTP_ADDR": "127.0.0.1:10350",
|
||||
"OCDAV_DEBUG_ADDR": "127.0.0.1:10163",
|
||||
"OCM_DEBUG_ADDR": "127.0.0.1:10281",
|
||||
"OCM_HTTP_ADDR": "127.0.0.1:10280",
|
||||
"OCM_GRPC_ADDR": "127.0.0.1:10282",
|
||||
|
||||
@@ -2137,7 +2137,6 @@ def opencloudServer(storage = "decomposed", accounts_hash_difficulty = 4, depend
|
||||
"IDP_DEBUG_ADDR": "0.0.0.0:9134",
|
||||
"INVITATIONS_DEBUG_ADDR": "0.0.0.0:9269",
|
||||
"NATS_DEBUG_ADDR": "0.0.0.0:9234",
|
||||
"OCDAV_DEBUG_ADDR": "0.0.0.0:9163",
|
||||
"OCM_DEBUG_ADDR": "0.0.0.0:9281",
|
||||
"OCS_DEBUG_ADDR": "0.0.0.0:9114",
|
||||
"POSTPROCESSING_DEBUG_ADDR": "0.0.0.0:9255",
|
||||
|
||||
1
Makefile
1
Makefile
@@ -44,7 +44,6 @@ OC_MODULES = \
|
||||
services/invitations \
|
||||
services/nats \
|
||||
services/notifications \
|
||||
services/ocdav \
|
||||
services/ocm \
|
||||
services/ocs \
|
||||
services/policies \
|
||||
|
||||
@@ -29,7 +29,6 @@ import (
|
||||
invitations "github.com/opencloud-eu/opencloud/services/invitations/pkg/command"
|
||||
nats "github.com/opencloud-eu/opencloud/services/nats/pkg/command"
|
||||
notifications "github.com/opencloud-eu/opencloud/services/notifications/pkg/command"
|
||||
ocdav "github.com/opencloud-eu/opencloud/services/ocdav/pkg/command"
|
||||
ocm "github.com/opencloud-eu/opencloud/services/ocm/pkg/command"
|
||||
ocs "github.com/opencloud-eu/opencloud/services/ocs/pkg/command"
|
||||
policies "github.com/opencloud-eu/opencloud/services/policies/pkg/command"
|
||||
@@ -164,11 +163,6 @@ var serviceCommands = []register.Command{
|
||||
cfg.Notifications.Commons = cfg.Commons
|
||||
})
|
||||
},
|
||||
func(cfg *config.Config) *cobra.Command {
|
||||
return ServiceCommand(cfg, cfg.OCDav.Service.Name, ocdav.GetCommands(cfg.OCDav), func(c *config.Config) {
|
||||
cfg.OCDav.Commons = cfg.Commons
|
||||
})
|
||||
},
|
||||
func(cfg *config.Config) *cobra.Command {
|
||||
return ServiceCommand(cfg, cfg.OCM.Service.Name, ocm.GetCommands(cfg.OCM), func(c *config.Config) {
|
||||
cfg.OCM.Commons = cfg.Commons
|
||||
|
||||
@@ -281,6 +281,7 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
|
||||
cfg.Collaboration.App.Insecure = true
|
||||
cfg.Frontend.AppHandler = _insecureService
|
||||
cfg.Frontend.Archiver = _insecureService
|
||||
cfg.Frontend.OCDav = _insecureService
|
||||
cfg.Graph.Spaces = _insecureService
|
||||
cfg.Graph.Events = _insecureEvents
|
||||
cfg.Notifications.Notifications.Events = _insecureEvents
|
||||
@@ -289,7 +290,6 @@ func CreateConfig(insecure, forceOverwrite, diff bool, configPath, adminPassword
|
||||
cfg.Sharing.Events = _insecureEvents
|
||||
cfg.StorageUsers.Events = _insecureEvents
|
||||
cfg.Nats.Nats.TLSSkipVerifyClientCert = true
|
||||
cfg.Ocdav = _insecureService
|
||||
cfg.Proxy = ProxyService{
|
||||
InsecureBackends: true,
|
||||
OIDC: InsecureProxyOIDC{
|
||||
|
||||
@@ -32,7 +32,6 @@ type OpenCloudConfig struct {
|
||||
AuthBearer AuthbearerService `yaml:"auth_bearer"`
|
||||
Users UsersAndGroupsService `yaml:"users"`
|
||||
Groups UsersAndGroupsService `yaml:"groups"`
|
||||
Ocdav InsecureService `yaml:"ocdav"`
|
||||
Ocm OcmService `yaml:"ocm"`
|
||||
Thumbnails ThumbnailService `yaml:"thumbnails"`
|
||||
Search Search `yaml:"search"`
|
||||
@@ -105,6 +104,7 @@ type FrontendService struct {
|
||||
AppHandler InsecureService `yaml:"app_handler"`
|
||||
Archiver InsecureService
|
||||
ServiceAccount ServiceAccount `yaml:"service_account"`
|
||||
OCDav InsecureService
|
||||
}
|
||||
|
||||
// Gateway is the configuration for the gateway
|
||||
|
||||
@@ -40,7 +40,6 @@ import (
|
||||
invitations "github.com/opencloud-eu/opencloud/services/invitations/pkg/command"
|
||||
nats "github.com/opencloud-eu/opencloud/services/nats/pkg/command"
|
||||
notifications "github.com/opencloud-eu/opencloud/services/notifications/pkg/command"
|
||||
ocdav "github.com/opencloud-eu/opencloud/services/ocdav/pkg/command"
|
||||
ocm "github.com/opencloud-eu/opencloud/services/ocm/pkg/command"
|
||||
ocs "github.com/opencloud-eu/opencloud/services/ocs/pkg/command"
|
||||
policies "github.com/opencloud-eu/opencloud/services/policies/pkg/command"
|
||||
@@ -204,11 +203,6 @@ func NewService(ctx context.Context, options ...Option) (*Service, error) {
|
||||
cfg.IDM.Commons = cfg.Commons
|
||||
return idm.Execute(cfg.IDM)
|
||||
})
|
||||
reg(3, opts.Config.OCDav.Service.Name, func(ctx context.Context, cfg *occfg.Config) error {
|
||||
cfg.OCDav.Context = ctx
|
||||
cfg.OCDav.Commons = cfg.Commons
|
||||
return ocdav.Execute(cfg.OCDav)
|
||||
})
|
||||
reg(3, opts.Config.OCS.Service.Name, func(ctx context.Context, cfg *occfg.Config) error {
|
||||
cfg.OCS.Context = ctx
|
||||
cfg.OCS.Commons = cfg.Commons
|
||||
|
||||
@@ -24,7 +24,6 @@ import (
|
||||
invitations "github.com/opencloud-eu/opencloud/services/invitations/pkg/config"
|
||||
nats "github.com/opencloud-eu/opencloud/services/nats/pkg/config"
|
||||
notifications "github.com/opencloud-eu/opencloud/services/notifications/pkg/config"
|
||||
ocdav "github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
ocm "github.com/opencloud-eu/opencloud/services/ocm/pkg/config"
|
||||
ocs "github.com/opencloud-eu/opencloud/services/ocs/pkg/config"
|
||||
policies "github.com/opencloud-eu/opencloud/services/policies/pkg/config"
|
||||
@@ -105,7 +104,6 @@ type Config struct {
|
||||
Invitations *invitations.Config `yaml:"invitations"`
|
||||
Nats *nats.Config `yaml:"nats"`
|
||||
Notifications *notifications.Config `yaml:"notifications"`
|
||||
OCDav *ocdav.Config `yaml:"ocdav"`
|
||||
OCM *ocm.Config `yaml:"ocm"`
|
||||
OCS *ocs.Config `yaml:"ocs"`
|
||||
Postprocessing *postprocessing.Config `yaml:"postprocessing"`
|
||||
|
||||
@@ -24,7 +24,6 @@ import (
|
||||
invitations "github.com/opencloud-eu/opencloud/services/invitations/pkg/config/defaults"
|
||||
nats "github.com/opencloud-eu/opencloud/services/nats/pkg/config/defaults"
|
||||
notifications "github.com/opencloud-eu/opencloud/services/notifications/pkg/config/defaults"
|
||||
ocdav "github.com/opencloud-eu/opencloud/services/ocdav/pkg/config/defaults"
|
||||
ocm "github.com/opencloud-eu/opencloud/services/ocm/pkg/config/defaults"
|
||||
ocs "github.com/opencloud-eu/opencloud/services/ocs/pkg/config/defaults"
|
||||
policies "github.com/opencloud-eu/opencloud/services/policies/pkg/config/defaults"
|
||||
@@ -80,7 +79,6 @@ func DefaultConfig() *Config {
|
||||
Invitations: invitations.DefaultConfig(),
|
||||
Nats: nats.DefaultConfig(),
|
||||
Notifications: notifications.DefaultConfig(),
|
||||
OCDav: ocdav.DefaultConfig(),
|
||||
OCM: ocm.DefaultConfig(),
|
||||
OCS: ocs.DefaultConfig(),
|
||||
Postprocessing: postprocessing.DefaultConfig(),
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"gotest.tools/v3/assert"
|
||||
"testing"
|
||||
"testing/fstest"
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
)
|
||||
|
||||
type TestConfig struct {
|
||||
@@ -98,6 +99,8 @@ frontend:
|
||||
service_account:
|
||||
service_account_id: c05389b2-d94c-4d01-a9b5-a2f97952cc14
|
||||
service_account_secret: GW5.x1vDM&+NPRi++eV@.P7Tms4vj!=s
|
||||
ocdav:
|
||||
insecure: true
|
||||
auth_basic:
|
||||
auth_providers:
|
||||
ldap:
|
||||
@@ -114,8 +117,6 @@ groups:
|
||||
drivers:
|
||||
ldap:
|
||||
bind_password: c68JL=V$c@0GHs!%eSb8r&Ps3rgzKnXJ
|
||||
ocdav:
|
||||
insecure: true
|
||||
ocm:
|
||||
service_account:
|
||||
service_account_id: c05389b2-d94c-4d01-a9b5-a2f97952cc14
|
||||
|
||||
@@ -33,7 +33,6 @@ type Config struct {
|
||||
EnableFederatedSharingIncoming bool `yaml:"enable_federated_sharing_incoming" env:"OC_ENABLE_OCM;FRONTEND_ENABLE_FEDERATED_SHARING_INCOMING" desc:"Changing this value is NOT supported. Enables support for incoming federated sharing for clients. The backend behaviour is not changed." introductionVersion:"1.0.0"`
|
||||
EnableFederatedSharingOutgoing bool `yaml:"enable_federated_sharing_outgoing" env:"OC_ENABLE_OCM;FRONTEND_ENABLE_FEDERATED_SHARING_OUTGOING" desc:"Changing this value is NOT supported. Enables support for outgoing federated sharing for clients. The backend behaviour is not changed." introductionVersion:"1.0.0"`
|
||||
SearchMinLength int `yaml:"search_min_length" env:"FRONTEND_SEARCH_MIN_LENGTH" desc:"Minimum number of characters to enter before a client should start a search for Share receivers. This setting can be used to customize the user experience if e.g too many results are displayed." introductionVersion:"1.0.0"`
|
||||
Edition string `desc:"Edition of OpenCloud. Used for branding purposes." introductionVersion:"1.0.0"`
|
||||
DisableSSE bool `yaml:"disable_sse" env:"OC_DISABLE_SSE;FRONTEND_DISABLE_SSE" desc:"When set to true, clients are informed that the Server-Sent Events endpoint is not accessible." introductionVersion:"1.0.0"`
|
||||
DisableRadicale bool `yaml:"disable_radicale" env:"FRONTEND_DISABLE_RADICALE" desc:"When set to true, clients are informed that the Radicale (CalDAV/CardDAV) is not accessible." introductionVersion:"4.0.0"`
|
||||
DefaultLinkPermissions int `yaml:"default_link_permissions" env:"FRONTEND_DEFAULT_LINK_PERMISSIONS" desc:"Defines the default permissions a link is being created with. Possible values are 0 (= internal link, for instance members only) and 1 (= public link with viewer permissions). Defaults to 1." introductionVersion:"1.0.0"`
|
||||
@@ -44,6 +43,7 @@ type Config struct {
|
||||
Archiver Archiver `yaml:"archiver"`
|
||||
DataGateway DataGateway `yaml:"data_gateway"`
|
||||
OCS OCS `yaml:"ocs"`
|
||||
OCDav OCDav `yaml:"ocdav"`
|
||||
Checksums Checksums `yaml:"checksums"`
|
||||
ReadOnlyUserAttributes []string `yaml:"read_only_user_attributes" env:"FRONTEND_READONLY_USER_ATTRIBUTES" desc:"A list of user attributes to indicate as read-only. Supported values: 'user.onPremisesSamAccountName' (username), 'user.displayName', 'user.mail', 'user.passwordProfile' (password), 'user.appRoleAssignments' (role), 'user.memberOf' (groups), 'user.accountEnabled' (login allowed), 'drive.quota' (quota). See the Environment Variable Types description for more details." introductionVersion:"1.0.0"`
|
||||
LDAPServerWriteEnabled bool `yaml:"ldap_server_write_enabled" env:"OC_LDAP_SERVER_WRITE_ENABLED;FRONTEND_LDAP_SERVER_WRITE_ENABLED" desc:"Allow creating, modifying and deleting LDAP users via the GRAPH API. This can only be set to 'true' when keeping default settings for the LDAP user and group attribute types (the 'OC_LDAP_USER_SCHEMA_* and 'OC_LDAP_GROUP_SCHEMA_* variables)." introductionVersion:"1.0.0"`
|
||||
@@ -152,6 +152,36 @@ type OCS struct {
|
||||
ShowUserEmailInResults bool `yaml:"show_email_in_results" env:"OC_SHOW_USER_EMAIL_IN_RESULTS" desc:"Include user email addresses in responses. If absent or set to false emails will be omitted from results. Please note that admin users can always see all email addresses." introductionVersion:"1.0.0"`
|
||||
}
|
||||
|
||||
type OCDav struct {
|
||||
Prefix string `yaml:"prefix" env:"OCDAV_HTTP_PREFIX" desc:"A URL path prefix for the handler." introductionVersion:"1.0.0"`
|
||||
|
||||
SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"OCDAV_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the loading of user's group memberships from the reva access token." introductionVersion:"1.0.0"`
|
||||
|
||||
WebdavNamespace string `yaml:"webdav_namespace" env:"OCDAV_WEBDAV_NAMESPACE" desc:"Jail requests to /dav/webdav into this CS3 namespace. Supports template layouting with CS3 User properties." introductionVersion:"1.0.0"`
|
||||
FilesNamespace string `yaml:"files_namespace" env:"OCDAV_FILES_NAMESPACE" desc:"Jail requests to /dav/files/{username} into this CS3 namespace. Supports template layouting with CS3 User properties." introductionVersion:"1.0.0"`
|
||||
SharesNamespace string `yaml:"shares_namespace" env:"OCDAV_SHARES_NAMESPACE" desc:"The human readable path for the share jail. Relative to a users personal space root. Upcased intentionally." introductionVersion:"1.0.0"`
|
||||
OCMNamespace string `yaml:"ocm_namespace" env:"OCDAV_OCM_NAMESPACE" desc:"The human readable path prefix for the ocm shares." introductionVersion:"1.0.0"`
|
||||
// PublicURL used to redirect /s/{token} URLs to
|
||||
PublicURL string `yaml:"public_url" env:"OC_URL;OCDAV_PUBLIC_URL" desc:"URL where OpenCloud is reachable for users." introductionVersion:"1.0.0"`
|
||||
|
||||
// Insecure certificates allowed when making requests to the gateway
|
||||
Insecure bool `yaml:"insecure" env:"OC_INSECURE;OCDAV_INSECURE" desc:"Allow insecure connections to the GATEWAY service." introductionVersion:"1.0.0"`
|
||||
EnableHTTPTPC bool `yaml:"enable_http_tpc" env:"OCDAV_ENABLE_HTTP_TPC" desc:"Enable HTTP / WebDAV Third-Party-Copy support." introductionVersion:"%%NEXT%%"`
|
||||
// Timeout in seconds when making requests to the gateway
|
||||
Timeout int64 `yaml:"gateway_request_timeout" env:"OCDAV_GATEWAY_REQUEST_TIMEOUT" desc:"Request timeout in seconds for requests from the oCDAV service to the GATEWAY service." introductionVersion:"1.0.0"`
|
||||
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OC_MACHINE_AUTH_API_KEY;OCDAV_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"1.0.0"`
|
||||
|
||||
AllowPropfindDepthInfinity bool `yaml:"allow_propfind_depth_infinity" env:"OCDAV_ALLOW_PROPFIND_DEPTH_INFINITY" desc:"Allow the use of depth infinity in PROPFINDS. When enabled, a propfind will traverse through all subfolders. If many subfolders are expected, depth infinity can cause heavy server load and/or delayed response times." introductionVersion:"1.0.0"`
|
||||
|
||||
NameValidation NameValidation `yaml:"name_validation"`
|
||||
}
|
||||
|
||||
type NameValidation struct {
|
||||
InvalidChars []string `yaml:"invalid_chars" env:"OCDAV_NAME_VALIDATION_INVALID_CHARS" desc:"List of characters that are not allowed in file or folder names." introductionVersion:"%%NEXT%%"`
|
||||
MaxLength int `yaml:"max_length" env:"OCDAV_NAME_VALIDATION_MAX_LENGTH" desc:"Max lenght og file or folder names." introductionVersion:"%%NEXT%%"`
|
||||
}
|
||||
|
||||
type CacheWarmupDrivers struct {
|
||||
CBOX CBOXDriver `yaml:"cbox,omitempty"`
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
"github.com/opencloud-eu/opencloud/pkg/structs"
|
||||
"github.com/opencloud-eu/opencloud/pkg/version"
|
||||
"github.com/opencloud-eu/opencloud/services/frontend/pkg/config"
|
||||
)
|
||||
|
||||
@@ -88,7 +87,6 @@ func DefaultConfig() *config.Config {
|
||||
DefaultUploadProtocol: "tus",
|
||||
DefaultLinkPermissions: 1,
|
||||
SearchMinLength: 3,
|
||||
Edition: version.Edition,
|
||||
CheckForUpdates: true,
|
||||
Checksums: config.Checksums{
|
||||
SupportedTypes: []string{"sha1", "md5", "adler32"},
|
||||
@@ -120,6 +118,24 @@ func DefaultConfig() *config.Config {
|
||||
PublicShareMustHavePassword: true,
|
||||
IncludeOCMSharees: false,
|
||||
},
|
||||
OCDav: config.OCDav{
|
||||
Prefix: "",
|
||||
SkipUserGroupsInToken: false,
|
||||
|
||||
WebdavNamespace: "/users/{{.Id.OpaqueId}}",
|
||||
FilesNamespace: "/users/{{.Id.OpaqueId}}",
|
||||
SharesNamespace: "/Shares",
|
||||
OCMNamespace: "/public",
|
||||
PublicURL: "https://localhost:9200",
|
||||
Insecure: false,
|
||||
EnableHTTPTPC: false,
|
||||
Timeout: 84300,
|
||||
AllowPropfindDepthInfinity: false,
|
||||
NameValidation: config.NameValidation{
|
||||
InvalidChars: []string{"\f", "\r", "\n", "\\"},
|
||||
MaxLength: 255,
|
||||
},
|
||||
},
|
||||
Middleware: config.Middleware{
|
||||
Auth: config.Auth{
|
||||
CredentialsByUserAgent: map[string]string{},
|
||||
|
||||
@@ -209,7 +209,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
|
||||
"needsDbUpgrade": false,
|
||||
"version": version.Legacy,
|
||||
"versionstring": version.LegacyString,
|
||||
"edition": cfg.Edition,
|
||||
"edition": version.Edition,
|
||||
"productname": "OpenCloud",
|
||||
"product": "OpenCloud",
|
||||
"productversion": version.GetString(),
|
||||
@@ -357,6 +357,34 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
|
||||
"include_ocm_sharees": cfg.OCS.IncludeOCMSharees,
|
||||
"show_email_in_results": cfg.OCS.ShowUserEmailInResults,
|
||||
},
|
||||
"ocdav": map[string]interface{}{
|
||||
"prefix": cfg.OCDav.Prefix,
|
||||
"files_namespace": cfg.OCDav.FilesNamespace,
|
||||
"webdav_namespace": cfg.OCDav.WebdavNamespace,
|
||||
"shares_namespace": cfg.OCDav.SharesNamespace,
|
||||
"ocm_namespace": cfg.OCDav.OCMNamespace,
|
||||
"gatewaysvc": cfg.Reva.Address,
|
||||
"timeout": cfg.OCDav.Timeout,
|
||||
"insecure": cfg.OCDav.Insecure,
|
||||
"enable_http_tpc": cfg.OCDav.EnableHTTPTPC,
|
||||
"public_url": cfg.OCDav.PublicURL,
|
||||
// still not supported
|
||||
//"favorite_storage_driver": unused,
|
||||
//"favorite_storage_drivers": unused,
|
||||
"version": version.Legacy,
|
||||
"version_string": version.LegacyString,
|
||||
"edition": version.Edition,
|
||||
"product": "OpenCloud",
|
||||
"product_name": "OpenCloud",
|
||||
"product_version": version.GetString(),
|
||||
"allow_depth_infinity": cfg.OCDav.AllowPropfindDepthInfinity,
|
||||
"validation": map[string]interface{}{
|
||||
"invalid_chars": cfg.OCDav.NameValidation.InvalidChars,
|
||||
"max_length": cfg.OCDav.NameValidation.MaxLength,
|
||||
},
|
||||
"url_signing_shared_secret": cfg.Commons.URLSigningSecret,
|
||||
"machine_auth_apikey": cfg.MachineAuthAPIKey,
|
||||
},
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
SHELL := bash
|
||||
NAME := ocdav
|
||||
|
||||
ifneq (, $(shell command -v go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
|
||||
include ../../.bingo/Variables.mk
|
||||
endif
|
||||
|
||||
include ../../.make/default.mk
|
||||
include ../../.make/go.mk
|
||||
include ../../.make/release.mk
|
||||
include ../../.make/docs.mk
|
||||
@@ -1,3 +0,0 @@
|
||||
# ocDAV
|
||||
|
||||
The ocdav service provides the WebDAV API which is required by OpenCloud clients. Previews (thumbnails) are provided by the [WebDAV service](../webdav).
|
||||
@@ -1,19 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/command"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config/defaults"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cfg := defaults.DefaultConfig()
|
||||
cfg.Context, _ = signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP)
|
||||
if err := command.Execute(cfg); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/config/configlog"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config/parser"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/logging"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// Health is the entrypoint for the health command.
|
||||
func Health(cfg *config.Config) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "health",
|
||||
Short: "check health status",
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
return configlog.ReturnError(parser.ParseConfig(cfg))
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
logger := logging.Configure(cfg.Service.Name, cfg.Log)
|
||||
|
||||
resp, err := http.Get(
|
||||
fmt.Sprintf(
|
||||
"http://%s/healthz",
|
||||
cfg.Debug.Addr,
|
||||
),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
logger.Fatal().
|
||||
Err(err).
|
||||
Msg("Failed to request health check")
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
logger.Fatal().
|
||||
Int("code", resp.StatusCode).
|
||||
Msg("Health seems to be in bad state")
|
||||
}
|
||||
|
||||
logger.Debug().
|
||||
Int("code", resp.StatusCode).
|
||||
Msg("Health got a good state")
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/clihelper"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// GetCommands provides all commands for this service
|
||||
func GetCommands(cfg *config.Config) []*cobra.Command {
|
||||
return []*cobra.Command{
|
||||
// start this service
|
||||
Server(cfg),
|
||||
|
||||
// interaction with this service
|
||||
|
||||
// infos about this service
|
||||
Health(cfg),
|
||||
Version(cfg),
|
||||
}
|
||||
}
|
||||
|
||||
// Execute is the entry point for the OpenCloud ocdav command.
|
||||
func Execute(cfg *config.Config) error {
|
||||
app := clihelper.DefaultApp(&cobra.Command{
|
||||
Use: "ocdav",
|
||||
Short: "Provide a WebDav API for OpenCloud",
|
||||
})
|
||||
app.AddCommand(GetCommands(cfg)...)
|
||||
app.SetArgs(os.Args[1:])
|
||||
|
||||
return app.ExecuteContext(cfg.Context)
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/signal"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/broker"
|
||||
"github.com/opencloud-eu/opencloud/pkg/config/configlog"
|
||||
"github.com/opencloud-eu/opencloud/pkg/registry"
|
||||
"github.com/opencloud-eu/opencloud/pkg/runner"
|
||||
ohttp "github.com/opencloud-eu/opencloud/pkg/service/http"
|
||||
"github.com/opencloud-eu/opencloud/pkg/tracing"
|
||||
"github.com/opencloud-eu/opencloud/pkg/version"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config/parser"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/logging"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/server/debug"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/micro/ocdav"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/sharedconf"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// Server is the entry point for the server command.
|
||||
func Server(cfg *config.Config) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "server",
|
||||
Short: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name),
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
return configlog.ReturnFatal(parser.ParseConfig(cfg))
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
logger := logging.Configure(cfg.Service.Name, cfg.Log)
|
||||
traceProvider, err := tracing.GetTraceProvider(cmd.Context(), cfg.Commons.TracesExporter, cfg.Service.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var cancel context.CancelFunc
|
||||
if cfg.Context == nil {
|
||||
cfg.Context, cancel = signal.NotifyContext(context.Background(), runner.StopSignals...)
|
||||
defer cancel()
|
||||
}
|
||||
ctx := cfg.Context
|
||||
|
||||
gr := runner.NewGroup()
|
||||
|
||||
// init reva shared config explicitly as the go-micro based ocdav does not use
|
||||
// the reva runtime. But we need e.g. the shared client settings to be initialized
|
||||
sc := map[string]interface{}{
|
||||
"jwt_secret": cfg.TokenManager.JWTSecret,
|
||||
"gatewaysvc": cfg.Reva.Address,
|
||||
"skip_user_groups_in_token": cfg.SkipUserGroupsInToken,
|
||||
"grpc_client_options": cfg.Reva.GetGRPCClientConfig(),
|
||||
}
|
||||
if err := sharedconf.Decode(sc); err != nil {
|
||||
logger.Error().Err(err).Msg("error decoding shared config for ocdav")
|
||||
}
|
||||
opts := []ocdav.Option{
|
||||
ocdav.Name(cfg.HTTP.Namespace + "." + cfg.Service.Name),
|
||||
ocdav.Version(version.GetString()),
|
||||
ocdav.Context(ctx),
|
||||
ocdav.Logger(logger.Logger),
|
||||
ocdav.Address(cfg.HTTP.Addr),
|
||||
ocdav.AllowCredentials(cfg.HTTP.CORS.AllowCredentials),
|
||||
ocdav.AllowedMethods(cfg.HTTP.CORS.AllowedMethods),
|
||||
ocdav.AllowedHeaders(cfg.HTTP.CORS.AllowedHeaders),
|
||||
ocdav.AllowedOrigins(cfg.HTTP.CORS.AllowedOrigins),
|
||||
ocdav.FilesNamespace(cfg.FilesNamespace),
|
||||
ocdav.WebdavNamespace(cfg.WebdavNamespace),
|
||||
ocdav.OCMNamespace(cfg.OCMNamespace),
|
||||
ocdav.AllowDepthInfinity(cfg.AllowPropfindDepthInfinity),
|
||||
ocdav.SharesNamespace(cfg.SharesNamespace),
|
||||
ocdav.Timeout(cfg.Timeout),
|
||||
ocdav.Insecure(cfg.Insecure),
|
||||
ocdav.PublicURL(cfg.PublicURL),
|
||||
ocdav.Prefix(cfg.HTTP.Prefix),
|
||||
ocdav.GatewaySvc(cfg.Reva.Address),
|
||||
ocdav.JWTSecret(cfg.TokenManager.JWTSecret),
|
||||
ocdav.ProductName(cfg.Status.ProductName),
|
||||
ocdav.ProductVersion(cfg.Status.ProductVersion),
|
||||
ocdav.Product(cfg.Status.Product),
|
||||
ocdav.Version(cfg.Status.Version),
|
||||
ocdav.VersionString(cfg.Status.VersionString),
|
||||
ocdav.Edition(cfg.Status.Edition),
|
||||
ocdav.MachineAuthAPIKey(cfg.MachineAuthAPIKey),
|
||||
ocdav.Broker(broker.NoOp{}),
|
||||
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation https://github.com/owncloud/ocis/issues/1228
|
||||
// ocdav.LockSystem(), // will default to the CS3 lock system
|
||||
// ocdav.TLSConfig() // tls config for the http server
|
||||
ocdav.MetricsEnabled(true),
|
||||
ocdav.MetricsNamespace("ocis"),
|
||||
ocdav.WithTraceProvider(traceProvider),
|
||||
ocdav.RegisterTTL(registry.GetRegisterTTL()),
|
||||
ocdav.RegisterInterval(registry.GetRegisterInterval()),
|
||||
ocdav.URLSigningSharedSecret(cfg.Commons.URLSigningSecret),
|
||||
}
|
||||
|
||||
s, err := ocdav.Service(opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// creating a runner for a go-micro service is a bit complex, so we'll
|
||||
// wrap the go-micro service with an ocis service the same way as
|
||||
// ocis-pkg/service/http is doing in order to reuse the factory.
|
||||
gr.Add(runner.NewGoMicroHttpServerRunner(cfg.Service.Name+".http", ohttp.Service{Service: s}))
|
||||
|
||||
debugServer, err := debug.Server(
|
||||
debug.Logger(logger),
|
||||
debug.Context(ctx),
|
||||
debug.Config(cfg),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
logger.Info().Err(err).Str("server", "debug").Msg("Failed to initialize server")
|
||||
return err
|
||||
}
|
||||
|
||||
gr.Add(runner.NewGolangHttpServerRunner(cfg.Service.Name+".debug", debugServer))
|
||||
|
||||
grResults := gr.Run(ctx)
|
||||
|
||||
// return the first non-nil error found in the results
|
||||
for _, grResult := range grResults {
|
||||
if grResult.RunnerError != nil {
|
||||
return grResult.RunnerError
|
||||
}
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/registry"
|
||||
"github.com/opencloud-eu/opencloud/pkg/version"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/olekukonko/tablewriter/tw"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// Version prints the service versions of all running instances.
|
||||
func Version(cfg *config.Config) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "print the version of this binary and the running service instances",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println("Version: " + version.GetString())
|
||||
fmt.Printf("Compiled: %s\n", version.Compiled())
|
||||
fmt.Println("")
|
||||
|
||||
reg := registry.GetRegistry()
|
||||
services, err := reg.GetService(cfg.HTTP.Namespace + "." + cfg.Service.Name)
|
||||
if err != nil {
|
||||
fmt.Println(fmt.Errorf("could not get %s services from the registry: %v", cfg.Service.Name, err))
|
||||
return err
|
||||
}
|
||||
|
||||
if len(services) == 0 {
|
||||
fmt.Println("No running " + cfg.Service.Name + " service found.")
|
||||
return nil
|
||||
}
|
||||
|
||||
table := tablewriter.NewTable(os.Stdout, tablewriter.WithHeaderAutoFormat(tw.Off))
|
||||
table.Header([]string{"Version", "Address", "Id"})
|
||||
for _, s := range services {
|
||||
for _, n := range s.Nodes {
|
||||
table.Append([]string{s.Version, n.Address, n.Id})
|
||||
}
|
||||
}
|
||||
table.Render()
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Commons *shared.Commons `yaml:"-"` // don't use this directly as configuration for a service
|
||||
Service Service `yaml:"-"`
|
||||
Log *Log `yaml:"log"`
|
||||
Debug Debug `yaml:"debug"`
|
||||
|
||||
HTTP HTTPConfig `yaml:"http"`
|
||||
|
||||
TokenManager *TokenManager `yaml:"token_manager"`
|
||||
Reva *shared.Reva `yaml:"reva"`
|
||||
|
||||
SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"OCDAV_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the loading of user's group memberships from the reva access token." introductionVersion:"1.0.0"`
|
||||
|
||||
WebdavNamespace string `yaml:"webdav_namespace" env:"OCDAV_WEBDAV_NAMESPACE" desc:"Jail requests to /dav/webdav into this CS3 namespace. Supports template layouting with CS3 User properties." introductionVersion:"1.0.0"`
|
||||
FilesNamespace string `yaml:"files_namespace" env:"OCDAV_FILES_NAMESPACE" desc:"Jail requests to /dav/files/{username} into this CS3 namespace. Supports template layouting with CS3 User properties." introductionVersion:"1.0.0"`
|
||||
SharesNamespace string `yaml:"shares_namespace" env:"OCDAV_SHARES_NAMESPACE" desc:"The human readable path for the share jail. Relative to a users personal space root. Upcased intentionally." introductionVersion:"1.0.0"`
|
||||
OCMNamespace string `yaml:"ocm_namespace" env:"OCDAV_OCM_NAMESPACE" desc:"The human readable path prefix for the ocm shares." introductionVersion:"1.0.0"`
|
||||
// PublicURL used to redirect /s/{token} URLs to
|
||||
PublicURL string `yaml:"public_url" env:"OC_URL;OCDAV_PUBLIC_URL" desc:"URL where OpenCloud is reachable for users." introductionVersion:"1.0.0"`
|
||||
|
||||
// Insecure certificates allowed when making requests to the gateway
|
||||
Insecure bool `yaml:"insecure" env:"OC_INSECURE;OCDAV_INSECURE" desc:"Allow insecure connections to the GATEWAY service." introductionVersion:"1.0.0"`
|
||||
// Timeout in seconds when making requests to the gateway
|
||||
Timeout int64 `yaml:"gateway_request_timeout" env:"OCDAV_GATEWAY_REQUEST_TIMEOUT" desc:"Request timeout in seconds for requests from the oCDAV service to the GATEWAY service." introductionVersion:"1.0.0"`
|
||||
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OC_MACHINE_AUTH_API_KEY;OCDAV_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"1.0.0"`
|
||||
|
||||
Context context.Context `yaml:"-"`
|
||||
Status Status `yaml:"-"`
|
||||
|
||||
AllowPropfindDepthInfinity bool `yaml:"allow_propfind_depth_infinity" env:"OCDAV_ALLOW_PROPFIND_DEPTH_INFINITY" desc:"Allow the use of depth infinity in PROPFINDS. When enabled, a propfind will traverse through all subfolders. If many subfolders are expected, depth infinity can cause heavy server load and/or delayed response times." introductionVersion:"1.0.0"`
|
||||
}
|
||||
|
||||
type Log struct {
|
||||
Level string `yaml:"level" env:"OC_LOG_LEVEL;OCDAV_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"1.0.0"`
|
||||
Pretty bool `yaml:"pretty" env:"OC_LOG_PRETTY;OCDAV_LOG_PRETTY" desc:"Activates pretty log output." introductionVersion:"1.0.0"`
|
||||
Color bool `yaml:"color" env:"OC_LOG_COLOR;OCDAV_LOG_COLOR" desc:"Activates colorized log output." introductionVersion:"1.0.0"`
|
||||
File string `yaml:"file" env:"OC_LOG_FILE;OCDAV_LOG_FILE" desc:"The path to the log file. Activates logging to this file if set." introductionVersion:"1.0.0"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
Name string `yaml:"-"`
|
||||
}
|
||||
|
||||
type Debug struct {
|
||||
Addr string `yaml:"addr" env:"OCDAV_DEBUG_ADDR" desc:"Bind address of the debug server, where metrics, health, config and debug endpoints will be exposed." introductionVersion:"1.0.0"`
|
||||
Token string `yaml:"token" env:"OCDAV_DEBUG_TOKEN" desc:"Token to secure the metrics endpoint." introductionVersion:"1.0.0"`
|
||||
Pprof bool `yaml:"pprof" env:"OCDAV_DEBUG_PPROF" desc:"Enables pprof, which can be used for profiling." introductionVersion:"1.0.0"`
|
||||
Zpages bool `yaml:"zpages" env:"OCDAV_DEBUG_ZPAGES" desc:"Enables zpages, which can be used for collecting and viewing in-memory traces." introductionVersion:"1.0.0"`
|
||||
}
|
||||
|
||||
type HTTPConfig struct {
|
||||
Addr string `yaml:"addr" env:"OCDAV_HTTP_ADDR" desc:"The bind address of the HTTP service." introductionVersion:"1.0.0"`
|
||||
Namespace string `yaml:"-"`
|
||||
Protocol string `yaml:"protocol" env:"OCDAV_HTTP_PROTOCOL" desc:"The transport protocol of the HTTP service." introductionVersion:"1.0.0"`
|
||||
Prefix string `yaml:"prefix" env:"OCDAV_HTTP_PREFIX" desc:"A URL path prefix for the handler." introductionVersion:"1.0.0"`
|
||||
CORS `yaml:"cors"`
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
type CORS struct {
|
||||
AllowedOrigins []string `yaml:"allow_origins" env:"OC_CORS_ALLOW_ORIGINS;OCDAV_CORS_ALLOW_ORIGINS" desc:"A list of allowed CORS origins. See following chapter for more details: *Access-Control-Allow-Origin* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"`
|
||||
AllowedMethods []string `yaml:"allow_methods" env:"OC_CORS_ALLOW_METHODS;OCDAV_CORS_ALLOW_METHODS" desc:"A list of allowed CORS methods. See following chapter for more details: *Access-Control-Request-Method* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"`
|
||||
AllowedHeaders []string `yaml:"allow_headers" env:"OC_CORS_ALLOW_HEADERS;OCDAV_CORS_ALLOW_HEADERS" desc:"A list of allowed CORS headers. See following chapter for more details: *Access-Control-Request-Headers* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers. See the Environment Variable Types description for more details." introductionVersion:"1.0.0"`
|
||||
AllowCredentials bool `yaml:"allow_credentials" env:"OC_CORS_ALLOW_CREDENTIALS;OCDAV_CORS_ALLOW_CREDENTIALS" desc:"Allow credentials for CORS.See following chapter for more details: *Access-Control-Allow-Credentials* at https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials." introductionVersion:"1.0.0"`
|
||||
}
|
||||
|
||||
// Status holds the configurable values for the status.php
|
||||
type Status struct {
|
||||
Version string
|
||||
VersionString string
|
||||
Product string
|
||||
ProductName string
|
||||
ProductVersion string
|
||||
Edition string `desc:"Edition of OpenCloud. Used for branding purposes." introductionVersion:"1.0.0"`
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package defaults
|
||||
|
||||
import (
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
"github.com/opencloud-eu/opencloud/pkg/structs"
|
||||
"github.com/opencloud-eu/opencloud/pkg/version"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
)
|
||||
|
||||
// FullDefaultConfig returns a fully initialized default configuration
|
||||
func FullDefaultConfig() *config.Config {
|
||||
cfg := DefaultConfig()
|
||||
EnsureDefaults(cfg)
|
||||
Sanitize(cfg)
|
||||
return cfg
|
||||
}
|
||||
|
||||
// DefaultConfig returns a basic default configuration
|
||||
func DefaultConfig() *config.Config {
|
||||
return &config.Config{
|
||||
Debug: config.Debug{
|
||||
Addr: "127.0.0.1:9163",
|
||||
Token: "",
|
||||
Pprof: false,
|
||||
Zpages: false,
|
||||
},
|
||||
HTTP: config.HTTPConfig{
|
||||
Addr: "127.0.0.1:9350",
|
||||
Namespace: "eu.opencloud.web",
|
||||
Protocol: "tcp",
|
||||
Prefix: "",
|
||||
CORS: config.CORS{
|
||||
AllowedOrigins: []string{"https://localhost:9200"},
|
||||
AllowedMethods: []string{
|
||||
"OPTIONS",
|
||||
"HEAD",
|
||||
"GET",
|
||||
"PUT",
|
||||
"POST",
|
||||
"DELETE",
|
||||
"MKCOL",
|
||||
"PROPFIND",
|
||||
"PROPPATCH",
|
||||
"MOVE",
|
||||
"COPY",
|
||||
"REPORT",
|
||||
"SEARCH",
|
||||
},
|
||||
AllowedHeaders: []string{
|
||||
"Origin",
|
||||
"Accept",
|
||||
"Content-Type",
|
||||
"Depth",
|
||||
"Authorization",
|
||||
"Ocs-Apirequest",
|
||||
"If-None-Match",
|
||||
"If-Match",
|
||||
"Destination",
|
||||
"Overwrite",
|
||||
"X-Request-Id",
|
||||
"X-Requested-With",
|
||||
"Tus-Resumable",
|
||||
"Tus-Checksum-Algorithm",
|
||||
"Upload-Concat",
|
||||
"Upload-Length",
|
||||
"Upload-Metadata",
|
||||
"Upload-Defer-Length",
|
||||
"Upload-Expires",
|
||||
"Upload-Checksum",
|
||||
"Upload-Offset",
|
||||
"X-HTTP-Method-Override",
|
||||
"Cache-Control",
|
||||
},
|
||||
AllowCredentials: false,
|
||||
},
|
||||
},
|
||||
Service: config.Service{
|
||||
Name: "ocdav",
|
||||
},
|
||||
Reva: shared.DefaultRevaConfig(),
|
||||
WebdavNamespace: "/users/{{.Id.OpaqueId}}",
|
||||
FilesNamespace: "/users/{{.Id.OpaqueId}}",
|
||||
SharesNamespace: "/Shares",
|
||||
OCMNamespace: "/public",
|
||||
PublicURL: "https://localhost:9200",
|
||||
Insecure: false,
|
||||
Timeout: 84300,
|
||||
MachineAuthAPIKey: "",
|
||||
Status: config.Status{
|
||||
Version: version.Legacy,
|
||||
VersionString: version.LegacyString,
|
||||
ProductVersion: version.GetString(),
|
||||
Product: "OpenCloud",
|
||||
ProductName: "OpenCloud",
|
||||
Edition: version.Edition,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// EnsureDefaults adds default values to the configuration if they are not set yet
|
||||
func EnsureDefaults(cfg *config.Config) {
|
||||
// provide with defaults for shared logging, since we need a valid destination address for "envdecode".
|
||||
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
||||
cfg.Log = &config.Log{
|
||||
Level: cfg.Commons.Log.Level,
|
||||
Pretty: cfg.Commons.Log.Pretty,
|
||||
Color: cfg.Commons.Log.Color,
|
||||
File: cfg.Commons.Log.File,
|
||||
}
|
||||
} else if cfg.Log == nil {
|
||||
cfg.Log = &config.Log{}
|
||||
}
|
||||
|
||||
if cfg.Reva == nil && cfg.Commons != nil {
|
||||
cfg.Reva = structs.CopyOrZeroValue(cfg.Commons.Reva)
|
||||
}
|
||||
|
||||
if cfg.TokenManager == nil && cfg.Commons != nil && cfg.Commons.TokenManager != nil {
|
||||
cfg.TokenManager = &config.TokenManager{
|
||||
JWTSecret: cfg.Commons.TokenManager.JWTSecret,
|
||||
}
|
||||
} else if cfg.TokenManager == nil {
|
||||
cfg.TokenManager = &config.TokenManager{}
|
||||
}
|
||||
|
||||
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||
}
|
||||
|
||||
if (cfg.Commons != nil && cfg.Commons.OpenCloudURL != "") &&
|
||||
(cfg.HTTP.CORS.AllowedOrigins == nil ||
|
||||
len(cfg.HTTP.CORS.AllowedOrigins) == 1 &&
|
||||
cfg.HTTP.CORS.AllowedOrigins[0] == "https://localhost:9200") {
|
||||
cfg.HTTP.CORS.AllowedOrigins = []string{cfg.Commons.OpenCloudURL}
|
||||
}
|
||||
}
|
||||
|
||||
// Sanitize sanitizes the configuration
|
||||
func Sanitize(cfg *config.Config) {
|
||||
// nothing to sanitize here atm
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package parser
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
occfg "github.com/opencloud-eu/opencloud/pkg/config"
|
||||
"github.com/opencloud-eu/opencloud/pkg/shared"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config/defaults"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/config/envdecode"
|
||||
)
|
||||
|
||||
// ParseConfig loads configuration from known paths.
|
||||
func ParseConfig(cfg *config.Config) error {
|
||||
err := occfg.BindSourcesToStructs(cfg.Service.Name, cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defaults.EnsureDefaults(cfg)
|
||||
|
||||
// load all env variables relevant to the config in the current context.
|
||||
if err := envdecode.Decode(cfg); err != nil {
|
||||
// no environment variable set for this config is an expected "error"
|
||||
if !errors.Is(err, envdecode.ErrNoTargetFieldsAreSet) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
defaults.Sanitize(cfg)
|
||||
|
||||
return Validate(cfg)
|
||||
}
|
||||
|
||||
func Validate(cfg *config.Config) error {
|
||||
if cfg.TokenManager.JWTSecret == "" {
|
||||
return shared.MissingJWTTokenError(cfg.Service.Name)
|
||||
}
|
||||
|
||||
if cfg.MachineAuthAPIKey == "" {
|
||||
return shared.MissingMachineAuthApiKeyError(cfg.Service.Name)
|
||||
}
|
||||
|
||||
if cfg.Commons.URLSigningSecret == "" {
|
||||
return shared.MissingURLSigningSecret(cfg.Service.Name)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package config
|
||||
|
||||
// TokenManager is the config for using the reva token manager
|
||||
type TokenManager struct {
|
||||
JWTSecret string `yaml:"jwt_secret" env:"OC_JWT_SECRET;OCDAV_JWT_SECRET" desc:"The secret to mint and validate jwt tokens." introductionVersion:"1.0.0"`
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
)
|
||||
|
||||
// Configure initializes a service-specific logger instance.
|
||||
func Configure(name string, cfg *config.Log) log.Logger {
|
||||
return log.NewLogger(
|
||||
log.Name(name),
|
||||
log.Level(cfg.Level),
|
||||
log.Pretty(cfg.Pretty),
|
||||
log.Color(cfg.Color),
|
||||
log.File(cfg.File),
|
||||
)
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package debug
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/log"
|
||||
"github.com/opencloud-eu/opencloud/services/ocdav/pkg/config"
|
||||
)
|
||||
|
||||
// Option defines a single option function.
|
||||
type Option func(o *Options)
|
||||
|
||||
// Options defines the available options for this package.
|
||||
type Options struct {
|
||||
Logger log.Logger
|
||||
Context context.Context
|
||||
Config *config.Config
|
||||
}
|
||||
|
||||
// newOptions initializes the available default options.
|
||||
func newOptions(opts ...Option) Options {
|
||||
opt := Options{}
|
||||
|
||||
for _, o := range opts {
|
||||
o(&opt)
|
||||
}
|
||||
|
||||
return opt
|
||||
}
|
||||
|
||||
// Logger provides a function to set the logger option.
|
||||
func Logger(val log.Logger) Option {
|
||||
return func(o *Options) {
|
||||
o.Logger = val
|
||||
}
|
||||
}
|
||||
|
||||
// Context provides a function to set the context option.
|
||||
func Context(val context.Context) Option {
|
||||
return func(o *Options) {
|
||||
o.Context = val
|
||||
}
|
||||
}
|
||||
|
||||
// Config provides a function to set the config option.
|
||||
func Config(val *config.Config) Option {
|
||||
return func(o *Options) {
|
||||
o.Config = val
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package debug
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/pkg/service/debug"
|
||||
"github.com/opencloud-eu/opencloud/pkg/version"
|
||||
)
|
||||
|
||||
// Server initializes the debug service and server.
|
||||
func Server(opts ...Option) (*http.Server, error) {
|
||||
options := newOptions(opts...)
|
||||
|
||||
return debug.NewService(
|
||||
debug.Logger(options.Logger),
|
||||
debug.Name(options.Config.Service.Name),
|
||||
debug.Version(version.GetString()),
|
||||
debug.Address(options.Config.Debug.Addr),
|
||||
debug.Token(options.Config.Debug.Token),
|
||||
debug.Pprof(options.Config.Debug.Pprof),
|
||||
debug.Zpages(options.Config.Debug.Zpages),
|
||||
//debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins),
|
||||
//debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods),
|
||||
//debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders),
|
||||
//debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials),
|
||||
), nil
|
||||
}
|
||||
@@ -28,7 +28,7 @@ policies:
|
||||
- endpoint: /
|
||||
service: eu.opencloud.web.web
|
||||
- endpoint: /dav/
|
||||
service: eu.opencloud.web.ocdav
|
||||
service: eu.opencloud.web.frontend
|
||||
```
|
||||
|
||||
For adding _additional_ routes to the default routes use:
|
||||
|
||||
@@ -223,33 +223,33 @@ func DefaultPolicies() []config.Policy {
|
||||
},
|
||||
{
|
||||
Endpoint: "/remote.php/",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
},
|
||||
{
|
||||
Endpoint: "/dav/",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
},
|
||||
{
|
||||
Endpoint: "/webdav/",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
},
|
||||
{
|
||||
Endpoint: "/status",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
Unprotected: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/status.php",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
Unprotected: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/index.php/",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
},
|
||||
{
|
||||
Endpoint: "/apps/",
|
||||
Service: "eu.opencloud.web.ocdav",
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
},
|
||||
{
|
||||
Endpoint: "/data",
|
||||
@@ -262,7 +262,7 @@ func DefaultPolicies() []config.Policy {
|
||||
Unprotected: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/app/", // /app or /apps? ocdav only handles /apps
|
||||
Endpoint: "/app/", // /app or /apps? frontend only handles /apps
|
||||
Service: "eu.opencloud.web.frontend",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -271,7 +272,11 @@ func (rt Router) regexRouteMatcher(pattern string, target url.URL) bool {
|
||||
}
|
||||
|
||||
func prefixRouteMatcher(prefix string, target url.URL) bool {
|
||||
return strings.HasPrefix(target.Path, prefix) && prefix != "/"
|
||||
cleanTarget := path.Clean(target.Path)
|
||||
if strings.HasSuffix(target.Path, "/") {
|
||||
cleanTarget += "/"
|
||||
}
|
||||
return strings.HasPrefix(cleanTarget, prefix) && prefix != "/"
|
||||
}
|
||||
|
||||
func singleJoiningSlash(a, b string) string {
|
||||
@@ -288,7 +293,7 @@ func singleJoiningSlash(a, b string) string {
|
||||
|
||||
func queryRouteMatcher(endpoint string, target url.URL) bool {
|
||||
u, _ := url.Parse(endpoint)
|
||||
if !strings.HasPrefix(target.Path, u.Path) || endpoint == "/" {
|
||||
if !strings.HasPrefix(path.Clean(target.Path), u.Path) || endpoint == "/" {
|
||||
return false
|
||||
}
|
||||
q := u.Query()
|
||||
|
||||
@@ -127,7 +127,7 @@ func TestRouter(t *testing.T) {
|
||||
Name: "default",
|
||||
Routes: []config.Route{
|
||||
{Type: config.PrefixRoute, Endpoint: "/web/unprotected/demo/", Backend: "http://web", Unprotected: true},
|
||||
{Type: config.PrefixRoute, Endpoint: "/dav", Backend: "http://ocdav"},
|
||||
{Type: config.PrefixRoute, Endpoint: "/dav", Backend: "http://frontend"},
|
||||
{Type: config.PrefixRoute, Method: "REPORT", Endpoint: "/dav", Backend: "http://opencloud-webdav"},
|
||||
},
|
||||
},
|
||||
@@ -138,7 +138,7 @@ func TestRouter(t *testing.T) {
|
||||
router := New(sel, policySelectorCfg, policies, log.NewLogger())
|
||||
|
||||
table := []matchertest{
|
||||
{method: "PROPFIND", endpoint: "/dav/files/demo/", target: "ocdav"},
|
||||
{method: "PROPFIND", endpoint: "/dav/files/demo/", target: "frontend"},
|
||||
{method: "REPORT", endpoint: "/dav/files/demo/", target: "opencloud-webdav"},
|
||||
{method: "GET", endpoint: "/web/unprotected/demo/", target: "web", unprotected: true},
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ This service is part of the storage services family and is responsible for:
|
||||
|
||||
The storage-publiclink service integrates with:
|
||||
- `sharing` service - Manages and persists public link shares
|
||||
- `frontend` and `ocdav` - Provide HTTP/WebDAV access to public links
|
||||
- `frontend` service - Provides HTTP/WebDAV access to public links
|
||||
- Storage drivers - Accesses the actual file content
|
||||
|
||||
## Storage Registry
|
||||
|
||||
@@ -13,7 +13,7 @@ This service is part of the storage services family and is responsible for:
|
||||
The storage-shares service integrates with:
|
||||
- `sharing` service - Manages and persists shares
|
||||
- `storage-users` service - Accesses the underlying file content
|
||||
- `frontend` and `ocdav` - Provide HTTP/WebDAV access to shares
|
||||
- `frontend` service - Provides HTTP/WebDAV access to shares
|
||||
|
||||
## Virtual Shares Folder
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Webdav
|
||||
|
||||
The webdav service, like the [ocdav](../ocdav) service, provides a HTTP API following the webdav protocol. It receives HTTP calls from requestors like clients and issues gRPC calls to other services executing these requests. After the called service has finished the request, the webdav service will render their responses in `xml` and sends them back to the requestor.
|
||||
The webdav service, like the [frontend](../frontend) service, provides a HTTP API following the webdav protocol. It receives HTTP calls from requestors like clients and issues gRPC calls to other services executing these requests. After the called service has finished the request, the webdav service will render their responses in `xml` and sends them back to the requestor.
|
||||
|
||||
## Endpoints Overview
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
#### [Readiness check for some services returns 500 status code](https://github.com/owncloud/ocis/issues/10661)
|
||||
|
||||
- [apiServiceAvailability/serviceAvailabilityCheck.feature:125](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiServiceAvailability/serviceAvailabilityCheck.feature#L125)
|
||||
- [apiServiceAvailability/serviceAvailabilityCheck.feature:123](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiServiceAvailability/serviceAvailabilityCheck.feature#L123)
|
||||
|
||||
#### [Skip tests for different languages](https://github.com/opencloud-eu/opencloud/issues/183)
|
||||
- [apiActivities/activities.feature:2598](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiActivities/activities.feature#L2598)
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
#### [Readiness check for some services returns 500 status code](https://github.com/owncloud/ocis/issues/10661)
|
||||
|
||||
- [apiServiceAvailability/serviceAvailabilityCheck.feature:125](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiServiceAvailability/serviceAvailabilityCheck.feature#L125)
|
||||
- [apiServiceAvailability/serviceAvailabilityCheck.feature:123](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiServiceAvailability/serviceAvailabilityCheck.feature#L123)
|
||||
|
||||
#### [Skip tests for different languages](https://github.com/opencloud-eu/opencloud/issues/183)
|
||||
- [apiActivities/activities.feature:2598](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiActivities/activities.feature#L2598)
|
||||
|
||||
@@ -19,7 +19,6 @@ Feature: service health check
|
||||
| http://%base_url_hostname%:9239/healthz | idm |
|
||||
| http://%base_url_hostname%:9134/healthz | idp |
|
||||
| http://%base_url_hostname%:9234/healthz | nats |
|
||||
| http://%base_url_hostname%:9163/healthz | ocdav |
|
||||
| http://%base_url_hostname%:9281/healthz | ocm |
|
||||
| http://%base_url_hostname%:9114/healthz | ocs |
|
||||
| http://%base_url_hostname%:9255/healthz | postprocessing |
|
||||
@@ -74,7 +73,6 @@ Feature: service health check
|
||||
| http://%base_url_hostname%:9161/readyz | groups |
|
||||
| http://%base_url_hostname%:9239/readyz | idm |
|
||||
| http://%base_url_hostname%:9234/readyz | nats |
|
||||
| http://%base_url_hostname%:9163/readyz | ocdav |
|
||||
| http://%base_url_hostname%:9281/readyz | ocm |
|
||||
| http://%base_url_hostname%:9114/readyz | ocs |
|
||||
| http://%base_url_hostname%:9255/readyz | postprocessing |
|
||||
|
||||
@@ -20,7 +20,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//files/%username%/PARENT/parent.txt |
|
||||
| /webdav//PARENT |
|
||||
| //dav/files/%username%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,200,204,204,200" on OpenCloud or "204,204,204,204,204" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "204"
|
||||
|
||||
|
||||
Scenario: send DELETE requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -30,7 +30,7 @@ Feature: make webdav request with special urls
|
||||
| //dav//spaces/%spaceid%/PARENT/parent.txt |
|
||||
| /dav//spaces/%spaceid%/PARENT |
|
||||
| //dav/spaces/%spaceid%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,200,204,200" on OpenCloud or "204,204,204,204" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "204"
|
||||
|
||||
|
||||
Scenario: send GET requests to webDav endpoints with 2 slashes
|
||||
@@ -84,7 +84,7 @@ Feature: make webdav request with special urls
|
||||
| //dav//files/%username%/PARENT4 |
|
||||
| /dav/files/%username%//PARENT5 |
|
||||
| /dav//files/%username%/PARENT6 |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,201,200,200,201,201" on OpenCloud or "201,201,201,201,201,201" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "201"
|
||||
|
||||
|
||||
Scenario: send MKCOL requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -96,7 +96,7 @@ Feature: make webdav request with special urls
|
||||
| //dav/spaces//%spaceid%/PARENT4 |
|
||||
| /dav/spaces/%spaceid%//PARENT5 |
|
||||
| /dav//spaces/%spaceid%/PARENT6 |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,201,200,200,201,201" on OpenCloud or "201,201,201,201,201,201" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "201"
|
||||
|
||||
|
||||
Scenario: send MOVE requests to webDav endpoints with 2 slashes
|
||||
@@ -107,7 +107,7 @@ Feature: make webdav request with special urls
|
||||
| /webdav//PARENT | /webdav/PARENT1 |
|
||||
| //dav/files//%username%//PARENT1 | /dav/files/%username%/PARENT2 |
|
||||
| /dav//files/%username%/PARENT2/parent.txt | /dav/files/%username%/PARENT2/parent1.txt |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,201,201,200,404" on OpenCloud or "201,201,201,201,201" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "201"
|
||||
|
||||
|
||||
Scenario: send MOVE requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -117,7 +117,7 @@ Feature: make webdav request with special urls
|
||||
| /dav/spaces/%spaceid%//PARENT | /dav/spaces/%spaceid%/PARENT1 |
|
||||
| //dav/spaces/%spaceid%//PARENT1 | /dav/spaces/%spaceid%/PARENT2 |
|
||||
| //dav/spaces/%spaceid%/PARENT2/parent.txt | /dav/spaces/%spaceid%/PARENT2/parent1.txt |
|
||||
Then the HTTP status code of responses on each endpoint should be "201,201,200,200" on OpenCloud or "201,201,201,201" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "201"
|
||||
|
||||
|
||||
Scenario: send POST requests to webDav endpoints with 2 slashes
|
||||
@@ -128,7 +128,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//files/%username%/PARENT/parent.txt |
|
||||
| /webdav//PARENT |
|
||||
| //dav/files//%username%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,200,412,412,200" respectively
|
||||
Then the HTTP status code of responses on all endpoints should be "412"
|
||||
|
||||
|
||||
Scenario: send POST requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -138,7 +138,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//spaces/%spaceid%/PARENT/parent.txt |
|
||||
| /dav//spaces/%spaceid%/PARENT |
|
||||
| //dav//spaces/%spaceid%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,412,412,200" respectively
|
||||
Then the HTTP status code of responses on all endpoints should be "412"
|
||||
|
||||
|
||||
Scenario: send PROPFIND requests to webDav endpoints with 2 slashes
|
||||
@@ -149,7 +149,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//files/%username%/PARENT/parent.txt |
|
||||
| /webdav//PARENT |
|
||||
| //dav/files//%username%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,200,207,207,200" on OpenCloud or "207,207,207,207,207" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "207"
|
||||
|
||||
|
||||
Scenario: send PROPFIND requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -159,7 +159,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//spaces/%spaceid%/PARENT/parent.txt |
|
||||
| /dav//spaces/%spaceid%/PARENT |
|
||||
| //dav/spaces//%spaceid%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,207,207,200" on OpenCloud or "207,207,207,207" on reva
|
||||
Then the HTTP status code of responses on all endpoints should be "207"
|
||||
|
||||
|
||||
Scenario: send PROPPATCH requests to webDav endpoints with 2 slashes
|
||||
@@ -170,7 +170,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//files/%username%/PARENT/parent.txt |
|
||||
| /webdav//PARENT |
|
||||
| //dav//files/%username%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,200,400,400,200" respectively
|
||||
Then the HTTP status code of responses on all endpoints should be "400"
|
||||
|
||||
|
||||
Scenario: send PROPPATCH requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -180,7 +180,7 @@ Feature: make webdav request with special urls
|
||||
| /dav//spaces/%spaceid%/PARENT/parent.txt |
|
||||
| /dav//spaces/%spaceid%/PARENT |
|
||||
| //dav/spaces//%spaceid%//FOLDER |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,400,400,200" respectively
|
||||
Then the HTTP status code of responses on all endpoints should be "400"
|
||||
|
||||
|
||||
Scenario: send PUT requests to webDav endpoints with 2 slashes
|
||||
@@ -191,7 +191,7 @@ Feature: make webdav request with special urls
|
||||
| //dav//files/%username%/textfile1.txt |
|
||||
| /dav/files//%username%/textfile7.txt |
|
||||
| //dav//files/%username%/PARENT//parent.txt |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,204,200,201,200" on OpenCloud or "204,204,204,201,204" on reva
|
||||
Then the HTTP status code of responses on each endpoint should be "204,204,204,201,204" respectively
|
||||
|
||||
|
||||
Scenario: send PUT requests to webDav endpoints with 2 slashes using the spaces WebDAV API
|
||||
@@ -202,4 +202,4 @@ Feature: make webdav request with special urls
|
||||
| //dav//spaces/%spaceid%/textfile1.txt |
|
||||
| /dav/spaces//%spaceid%/textfile7.txt |
|
||||
| //dav/spaces//%spaceid%/PARENT//parent.txt |
|
||||
Then the HTTP status code of responses on each endpoint should be "200,204,200,201,200" on OpenCloud or "204,204,204,201,204" on reva
|
||||
Then the HTTP status code of responses on each endpoint should be "204,204,204,201,204" respectively
|
||||
|
||||
@@ -45,8 +45,6 @@ export IDP_DEBUG_ADDR=127.0.0.1:10134
|
||||
export IDP_HTTP_ADDR=127.0.0.1:10130
|
||||
export NATS_DEBUG_ADDR=127.0.0.1:10234
|
||||
export NATS_NATS_PORT=10233
|
||||
export OCDAV_HTTP_ADDR=127.0.0.1:10350
|
||||
export OCDAV_DEBUG_ADDR=127.0.0.1:10163
|
||||
export OCM_DEBUG_ADDR=127.0.0.1:10281
|
||||
export OCM_HTTP_ADDR=127.0.0.1:10280
|
||||
export OCM_GRPC_ADDR=127.0.0.1:10282
|
||||
|
||||
Reference in New Issue
Block a user