Self hosted web app for storing temporary pastes (Pastebin). Forked from https://git.mills.io/prologic/pastebin to add persistence, //go:embed support
Go to file
2019-07-11 22:13:25 +10:00
client Add a CLI tool for easily interacting with pastebin 2017-07-04 01:37:59 -07:00
cmd/pb Add a CLI tool for easily interacting with pastebin 2017-07-04 01:37:59 -07:00
scripts Initial Commit 2017-07-02 23:42:34 -07:00
static/css Refacted, new look and raw download feature 2017-07-09 01:57:21 -07:00
templates Refacted, new look and raw download feature 2017-07-09 01:57:21 -07:00
_config.yml Set theme jekyll-theme-hacker 2019-04-13 13:50:06 +10:00
.gitignore Fix Makefile 2019-07-11 22:11:33 +10:00
config_test.go Fixed config tests 2017-07-06 22:42:04 -07:00
config.go Repsect -expiry configuration 2017-07-02 23:57:32 -07:00
Dockerfile Refacted, new look and raw download feature 2017-07-09 01:57:21 -07:00
go.mod Switch to Go11Modules 2019-07-11 22:11:33 +10:00
go.sum Switch to Go11Modules 2019-07-11 22:11:33 +10:00
LICENSE Fixed LICENSE 2017-07-11 01:03:54 -07:00
main.go Removed some cruft 2017-07-09 10:18:41 -07:00
Makefile Fix Makefile 2019-07-11 22:11:33 +10:00
README.md Improve README 2019-07-11 22:13:25 +10:00
server.go Fixed POST handler 2018-05-17 14:51:39 -07:00
templates.go Refacted, new look and raw download feature 2017-07-09 01:57:21 -07:00
utils.go Initial Commit 2017-07-02 23:42:34 -07:00

pastebin

GoDoc Go Report Card

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!

Source

$ go install github.com/prologic/pastebin
$ go install github.com/prologic/pastebin/cmd/pb/...

Usage

Run pastebin:

$ pastebin

Create a paste:

$ echo "Hello World" | pb
http://localhost:8000/92sHUeGPfoFctazBxdEhae

Or use the Web UI: http://localhost:8000/

Or curl:

$ echo "hello World" | curl -q -L -d @- -o - http://localhost:8000/
...

There is also an included command line utility for convenience:

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/

License

MIT