Go implementation of pastebinit.

Clone this repo:

Branches

  1. 2c37e6b travis go versions by Jess Frazelle · 1 year, 1 month ago master
  2. e84c3c9 jfrazelle -> jessfraz by Jess Frazelle · 1 year, 2 months ago
  3. 09aa208 Merge pull request #2 from sysradium/ansi by Jess Frazelle · 1 year, 2 months ago
  4. 1f3835d Add /ansi suffix which renders ANSI colors to HTML by sysradium · 1 year, 2 months ago
  5. 49e1f62 add vendor update dockerfile by Jess Frazelle · 1 year, 2 months ago

pastebinit

Travis CI

Go implementation of pastebinit. Host your own pastebin and post things there. Example file I posted here.

Why you ask? because pastebin.com has ads (booo) & is fugly as eff.

Usage

Command Line Tool

The command line tool can be installed as follows:

$ go get github.com/jessfraz/pastebinit

You need to set PASTEBINIT_USERNAME and PASTEBINIT_PASS as enviornment variables, so the client knows how to auth on paste. To change the uri, pass the -b flag.

Just like the pastebinit you are used to, this client can read from stdin & input. Heres some examples:

# pipe to pastebinit
$ docker images | pastebinit -b yoururl.com

# pass a file
$ pastebinit -b yoururl.com server.go

Server

The server can be run in a docker container, via the included dockerfile. You can use my image on the hub: jess/pastebinit or you can build the image yourself via:

$ git clone git@github.com/jessfraz/pastebinit.git
$ cd pastebinit
$ docker build -i your_name/pastebinit .

To run the image do, you need to pass the PASTEBINIT_USERNAME and PASTEBINIT_PASS enviornment variables to the container. You can also pass the following options as cli flags to the binary in the container, these are:

  • baseuri, -b: The uri of the domain you are going to be hosting this on, ex: https://paste.j3ss.co
  • port, -p: The port to run the app on, defaults to 8080
  • storage, s: The folder to store your posted pastes in, defaults to files/
  • certFile, --cert: For https servers, path to ssl certificate
  • keyFile, --key: For https servers, path to ssl key

Example command to run the container:

# to share the paste volume with your host
$ docker run -d --name=pastebinit --restart=always \
-e PASTEBINIT_USERNAME=your_username -e PASTEBINIT_PASS=your_pass \
-v  /home/jess/pastes:/src/files \
docker_image_name -b https://myserver.com

# to not share the paste volume
$ docker run -d --name=pastebinit --restart=always \
-e PASTEBINIT_USERNAME=your_username -e PASTEBINIT_PASS=your_pass \
docker_image_name -b https://myserver.com

# ssl example
$ docker run -d --name=pastebinit --restart=always \
-e PASTEBINIT_USERNAME=your_username -e PASTEBINIT_PASS=your_pass \
-v /path/to/ssl/stuffs:/ssl \
docker_image_name -b https://myserver.com --cert=/ssl/cert.crt --key=/ssl/key.key

Then you are all set! Happy pasteing!