Hacker News new | ask | show | jobs
by dashezup 1809 days ago
I used to self-host transfer.sh, but nowadays I just use WebDAV.

1. it's easy to get WebDAV running, most of HTTP server support it through modules. or you could run it with rclone, on non-standard port or behind a reverse proxy

2. I don't share upload access with others, it's only for my own use. and this way I don't need to deal with huge uploads or illegal contents.

3. I could also just curl it, the uploaded content will have proper mime types. It's convenient for me to share pictures and videos this way on Telegram because it generate previews for me, and it's easy to just copy-paste a link to send to more than one person.

  curl https://user:password@domain.tld:port/path/to/file.png -T file.png
4. I could use WebDAV for various other cases, such like keeweb instance, Orgzly (android) notes syncing, saving keepass database etc.

Could write a simple shell script to include random characters in the URL, copy url to clipboard etc, such like this one I wrote [1]

btw for plain text, I prefer to use fiche [2] a simple netcat based pastebin. I have a public fiche instance [3] which allow people to upload with bash/zsh/netcat and show webpage with syntax highlighting. Text usually consume very a few of storage and not that "sensitive" like some photos and videos could be, so it's less troublesome to provide a public service for that. I've also write a Telegram bot for easily upload to my pastebin.

Lifespan of my WebDAV uploads and pastes are 1 month, it's very easy to clean them with crontab

  @daily find ~/webdav/tmp -mindepth 1 -maxdepth 1 -type f -ctime +30 -delete
[1] https://ezup.dev/git/dotfiles/file/.local/bin/eztmp.html

[2] https://github.com/solusipse/fiche

[3] https://ezup.dev/p/

1 comments

I’m a big fan of WebDAV. As a bonus, you can host tiddlywiki in WebDAV and it just works.

The only downside as far as I can tell is WebDAV support in Windows Explorer has problems with modern TLS setups.

Haven't use Windows for a while, on macOS I used to use NFS to access files on a LAN server but switched to WebDAV as well because it seems easier and cleaner to use WebDAV compare to SMB/NFS, since it does not require extra services or opened ports on server.

Nowadays I mainly use linux distro, the main use case of accessing files from LAN server is watching movies or TV series. I just create m3u/m3u8 playlist on server and play it through HTTP (not necessarily use WebDAV in this case). this way could avoid potential troubles I could get from mounting a remote directory.

  # LAN server
  ls -1 *.mp4 >playlist.m3u
  # computer, mpv with "save-position-on-quit"
  mpv http://raspberrypi.lan/path/to/playlist.m3u
The problem with webdav on windows explorer for me has always been the lag. Windows explorer has never really handled remotes with latency well, and webdav is one of those when you access a server across the globe