All Projects → WantGuns → bin

WantGuns / bin

Licence: LGPL-3.0 license
highly opinionated, minimal pastebin

Programming Languages

rust
11053 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to bin

rustypaste
A minimal file upload/pastebin service.
Stars: ✭ 102 (+5.15%)
Mutual labels:  file-upload, pastebin
Privatebin
A minimalist, open source online pastebin where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES.
Stars: ✭ 3,622 (+3634.02%)
Mutual labels:  pastebin, self-hosted
Linx Server
Self-hosted file/code/media sharing website. ~~~~~~~~~~~~~~~~~~~ Demo: https://demo.linx-server.net/
Stars: ✭ 1,044 (+976.29%)
Mutual labels:  file-upload, pastebin
Paste
A sensible, modern pastebin.
Stars: ✭ 367 (+278.35%)
Mutual labels:  pastebin, self-hosted
Fileshelter
FileShelter is a “one-click” file sharing web application
Stars: ✭ 132 (+36.08%)
Mutual labels:  file-upload, self-hosted
crocofile
A webbased file upload manager to share files by sharing an account
Stars: ✭ 40 (-58.76%)
Mutual labels:  file-upload
MAPLEAF
6-DOF Rocket Flight Simulation Framework
Stars: ✭ 28 (-71.13%)
Mutual labels:  rocket
dyndnsd
A small, lightweight and extensible DynDNS server written with Ruby and Rack.
Stars: ✭ 69 (-28.87%)
Mutual labels:  self-hosted
local-cloud
Turn any computer at home into a cloud for easy sharing of files across your devices.
Stars: ✭ 70 (-27.84%)
Mutual labels:  file-upload
SaorTech-cloud-services
A range of scripts to provision and configure open source cloud services.
Stars: ✭ 23 (-76.29%)
Mutual labels:  self-hosted
trusted-cgi
Lightweight runner for lambda functions/apps in CGI like mode
Stars: ✭ 150 (+54.64%)
Mutual labels:  self-hosted
Unreal-Binary-Builder
An application designed to create installed Unreal Engine builds (aka Rocket builds) from Unreal Engine GitHub source.
Stars: ✭ 554 (+471.13%)
Mutual labels:  rocket
RSS-to-Telegram-Bot
A Telegram RSS bot that cares about your reading experience
Stars: ✭ 482 (+396.91%)
Mutual labels:  self-hosted
onionjuggler
Manage your Onion Services via CLI or TUI on Unix-like operating system with a POSIX compliant shell.
Stars: ✭ 31 (-68.04%)
Mutual labels:  self-hosted
finance
💰 Free open-source personal finance tracking web application.
Stars: ✭ 156 (+60.82%)
Mutual labels:  self-hosted
Jawbreaker
A Python obfuscator using HTTP Requests and Hastebin.
Stars: ✭ 50 (-48.45%)
Mutual labels:  pastebin
awesome-pastebin
List of pastebin sites.
Stars: ✭ 58 (-40.21%)
Mutual labels:  pastebin
simply-nzedb
The simplest way to get nZEDb up and running with docker
Stars: ✭ 67 (-30.93%)
Mutual labels:  self-hosted
simple-file-uploader
A file uploader written using HTML5 and Node.js. It can upload both to a local directory on the server or to an AWS S3 server.
Stars: ✭ 85 (-12.37%)
Mutual labels:  file-upload
notesnook
A fully open source & end-to-end encrypted note taking alternative to Evernote.
Stars: ✭ 5,098 (+5155.67%)
Mutual labels:  self-hosted

Bin

A minimal pastebin which also accepts binary files like Images, PDFs and ships multiple clients.

It does not require you to host a SQL server and everything is self-contained in a statically linked binary (the docker image runs on scratch !), which makes it extremely easy to deploy.

Try it out on: https://basedbin.fly.dev

Clients

Web

You can paste

  • Normal Text

  • Paste Images from clipboard:
    clipboard-paste

  • Files by drag and drop:
    drag_n_drop

CLI

cli-usage

Installation

Get the client from this repository or from my deployed paste:

curl -o pst https://bin.wantguns.dev/client
chmod +x pst

or manually copy the following at a file in your path.

