Hardening

Security model

Products are never on a public CDN. Every pull is minted, bound, logged, and short-lived.

Discord Member gate

OAuth login + live bot check against DISCORD_GUILD_ID / DISCORD_MEMBER_ROLE_ID. No role = no vault.

Unique download tokens

Each request creates a random base64url token. Only the SHA-256 hash is stored. Raw token is shown once in the URL.

IP binding

Token is locked to the IP that requested it. Share the link from another network and it fails with ip_mismatch — logged.

VPN / proxy / Tor block

Proxycheck.io (or configured provider) runs on issue and redeem. VPN users cannot mint or redeem links.

TTL + use caps

Default 30 minutes, 3 uses. After that the token is dead. Issue a new one from your account.

Full audit log

DownloadEvent stores user, product, IP, UA, country, VPN flag, success/fail reason. SecurityLog catches VPN and IP mismatch events.

Private object storage

Files live in Cloudflare R2 / S3 with no public ACL. Redeem returns a short-lived signed URL (or streams via the function).

No system is leak-proof against a determined buyer who re-uploads after a legitimate download. This stack makes casual sharing and scraping fail hard — and gives you forensic logs when someone tries.