Pastebin

Check-in [9fe314d5fa]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use a reserved TLD for examples.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9fe314d5fa79abdadd1ceb29520266fcee51647326c55b33e43651c42f046a2c
User & Date: jef 2019-11-04 14:54:21
Context
2019-11-05
06:59
Fix typo in man page check-in: 49f2abf624 user: jef tags: trunk
2019-11-04
14:54
Use a reserved TLD for examples. check-in: 9fe314d5fa user: jef tags: trunk
14:46
Initial import. check-in: d861ce585b user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pastebin.1.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
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
125
126
127
128
129
130
131
132
133
134
135
136
137
configuration file is made of key/value pairs:
.Ss pasteurl
Specify the base url of this pastebin server (required). This value is used to
and generate valid pastes URL. When pastebin is used behind an http
proxy, the public URL should be specified here.
.Pp
Example:
.Dl pasteurl: https://domain.com/pastebin
.Ed
.Pp
Using the value above, the pastes URL will have the following
form:
.Dl https://domain.com/pastebin/e2bd5143bd
.Pp
And the administator API will be available as:
.Dl https://domain.com/pastebin/api/...
.Ss dbpath
Specify the location of the sqlite3 database (required). The database
is created automatically if not present.
.Pp
Example:
.Dl dbpath: /var/db/pastebin.sqlite3
.Ss sizelimit
................................................................................
.Pp
Example:
.Dl httpport: 80
.Sh SAMPLE HTTP CONFIG
Here goes a complete configuration in HTTP mode:
.Bd -literal -offset indent
$ cat pastebin.cfg
pasteurl: https://domain.com/pastebin
dbpath: /var/db/pastebin.sqlite3
apikey: 810a5bdaaf
sizelimit: 10M
.Ed
.Pp
And the pastebin server can be started this way:
.Pp
................................................................................
.Ed
.Sh SAMPLE CGI CONFIG
A CGI script can be setup in a single file, using pastebin as a
shebang interpreter, and the rest of the file for configuration pragmas:
.Bd -literal -offset indent
$ cat pastebin.cgi
#!/usr/local/bin/pastebin
pasteurl: https://domain.com/pastebin.cgi
dbpath: /var/db/pastebin.sqlite3
apikey: 810a5bdaaf
sizelimit: 10M
httpport: 0
.Ed
.Pp
Then, a web server has to be configured to serve this CGI script.
.Sh USAGE
The pastebin can be used from a web browser:
.Pp
.Dl $ firefox https://domain.com/pastebin
.Pp
or from the command line:
.Pp
.Bd -literal -offset indent
$ curl https://domain.com/pastebin < image.jpg
https://domain.com/pastebin/1bbe793662
.Ed
.Sh ADMIN API
Pastebin provide a small API to manage pastes.
.Ss <pasteurl>/api/list
List pastes in JSON format.
.Pp
Example:
.Bd -literal -offset indent
$ curl -d apikey="810a5bdaaf" https://domain.com/pastebin/api/list
[
  {
    "url": "https://domain.com/pastebin/46dbac46ae",
    "inserttime": "2019-10-28T15:38:10Z",
    "mimetype": "text/plain; charset=UTF-8"
  },
  {
    "url": "https://domain.com/pastebin/1085a72014",
    "inserttime": "2019-11-04T12:45:10Z",
    "mimetype": "application/json"
  }
]
.Ss <pasteurl>/api/purge/<ndays>
Purge pastes older than <ndays> days.
.Pp
Example:
.Pp
.Bd -literal -offset indent
$ curl -d apikey="810a5bdaaf" https://domain.com/pastebin/api/purge/10
.Ed
.Ss <pasteurl>/api/del/<pasteid>
Delete a single paste. The <pasteid> argument must be the 10
characters hexadecimal value assigned to a paste.
.Pp
Example:
.Bd -literal -offset indent
$ curl -d apikey="810a5bdaaf" https://domain.com/pastebin/api/del/1085a72014
.Ed
.Sh AUTHOR
.An Gerome Fournier Aq Mt jef@foutaise.org .







|




|


|







 







|







 







|










|




|
|








|


|




|










|







