Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:services:nas:webdav [2023/02/28 17:48] – [ZeroConf autodiscovery] stokitodocs:guide-user:services:nas:webdav [2024/12/15 13:03] – [ZeroConf autodiscovery] stokito
Line 8: Line 8:
  
 ==== WebDAV with Lighttpd ==== ==== WebDAV with Lighttpd ====
-Assuming that USB drive is mounted to ''/srv/disk/'' folder.+First of all if you already have the Lighttpd then update it and it's modules to avoid conflicts: 
 +<code bash> 
 +opkg update 
 +opkg list-upgradable | cut -f 1 -d ' ' | grep lighttpd | xargs opkg upgrade 
 +</code> 
 + 
 +Assuming that USB drive is mounted to ''/mnt/disk/'' folder.
  
 <code bash> <code bash>
-mkdir -p /etc/lighttpd/conf.d /srv/disk/dav /var/lib/lighttpd +mkdir -p /etc/lighttpd/conf.d /mnt/disk/dav /var/lib/lighttpd 
-chown http:www-data /srv/disk/dav /var/lib/lighttpd+chown http:www-data /mnt/disk/dav /var/lib/lighttpd
 cat << "EOF" > /etc/lighttpd/conf.d/99-disk.conf cat << "EOF" > /etc/lighttpd/conf.d/99-disk.conf
 $HTTP["url"] =~ "^/dav($|/)" { $HTTP["url"] =~ "^/dav($|/)" {
-  server.document-root := "/srv/disk/"+  server.document-root := "/mnt/disk/"
   auth.backend = "plain"   auth.backend = "plain"
   auth.backend.plain.userfile = "/etc/lighttpd/webdav.shadow"   auth.backend.plain.userfile = "/etc/lighttpd/webdav.shadow"
Line 58: Line 64:
  
 <code bash> <code bash>
-curl -u youruser -X PROPFIND -H "Depth: 1http://192.168.1.1/dav/+curl -u youruser:pass -X PROPFIND -H 'Depth: 1http://192.168.1.1/dav/
 </code> </code>
 You must see a 207 status code and XML response with directory listing. You must see a 207 status code and XML response with directory listing.
  
- +See more details and examples [[https://gist.github.com/stokito/cf82ce965718ce87f36b78f7501d7940|WebDAV with curl]]
-For advanced test install the FTP-like command line client ''cadaver'': +
- +
-<code> +
-cadaver http://192.168.1.1/dav/ +
-Authentication required for webdav on server `192.168.1.1': +
-Username: youruser +
-Password:  +
-dav:/dav/> ls +
-Listing collection `/dav/': succeeded. +
-    README.txt +
-dav:/dav/> cat README.txt  +
-Displaying `/dav/README.txt': +
-It works! +
-dav:/dav/> exit +
-Connection to `192.168.1.1' closed. +
-</code> +
  
 ==== Don't forget about encryption! ==== ==== Don't forget about encryption! ====
Line 86: Line 75:
  
 ==== Browser UI for the WebDAV share ==== ==== Browser UI for the WebDAV share ====
-To watch the share from a browser you can install the small and nice UI [[https://github.com/dom111/webdav-js|webdav-js]]:+As with usual HTTP you can see (GET) any file directly from a browser but you can't see a listing of files in a folder. That's because for a listing is used a PROPFIND method but not just GET. 
 +But you can install a [[https://github.com/stokito/webdav-browser-extension|browser extension]] or more advanced [[https://chrome.google.com/webstore/detail/file-management-webdav/famepaffkmmhdefbapbadnniioekdppm|app]]. 
 + 
 +But a better is to install the small and nice UI [[https://github.com/dom111/webdav-js|webdav-js]]. Just create a file in dav folder's root `/mnt/disk/dav/index.html`
  
 <code html> <code html>
-cat << EOF > /srv/disk/dav/index.html 
 <!DOCTYPE html> <!DOCTYPE html>
 <html lang="en"> <html lang="en">
Line 98: Line 89:
 </head> </head>
 <body> <body>
-<script src="https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js"/>+<script src="https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js"></script>
 </body> </body>
 </html> </html>
-EOF 
 </code> </code>
  
-Then open [[http://192.168.1.1/dav/]] and you'll see a simple file manager.+Then open [[http://192.168.1.1/dav/]] and you'll see a simple file manager. Internally it performs all webdav operations with AJAX e.g. sends a PROPFIND to list files.
  
 The disadvantage of the method is that it's doesn't work for subfolders i.e. when you open [[http://192.168.1.1/dav/Documents/]] then the ''index.html'' file wont be show. The disadvantage of the method is that it's doesn't work for subfolders i.e. when you open [[http://192.168.1.1/dav/Documents/]] then the ''index.html'' file wont be show.
 That's fine for 99% of usages. That's fine for 99% of usages.
  
-== Online apps and PWAs ==+==== Online apps and PWAs ====
 You can also try an online apps that can connect directly to your WebDAV share to backup data. Some notable apps: You can also try an online apps that can connect directly to your WebDAV share to backup data. Some notable apps:
   * [[https://diffuse.sh/|Diffuse]] a music player [[https://github.com/icidasset/diffuse|Source code]]   * [[https://diffuse.sh/|Diffuse]] a music player [[https://github.com/icidasset/diffuse|Source code]]
Line 119: Line 109:
 Here is an example [[https://gist.github.com/stokito/0a6274106d407ba6d9fb776e7773445d]] Here is an example [[https://gist.github.com/stokito/0a6274106d407ba6d9fb776e7773445d]]
  
-== Useful Apps ==+==== Useful Apps ====
 Useful mobile apps that supports WebDAV sync: Useful mobile apps that supports WebDAV sync:
-  * [[https://www.orgzly.com/|Orgzly]] Outliner for notes and to-do lists. [[https://github.com/orgzly|Source code]] +  * [[https://www.orgzly.com/|Orgzly]] Outliner for notes and to-do lists. [[https://github.com/orgzly|Source code]] 
-  * [[https://www.cloudbeatsapp.com/|CloudBeats]] a music player. Not FOSS!+  * [[https://www.cloudbeatsapp.com/|CloudBeats]] a music player. Proprietary. 
 +  * [[https://github.com/phpbg/easysync|EasySync]] - two way synchronization of images, videos, audio and downloads. 
 +  * [[https://play.google.com/store/apps/details?id=dk.tacit.android.foldersync.lite|FolderSync]] - a backup and sync e.g. you can upload photos automatically. Proprietary.
  
  
Line 129: Line 121:
   * [[https://redmine.lighttpd.net/projects/1/wiki/Docs_ModWebDAV|Module mod_webdav - WebDAV]]   * [[https://redmine.lighttpd.net/projects/1/wiki/Docs_ModWebDAV|Module mod_webdav - WebDAV]]
   * [[https://redmine.lighttpd.net/projects/1/wiki/Docs_ModSecDownload|Module mod_secdownload - Secure and fast downloading]]   * [[https://redmine.lighttpd.net/projects/1/wiki/Docs_ModSecDownload|Module mod_secdownload - Secure and fast downloading]]
-  * [[https://github.com/fstanis/awesome-webdav|Awesome WebDAV]] a list of software that works with WebDAV.+  * [[https://github.com/webdavdevs/awesome-webdav|Awesome WebDAV]] a list of software that works with WebDAV.
   * [[https://gist.github.com/stokito/77c42f8aff2dade91621c1051f73e58c|WebDAV with Lighttpd on Turris Omnia (TurrisOS)]]   * [[https://gist.github.com/stokito/77c42f8aff2dade91621c1051f73e58c|WebDAV with Lighttpd on Turris Omnia (TurrisOS)]]
  
Line 138: Line 130:
 Install the umdns package with ''opkg install umdns'' and create a service description file: Install the umdns package with ''opkg install umdns'' and create a service description file:
  
-<code /etc/umdns/lighttpd_webdav.json>+<code yaml /etc/umdns/lighttpd_webdav.json>
 { {
   "lighttpd_webdav": {   "lighttpd_webdav": {
  • Last modified: 2024/12/19 14:35
  • by stokito