WebDAV Service Configuration

Introduction

The WebDAV service, like the 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. Also see the ocdav service.

Default Values

  • WebDav listens on port 9115 by default.

Endpoints Overview

Currently, the webdav service handles request for two functionalities, which are for the Thumbnails and Search service.

Thumbnails Service

The webdav service provides various GET endpoints to get the thumbnails of a file in authenticated and unauthenticated contexts. It also provides thumbnails for spaces on different endpoints.

See the thumbnails service for more information about thumbnails.

Search Service

The webdav service provides access to the search functionality. It offers multiple REPORT endpoints for getting search results.

See the search service for more details about the search functionality.

Scalability

The webdav service does not persist any data and does not cache any information. Therefore multiple instances of this service can be spawned in a bigger deployment like when using container orchestration with Kubernetes, without any extra configuration.

Configuration

Environment Variables

The webdav service is configured via the following environment variables. Read the Environment Variable Types documentation for important details.

  • 4.0.5

Environment variables for the webdav service
Name Type Default Value Description

OCIS_TRACING_ENABLED
WEBDAV_TRACING_ENABLED

bool

false

Activates tracing.

OCIS_TRACING_TYPE
WEBDAV_TRACING_TYPE

string

The type of tracing. Defaults to '', which is the same as 'jaeger'. Allowed tracing types are 'jaeger' and '' as of now.

OCIS_TRACING_ENDPOINT
WEBDAV_TRACING_ENDPOINT

string

The endpoint of the tracing agent.

OCIS_TRACING_COLLECTOR
WEBDAV_TRACING_COLLECTOR

string

The HTTP endpoint for sending spans directly to a collector, i.e. http://jaeger-collector:14268/api/traces. Only used if the tracing endpoint is unset.

OCIS_LOG_LEVEL
WEBDAV_LOG_LEVEL

string

The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'.

OCIS_LOG_PRETTY
WEBDAV_LOG_PRETTY

bool

false

Activates pretty log output.

OCIS_LOG_COLOR
WEBDAV_LOG_COLOR

bool

false

Activates colorized log output.

OCIS_LOG_FILE
WEBDAV_LOG_FILE

string

The path to the log file. Activates logging to this file if set.

WEBDAV_DEBUG_ADDR

string

127.0.0.1:9119

Bind address of the debug server, where metrics, health, config and debug endpoints will be exposed.

WEBDAV_DEBUG_TOKEN

string

Token to secure the metrics endpoint.

WEBDAV_DEBUG_PPROF

bool

false

Enables pprof, which can be used for profiling.

WEBDAV_DEBUG_ZPAGES

bool

false

Enables zpages, which can be used for collecting and viewing in-memory traces.

WEBDAV_HTTP_ADDR

string

127.0.0.1:9115

The bind address of the HTTP service.

WEBDAV_HTTP_ROOT

string

/

Subdirectory that serves as the root for this HTTP service.

OCIS_CORS_ALLOW_ORIGINS
WEBDAV_CORS_ALLOW_ORIGINS

[]string

[*]

A comma-separated 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

OCIS_CORS_ALLOW_METHODS
WEBDAV_CORS_ALLOW_METHODS

[]string

[GET POST PUT PATCH DELETE OPTIONS]

A comma-separated 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

OCIS_CORS_ALLOW_HEADERS
WEBDAV_CORS_ALLOW_HEADERS

[]string

[Authorization Origin Content-Type Accept X-Requested-With X-Request-Id Cache-Control]

A blank or comma-separated 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.

OCIS_CORS_ALLOW_CREDENTIALS
WEBDAV_CORS_ALLOW_CREDENTIALS

bool

true

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.

OCIS_HTTP_TLS_ENABLED

bool

false

Activates TLS for the http based services using the server certifcate and key configured via OCIS_HTTP_TLS_CERTIFICATE and OCIS_HTTP_TLS_KEY. If OCIS_HTTP_TLS_CERTIFICATE is not set a temporary server certificate is generated - to be used with PROXY_INSECURE_BACKEND=true.

OCIS_HTTP_TLS_CERTIFICATE

string

Path/File name of the TLS server certificate (in PEM format) for the http services.

OCIS_HTTP_TLS_KEY

string

Path/File name for the TLS certificate key (in PEM format) for the server certificate to use for the http services.

OCIS_DISABLE_PREVIEWS
WEBDAV_DISABLE_PREVIEWS

bool

false

Set this option to 'true' to disable rendering of thumbnails triggered via webdav access. Note that when disabled, all access to preview related webdav paths will return a 404.

OCIS_URL
OCIS_PUBLIC_URL

string

https://127.0.0.1:9200

URL, where oCIS is reachable for users.

WEBDAV_WEBDAV_NAMESPACE

string

/users/{{.Id.OpaqueId}}

CS3 path layout to use when forwarding /webdav requests

OCIS_REVA_GATEWAY

string

com.owncloud.api.gateway

CS3 gateway used to look up user metadata

OCIS_REVA_GATEWAY_TLS_MODE

string

TLS mode for grpc connection to the CS3 gateway endpoint. Possible values are 'off', 'insecure' and 'on'. 'off': disables transport security for the clients. 'insecure' allows using transport security, but disables certificate verification (to be used with the autogenerated self-signed certificates). 'on' enables transport security, including server certificate verification.

OCIS_REVA_GATEWAY_TLS_CACERT

string

The root CA certificate used to validate the gateway’s TLS certificate.

YAML Example

Note that the filename shown below has been chosen on purpose.
See the Configuration File Naming for details when setting up your own configuration.

  • 4.0.5

# Autogenerated
# Filename: webdav-config-example.yaml

tracing:
  enabled: false
  type: ""
  endpoint: ""
  collector: ""
log:
  level: ""
  pretty: false
  color: false
  file: ""
debug:
  addr: 127.0.0.1:9119
  token: ""
  pprof: false
  zpages: false
grpc_client_tls: null
http:
  addr: 127.0.0.1:9115
  root: /
  cors:
    allow_origins:
    - '*'
    allow_methods:
    - GET
    - POST
    - PUT
    - PATCH
    - DELETE
    - OPTIONS
    allow_headers:
    - Authorization
    - Origin
    - Content-Type
    - Accept
    - X-Requested-With
    - X-Request-Id
    - Cache-Control
    allow_credentials: true
  tls:
    enabled: false
    cert: ""
    key: ""
disablePreviews: false
ocis_public_url: https://127.0.0.1:9200
webdav_namespace: /users/{{.Id.OpaqueId}}
reva_gateway: com.owncloud.api.gateway
reva_gateway_tls_mode: ""
reva_gateway_tls_cacert: ""