tylerlm / minibin

A minimal pastebin. Fork of https://github.com/w4/bin with several bits removed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minibin

A minimal pastebin.

minibin is a slightly-tweaked fork of bin by Jordan Doyle with syntax highlighting removed to make it even more minimal.

Features

  1. In-memory, no database.
  2. Create and view pastes from the browser or the command line.

Install

Quickstart

  • Make sure you have docker and docker-compose
  • Clone this repository somewhere and cd to it
  • Optionally, adapt docker-compose.yml to your liking

Then run:

$ docker-compose build
$ docker-compose up -d

Should now be accessible on http://0.0.0.0:8000.

Build manually

Install rustup, then:

$ git clone https://github.com/tylerlm/minibin.git
$ cd minibin
$ cargo +nightly build --release
   Compiling minibin v0.0.1 (/home/user/code/minibin)
    Finished release [optimized] target(s) in 5.55s

Find the resulting binary at ./target/release/minibin -- just run it.

Settings

minibin uses rocket so you can add a rocket config file if you like.

Environment variables

  • ROCKET_PORT: change the default port (default: 8000)
  • PASTEBIN_MAX_PASTES: how many pastes to keep (default: 1000)

curl examples

$ curl -X PUT --data 'example text' https://bin.example.com
https://bin.example.com/abcdefghij

$ echo 'example file' > file.txt
$ curl -X PUT --data-binary @file.txt https://bin.example.com
https://bin.example.com/klmnopqrst

$ echo 'example stdin' | curl -X PUT --data-binary @- https://bin.example.com
https://bin.example.com/uvwxyzabcd

$ curl https://bin.example.com/abcdefghij
example text
$ curl https://bin.example.com/klmnopqrst
example file
$ curl https://bin.example.com/uvwxyzabcd
example stdin

About

A minimal pastebin. Fork of https://github.com/w4/bin with several bits removed.

License:Other


Languages

Language:Rust 66.2%Language:HTML 29.2%Language:Dockerfile 4.6%