MCPSERV.CLUB
bin

bin

Self-Hosted

Minimalist paste bin in Rust

Stale(65)
593stars
0views
Updated May 25, 2025

Overview

Discover what makes bin powerful

`bin` is a minimal, self‑hosted paste service written entirely in Rust. The core idea is to deliver a **single executable** that can be dropped into any environment and started with zero external dependencies. Once running, it exposes a tiny HTTP API that accepts `PUT` requests for new pastes and serves them via simple GET URLs. The application keeps a rotating in‑memory buffer of the most recent pastes, discarding older entries automatically. This design eliminates the need for a database or persistent storage while still offering fast, low‑latency responses.

Zero‑dependency runtime

In‑memory rotation buffer

HTTP API

Lightweight syntax highlighting

Overview

bin is a minimal, self‑hosted paste service written entirely in Rust. The core idea is to deliver a single executable that can be dropped into any environment and started with zero external dependencies. Once running, it exposes a tiny HTTP API that accepts PUT requests for new pastes and serves them via simple GET URLs. The application keeps a rotating in‑memory buffer of the most recent pastes, discarding older entries automatically. This design eliminates the need for a database or persistent storage while still offering fast, low‑latency responses.

Key Features

  • Zero‑dependency runtime – a single binary, no database, no external services.
  • In‑memory rotation buffer – configurable size (--buffer-size) and paste limit (--max-paste-size).
  • HTTP APIPUT to create, GET to retrieve; supports optional file‑extension query for syntax highlighting.
  • Lightweight syntax highlighting – uses the syntect crate to render code blocks based on file extensions.
  • Cross‑platform – compiled Rust binaries work on Linux, macOS, Windows; container images are also available.
  • Extremely small footprint – ~300 lines of Rust, < 10 MB binary.

Technical Stack

LayerTechnology
LanguageRust 1.70+ (stable)
Web frameworkhyper + tokio for async I/O
Routing / handlingMinimal custom router; no heavy framework overhead
Syntax highlightingsyntect crate, bundled with a small set of language grammars
StorageIn‑memory VecDeque with configurable capacity; no persistence layer
ConfigurationCommand‑line flags (--buffer-size, --max-paste-size) parsed with clap
DeploymentSingle static binary; optional Docker image (ghcr.io/w4/bin)

Core Capabilities & APIs

  • Create a paste
    curl -X PUT --data-binary @file.txt http://localhost:8820/
    
    Returns a short, unique URL (e.g., /a1b2c3).
  • Retrieve a paste – simple GET to the returned URL.
  • Syntax highlighting – append the file extension (e.g., /a1b2c3.rs) to trigger syntect.
  • Health & metrics – no built‑in monitoring, but the lightweight nature allows easy integration with Prometheus or custom metrics via HTTP endpoints.

Deployment & Infrastructure

  • Self‑hosting – Run ./bin or the Docker container; no privileged operations required.
  • Scalability – The in‑memory buffer limits memory usage; for higher throughput, run multiple instances behind a load balancer.
  • Containerization – Official Docker images are available; the binary is statically linked, so the image size stays below 30 MB.
  • Resource profile – CPU: <10 % on a single core; Memory: ~1 MB per 1000 pastes (configurable).

Integration & Extensibility

While bin is intentionally minimal, its API makes it easy to embed into larger workflows:

  • CI/CD pipelines – Store build logs or test outputs temporarily.
  • Developer tools – Plug into IDEs to share snippets via the PUT endpoint.
  • Webhooks – Trigger paste creation from external services (e.g., GitHub Actions).
  • Custom front‑ends – The server only serves raw text; any UI can be built on top (e.g., a Vue or React app that consumes the API).

No plugin system is shipped, but the small codebase invites contributors to add features such as authentication or persistence.

Developer Experience

  • Configuration – All options are exposed via command‑line flags; no configuration files.
  • Documentation – The README is concise but covers usage, API examples, and build instructions.
  • Community – The project is hosted on GitHub with an active issue tracker; contributions are welcomed.
  • Licensing – MIT license, allowing unrestricted use in commercial or internal projects.

Use Cases

ScenarioWhy bin fits
Rapid code sharingInstant paste URLs via curl; no registration required.
CI artifact storageStore logs or test results for a few minutes without persisting on disk.
Internal toolingEmbed into custom dashboards or chatbots to share snippets on demand.
Educational environmentsProvide a simple, self‑hosted paste service for classrooms or hackathons.

Advantages Over Alternatives

CriterionbinTypical Paste Services
PerformanceSingle‑threaded async, <10 % CPUOften heavier frameworks
Footprint< 10 MB binary, no DBLarger images, external storage
Simplicity300 lines of Rust, no config filesMultiple moving parts
LicensingMITGPL or proprietary
ExtensibilityCustomizable via code, API hooksClosed ecosystems

For developers who need a quick, reliable, and fully controllable paste service without the overhead of database migrations or third‑party integrations, bin offers an elegant

Open SourceReady to get started?

Join the community and start self-hosting bin today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
other
License
NOASSERTION
Stars
593
Technical Specs
Pricing
Open Source
Database
None
Supported OS
Linux
Author
w4
w4
Last Updated
May 25, 2025