servefile/servefile.1

125 lines
4.0 KiB
Groff
Raw Normal View History

2023-01-23 21:12:46 +01:00
.TH SERVEFILE 1 "January 2023" "servefile 0.5.4" "User Commands"
2012-04-20 15:01:38 +02:00
.SH NAME
2012-04-26 14:02:13 +02:00
servefile \- small HTTP-Server for temporary file transfer
2012-04-20 15:01:38 +02:00
.SH SYNOPSIS
.B servefile
[\fI\-h\fR\fR] [\fI\-\-version\fR] [\fI\-p PORT\fR] [\fI\-u\fR] [\fI\-s MAX_UPLOAD_SIZE\fR] [\fI\-l\fR]
.IP
[\fI\-\-ssl\fR] [\fI\-\-key KEY\fR] [\fI\-\-cert CERT\fR] [\fI\-a user:password\fR]
\fIfile/directory\fR
.SH DISCLAIMER
2012-04-27 23:19:55 +02:00
Do not use this as a normal web server. This server is optimized for running
2012-04-27 17:39:33 +02:00
a short time and to send files to other people, not for doing high-performance
2012-04-20 15:01:38 +02:00
static file serving.
.SH DESCRIPTION
2012-04-27 23:19:55 +02:00
Servefile is a small HTTP-server intended for temporary file transfer mostly
in the local network. It aims to make transferring single files as painless as
2012-04-26 14:02:13 +02:00
possible and to replace tar/netcat solutions.
2012-04-20 15:01:38 +02:00
2012-04-26 14:02:13 +02:00
With just a file as argument servefile serves just that one file and redirects
all HTTP requests to that file.
2012-04-20 15:01:38 +02:00
Uploads can be done with curl, wget (see EXAMPLES) or a normal browser.
2012-04-26 14:02:13 +02:00
In upload mode with \fB\-u\fR servefile creates a directory and saves all
uploaded files into that directory. When uploading with curl or wget the
filename is extracted from the path part of the url used for the upload.
2012-04-20 15:01:38 +02:00
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
2012-04-20 15:01:38 +02:00
fingerprint.
2012-04-27 17:39:33 +02:00
In \fB--tar\fR mode the given file or directory will be packed on (each)
2012-05-04 14:55:30 +02:00
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 \fIfile/directory\fR 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.
2012-04-27 17:39:33 +02:00
Symlinks will not be dereferenced.
2012-04-27 04:30:53 +02:00
2012-04-20 15:01:38 +02:00
.SH COMMAND SUMMARY
.SS "positional arguments:"
.TP
\fIfile/directory\fR
file or directory (with \fB\-l\fR or \fB\-u\fR) which should be served or uploaded to
.SS "optional arguments:"
.TP
\fB\-h\fR, \fB\-\-help\fR
2012-05-04 14:55:30 +02:00
Show a help message and exit
2012-04-20 15:01:38 +02:00
.TP
\fB\-\-version\fR
Show program's version number and exit
.TP
\fB\-p\fR PORT, \fB\-\-port\fR PORT
Port to listen on
.TP
\fB\-u\fR, \fB\-\-upload\fR
Enable uploads to a given directory
.TP
\fB\-s\fR MAX_UPLOAD_SIZE, \fB\-\-max\-upload\-size\fR MAX_UPLOAD_SIZE
2012-04-27 23:19:55 +02:00
Limit upload size in kB. Size modifiers are allowed,
e.g. 2G, 12MB, 1B.
2012-04-20 15:01:38 +02:00
.TP
\fB\-l\fR, \fB\-\-list\-dir\fR
Show directory indexes and allow access to all
subdirectories
.TP
\fB\-\-ssl\fR
Enable SSL. If no key/cert is specified one will be
generated.
.TP
\fB\-\-key\fR KEY
2012-04-27 23:19:55 +02:00
Key file to use for SSL. If no cert is given with
\fB\-\-cert\fR the key file will also be searched for a cert
2012-04-20 15:01:38 +02:00
.TP
\fB\-\-cert\fR CERT
Certfile to use for SSL
.TP
\fB\-a\fR user:password, \fB\-\-auth\fR user:password
Set user and password for HTTP basic authentication
2012-04-27 04:30:53 +02:00
.TP
2012-06-25 13:05:43 +02:00
\fB\-\-realm\fR REALM
Set a realm for HTTP basic authentication. This is an
arbitrary string which is displayed when doing HTTP
basic authentication
.TP
2012-04-27 04:30:53 +02:00
\fB\-t\fR, \fB\-\-tar\fR
Enable on the fly tar creation for given file or
directory. Note: Download continuation will not be
available.
.TP
\fB\-c\fR method, \fB\-\-compression\fR method
Set compression method, only in combination with
2019-02-14 23:25:36 +01:00
\fB\-\-tar\fR. Can be one of none, gzip, bzip2, xz.
2012-06-25 02:45:28 +02:00
.TP
\fB\-4\fR, \fB\-\-ipv4\-only\fR
Listen on IPv4 only
.TP
\fB\-6\fR, \fB\-\-ipv6\-only\fR
Listen on IPv6 only
2012-04-20 15:01:38 +02:00
.SH EXAMPLES
Serving a single file with SSL and HTTP Basic auth:
2012-04-20 16:11:22 +02:00
.IP
servefile \-\-ssl \-\-auth foo:bar the_file
2012-04-20 15:01:38 +02:00
.PP
Enabling uploads to a directory:
2012-04-20 16:11:22 +02:00
.IP
servefile \-u dir/
2012-04-20 15:01:38 +02:00
.PP
Uploading file foo as bar to servefile via command line:
.PP
2012-06-22 13:55:21 +02:00
curl \-X PUT http://ip:port/bar \-\-data-binary @foo
curl \-X POST http://ip:port/bar \-\-data-binary @foo
2012-04-20 16:11:22 +02:00
wget http://ip:port/bar \-\-post-file=foo
2012-04-20 15:01:38 +02:00
.PP
2012-05-04 15:40:46 +02:00
Serving a on the fly generated tar.gz file of a directory:
2012-04-27 04:30:53 +02:00
.IP
2012-05-04 15:40:46 +02:00
servefile \-\-tar \-c gzip path/to/dir
2012-04-27 04:30:53 +02:00
.PP
2012-04-20 15:01:38 +02:00
.SH AUTHOR
servefile is developed by Sebastian Lohff <seba@someserver.de>