tech:notes_webdav
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| tech:notes_webdav [2026/04/21 17:06] – Jean-Baptiste | tech:notes_webdav [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Webdav | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | ## Serveur | ||
| + | |||
| + | Voir : | ||
| + | * [[Notes rclone]] | ||
| + | * [KaraDAV](https:// | ||
| + | |||
| + | Vérifier que votre serveur implémente implémente correctement le protocole Webdav avec Litmus | ||
| + | |||
| + | WebDAV server protocol compliance test suite | ||
| + | * http:// | ||
| + | |||
| + | |||
| + | ### Nginx | ||
| + | |||
| + | Voir `proxy_request_buffering off;` | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install nginx-full | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~nginx | ||
| + | server { | ||
| + | listen 80; | ||
| + | server_name webdav.acme.fr; | ||
| + | |||
| + | access_log | ||
| + | error_log | ||
| + | |||
| + | autoindex on; | ||
| + | charset utf-8; | ||
| + | client_max_body_size 10M; | ||
| + | |||
| + | location / { | ||
| + | root / | ||
| + | |||
| + | # | ||
| + | |||
| + | dav_methods PUT DELETE MKCOL COPY MOVE; | ||
| + | dav_ext_methods PROPFIND OPTIONS; | ||
| + | # | ||
| + | # | ||
| + | |||
| + | #auth_basic " | ||
| + | # | ||
| + | |||
| + | create_full_put_path | ||
| + | dav_access user:rw group:rw all:r; | ||
| + | |||
| + | limit_except GET { | ||
| + | allow 192.168.1.22; | ||
| + | allow all; | ||
| + | #deny all; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | ### davserver (python) | ||
| + | |||
| + | Voir : | ||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | ~~~bash | ||
| + | #sudo apt-get install python3-webdav | ||
| + | python3 -m pip install PyWebDAV3 | ||
| + | ~~~ | ||
| + | |||
| + | `config.ini` | ||
| + | ~~~ini | ||
| + | [DAV] | ||
| + | |||
| + | #baseurl = | ||
| + | baseurl = https:// | ||
| + | |||
| + | # Verbose? | ||
| + | # verbose enabled is like loglevel = INFO | ||
| + | verbose = 1 | ||
| + | |||
| + | #log level : DEBUG, INFO, WARNING, ERROR, CRITICAL (Default is WARNING) | ||
| + | #loglevel = WARNING | ||
| + | |||
| + | # main directory | ||
| + | directory = / | ||
| + | |||
| + | # Server address | ||
| + | port = 8082 | ||
| + | host = localhost | ||
| + | |||
| + | # disable auth | ||
| + | noauth = 1 | ||
| + | |||
| + | # Enable mysql auth | ||
| + | mysql_auth=0 | ||
| + | |||
| + | # admin user | ||
| + | user = test | ||
| + | password = test00 | ||
| + | |||
| + | # daemonize? | ||
| + | daemonize = 0 | ||
| + | daemonaction = start | ||
| + | |||
| + | # instance counter | ||
| + | counter = 0 | ||
| + | |||
| + | # mimetypes support | ||
| + | #mimecheck = 1 | ||
| + | mimecheck = 0 | ||
| + | |||
| + | # webdav level (1 = webdav level 2) | ||
| + | lockemulation = 1 | ||
| + | |||
| + | # internal features | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | su - www-data | ||
| + | davserver -c config.ini | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Weborf - Le serveur ultra léger | ||
| + | |||
| + | https:// | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install weborf | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | python / | ||
| + | chmod 777 / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | iptables -A INPUT -i eth0 -p tcp -m tcp --dport 8083 -j REJECT | ||
| + | iptables-save > / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Client | ||
| + | |||
| + | Voir : | ||
| + | * [[Notes rclone]] | ||
| + | * [[Notes client FTP lftp]] | ||
| + | |||
| + | davfs2 | ||
| + | http:// | ||
| + | |||
| + | ~~~bash | ||
| + | cadaver https:// | ||
| + | ~~~ | ||
| + | |||
| + | Pour ne pas taper le mdp à chaque fois | ||
| + | |||
| + | `~/.netrc` | ||
| + | ~~~ini | ||
| + | default | ||
| + | login myusername | ||
| + | password P@ssw0rd | ||
| + | |||
| + | machine | ||
| + | login myusername | ||
| + | password P@ssw0rd | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | chmod 600 ~/.netrc | ||
| + | ~~~ | ||
| + | |||
| + | Voir `man netrc` | ||
| + | |||
| + | Exemple de fichier conf (commandes lancées automatique au démarrage de cadaver) | ||
| + | |||
| + | `~/ | ||
| + | ~~~ | ||
| + | set editor vim | ||
| + | set pager less | ||
| + | set tolerant | ||
| + | |||
| + | cd home | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ### WDFS | ||
| + | |||
| + | Voir aussi : | ||
| + | * [udevil](http:// | ||
| + | |||
| + | |||
| + | |||
| + | Ajout de l' | ||
| + | Apparement pas nécessaire si fuse est installé alors qu'il n' | ||
| + | Est-ce lié à systemd ? | ||
| + | ~~~bash | ||
| + | adduser jean fuse | ||
| + | ~~~ | ||
| + | |||
| + | Montage (dans un dossier vide) \\ | ||
| + | Exemples : | ||
| + | ~~~bash | ||
| + | mkdir -p ~/ | ||
| + | wdfs -o username=utilisateur -o password=MDP_En_Clair https:// | ||
| + | ~~~ | ||
| + | |||
| + | Pour démonter | ||
| + | ~~~bash | ||
| + | fusermount -u ~/mnt/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Protocole | ||
| + | |||
| + | ### Curl | ||
| + | |||
| + | Faut-il préciser le `Content-Type` ? | ||
| + | |||
| + | ~~~bash | ||
| + | curl -XPROPFIND https:// | ||
| + | |||
| + | curl --request PROPFIND | ||
| + | |||
| + | curl -X PROPFIND -H " | ||
| + | ~~~ | ||
| + | |||
| + | Envoyer un fichier | ||
| + | ~~~bash | ||
| + | curl -X PUT https:// | ||
| + | ~~~ | ||
| + | |||
| + | Déplacer un fichier | ||
| + | ~~~bash | ||
| + | curl -X MOVE -H ' | ||
| + | ~~~ | ||
| + | |||
| + | Juste un bout d'un fichier grâce à `Content-Range` | ||
| + | ~~~bash | ||
| + | curl -H ' | ||
| + | ~~~ | ||
| + | |||
