-
Notifications
You must be signed in to change notification settings - Fork 10
/
servefile.1
124 lines (115 loc) · 4.02 KB
/
servefile.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.TH SERVEFILE 1 "January 2023" "servefile 0.5.4" "User Commands"
.SH NAME
servefile \- small HTTP-Server for temporary file transfer
.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
Do not use this as a normal web server. This server is optimized for running
a short time and to send files to other people, not for doing high-performance
static file serving.
.SH DESCRIPTION
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
possible and to replace tar/netcat solutions.
With just a file as argument servefile serves just that one file and redirects
all HTTP requests to that file.
Uploads can be done with curl, wget (see EXAMPLES) or a normal browser.
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.
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.
In \fB--tar\fR 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 \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.
Symlinks will not be dereferenced.
.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
Show a help message and exit
.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
Limit upload size in kB. Size modifiers are allowed,
e.g. 2G, 12MB, 1B.
.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
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
.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
.TP
\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
\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
\fB\-\-tar\fR. Can be one of none, gzip, bzip2, xz.
.TP
\fB\-4\fR, \fB\-\-ipv4\-only\fR
Listen on IPv4 only
.TP
\fB\-6\fR, \fB\-\-ipv6\-only\fR
Listen on IPv6 only
.SH EXAMPLES
Serving a single file with SSL and HTTP Basic auth:
.IP
servefile \-\-ssl \-\-auth foo:bar the_file
.PP
Enabling uploads to a directory:
.IP
servefile \-u dir/
.PP
Uploading file foo as bar to servefile via command line:
.PP
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
.PP
Serving a on the fly generated tar.gz file of a directory:
.IP
servefile \-\-tar \-c gzip path/to/dir
.PP
.SH AUTHOR
servefile is developed by Sebastian Lohff <[email protected]>