No description
  • PHP 71.4%
  • JavaScript 13.6%
  • CSS 12.8%
  • Dockerfile 1.7%
  • Shell 0.5%
Find a file
RGBToaster 38a4715ab3
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Switched from local build to prebuild image
2026-04-11 02:50:05 +02:00
config Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00
data Added files 2026-04-11 00:09:33 +02:00
public Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00
scripts Reworked webinterface, fixed some stuff lol 2026-04-11 01:38:19 +02:00
.dockerignore Tried making the image smaller 2026-04-11 01:49:02 +02:00
.env Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00
.gitignore Added files 2026-04-11 00:09:33 +02:00
.woodpecker.yml Reworked webinterface, fixed some stuff lol 2026-04-11 01:38:19 +02:00
config.php Added files 2026-04-11 00:09:33 +02:00
crontab Tried making the image smaller 2026-04-11 01:49:02 +02:00
docker-compose.yml Switched from local build to prebuild image 2026-04-11 02:50:05 +02:00
Dockerfile Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00
entrypoint.sh Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00
nginx.conf Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00
README.md Changed web-stuff again; switched to nginx from PHP Dev server, rewrote frontend 2026-04-11 02:49:18 +02:00

CrystalBin

CrystalBin is a lightweight FileBin/PasteBin web app that stores bins in a date-sorted directory structure and keeps a simple index for expiry cleanup.

Features

  • PasteBin with automatic highlight.js language detection or manual selection.
  • FileBin with configurable per-file size limits (default 500MB).
  • Date-sorted storage layout: /storage_root/10.04.2025/<bin-id>/....
  • Index log (index.jsonl) plus per-bin metadata files (index/<bin-id>.json).
  • Per-bin retention controls with admin and per-type caps (supports infinite).
  • mCaptcha verification support.

Configuration

All settings live in config/settings.php and can be overridden via environment variables or a local .env file.

  • CRYSTALBIN_STORAGE: storage root (default ./data).
  • CRYSTALBIN_ADMIN_MAX_DAYS: global max retention (default 3, use infinite for no cap).
  • CRYSTALBIN_PASTE_MAX_DAYS: PasteBin cap (default infinite).
  • CRYSTALBIN_FILE_MAX_DAYS: FileBin cap (default 3).
  • CRYSTALBIN_MAX_BIN_MB: per-bin upload limit in MB (default 500).
  • MCAPTCHA_ENABLED: true to enable mCaptcha (default false).
  • MCAPTCHA_URL, MCAPTCHA_SITEKEY, MCAPTCHA_SECRET: enable mCaptcha verification.

Example storage layout when CRYSTALBIN_STORAGE=/bin:

/bin/10.04.2025/<bin-id>/paste.txt
/bin/10.04.2025/<bin-id>/myfile.zip
/bin/index.jsonl
/bin/index/<bin-id>.json

Running locally

php -S localhost:8080 -t public

Docker

Build and run:

docker build -t crystalbin .
docker run -p 8080:80 \
  --env-file .env \
  -v $(pwd)/data:/data \
  crystalbin

The container runs nginx with php-fpm for production-ready serving.

Docker Compose

docker compose up --build

The compose setup reads environment variables from .env.

Notes

  • Expired bins are cleaned up on request.
  • mCaptcha verification uses POST {MCAPTCHA_URL}/api/v1/pow/siteverify with JSON {token, secret, key}.