a simple bin with optional abuse and auth support.
feature/file-sharing for file sharing and admin panel.built using sveltekit and better-sqlite. auth: Username + Google Authenticator TOTP abuse blocking and purifying (isomorphic-dompurify).
isomorphic-dompurify to prevent XSS attacks.log/pastebin.log./api/admin/purge-and-ban) allows for purging all pastes of a user and permanently banning their last known IP address. This endpoint is restricted to local access only.MAX_PASTE_SIZE: Maximum size of a paste (default: 1MB).RATE_LIMIT_WINDOW_MS: Time window for rate limiting (default: 10 seconds).MAX_REQUESTS_PER_WINDOW: Maximum requests allowed within the rate limit window (default: 1).OFFENSE_EXPIRATION_MS: Duration after which an offense expires (default: 1 day).MAX_OFFENSES: Number of offenses before an IP is permanently banned (default: 5).LOGIN_ENABLED: Set to false to hide the login UI on the frontend.RATE_LIMIT_ENABLED: Set to false to disable all rate limiting and banning.SHOW_CREDITS: Set to TRUE to display the "made by timuzkas" credit on the frontend.Once you've cloned the project and installed dependencies with bun install (or npm install or pnpm install),
start a development server:
# with bun
bun run dev
# To disable login and rate limiting during development:
LOGIN_ENABLED=false RATE_LIMIT_ENABLED=false bun run dev
# or start the server and open the app in a new browser tab
bun run dev --open
To build your app for production:
bun run build
You can preview the production build with bun run preview.
To delete expired pastes, run the following command:
node cron/delete-expired-pastes.js
You can schedule this script to run periodically using your operating system's cron scheduler.