
Why
You have a static site — Hugo, Astro, Jekyll, hand-written HTML — and a
<form> that needs somewhere to POST. The hosted services work, but your
submissions live on someone else’s server, priced per submission, and you find
out about the pricing change with everyone else.
dsforms is the boring alternative you run yourself. Point your form at it and
every submission lands in a SQLite file on a $5 VPS that you can copy, query or
delete. No per-submission fee, no vendor, no Redis, no Postgres.
Features
- Spam quarantine, not a bin. Submissions are scored and held with the
breakdown that held them, so a false positive is one click from your inbox
instead of gone. Link markup, keywords, injection probes, repeat-IP activity
and synthetic tokens all feed a score you can tune per form.
- Filter rules — block an address, domain, IP or CIDR; allowlist the
customer the filter keeps catching. Allow always beats block.
- Email and webhooks — SMTP notifications, plus Slack, Discord or generic
JSON on every submission.
- Waitlists — unique signups by email, positions, confirmation emails, and
a restart-safe broadcast when you launch.
- Admin UI with search, bulk actions, CSV export and a reading drawer.
- Backups that fail safely — download or restore a snapshot from the UI; a
failed restore puts the original back rather than leaving you with nothing.
- Honeypot, rate limiting and login lockout built in. No CAPTCHA.
- MCP endpoint (optional) — point an MCP client at your instance to list
unread messages, read one, mark it as spam, or ask what is in the database.
Revocable bearer tokens, scoped by permission and limitable to particular
forms, or OAuth sign-in with a consent page for clients that need it; off
unless you turn it on.
- CLI for user management, API tokens and snapshots from inside the container.
- ~20MB image, health check included.

Quick start
docker run -d --name dsforms -p 8080:8080 \
-e SECRET_KEY="$(openssl rand -base64 32)" \
-v dsforms_data:/data \
ghcr.io/barancezayirli/dsforms:latest
Open http://localhost:8080, log in with admin / admin, and change the
password when it tells you to.
Prefer Compose, or want email working? See Deployment.
Building from source is make dev-up, which brings up Mailpit on :8025 so you
can see the notification emails.
Create a form in the admin, then paste the snippet it gives you:
<form action="https://your-server.com/f/YOUR_FORM_ID" method="POST">
<input type="text" name="name" placeholder="Your name" required>
<input type="email" name="email" placeholder="Your email" required>
<textarea name="message" placeholder="Your message" required></textarea>
<button type="submit">Send</button>
</form>
That is the whole integration.
Add these hidden fields to change what happens:
| Field |
Purpose |
_redirect |
Where to send the visitor after submitting — see below |
_honeypot |
Hidden spam trap — bots fill it, humans don’t |
<input type="text" name="_honeypot" style="display:none" tabindex="-1" autocomplete="off">
Redirect rules. _redirect comes from the browser, so it is only accepted
if it is a path on this instance, or a URL on the same origin as BASE_URL or
the form’s configured Redirect after submit. Anything else falls back to that
configured redirect — the submission is still stored either way.
So: point Redirect after submit at your own site and _redirect works for
any page on it. Without the rule, anyone could use your endpoint to bounce
visitors from your domain to theirs.
JSON instead of a redirect — send Accept: application/json:
curl -X POST https://your-server.com/f/FORM_ID \
-H "Accept: application/json" \
-d "name=Alice&[email protected]&message=Hello"
# {"success": true}
Documentation
|
|
| Configuration |
Every environment variable, SMTP providers, spam filtering |
| Deployment |
Docker, reverse proxy, TLS, health checks |
| Operations |
Users, backups, and what happens when a restore fails |
| Waitlists |
Signups, positions, confirmations, broadcasts |
| Development |
Building, testing, project layout |
| MCP |
Connecting an MCP client, tokens, scopes, the tools |
Security
- Session tokens stored as SHA-256 hashes — a leaked cookie does not expose the session
- Changing a password invalidates every session on every device
- bcrypt at cost 12, minimum 12 characters, enforced in the store so it covers the UI and both CLI commands
- HMAC-SHA256 signed flash cookies;
HttpOnly, SameSite=Lax, conditional Secure
- Per-IP rate limiting on submissions, and a 5-attempt / 15-minute login lockout
X-Content-Type-Options, X-Frame-Options, Referrer-Policy and a CSP
- 64KB request body limit (100MB for backup import, 1MB for MCP)
- API tokens stored as SHA-256 hashes, shown once, scoped and individually
revocable; deleting a user revokes theirs in the same statement
- API tokens and sessions are stripped from a snapshot on the way out and on
the way in, so a restore through the admin walks no revoked token or ended
session back in. Nothing else is removed, so a snapshot is as sensitive as the
database it copies, and a restore returns everything else to that point
- dsforms refuses to start with the MCP endpoint enabled over plain http, since
a bearer token would cross the network in the clear on every request
- Chat-template control tokens and invisible Unicode are removed from submission
content before an MCP client sees it, and reported to the client. The
recognised marker families are a list, so the client is told that an empty
report is not a clean bill of health. The stored message is never changed, and
the admin marks what was withheld
- An API token can be limited to particular forms, and then cannot read, change
or delete anything in the others — enforced in SQL on every query, not by
filtering rows afterwards
Found something? Please report it privately — see SECURITY.md.
Contributing
Issues and pull requests are welcome — start with
CONTRIBUTING.md. AGENT.md is the working
agreement this project actually runs on, and its testing section is worth
reading before a first patch.
Licence
AGPL-3.0. You can run it, modify it and self-host it freely. If
you modify dsforms and offer it to others as a network service, you have to
publish your changes under the same licence.
For the overwhelmingly common case — running it for yourself or your clients —
this asks nothing of you that MIT did. Releases up to and including v0.5.2
were published under MIT and stay available under those terms; the change
applies from the next release onward.
Support
Built by Baran Cezayirli. If dsforms saves you a
subscription, a coffee is very
welcome — and a ⭐ helps other people find it.
评论