• Stars
    star
    167
  • Rank 226,635 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yet another pastebin, simple but feature-rich, along with a CLI client

YABin: Yet Another Pastebin

GitHub Sponsor GitHub License Stars Demo Website

ko-fi

Demo

Demo Video

Why (yet) another pastebin?

Well, cause no pastebin I could find had ALL of the following features:

  • Modern and minimal UI (This site's design was inspired by bin).
  • Optional end-to-end encryption (we're using AES-256-GCM) with optional password protection (using PBKDF2).
  • Syntax highlighting (using Prism) that supports 297 languages.
  • API support to create and get pastes from command line.
  • View raw pastes. Normally, encrypted pastebins do not have this. With this site, you can either get the Base64-encoded encrypted paste, or decrypt it on the server side (even with the password) and get the raw paste.
  • Keyboard shortcuts!
  • And of course, being fully open-source and easily self-hostable.
  • Ability to edit pastes after creation, and a dashboard for viewing all your pastes.
  • NEW Feature to use custom path names.
  • Comes with a CLI tool to create and read pastes from the command line!

API Documentation

See API.md.

CLI Usage

Installation and Usage

pip install yabin
yabin create
yabin read "<URL>"

See cli/README.md for detailed instructions and library usage.

How to Host

Requirements: Node.js (tested on 18+, should work with 14+), and a SQL database (tested on PostgreSQL, should work with MySQL and SQLite).

Right now, my instance is using PostgreSQL on Vercel.

.env Configuration

By default, it is configured to use PostgreSQL. However, it can be run using any SQL DB such as SQLite or MySQL. To use other backends, please update the provider in schema.prisma.

  • DB_NAME is the database name;
  • DB_HOST database host (defaults to 'db', but can be changed to aything like localhost)
  • DB_USER database user
  • DB_PORT database port 5432
  • DB_PASSWORD the database user password
  • DATABASE_URL you don't need to modify this variable (thanks to dotenv-expand). keep it though!

Remember to modify SALT to something secure if you plan on using user accounts.

You can disable or enable public registration by modifying the PUBLIC_REGISTRATION_ENABLED variable to true or false.

You can enable custom paste paths for everyone with the variable PUBLIC_CUSTOM_PATHS_ENABLED. If it is false, only users who are logged in can use custom paths.

You can disable anonymous pastes by setting PUBLIC_ANONYMOUS_PASTES_ENABLED to false.

By default, if no e-mail services are configured, all user accounts will be marked as validated. To enable e-mail validation, please configure the MAIL_* variables.

Locally

yarn install
cp .env.example .env
# Modify .env to add the database URL and other parameters
yarn dev

Using Docker

docker run --env-file .env -it -p 3000:3000 yureien/yabin:latest
# Or with Docker Compose
# Remember to change the DB password!
docker compose up

Fun fact: At a point of time, my instance used to be hosted in a Kubernetes cluster

Other Serverless Environments (Cloudflare Workers, Netlify etc.)

I have not yet tested this, but this is made with SvelteKit. Please take a look at the SvelteKit documentation for more information. If there are any issues, please open an issue, and I will put up a proper guide on how to deploy on such environmments.

My instance uses Vercel. Checkout the vercel branch for the Vercel configuration.

Public Instances

If you host one and want to make it public, just open an issue and I will add it here!

  1. bin.sohamsen.me Website Status

More Repositories

1

YTSwag

YTSwag: YouTube Music lyrics, and more
CSS
20
star
2

nginx-mime-magic-module

Set Content-Type mime-type automatically from the magic bytes of some file! (Similar to file(1))
C
12
star
3

GradeChecker

Fetch grades for IIT Kharagpur students
Python
6
star
4

PinocchioBot

The best Discord bot for weebs
Python
6
star
5

AnimeScraperGUI

This is a GUI version of https://github.com/jQwotos/anime_scrapers with extra features!
Python
5
star
6

text-fragment-scraper

Scrape highlighted text using text fragments
TypeScript
4
star
7

SPlaying

SPlaying: Spotify now Playing API. Getting your current playing song or top artists/songs on Spotify has never been so easy.
TypeScript
4
star
8

InterIIT-Task

Python
4
star
9

Monika-Bot

Telegram bot - @lilmonix3Bot
Python
3
star
10

ChatBot

ChatBot for learning. With seq2seq and Keras.
Python
2
star
11

ProxyList

A list of proxies.
Python
2
star
12

realtime-camera

This app lets you stream your phone's camera in HD, to any device on any platform having browser support, and that too in realtime!
C++
2
star
13

StartupWorld-Backend

A roleplay text based MMO game
Go
2
star
14

ESP-AC-Controller

ESP32 based AC controller for remotely controlling my Hitachi AC with Alexa support
C++
2
star
15

PyFileHosting

A simple python-based file hosting service
HTML
2
star
16

shiroyasha263.github.io

HTML
1
star
17

Teeshood

Python
1
star
18

CIFAR10-Keras

CIFAR-10 Keras DNN. About ~70% accuracy. Made for learning.
Python
1
star
19

dotfiles

My dotfiles ™️
Emacs Lisp
1
star
20

TextGenerator-Keras

A simple RNN made with Keras to learn RNNs.
Python
1
star
21

sohamsen.me

My site :)
HTML
1
star
22

BetterGoogle

HTML
1
star
23

Real-Resume

Real Resume, for and by IIT Kharagpur students
Svelte
1
star