|



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
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
125
126
127
128
129
130
131
132
133
134
135
136
137
configuration file is made of key/value pairs:
.Ss pasteurl
Specify the base url of this pastebin server (required). This value is used to
and generate valid pastes URL. When pastebin is used behind an http
proxy, the public URL should be specified here.
.Pp
Example:
.Dl pasteurl: https://domain.test/pastebin
.Ed
.Pp
Using the value above, the pastes URL will have the following
form:
.Dl https://domain.test/pastebin/e2bd5143bd
.Pp
And the administator API will be available as:
.Dl https://domain.test/pastebin/api/...
.Ss dbpath
Specify the location of the sqlite3 database (required). The database
is created automatically if not present.
.Pp
Example:
.Dl dbpath: /var/db/pastebin.sqlite3
.Ss sizelimit
................................................................................
.Pp
Example:
.Dl httpport: 80
.Sh SAMPLE HTTP CONFIG
Here goes a complete configuration in HTTP mode:
.Bd -literal -offset indent
$ cat pastebin.cfg
pasteurl: https://domain.test/pastebin
dbpath: /var/db/pastebin.sqlite3
apikey: 810a5bdaaf
sizelimit: 10M
.Ed
.Pp
And the pastebin server can be started this way:
.Pp
................................................................................
.Ed
.Sh SAMPLE CGI CONFIG
A CGI script can be setup in a single file, using pastebin as a
shebang interpreter, and the rest of the file for configuration pragmas:
.Bd -literal -offset indent
$ cat pastebin.cgi
#!/usr/local/bin/pastebin
pasteurl: https://domain.test/pastebin.cgi
dbpath: /var/db/pastebin.sqlite3
apikey: 810a5bdaaf
sizelimit: 10M
httpport: 0
.Ed
.Pp
Then, a web server has to be configured to serve this CGI script.
.Sh USAGE
The pastebin can be used from a web browser:
.Pp
.Dl $ firefox https://domain.test/pastebin
.Pp
or from the command line:
.Pp
.Bd -literal -offset indent
$ curl https://domain.test/pastebin < image.jpg
https://domain.test/pastebin/1bbe793662
.Ed
.Sh ADMIN API
Pastebin provide a small API to manage pastes.
.Ss <pasteurl>/api/list
List pastes in JSON format.
.Pp
Example:
.Bd -literal -offset indent
$ curl -d apikey="810a5bdaaf" https://domain.test/pastebin/api/list
[
  {
    "url": "https://domain.test/pastebin/46dbac46ae",
    "inserttime": "2019-10-28T15:38:10Z",
    "mimetype": "text/plain; charset=UTF-8"
  },
  {
    "url": "https://domain.test/pastebin/1085a72014",
    "inserttime": "2019-11-04T12:45:10Z",
    "mimetype": "application/json"
  }
]
.Ss <pasteurl>/api/purge/<ndays>
Purge pastes older than <ndays> days.
.Pp
Example:
.Pp
.Bd -literal -offset indent
$ curl -d apikey="810a5bdaaf" https://domain.test/pastebin/api/purge/10
.Ed
.Ss <pasteurl>/api/del/<pasteid>
Delete a single paste. The <pasteid> argument must be the 10
characters hexadecimal value assigned to a paste.
.Pp
Example:
.Bd -literal -offset indent
$ curl -d apikey="810a5bdaaf" https://domain.test/pastebin/api/del/1085a72014
.Ed
.Sh AUTHOR
.An Gerome Fournier Aq Mt jef@foutaise.org .

Changes to pastebin.1.txt.

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

   pasteurl
     Specify the base url of this pastebin server (required). This value is
     used to and generate valid pastes URL. When pastebin is used behind an
     http proxy, the public URL should be specified here.

     Example:
           pasteurl: https://domain.com/pastebin

     Using the value above, the pastes URL will have the following form:
           https://domain.com/pastebin/e2bd5143bd

     And the administator API will be available as:
           https://domain.com/pastebin/api/...

   dbpath
     Specify the location of the sqlite3 database (required). The database is
     created automatically if not present.

     Example:
           dbpath: /var/db/pastebin.sqlite3
................................................................................
     Example:
           httpport: 80

SAMPLE HTTP CONFIG
     Here goes a complete configuration in HTTP mode:

           $ cat pastebin.cfg
           pasteurl: https://domain.com/pastebin
           dbpath: /var/db/pastebin.sqlite3
           apikey: 810a5bdaaf
           sizelimit: 10M

     And the pastebin server can be started this way:

           $ pastebin pastebin.cfg
................................................................................

SAMPLE CGI CONFIG
     A CGI script can be setup in a single file, using pastebin as a shebang
     interpreter, and the rest of the file for configuration pragmas:

           $ cat pastebin.cgi
           #!/usr/local/bin/pastebin
           pasteurl: https://domain.com/pastebin.cgi
           dbpath: /var/db/pastebin.sqlite3
           apikey: 810a5bdaaf
           sizelimit: 10M
           httpport: 0

     Then, a web server has to be configured to serve this CGI script.

