Projects
Free communication in the digital age
Bachelor’s thesis · University of Rome Tor Vergata · 2025/2026
A self-hosted alternative to centralized messaging platforms, built on the open, federated Matrix protocol. The project covers the whole stack: running my own homeserver in production and writing a terminal client for it from scratch, both in Rust.
Server
- Matrix homeserver (Conduit, since migrated to its successor Tuwunel) on a personal Debian VPS, running in Docker with a RocksDB database.
- Nginx reverse proxy with TLS termination for client traffic and federation; certificates issued and renewed automatically by Let’s Encrypt.
- Federated with the public Matrix network: users on
matrix.ascenzi.orgcan talk to people on any other Matrix server. - Registration restricted with a token, so only invited users can create an account.
Client: Telaio
- Minimal text-based (TUI) Matrix client written in Rust with Ratatui, on top of
matrix-sdkand the Tokio async runtime. Free software, released under the GPL-3.0. - A single event loop waits on terminal input, results from background work and a timer. Key handlers never touch the network: they turn input into commands, each run in its own Tokio task, while the Matrix sync runs in a separate task. Results come back as events on a channel and are applied to the state in one place, so the interface never blocks.
- The screen is redrawn only when something changed, once per burst of events, and the message view builds only the lines that fit on screen.
- Clear separation of layers: the application state has no terminal or network code, a single module talks to
matrix-sdk, and rendering is split by screen area. - Rooms, Spaces, direct messages and invites, attachments, moderation and multiple accounts, with vim-style keybindings and mouse support.
- End-to-end encryption (Olm/Megolm), with session verification by emoji (SAS) or recovery key; keys stored in a local encrypted SQLite database.
- Unit and rendering tests that draw the interface on Ratatui’s test backend with sample data, without a homeserver; kept free of Clippy warnings.
Thesis (PDF, in Italian)·Presentation slides·Telaio on GitHub
WireGuard VPN
Personal project
A WireGuard VPN running on the same VPS, giving my laptop and phone a private, encrypted network with the server.
- Full-tunnel setup: all traffic from my devices goes through the VPN, with NAT on the server to reach the internet.
- Private DNS available only inside the tunnel: Pi-hole blocks ads and trackers for every connected device, and Unbound resolves names recursively with DNSSEC validation, without relying on a third-party DNS provider.
- Management services (the Pi-hole admin panel and the DNS resolver) listen only on the VPN interface and are not reachable from the internet.
- Started at boot by systemd, with the services that depend on it brought up afterwards; the DNS containers are updated automatically every week, with a backup taken first.
Self-hosted infrastructure
Ongoing
Everything on this page runs on a single small Debian VPS that I set up and maintain myself, treated as a production system rather than a playground.
- Services: the Matrix homeserver, a TeamSpeak voice server, Pi-hole and Unbound for the VPN, and this website. Most of them run in Docker containers, with Nginx serving the site and acting as reverse proxy for Matrix.
- Automation: weekly updates for the containers, each preceded by a backup; weekly backups of the Matrix database; unattended security updates for the system; automatic TLS certificate renewal and log rotation.
- Hardening: key-only SSH with root login disabled, fail2ban, internal services bound only to localhost or to the VPN, and strict HTTP security headers (CSP, HSTS). The setup is checked periodically from the outside with port, TLS and header scans.
- Maintenance: an in-place migration of the Matrix homeserver from Conduit to Tuwunel, keeping all data and the server’s signing key, with a tested rollback plan. Every change is recorded in a maintenance log.