Skip to content

Spam protection and API keys for MSK Paste and MSK Shortener - #66

Merged
Musiker15 merged 2 commits into
mainfrom
docs/paste-shortener-spam-protection
Oct 30, 2026
Merged

Musiker15 merged 2 commits into
mainfrom
docs/paste-shortener-spam-protection

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Documents MSK-Scripts/msk-paste#30 and MSK-Scripts/msk-shortener#42. Merge only after both are deployed, every push to main here goes live at once.

What changes, English and German

  • API. Creating needs a Bearer key (mskp_…, msks_…), and without one the API answers 401. The new error codes and the content or target checks are documented, and every example sends the key. The hosted instances do not hand out keys.
  • FAQ. Where a key comes from, the daily limits, refusals with 409/422, and a form that creates nothing because the Turnstile keys are missing.
  • Usage. The spam protection (Turnstile, honeypot, form timestamp, daily limits) and the new rows in the limit tables.
  • Installation. Node.js 24 instead of 22, the new environment variables (CAPTCHA_*, DAILY_*, API_KEY_CREATE_PER_HOUR), managing keys with scripts/api-key.sh, and a note for the update.
  • Privacy. Cloudflare Turnstile is the only third-party script, on the create page only. The client address now comes from X-Real-IP or the last X-Forwarded-For entry. The language cookie is NEXT_LOCALE, which is what the code sets.

Not touched, still out of date

  • Shortener click IP hash. The shortener pages still describe a hashed IP per click, but clicks.ip_hash was dropped with migration 004. Affected: privacy, usage, faq, installation.
  • Port. .env.example of the shortener says port 3001, the docs say 3011.

Creating through the API now needs a key, the web form runs Cloudflare
Turnstile and further spam checks, and both tools turn down certain
content (paste: encoded files, link spam, repeats; shortener: own links,
other shorteners, IP hosts, phishing hostnames).

- API pages: authentication with Bearer keys, the new error codes and the
  content or target checks, every example sends the key.
- FAQ: where the key comes from, the daily limits, refusals with 409/422,
  a form that creates nothing without Turnstile keys.
- Usage: the spam protection and the new limits.
- Installation: Node.js 24, the new environment variables, managing keys
  with scripts/api-key.sh, a note for the update.
- Privacy: Cloudflare Turnstile as the only third-party script, how the
  client address is taken, the language cookie is NEXT_LOCALE.
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

MSK Paste and MSK Shortener store API keys as scrypt hashes now and stop an address after ten wrong keys in ten minutes (429, key-attempts).
@Musiker15
Musiker15 merged commit 9caec5d into main Oct 30, 2026
4 checks passed
@Musiker15
Musiker15 deleted the docs/paste-shortener-spam-protection branch October 30, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant