Simple pastebin-like service in asynchronous Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
lemon 95bb637c79 Logging overhaul 1 month ago
openrc Update readme 1 month ago
src Logging overhaul 1 month ago
.gitignore Update readme 1 month ago
Cargo.lock Logging overhaul 1 month ago
Cargo.toml Logging overhaul 1 month ago
LICENSE Create LICENSE 6 months ago
README.md Logging overhaul 1 month ago

README.md

qbin

Simple pastebin-like service in asynchronous Rust. Written to demonstrate the superiority of async programming by handling many TCP clients on a single OS thread.

There's a demo instance running at tcp.famfo.xyz:51337.

Building

Run cargo build --release to build the project and use the generated binary in target/release/qbin.

Running

qbin expects the following environment variables at runtime:

  • QBIN_LISTEN - the network address to listen on (e.g. 127.0.0.1:1234)
  • QBIN_DB - SQLite3 database file path
  • QBIN_LOG - log level (trace, debug, info, warn or error), default: warn

Simple OpenRC service scripts are available in the openrc directory.

Usage

qbin requires the input stream to be closed before proceeding with the input (e.g. EOF). The recommened tool is OpenBSD's netcat, available on most *nixes:

pfetch | nc -N tcp.famfo.xyz 51337

Or alternatively, nmap's ncat available on most platforms (including Windows):

pfetch | ncat tcp.famfo.xyz 51337

A sucessful run will return the paste ID. Pastes also can be retreived with netcat/ncat:

echo '!get <paste id>' | nc -N tcp.famfo.xyz 51337

Note: The -N flag seems to be nonexistent in GNU netcat, although it is essential for qbin connections to work, since (unlike termbin.com), qbin doesn't implement a timeout (to improve stability on very slow connections).