pastebin/README.md

81 lines
2.2 KiB
Markdown
Raw Normal View History

2017-07-03 06:42:34 +00:00
# pastebin
2019-07-11 12:13:25 +00:00
2019-07-11 12:20:59 +00:00
[![Build Status](https://cloud.drone.io/api/badges/prologic/pastebin/status.svg)](https://cloud.drone.io/prologic/pastebin)
[![CodeCov](https://codecov.io/gh/prologic/pastebin/branch/master/graph/badge.svg)](https://codecov.io/gh/prologic/pastebin)
[![Go Report Card](https://goreportcard.com/badge/prologic/pastebin)](https://goreportcard.com/report/prologic/pastebin)
2021-07-12 22:31:38 +00:00
[![GoDoc](https://godoc.org/git.mills.io/prologic/pastebin?status.svg)](https://godoc.org/git.mills.io/prologic/pastebin)
[![Sourcegraph](https://sourcegraph.com/git.mills.io/prologic/pastebin/-/badge.svg)](https://sourcegraph.com/git.mills.io/prologic/pastebin?badge)
2017-07-03 06:42:34 +00:00
pastebin is a self-hosted pastebin web app that lets you create and share
"ephemeral" data between devices and users. There is a configurable expiry
(TTL) afterwhich the paste expires and is purged. There is also a handy
CLI for interacting with the service in a easy way or you can also use curl!
2017-07-03 06:42:34 +00:00
### Source
```#!bash
2021-07-12 22:31:38 +00:00
$ go get git.mills.io/prologic/pastebin/...
2017-07-03 06:42:34 +00:00
```
## Usage
Run pastebin:
```#!bash
$ pastebin
```
Create a paste:
```#!bash
$ echo "Hello World" | pb
http://localhost:8000/92sHUeGPfoFctazBxdEhae
2017-07-03 06:42:34 +00:00
```
Or use the Web UI: http://localhost:8000/
2017-07-03 06:42:34 +00:00
Or curl:
```#bash
$ echo "Hello World" | curl -q -L --form blob='<-' -o - http://localhost:8000/
...
```
2017-07-03 06:42:34 +00:00
2017-07-09 20:17:16 +00:00
There is also an included command line utility for convenience:
```#!bash
echo hello | pb
```
## Configuration
When running the `pastebin` server there are a few default options you might
want to tweak:
```
$ ./pastebin --help
...
-expiry duration
expiry time for pastes (default 5m0s)
-fqdn string
FQDN for public access (default "localhost")
```
Setting a custom `-expiry` lets you change when pastes are automatically
expired (*the purge time is 2x this value*). The ``-fqdn` option is used as
a namespace for generating the UUID(s) for pastes, change this to be your
domain name.
The command-line utility by default talk to http://localhost:8000 which can be
changed via the `-url` option or by creating a `$HOME/.pastebin.conf`
configuration file with contents similar to:
```
$ cat ~/.pastebin.conf
url=https://paste.mydomain.com/
```
2017-07-03 06:42:34 +00:00
2019-07-11 12:13:25 +00:00
## License
2017-07-09 20:17:16 +00:00
2017-07-03 06:42:34 +00:00
MIT