SERVEFILE(1)

πŸ’– SERVEFILE(1) πŸ’–

okay bestie, welcome to the servefile page β€” it's a tiny HTTP server for temporary file transfer, and honestly? it's giving main character energy for exactly five minutes and then it dips. periodt.


✨ NAME ✨

servefile β€” small HTTP-Server for temporary file transfer 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

servefile [-h] [--version] [-p PORT] [-u] [-s MAX_UPLOAD_SIZE] [-l]
       [--ssl] [--key KEY] [--cert CERT] [-a user:password]
       file/directory

πŸ’€ DISCLAIMER πŸ’€

okay so do NOT use this as a normal web server. like, fr fr. this thing is optimized for running a short time and yeeting files at other people β€” it is not here to do high-performance static file serving. she's a sprinter, not a marathon runner, and we respect that πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

Servefile is a small HTTP-server built for temporary file transfer, mostly in the local network. Her whole goal is making transferring single files as painless as humanly possible, and replacing those tar/netcat solutions that nobody wants to deal with anymore. iconic behavior.

With just a file as argument, servefile serves just that one file and redirects all HTTP requests to that file. no detours, no side quests.

Uploads can be done with curl, wget (peep the EXAMPLES section 🫢) or a normal browser. In upload mode with -u, servefile creates a directory and saves all uploaded files into that directory. When you're uploading with curl or wget, the filename is extracted from the path part of the url you used for the upload. iykyk.

For SSL support, pyopenssl (python3-openssl) needs to be installed. If no key and cert is given, servefile will generate a key pair for you and display its fingerprint. she's self-sufficient like that ✨

In --tar mode, the given file or directory will be packed on (each) request and piped to the client through the HTTP connection, thus serving always the latest content of the directory and preventing temporary file creaton. Tar files will be created containing only the lowest directory name from the full path, so using /path/to/dir/ as file/directory argument will create a tar file starting with the dir/ directory. When giving a file as argument, only the file without any path will be in the tarfile. Symlinks will not be dereferenced. no cap, that's the whole vibe.


πŸŽ€ COMMAND SUMMARY πŸŽ€

🌟 positional arguments:

  • file/directory β€” file or directory (with -l or -u) which should be served or uploaded to πŸ“

🌟 optional arguments:

  • -h, --help β€” Show a help message and exit πŸ™ˆ
  • --version β€” Show program's version number and exit ✨
  • -p PORT, --port PORT β€” Port to listen on πŸ”₯
  • -u, --upload β€” Enable uploads to a given directory πŸ“€
  • -s MAX_UPLOAD_SIZE, --max-upload-size MAX_UPLOAD_SIZE β€” Limit upload size in kB. Size modifiers are allowed, e.g. 2G, 12MB, 1B. πŸ‘‘
  • -l, --list-dir β€” Show directory indexes and allow access to all subdirectories πŸ¦‹
  • --ssl β€” Enable SSL. If no key/cert is specified one will be generated. πŸ”
  • --key KEY β€” Key file to use for SSL. If no cert is given with --cert the key file will also be searched for a cert πŸ—οΈ
  • --cert CERT β€” Certfile to use for SSL πŸ“œ
  • -a user:password, --auth user:password β€” Set user and password for HTTP basic authentication 🫢
  • --realm REALM β€” Set a realm for HTTP basic authentication. This is an arbitrary string which is displayed when doing HTTP basic authentication πŸ’œ
  • -t, --tar β€” Enable on the fly tar creation for given file or directory. Note: Download continuation will not be available. πŸ’€
  • -c method, --compression method β€” Set compression method, only in combination with --tar. Can be one of none, gzip, bzip2, xz. 🎁
  • -4, --ipv4-only β€” Listen on IPv4 only 4️⃣
  • -6, --ipv6-only β€” Listen on IPv6 only 6️⃣

🌈 EXAMPLES 🌈

Serving a single file with SSL and HTTP Basic auth:

servefile --ssl --auth foo:bar the_file

Enabling uploads to a directory:

servefile -u dir/

Uploading file foo as bar to servefile via command line:

curl -X PUT http://ip:port/bar --data-binary @foo
curl -X POST http://ip:port/bar --data-binary @foo
wget http://ip:port/bar --post-file=foo

Serving a on the fly generated tar.gz file of a directory:

servefile --tar -c gzip path/to/dir

πŸ’… AUTHOR πŸ’…

servefile is developed by Sebastian Lohff <seba@someserver.de> β€” shoutout to the dev, absolute legend 🫢


ok that's the whole page bestie, you're officially fluent in servefile. go transfer some files, slay, and remember: short-lived server, long-lived main character energy. πŸ’–βœ¨

this was servefile version 0.5.4, dated January 2023 β€” mwah, catch you on the next manpage πŸ’‹πŸŒˆ