Code Monkey home page Code Monkey logo

pastebinit's Introduction

pastebinit

make-all make-image GoDoc

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.

Table of Contents

Installation

Binaries

For installation instructions from binaries please visit the Releases Page.

Via Go

$ go get github.com/jessfraz/pastebinit

Usage

Client

You need to set PASTEBINIT_USERNAME and PASTEBINIT_PASSWORD as environment 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
$ pastebinit -h
pastebinit -  Command line paste bin.

Usage: pastebinit <command>

Flags:

  -b, --uri       pastebin base uri (default: https://paste.j3ss.co/)
  -d, --debug     enable debug logging (default: false)
  -p, --password  password (or env var PASTEBINIT_PASSWORD) (default: <none>)
  -u, --username  username (or env var PASTEBINIT_USERNAME)

Commands:

  server   Run the server.
  version  Show the version information.

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 [email protected]/jessfraz/pastebinit.git
$ cd pastebinit
$ docker build -t your_name/pastebinit .

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

$ pastebinit server -h
Usage: pastebinit server [OPTIONS]

Run the server.

Flags:

  --asset-path    Path to assets and templates (default: /src/static)
  -b, --uri       pastebin base uri (default: https://paste.j3ss.co/)
  --cert          path to ssl cert (default: <none>)
  -d, --debug     enable debug logging (default: false)
  --key           path to ssl key (default: <none>)
  -p, --password  password (or env var PASTEBINIT_PASSWORD) (default: <none>)
  --port          port for server to run on (default: 8080)
  -s, --storage   directory to store pastes (default: /etc/pastebinit/files)
  -u, --username  username (or env var PASTEBINIT_USERNAME)

Running in a container

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_PASSWORD=your_pass \
    -v  /home/jess/pastes:/src/files \
    jess/pastebinit server \
        -b https://myserver.com

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

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

Then you are all set! Happy pasting!

pastebinit's People

Contributors

bjoern-r avatar freerobby avatar github-actions[bot] avatar ilyaglow avatar jessfraz avatar sysradium avatar toc-me[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.