USAGE
     The pastebin can be used from a web browser:

           $ firefox https://domain.com/pastebin

     or from the command line:

           $ curl https://domain.com/pastebin < image.jpg
           https://domain.com/pastebin/1bbe793662

ADMIN API
     Pastebin provide a small API to manage pastes.

   <pasteurl>/api/list
     List pastes in JSON format.

     Example:

           $ curl -d apikey="810a5bdaaf" https://domain.com/pastebin/api/list
           [
             {
               "url": "https://domain.com/pastebin/46dbac46ae",
               "inserttime": "2019-10-28T15:38:10Z",
               "mimetype": "text/plain; charset=UTF-8"
             },
             {
               "url": "https://domain.com/pastebin/1085a72014",
               "inserttime": "2019-11-04T12:45:10Z",
               "mimetype": "application/json"
             }
           ]

   <pasteurl>/api/purge/<ndays>
     Purge pastes older than <ndays> days.

     Example:

           $ curl -d apikey="810a5bdaaf" https://domain.com/pastebin/api/purge/10

   <pasteurl>/api/del/<pasteid>
     Delete a single paste. The <pasteid> argument must be the 10 characters
     hexadecimal value assigned to a paste.

     Example:

           $ curl -d apikey="810a5bdaaf" https://domain.com/pastebin/api/del/1085a72014

AUTHOR
     Gerome Fournier <jef@foutaise.org>.

                                 November 2019







|


|


|







 







|







 







|










|



|
|









|


|




|










|







|





18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

   pasteurl
     Specify the base url of this pastebin server (required). This value is
     used to and generate valid pastes URL. When pastebin is used behind an
     http proxy, the public URL should be specified here.

     Example:
           pasteurl: https://domain.test/pastebin

     Using the value above, the pastes URL will have the following form:
           https://domain.test/pastebin/e2bd5143bd

     And the administator API will be available as:
           https://domain.test/pastebin/api/...

   dbpath
     Specify the location of the sqlite3 database (required). The database is
     created automatically if not present.

     Example:
           dbpath: /var/db/pastebin.sqlite3
................................................................................
     Example:
           httpport: 80

SAMPLE HTTP CONFIG
     Here goes a complete configuration in HTTP mode:

           $ cat pastebin.cfg
           pasteurl: https://domain.test/pastebin
           dbpath: /var/db/pastebin.sqlite3
           apikey: 810a5bdaaf
           sizelimit: 10M

     And the pastebin server can be started this way:

           $ pastebin pastebin.cfg
................................................................................

SAMPLE CGI CONFIG
     A CGI script can be setup in a single file, using pastebin as a shebang
     interpreter, and the rest of the file for configuration pragmas:

           $ cat pastebin.cgi
           #!/usr/local/bin/pastebin
           pasteurl: https://domain.test/pastebin.cgi
           dbpath: /var/db/pastebin.sqlite3
           apikey: 810a5bdaaf
           sizelimit: 10M
           httpport: 0

     Then, a web server has to be configured to serve this CGI script.

USAGE
     The pastebin can be used from a web browser:

           $ firefox https://domain.test/pastebin

     or from the command line:

           $ curl https://domain.test/pastebin < image.jpg
           https://domain.test/pastebin/1bbe793662

ADMIN API
     Pastebin provide a small API to manage pastes.

   <pasteurl>/api/list
     List pastes in JSON format.

     Example:

           $ curl -d apikey="810a5bdaaf" https://domain.test/pastebin/api/list
           [
             {
               "url": "https://domain.test/pastebin/46dbac46ae",
               "inserttime": "2019-10-28T15:38:10Z",
               "mimetype": "text/plain; charset=UTF-8"
             },
             {
               "url": "https://domain.test/pastebin/1085a72014",
               "inserttime": "2019-11-04T12:45:10Z",
               "mimetype": "application/json"
             }
           ]

   <pasteurl>/api/purge/<ndays>
     Purge pastes older than <ndays> days.

     Example:

           $ curl -d apikey="810a5bdaaf" https://domain.test/pastebin/api/purge/10

   <pasteurl>/api/del/<pasteid>
     Delete a single paste. The <pasteid> argument must be the 10 characters
     hexadecimal value assigned to a paste.

     Example:

           $ curl -d apikey="810a5bdaaf" https://domain.test/pastebin/api/del/1085a72014

AUTHOR
     Gerome Fournier <jef@foutaise.org>.

                                 November 2019