diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-08-16 20:07:18 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-08-16 20:07:18 +0200 |
commit | 7cf51e6fcd1cce954ffef5bbb71ae865b0d4d5d8 (patch) | |
tree | cb71c6e15a5caf73ab860cde170300761c2cad63 /mpaste.1 | |
parent | f9d7145f52004048f7c309f92f591db885803e02 (diff) |
Diffstat (limited to 'mpaste.1')
-rw-r--r-- | mpaste.1 | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -8,8 +8,8 @@ .Sh SYNOPSIS .Nm .Op Fl c Ar counter -.Op Fl f Ar file_dir .Op Fl i Ar index +.Op Fl p Ar file_dir .Op Fl u Ar users .Ar domain .Ar port @@ -30,37 +30,37 @@ after a successful paste so that they have a direct link to click on to go to th The port on the otherhand does matter, it is the port on which the server will listen. .Pp Once the server is running you can POST a file to the server by sending a form with the name -.Dq file . +.Sq file . Here is an example of POSTing a file with .Xr curl 1 : .Pp .Dl $ curl -X POST -F \(aqfile=@foo.txt\(aq domain.com .Pp After a successful POST the server will respond with a URI to the post in the form -.Dq domain.com/ID +.Sq domain.com/ID where -.Dq ID +.Sq ID is a number which increments with each paste. When viewed, the paste will be displayed as unformatted plaintext. If you would like syntax highlighting simply append the appropiate file extension to the URI. For example, to syntax highlight C code with paste ID 5, go to -.Dq domain.com/5.c . +.Sq domain.com/5.c . .Pp By default when syntax highlighting the server displays tab characters with a width of 8 columns. If you would like to customize the width of a tab you can set the -.Dq tabs +.Sq tabs query parameter in the URI. For example, to view a Python file with a tab width of 4 columns, go to -.Dq domain.com/1.py?tabs=4 . +.Sq domain.com/1.py?tabs=4 . .Pp If you would like to protect the server by requiring all users to have an API key, simply set the .Ev MPASTE_SECRET environment variable. With this secret set, you can generate a JWT token encoded with that same secret, and with the playload -.Dq name=USERS NAME . +.Sq name=USERS NAME . For example, one might have the payload -.Dq name=Johnny Appleseed . +.Sq name=Johnny Appleseed . This name is then looked up in the .Pa users file. @@ -94,24 +94,24 @@ If you would like to specify a different file, you can use the flag. .Sh OPTIONS .Bl -tag -width Ds -.It Fl c Ar counter +.It Fl c Ar counter , Fl Fl counter-file Ns = Ns Ar counter Specify the path to a file to use as a counter. This file will hold the number of the ID that will be assigned to the next paste. If the given file does not exist, it will be created on the next successful paste. If this flag is not specified then it will default to .Pa counter . -.It Fl f Ar file_dir -Specify a directory in which to store the pastes that users POST to the server. -If the given folder does not exist, then it will be created. -If this flag is not specified then it will default to -.Pa files/ . -.It Fl i Ar index +.It Fl i Ar index , Fl Fl index Ns = Ns Ar index Specify a file to serve on the servers root .Pq Pa / page. If this flag is not specified then it will default to .Pa index.html . -.It Fl u Ar users +.It Fl p Ar file_dir , Fl Fl prefix Ns = Ns Ar file_dir +Specify a directory in which to store the pastes that users POST to the server. +If the given folder does not exist, then it will be created. +If this flag is not specified then it will default to +.Pa files/ . +.It Fl u Ar users , Fl Fl user-file Ns = Ns Ar users Specify a file to store authorized users in. This file must be created by the user and must contain a newline seperated list of authorized users as shown in the @@ -165,4 +165,4 @@ Users uploading exessively many files. .It Users uploading non-plaintext files. On certain browsers this may prompt a user to download the hosted content, which is a potential attack vector. -.El +.El
\ No newline at end of file |