#!/bin/bash

# Change the url accordingly
URL="https://basedbin.fly.dev"

FILEPATH="$1"
FILENAME=$(basename -- "$FILEPATH")
EXTENSION="${FILENAME##*.}"

RESPONSE=$(curl --data-binary @${FILEPATH:-/dev/stdin} --url $URL)
PASTELINK="$URL$RESPONSE"

[ -z "$EXTENSION" ] && \
    echo "$PASTELINK" || \
    echo "$PASTELINK.$EXTENSION"

You have the option to remove the /client description / help in the landing page. To show the /client description, run the bin binary with either BIN_CLIENT_DESC env variable or a -c flag. More on arguments later

Usage

It just works.

$ pst somefile.txt
$ cat someimage.png | pst

(Neo)Vim

Installation

  1. Install the CLI client
  2. Append this to your init.vim / vimrc
nnoremap <leader>p :!pst %<CR>

Usage

Use <leader> + p paste.

Server Deployment

Currently, builds for the following target triples are shipped:

  • x86_64-unknown-linux-gnu (amd64)
  • aarch64-unknown-linux-gnu (arm64)

The builds shipped are statically linked, so you don't even need a libc to run the binary !
The docker manifest labelled wantguns/bin:latest includes the images for both amd64 and arm64 images.

Docker

$ docker run -p 6162:6162 wantguns/bin

Docker Compose

version: '3.3'
services:
  pastebin:
    image: wantguns/bin
    container_name: pastebin
    ports:
      - 127.0.0.1:6163:6163
    environment:
      - BIN_PORT=6163 # Defaults to 6162
      - BIN_LIMITS={form="16 MiB"}
      - BIN_CLIENT_DESC=placeholder
    volumes:
      - ./upload:/upload  # upload folder will have your pastes

Manual

  • Grab a copy of the binary from GH releases
    OR
  • Build on your own:
# A statically linked build
$ cargo build --release
  • Execute the binary as is, no extra shenanigans needed:
$ ./bin

Usage

USAGE:
    bin [OPTIONS]

OPTIONS:
    -a, --address <ADDRESS>
            Address on which the webserver runs [default: 127.0.0.1]

    -b, --binary-upload-limit <BINARY_UPLOAD_LIMIT>
            Binary uploads file size limit (in MiB) [default: 100]

    -c, --client-desc
            Include client description [env: CLIENT_DESC=]

    -h, --help
            Print help information

    -p, --port <PORT>
            Port on which the webserver runs [default: 6162]

    -u, --upload <UPLOAD>
            Path to the uploads folder [default: ./upload]

    -V, --version
            Print version information

Configuration

This pastebin utilizes a custom configuration provider from Rocket. Apart from the essential arguments, you can also use environment variables, which have the highest preference in order.

Everything from the official Rocket doc is supported, just that you have to prefix the env variable with "BIN_":

BIN_PORT=6163
BIN_ADDRESS=0.0.0.0
BIN_LIMITS={form="16 MiB"}
BIN_WORKERS=8
BIN_IDENT=false
...

API

GET /<id>
Get raw pastes

GET /p/<id>
Get highlighted pastes

GET /p/<id>.<ext>

Get syntax highlighted pastes.
E.g. https://basedbin.fly.dev/p/foobaz.cpp should return a C++ syntax highlighted paste

POST /
Post binary data

Design Decisions

This pastebin:

  • does not use a database. It lacks non-essential features like password-protection / automatic deletion as a result of which, it can do completely fine with flat filesystems. As an upside (opinionated), it makes deploying it easier.
  • uses server sided highlighting, which ensures that everything stays light and snappy at the client side.
  • uses very minimal frontend because a pastebin does not need it. It focuses (or atleast tries to) on getting things done in minimum amount of clicks.

Hacking

  • If you want to ensure your pushed refs will pass CI, add the prepush script to your Git hooks:

    $ cp -a tools/prepush .git/hooks/pre-push

    Alternately, just run ./tools/prepush yourself before pushing.

  • The Cargo configuration for this project is set for statically compiled builds. You can check out the config file to know more.

  • Read the buildci to know how the project is statically compiled for two architectures.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].