Ich habe bereits hier eine Anleitung geschrieben, wie ihr WebDAV in Seafile aktivieren könnt. Nun zeige ich euch, wie ihr WebDAV in Seafile mit Docker und Traefik aktivieren könnt.
Diese Anleitung beruht auf meiner Seafile Docker Anleitung. Für die Updates mit Seafile 7.1+ habe ich mich an die offizielle Anleitung gehalten.
Update
16.10.2020 | Anpassung an Seafile 7.1 + |
15.04.2020 | Erstellung dieser Anleitung. |
Inhaltsverzeichnis
1. Seafile WebDAV aktivieren
Dazu öffnet ihr die Datei „seafdav.conf“ in eurem Seafile Verzeichnis.
nano /opt/containers/seafile/seafile-data/seafile/conf/seafdav.conf
Inhalt
[WEBDAV] enabled = true port = 8080 share_name = /seafdav
2. Proxy Einstellungen anpassen
Dazu öffnet ihr folgende Datei:
nano /opt/containers/seafile/seafile-data/nginx/conf/seafile.nginx.conf
Hier LÖSCHT ihr nun diesen Code:
location /seafdav { client_max_body_size 0; fastcgi_pass 127.0.0.1:8080; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; #fastcgi_param HTTPS on; #fastcgi_param HTTP_SCHEME https; access_log /var/log/nginx/seafdav.access.log seafileformat; error_log /var/log/nginx/seafdav.error.log; }
Nun kopiert ihr folgenden Code an diese Stelle:
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; proxy_set_header Destination "http:$nossl_destination"; access_log /var/log/nginx/seafdav.access.log seafileformat; error_log /var/log/nginx/seafdav.error.log; }
Ganz ans Ende der Datei kopiert ihr noch folgendes:
map $http_destination $nossl_destination { "~^https:(.+)$" $1; "~^http:(.+)$" $1; }
Meine komplette seafile.nginx.conf:
server { listen 80; server_name cloud.euredomain.de; client_max_body_size 10m; location / { proxy_pass http://127.0.0.1:8000/; proxy_read_timeout 310s; proxy_set_header Host $host; proxy_set_header Forwarded "for=$remote_addr;proto=$scheme"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Connection ""; proxy_http_version 1.1; client_max_body_size 0; access_log /var/log/nginx/seahub.access.log seafileformat; error_log /var/log/nginx/seahub.error.log; } location /seafhttp { rewrite ^/seafhttp(.*)$ $1 break; proxy_pass http://127.0.0.1:8082; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 0; proxy_connect_timeout 36000s; proxy_read_timeout 36000s; proxy_request_buffering off; access_log /var/log/nginx/seafhttp.access.log seafileformat; error_log /var/log/nginx/seafhttp.error.log; } 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; proxy_set_header Destination "http:$nossl_destination"; access_log /var/log/nginx/seafdav.access.log seafileformat; error_log /var/log/nginx/seafdav.error.log; } location /media { root /opt/seafile/seafile-server-latest/seahub; } # For letsencrypt location /.well-known/acme-challenge/ { alias /var/www/challenges/; try_files $uri =404; } } map $http_destination $nossl_destination { "~^https:(.+)$" $1; "~^http:(.+)$" $1; }
3. Docker Container neu starten
Nun startet ihr noch Seafile neu und alles sollte funktionieren.
docker-compose -f /opt/containers/seafile/docker-compose.yml down docker-compose -f /opt/containers/seafile/docker-compose.yml up -d
4. Testen
Ihr könnt WebDAV testen, wenn ihr auf euren Server geht: https://eurecloud.de/seafdav