mirror of
https://github.com/mrgluek/deltachat_username.git
synced 2026-09-20 21:41:02 +02:00
Short invite link service & custom username bot for Delta Chat
- Python 98.7%
- Shell 1.1%
- Dockerfile 0.2%
| .github/workflows | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| bot.py | ||
| Caddyfile | ||
| CHANGELOG.md | ||
| database.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| favicon.ico | ||
| icon.jpg | ||
| icon.png | ||
| identicon.py | ||
| README.md | ||
| requirements.txt | ||
| set_admin.py | ||
| update.sh | ||
🔗 Delta Chat Username & Short Link Bot (deltachat_username)
A Delta Chat bot and FastAPI web service for registering custom usernames and generating short invite links (https://deltachat.id/<username>) that redirect (via HTTP 307 Temporary Redirect) to standard Delta Chat invite URLs (https://i.delta.chat/#...).
✨ Features
- 👤 Custom Usernames: Claim a short username (
/username myname) for your personal profile or group chat. - 🔐 Visual Cryptographic Verification: Anti-impersonation verification displaying 10-group formatted PGP fingerprints, 5x5 symmetric Unicode block Identicons, and 5-emoji visual badges.
- 🖼️ Social OpenGraph & Twitter Cards: Smart crawler detection serving rich metadata and cached dynamic PNG cards (
1200x630) on Telegram, Discord, Twitter, WhatsApp, etc. - 📇 Web Profile Cards & Avatars: Dynamic endpoints (
/{username}/og.png,/{username}/avatar.svg, and/{username}/card) for visual badges, QR codes, and web verification. - ⚡️ Group Chat Auto-Binding: Use
/username mynamedirectly inside any group chat — the bot instantly generates the group's invite URL without manual link pasting. - 🔀 HTTP 307 Temporary Redirect: Guarantees browsers and proxies always fetch the newest invite link without aggressive caching.
- 🌐 Web Landing Page: Beautiful dark-mode glassmorphism interface on
GET /displaying bot description, QR code, and interactive command hints. - 🛡️ Secure Administration: Authenticate ownership via
/initadminwith cryptographic fingerprint verification. - 📡 Multi-Transport & Statistics: Track sent/received relay stats and configure backup transports.
🚀 Quick Start & Deployment
1. Build Container
Clone repository and navigate to deltachat_username:
cd deltachat_username
cp .env.example .env
docker compose build
2. Initialize Delta Chat Account
Initialize the bot's account in Delta Chat CLI (deltabot-cli):
# Option A: Automatic setup on a Chatmail server (e.g. chatmail.uk or nine.testrun.org)
docker compose run --rm username_bot python bot.py init usernamebot@chatmail.uk
# Option B: Standard email account with password
docker compose run --rm username_bot python bot.py init usernamebot@yourdomain.com "your_password"
3. (Optional) Pre-configure Admin Email / Fingerprint
docker compose run --rm username_bot python set_admin.py --email admin@yourdomain.com
4. Launch Bot Daemon
docker compose up -d
5. Claim Administrative Ownership
Send /initadmin to the bot in a private message in Delta Chat to complete admin identity verification.
🤖 Bot Commands
| Command | Scope | Description |
|---|---|---|
/username |
All | Check your current chat's registered username and short link. |
/username <name> |
All | Look up short link for any registered username. |
/link <name> <url> |
Private | Bind custom username & invite link (replaces old username if present). |
/link <name> |
Group | Auto-generate group invite link and bind username. |
/unlink |
All | Unlink registered username from current chat. |
/unlink <name> |
Admin | Force-unlink a registered username. |
/help |
All | Show command help and bot info. |
/donate |
All | Support bot development. |
/initadmin |
Admin | Claim administrative ownership. |
/url <url> |
Admin | Set base domain URL (https://deltachat.id). |
/inviteurl <url> |
Admin | Set custom invite base URL/mirror (https://i.gluek.info/#). |
/stats |
Admin | Show registered usernames, resilient mode, and database stats. |
/transports |
Admin | List configured mail relays and statistics. |
/addtransport <uri/creds> |
Admin (Private) | Add a backup mail transport relay. |
/rmtransport <addr> |
Admin | Remove a configured mail transport. |
/setprimary <addr> |
Admin | Switch primary mail sending transport. |
/resilient [on|off] |
Admin | Toggle resilient multi-relay broadcasting mode. |
🌐 Caddy Configuration
Add to your /etc/caddy/Caddyfile:
deltachat.id, d.gluek.info {
reverse_proxy 127.0.0.1:8080
}
www.deltachat.id {
redir https://deltachat.id{uri} permanent
}
🧪 Running Unit Tests
python3 -m unittest discover -s tests -p "test_*.py" -v
❤️ Support & Development
If you find this bot useful, consider supporting its development:
- ⭐ Star this repository or bookmark it!
- Git Repository: mrgluek/deltachat_username
- Forgejo Mirror: gluek/deltachat_username
- Donations: