Simple pastebin-like service in asynchronous Rust
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
lemonsh 2e45a08694 Update documentation 2 months ago
openrc Update documentation 2 months ago
src Add config file, remove ratelimit (temporarily), modernize everything. 2 months ago
.gitignore Update documentation 2 months ago
Cargo.lock Add config file, remove ratelimit (temporarily), modernize everything. 2 months ago
Cargo.toml Add config file, remove ratelimit (temporarily), modernize everything. 2 months ago
LICENSE Create LICENSE 1 year ago
README.md Update documentation 2 months ago
qbin.toml Update documentation 2 months ago
rustfmt.toml Add config file, remove ratelimit (temporarily), modernize everything. 2 months ago
sample_qbin.toml Update documentation 2 months 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.

Building

Run cargo build --release to build the project. The resulting binary will be in the target/release directory.

Running

qbin uses a configuration file in the TOML format. A sample config is provided in the repository.

You can specify the config file location using the QBIN_CONFIG environment variable, otherwise qbin looks for a file named qbin.toml in the working directory.

Simple OpenRC service scripts are available in the openrc directory.

Usage

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

pfetch | nc -N <host> <port>

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

pfetch | ncat <host> <port>

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

echo 'G!<paste id>' | nc -N <host> <port>

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).