apaste
Software
skarnet.org

The apasted program

apasted is the server-side program for the apaste package. It expects its stdin and stdout to be connected to the network, having being contacted by an apastec client. It reads a series of files transmitted by the client, stores it on the server, and sends back a slug to the client, i.e. an identifier for the stored files.

Interface

     apasted [ -r rtimeout ] [ -w wtimeout ] [ -d rootdir ] [ -p prefix ] [ -n maxfiles ] [ -s maxsize ] [ -S maxtotalsize ]

Exit codes

0
Success.
1
Protocol error. The client sent incorrectly formatted data.
100
Bad usage. apasted was run in an incorrect way.
111
System call failed. This usually signals an issue with the underlying operating system, or with the network in some way.

Options

-r rtimeout
If the client hasn't transmitted all its data within rtimeout milliseconds, give up. The default is 0, meaning infinite: apasted will wait forever for client data if necessary.
-w wtimeout
If apasted fails to send the slug to the client within wtimeout milliseconds, give up. The default is 0, meaning infinite: apasted will take as much time as it needs to send its answer.
-d rootdir
Switch to rootdir and store files there. The default is apasted's working directory.
-p prefix
When sending a slug to the client, prefix subdir with prefix, and append a slash at the end if prefix starts with http. This is useful when apasted writes its files to a web server's document hierarchy, which is the intended case. If prefix is the URL of apasted's base directory, then the slug can directly be used as a URL to access the client's files.
-n maxfiles
Accept a maximum of maxfiles files at a time from the client. The default is 0, meaning unlimited: the client can send as many files as it wants and apasted will still store them if it is possible.
-s maxsize
Accept a maximum of maxsize bytes for each file. 0 means unlimited: the files can be as big as the client wants, which is not a very good idea. The default is 1 MB.
-S maxtotalsize
Accept a maximum of maxtotalsize bytes for a single apaste transaction, all files included. 0 means unlimited: the transaction can be as large as the client wants, which is not a very good idea. The default is 10 MB.

Typical usage

Caveats

Notes