{"id":48537970,"url":"https://github.com/fialkaapp/fialka-mailbox","last_synced_at":"2026-04-08T03:02:01.053Z","repository":{"id":349879838,"uuid":"1204127796","full_name":"FialkaApp/fialka-mailbox","owner":"FialkaApp","description":"📬 Self-hosted store-and-forward relay for Fialka over Tor. AES-256-GCM, zero server-side decryption, no metadata, Raspberry Pi ready.","archived":false,"fork":false,"pushed_at":"2026-04-08T01:08:36.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-08T01:25:31.859Z","etag":null,"topics":["aes-256-gcm","cryptography","e2e-encryption","end-to-end-encryption","kotlin","mailbox","messenger","onion-service","post-quantum","privacy","raspberry-pi","relay","security","self-hosted","server","store-and-forward","tor","zero-metadata"],"latest_commit_sha":null,"homepage":"https://fialka.app","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FialkaApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T18:04:37.000Z","updated_at":"2026-04-08T01:07:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/FialkaApp/fialka-mailbox","commit_stats":null,"previous_names":["fialkaapp/fialka-mailbox"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FialkaApp/fialka-mailbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FialkaApp%2Ffialka-mailbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FialkaApp%2Ffialka-mailbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FialkaApp%2Ffialka-mailbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FialkaApp%2Ffialka-mailbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FialkaApp","download_url":"https://codeload.github.com/FialkaApp/fialka-mailbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FialkaApp%2Ffialka-mailbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31537791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-256-gcm","cryptography","e2e-encryption","end-to-end-encryption","kotlin","mailbox","messenger","onion-service","post-quantum","privacy","raspberry-pi","relay","security","self-hosted","server","store-and-forward","tor","zero-metadata"],"created_at":"2026-04-08T03:02:00.276Z","updated_at":"2026-04-08T03:02:01.048Z","avatar_url":"https://github.com/FialkaApp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fialka-mailbox\n\n\u003e **[English version below](#english)**\n\n---\n\n## Français\n\nServeur relay auto-hébergé, privacy-first, pour l'écosystème [Fialka](https://fialka.app).\n\n### Ce que c'est\n\n**fialka-mailbox** est un relais store-and-forward **aveugle** : il stocke et transfère des blobs chiffrés sans jamais en voir le contenu. Les messages sont chiffrés par l'application Fialka (PQXDH + Double Ratchet) avant dépôt — le serveur ne voit que du bruit.\n\n- Exposé via **Tor hidden service v3 (.onion)** — aucune IP exposée\n- Protocole TCP binaire au lieu de HTTP — surface d'attaque minimale\n- Membership contrôlé (liste blanche Ed25519 — pas de relay public ouvert)\n- Clé .onion protégée : **passphrase** (argon2id + AES-256-GCM) ou **TPM 2.0** (systemd-creds)\n- Binaire statique unique — déployable sur RPi, VPS, Docker\n\n### Installation rapide (Linux / RPi)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/FialkaApp/fialka-mailbox/main/deploy/install.sh | sudo bash\n```\n\nL'installeur détecte automatiquement si un **TPM 2.0** est disponible et propose :\n1. **TPM 2.0** — clé liée au hardware, redémarrage automatique\n2. **Passphrase** — argon2id + AES-256-GCM, saisie à chaque démarrage *(recommandé sans TPM)*\n3. **Plaintext** — legacy, non recommandé\n\n### Installation manuelle\n\n```bash\n# Cloner\ngit clone https://github.com/FialkaApp/fialka-mailbox.git\ncd fialka-mailbox\n\n# Compiler (Go 1.23+)\ngo build -o fialka .\n\n# Setup interactif\nsudo ./fialka setup\n\n# Démarrer\nsudo ./fialka start\n```\n\n### Docker\n\n```bash\ndocker compose up -d\n```\n\nLa clé .onion est persistée dans le volume `mailbox-data`.\n\n### Commandes\n\n| Commande | Description |\n|---|---|\n| `fialka setup` | Wizard de configuration interactif (TUI) |\n| `fialka start` | Démarrer le daemon relay |\n| `fialka stop` | Arrêter le daemon |\n| `fialka restart` | Redémarrer le daemon |\n| `fialka status` | Statut + adresse .onion |\n| `fialka config` | Édition interactive de la configuration |\n| `fialka logs` | Logs en temps réel |\n| `fialka mailbox` | Gestion membres et invitations |\n| `fialka uninstall` | Désinstallation propre |\n\n### Configuration\n\nFichier : `/etc/fialka-mailbox/config.toml`\n\n```toml\n[server]\nlisten = \"127.0.0.1:7333\"   # Port TCP interne (Tor gère l'exposition)\n\n[tor]\nenabled = true\ntor_binary = \"\"              # Auto-détecté\ndata_dir = \"\"                # Défaut: ~/.config/fialka-mailbox/tor\nkey_protection = \"passphrase\" # \"plaintext\" | \"passphrase\" | \"tpm\"\ncred_name = \"onion-key\"      # Nom du credential systemd (mode tpm)\n\n[storage]\ndb_path = \"mailbox.db\"\n\n[limits]\nmax_message_size = 65536     # 64 Ko par message\nmax_messages_per_recipient = 100\nmessage_ttl_hours = 168      # 7 jours\nmax_storage_mb = 500\n\n[security]\nrate_limit_deposits = 60     # Dépôts max par IP par minute\nrequire_auth_fetch = true    # Auth Ed25519 obligatoire pour la récupération\n```\n\n### Protocole\n\nLe serveur utilise un protocole **TCP binaire** (pas HTTP), format :\n\n```\n[4 octets : type] [4 octets : longueur payload] [payload]\n```\n\n| Type | Code | Description |\n|---|---|---|\n| DEPOSIT | 0x01 | Dépôt d'un blob chiffré |\n| FETCH | 0x02 | Récupération des messages (auth Ed25519) |\n| DELETE | 0x03 | Acquittement / suppression |\n| FETCH_RESP | 0x04 | Réponse avec les blobs |\n| ACK | 0x05 | Accusé de réception |\n| ERROR | 0x06 | Erreur protocolaire |\n| INVITE_USE | 0x07 | Utilisation d'un token d'invitation |\n| MEMBER_LIST | 0x08 | Liste des membres |\n\n**Auth FETCH** : challenge-response Ed25519.\nLe serveur ne connaît que `base64(raw 32B pubkey)` — jamais la clé privée, jamais le contenu.\n\n### Membership\n\n```bash\n# Générer une invitation (usage unique, 24h)\nfialka mailbox invite --max-uses 1 --expires 24h\n\n# Lister les membres\nfialka mailbox list\n\n# Révoquer un membre\nfialka mailbox revoke \u003cpubkey_hash\u003e\n```\n\n### Sécurité — Modèle de menace\n\n**Ce que fialka-mailbox protège :**\n- Contenu des messages (chiffrement E2E par Fialka — le serveur voit des blobs opaques)\n- Identité des correspondants (seul le hash SHA-256 de la pubkey est stocké)\n- Clé .onion au repos en modes passphrase et TPM\n\n**Ce que fialka-mailbox ne protège PAS :**\n- Métadonnées de timing (moment du dépôt/récupération)\n- Analyse de trafic réseau (Tor atténue mais n'élimine pas)\n- Compromission du serveur en cours d'exécution\n- Saisie légale du serveur (les blobs chiffrés restent inutilisables pour l'attaquant)\n\n### Stack technique\n\n| Composant | Librairie |\n|---|---|\n| CLI | `cobra` |\n| Wizard setup | `bubbletea` + `huh` |\n| Protocole TCP | stdlib `net` |\n| Base de données | `modernc/sqlite` (pure Go) |\n| Tor | control port (`ADD_ONION ED25519-V3`) |\n| Config | `viper` (TOML) |\n| Logs | `zerolog` |\n| Crypto clé | `golang.org/x/crypto` (argon2id + AES-256-GCM) |\n| TTY passphrase | `golang.org/x/term` |\n\n### Licence\n\nGPL-3.0 — voir [LICENSE](LICENSE)\n\n---\n\n## English\n\n\u003ca name=\"english\"\u003e\u003c/a\u003e\n\nSelf-hosted, privacy-first message relay for the [Fialka](https://fialka.app) ecosystem.\n\n### What it is\n\n**fialka-mailbox** is a **blind** store-and-forward relay: it stores and forwards encrypted blobs without ever seeing their content. Messages are encrypted by the Fialka app (PQXDH + Double Ratchet) before deposit — the server only sees opaque ciphertext.\n\n- Exposed via **Tor hidden service v3 (.onion)** — no IP address exposed\n- Binary TCP protocol instead of HTTP — minimal attack surface\n- Controlled membership (Ed25519 allowlist — no open relay)\n- .onion key protection: **passphrase** (argon2id + AES-256-GCM) or **TPM 2.0** (systemd-creds)\n- Single static binary — deployable on RPi, VPS, Docker\n\n### Quick install (Linux / RPi)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/FialkaApp/fialka-mailbox/main/deploy/install.sh | sudo bash\n```\n\nThe installer automatically detects if a **TPM 2.0** is available and offers:\n1. **TPM 2.0** — hardware-bound key, automatic restart\n2. **Passphrase** — argon2id + AES-256-GCM, prompted on every start *(recommended without TPM)*\n3. **Plaintext** — legacy, not recommended\n\n### Manual install\n\n```bash\ngit clone https://github.com/FialkaApp/fialka-mailbox.git\ncd fialka-mailbox\n\n# Build (requires Go 1.23+)\ngo build -o fialka .\n\n# Interactive setup\nsudo ./fialka setup\n\n# Start\nsudo ./fialka start\n```\n\n### Docker\n\n```bash\ndocker compose up -d\n```\n\nThe .onion key is persisted in the `mailbox-data` volume.\n\n### Commands\n\n| Command | Description |\n|---|---|\n| `fialka setup` | Interactive configuration wizard (TUI) |\n| `fialka start` | Start the relay daemon |\n| `fialka stop` | Stop the daemon |\n| `fialka restart` | Restart the daemon |\n| `fialka status` | Status + .onion address |\n| `fialka config` | Interactive configuration editor |\n| `fialka logs` | Tail live logs |\n| `fialka mailbox` | Manage members and invitations |\n| `fialka uninstall` | Clean uninstall |\n\n### Configuration\n\nFile: `/etc/fialka-mailbox/config.toml`\n\n```toml\n[server]\nlisten = \"127.0.0.1:7333\"   # Internal TCP port (Tor handles exposure)\n\n[tor]\nenabled = true\ntor_binary = \"\"              # Auto-detected\ndata_dir = \"\"                # Default: ~/.config/fialka-mailbox/tor\nkey_protection = \"passphrase\" # \"plaintext\" | \"passphrase\" | \"tpm\"\ncred_name = \"onion-key\"      # systemd credential name (tpm mode)\n\n[storage]\ndb_path = \"mailbox.db\"\n\n[limits]\nmax_message_size = 65536     # 64 KB per message\nmax_messages_per_recipient = 100\nmessage_ttl_hours = 168      # 7 days\nmax_storage_mb = 500\n\n[security]\nrate_limit_deposits = 60     # Max deposits per IP per minute\nrequire_auth_fetch = true    # Ed25519 auth required to fetch messages\n```\n\n### Protocol\n\nThe server uses a **binary TCP protocol** (not HTTP), with the frame format:\n\n```\n[4 bytes: type] [4 bytes: payload length] [payload]\n```\n\n| Type | Code | Description |\n|---|---|---|\n| DEPOSIT | 0x01 | Deposit an encrypted blob |\n| FETCH | 0x02 | Retrieve messages (Ed25519 auth) |\n| DELETE | 0x03 | Acknowledge receipt / delete |\n| FETCH_RESP | 0x04 | Response with blobs |\n| ACK | 0x05 | Acknowledgement |\n| ERROR | 0x06 | Protocol error |\n| INVITE_USE | 0x07 | Use an invitation token |\n| MEMBER_LIST | 0x08 | List members |\n\n**FETCH auth**: Ed25519 challenge-response.\nThe server only stores `base64(raw 32B pubkey)` — never the private key, never the content.\n\n### Membership\n\n```bash\n# Generate an invitation (single-use, 24h)\nfialka mailbox invite --max-uses 1 --expires 24h\n\n# List members\nfialka mailbox list\n\n# Revoke a member\nfialka mailbox revoke \u003cpubkey_hash\u003e\n```\n\n### Security — Threat model\n\n**What fialka-mailbox protects:**\n- Message content (E2E encrypted by Fialka — the server sees opaque blobs)\n- Correspondent identities (only SHA-256 hash of pubkey is stored)\n- .onion key at rest in passphrase and TPM modes\n\n**What fialka-mailbox does NOT protect:**\n- Timing metadata (when messages are deposited/retrieved)\n- Network traffic analysis (Tor mitigates but does not eliminate)\n- A compromised running server\n- Legal seizure of the server (encrypted blobs remain useless to an attacker)\n\n### Tech stack\n\n| Component | Library |\n|---|---|\n| CLI | `cobra` |\n| Setup wizard | `bubbletea` + `huh` |\n| TCP protocol | stdlib `net` |\n| Database | `modernc/sqlite` (pure Go) |\n| Tor | control port (`ADD_ONION ED25519-V3`) |\n| Config | `viper` (TOML) |\n| Logging | `zerolog` |\n| Key crypto | `golang.org/x/crypto` (argon2id + AES-256-GCM) |\n| TTY passphrase | `golang.org/x/term` |\n\n### License\n\nGPL-3.0 — see [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffialkaapp%2Ffialka-mailbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffialkaapp%2Ffialka-mailbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffialkaapp%2Ffialka-mailbox/lists"}