No description
- PHP 71.4%
- JavaScript 13.6%
- CSS 12.8%
- Dockerfile 1.7%
- Shell 0.5%
|
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
|
||
|---|---|---|
| config | ||
| data | ||
| public | ||
| scripts | ||
| .dockerignore | ||
| .env | ||
| .gitignore | ||
| .woodpecker.yml | ||
| config.php | ||
| crontab | ||
| docker-compose.yml | ||
| Dockerfile | ||
| entrypoint.sh | ||
| nginx.conf | ||
| README.md | ||
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 (default3, useinfinitefor no cap).CRYSTALBIN_PASTE_MAX_DAYS: PasteBin cap (defaultinfinite).CRYSTALBIN_FILE_MAX_DAYS: FileBin cap (default3).CRYSTALBIN_MAX_BIN_MB: per-bin upload limit in MB (default500).MCAPTCHA_ENABLED:trueto enable mCaptcha (defaultfalse).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/siteverifywith JSON{token, secret, key}.