Public
Remixed
Ciphertext relay and private local-reader inbox
emailformssecurity
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Secure Message Relay

Receives OpenPGP ciphertext from approved website origins, stores only ciphertext in val-scoped blob storage, and emails the armored ciphertext plus a downloadable .asc backup. The optional sender name remains cleartext for the email subject. Message-management routes require a bearer token and are intended for the local GPG reader.

Files

  • main.tsx — public submission API and protected reader routes
  • shared.ts — validation and record types
  • storage.ts — val-scoped blob storage and retention logic
  • cleanup.ts — scheduled retention cleanup

Environment variables

Required for every deployment:

  • ALLOWED_ORIGINS
  • EXPECTED_KEY_ID
  • INBOX_TOKEN

Email delivery:

  • Free tier: EMAIL_TO_SELF=true
  • Paid tier: NOTIFICATION_EMAIL=recipient@example.com and omit or set EMAIL_TO_SELF=false

Optional:

  • RETENTION_DAYS (default 30)
  • SUBMISSION_LIMIT_PER_10_MINUTES (default 10)

The private OpenPGP key and plaintext are never uploaded to Val Town or included in email.

Health check