From eddc99cefa82b2878464cd0bbeba4d15dff5b8fc Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Thu, 31 Oct 2024 10:06:08 +0800 Subject: [PATCH] feat: webdav add docker --- manual/extension/webdav.md | 84 +++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/manual/extension/webdav.md b/manual/extension/webdav.md index 5ab1a9eb..232615dd 100644 --- a/manual/extension/webdav.md +++ b/manual/extension/webdav.md @@ -35,7 +35,7 @@ Every time the configuration is modified, you need to restart seafile server to ``` -Your WebDAV client would visit the Seafile WebDAV server at `http://example.com:8080/seafdav` +Your WebDAV client would visit the Seafile WebDAV server at `http{s}://example.com/seafdav` In Pro edition 7.1.8 version and community edition 7.1.5, an option is added to append library ID to the library name returned by SeafDAV. @@ -47,47 +47,63 @@ show_repo_id=true ## Proxy -=== "Nginx" - - For Seafdav, the configuration of Nginx is as follows: - +=== "Deploy in Docker" + Modify `seafile-server.yml` + ```yml + services: + ... + seafile: + ... + labels: + caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty} + caddy.0_reverse_proxy: "{{upstreams 80}}" + caddy.1_handle_path: /seafdav/* + caddy.1_handle_path.0_rewrite: "* /seafdav{uri}" + caddy.1_handle_path.1_reverse_proxy: "{{upstreams 8080}}" + ... ``` - ..... +=== "Deploy from binary packages" + === "Nginx" - location /seafdav { - rewrite ^/seafdav$ /seafdav/ permanent; - } + For Seafdav, the configuration of Nginx is as follows: - location /seafdav/ { - proxy_pass http://127.0.0.1:8080/seafdav/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $server_name; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_read_timeout 1200s; - client_max_body_size 0; -  - access_log /var/log/nginx/seafdav.access.log seafileformat; - error_log /var/log/nginx/seafdav.error.log; - } + ``` + ..... - location /:dir_browser { - proxy_pass http://127.0.0.1:8080/:dir_browser; - } - ``` + location /seafdav { + rewrite ^/seafdav$ /seafdav/ permanent; + } -=== "Apache" + location /seafdav/ { + proxy_pass http://127.0.0.1:8080/seafdav/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 1200s; + client_max_body_size 0; +  + access_log /var/log/nginx/seafdav.access.log seafileformat; + error_log /var/log/nginx/seafdav.error.log; + } - For Seafdav, the configuration of Apache is as follows: + location /:dir_browser { + proxy_pass http://127.0.0.1:8080/:dir_browser; + } + ``` - ``` - ...... - - ProxyPass "http://127.0.0.1:8080/seafdav" - + === "Apache" - ``` + For Seafdav, the configuration of Apache is as follows: + + ``` + ...... + + ProxyPass "http://127.0.0.1:8080/seafdav" + + + ``` ## Notes on Clients