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
2021-07-13 08:31:38 +10:00
client Fix pb utility (#16) 2021-04-20 23:20:39 +10:00
cmd/pb Fix import paths 2021-07-13 08:31:38 +10: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 Add delete functionality (#13) 2021-04-21 07:25:57 +10:00
_config.yml Set theme jekyll-theme-hacker 2019-04-13 13:50:06 +10:00
.dockerignore updates dockerfile to work with latest golang, adds .dockerignore, fixes CI (#4) 2020-10-15 16:41:45 +10:00
.drone.yml Fix Drone CI config 2019-07-11 22:42:44 +10:00
.gitignore Update .gitignore 2021-04-09 21:41:50 +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 docker: Multistage Docker build (#6) 2020-12-06 20:54:16 +10:00
go.mod Fix import paths 2021-07-13 08:31:38 +10:00
go.sum Enables returning url for "Accept: text/plain" (#14) 2021-04-20 23:22:10 +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 Add Drone CI config 2019-07-11 22:26:21 +10:00
README.md Fix import paths 2021-07-13 08:31:38 +10:00
server.go Add delete functionality (#13) 2021-04-21 07:25:57 +10: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

Build Status CodeCov Go Report Card GoDoc Sourcegraph

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 get git.mills.io/prologic/pastebin/...

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 --form blob='<-' -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