Self hosted web app for storing temporary pastes (Pastebin)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
James Mills 773a608ba6
Fix import paths
3 months ago
client Fix pb utility (#16) 5 months ago
cmd/pb Fix import paths 3 months ago
scripts Initial Commit 4 years ago
static/css Refacted, new look and raw download feature 4 years ago
templates Add delete functionality (#13) 5 months ago
.dockerignore updates dockerfile to work with latest golang, adds .dockerignore, fixes CI (#4) 12 months ago
.drone.yml Fix Drone CI config 2 years ago
.gitignore Update .gitignore 6 months ago
Dockerfile docker: Multistage Docker build (#6) 10 months ago
LICENSE Fixed LICENSE 4 years ago
Makefile Add Drone CI config 2 years ago
README.md Fix import paths 3 months ago
_config.yml Set theme jekyll-theme-hacker 2 years ago
config.go Repsect -expiry configuration 4 years ago
config_test.go Fixed config tests 4 years ago
go.mod Fix import paths 3 months ago
go.sum Enables returning url for "Accept: text/plain" (#14) 5 months ago
main.go Removed some cruft 4 years ago
server.go Add delete functionality (#13) 5 months ago
templates.go Refacted, new look and raw download feature 4 years ago
utils.go Initial Commit 4 years ago

README.md

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