Stefano Marinelli<p>Good morning, friends of the <a href="https://mastodon.bsd.cafe/tags/BSDcafe" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>BSDcafe</span></a> and <a href="https://mastodon.bsd.cafe/tags/fediverse" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fediverse</span></a> <br> I'd like to share some details on the infrastructure of BSD.cafe with you all. </p><p>Currently, it's quite simple (we're not many and the load isn't high), but I've structured it to be scalable. It's based on <a href="https://mastodon.bsd.cafe/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FreeBSD</span></a>, connected in both ipv4 and ipv6, and split into jails:</p><p>* A dedicated jail with nginx acting as a reverse proxy - managing certificates and directing traffic<br>* A jail with a small <a href="https://mastodon.bsd.cafe/tags/opensmtpd" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>opensmtpd</span></a> server - handling email dispatch - didn't want to rely on external services<br>* A jail with <a href="https://mastodon.bsd.cafe/tags/redis" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>redis</span></a> - the heart of the communication between <a href="https://mastodon.bsd.cafe/tags/Mastodon" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Mastodon</span></a> services - the nervous system of BSDcafe<br>* A jail with <a href="https://mastodon.bsd.cafe/tags/postgresql" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>postgresql</span></a> - the database, the memory of BSDcafe<br>* A jail for media storage. The 'multimedia memory' of BSDcafe. This jail is on an external server with rotating disks, behind <a href="https://mastodon.bsd.cafe/tags/cloudflare" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>cloudflare</span></a>. Aim is georeplicated caching of multimedia data to reduce bandwidth usage.<br>* A jail with Mastodon itself - <a href="https://mastodon.bsd.cafe/tags/sidekiq" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sidekiq</span></a>, <a href="https://mastodon.bsd.cafe/tags/puma" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>puma</span></a>, <a href="https://mastodon.bsd.cafe/tags/streaming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>streaming</span></a>. Here is where all processing and connection management takes place.</p><p>All communicate through a private LAN (in bridge) and is set up for VPN connection to external machines - in case I want to move some services, replicate or add them. The VPN connection can occur via <a href="https://mastodon.bsd.cafe/tags/zerotier" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>zerotier</span></a> or <a href="https://mastodon.bsd.cafe/tags/wireguard" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>wireguard</span></a>, and I've also set up a bridge between machines through a <a href="https://mastodon.bsd.cafe/tags/vxlan" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vxlan</span></a> interface over <a href="https://mastodon.bsd.cafe/tags/wireguard" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>wireguard</span></a>.</p><p>Backups are constantly done via <a href="https://mastodon.bsd.cafe/tags/zfs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>zfs</span></a> snapshots and external replication on two different machines, in two different datacenters (and different from the production VPS datacenter).</p><p><a href="https://mastodon.bsd.cafe/tags/sysadmin" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sysadmin</span></a> <a href="https://mastodon.bsd.cafe/tags/tech" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tech</span></a> <a href="https://mastodon.bsd.cafe/tags/servers" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>servers</span></a> <a href="https://mastodon.bsd.cafe/tags/ITinfrastructure" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ITinfrastructure</span></a> <a href="https://mastodon.bsd.cafe/tags/BSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>BSD</span></a></p>