Write-Up: My Multi-Purpose Travel Server
from IcedRaktajino@startrek.website to selfhosted@lemmy.world on 10 Jul 15:53
https://startrek.website/post/41991401

By popular demand from this post, here’s the write-up for my version of that travel server.

The travel server is shown with the, currently, bare 5V UPS board to its right. One day I hope to have a 3D printed case for both of those, but they’re currently separate as my 3D modeling skills are basically non-existent. The power cable is wrapped in aluminum foil and then wrapped in electrical tape due to EMI from the wifi adapter causing random glitches. A ferrite bead would probably solve that more elegantly, but I didn’t have any on hand so made due with what I have.

Hardware

Note: Unlike the Pi Zero, these have two USB ports. One is configured in host mode and the other in peripheral mode.

Features and Capabilities

Travel Router / Access Point

For internet uplink, there are multiple options depending on need. By default, the internal/bulit-in wi-fi is the internet uplink and the USB wi-fi adapter is the client-facing AP interface. This is how I normally keep it configured in my use-cases.

Alternatively, the built-in wi-fi can be used as the client-facing AP and the uplink to the internet can be provided by a USB-tethered smartphone or a USB ethernet adapter or the internet uplink can be omitted entirely and either the USB or built-in wifi adapters can serve clients. Fortunately, the built-in wifi chip in the Banana Pi works well in AP mode but that’s not always the case (cough Orange Pi Zero W2 cough).

If a PC is connected to USB0 (the OTG port), the device will act as an ethernet gadget. The travel server will add its end of the usb0 interface into the LAN bridge along with the client-side AP. This means the connected PC will be on the same LAN as the wireless clients.

It’s also possible to add a USB ethernet adapter and bridge it into the LAN side as well.

Depending on configuration, a small USB-C hub may be needed. I’ve got one that includes a USB A port, ethernet port, and additional USB C port.

VPNs can also be configured as needed. I’ve got a privacy one that can route all traffic as well as a Wireguard one that connects back to my home LAN when I’m using it remotely.

DHCP and DNS are both provided by PiHole

Reverse Proxy

All applications hosted on the travel server are fronted by Nginx and use valid Let’s Encrypt certificates. This eliminates the need to install a custom CA cert in end devices or have the clients accept an untrusted self-signed cert.

This also ensures all applications are protected by TLS which is required for full functionality of some applications.

How does that work?

The hostname of the travel server (mobile) is a subdomain of my personal, project domain (mydomain.xyz). All applications are a subdomain of that (e.g. application.mobile.mydomain.xyz), and I simply request a wildcard cert from Let’s Encrypt for *.mobile.mydomain.xyz. Currently, Let’s Encrypt requires the use of DNS validation when requesting wildcard certificates.

Movies/TV

Movies and TV shows are provided by Jellyfin and are stored on the 1 TB SD card. I’ve tested 4 simultaneous streams, and the travel server didn’t even break a sweat. Granted, it’s not transcoding anything so I believe I’m mostly limited by USB, wifi, and/or SD card bandwidth in that regard.

For reliability, the Jellyfin database is stored on the internal 32 GB eMMC rather than the SD card. This both reduces wear and tear on the card as well as proves to be more reliable.

CPU transoding is a non-starter, and the GPU drivers for these boards isn’t exactly well supported. The GPU drivers also rely on V4L which Jellyfin has deprecated for hardware transcoding, so I opted to forego transcoding entirely.

To load movies/TV shows on here, I pre-process them with ffmpeg in the following way:

Music

Music is provided by a combination of MPD and Snapcast and the library is also stored on the 1TB SD card.

MPD manages the music collection while Snapcast allows synchronized multi-room audio and connecting receivers via wifi.

For local playback, I use myMPD web UI and use its streaming feed or use the MPD and Snapcast clients on the end device. There’s also a Snapcast client installed on the travel server itself, so if you add a USB speaker it can playback music directly.

Books

It runs Calibre-Web to manage my book collection which is also stored on the 1 TB SD card.

Development

The travel server runs CodeServer which is an un-Microsofted web-based version of VSCode. You can set that up however you want, but I’ve got it setup for:

Other services it runs to facilitate development include:

Offline Knowledge

Kiwix is installed with a large selection of ZIMS for offline reference.

Search

I installed SearxNG so I always have an ad-free, AI-free, no BS search engine available.

File Sharing

The travel server has a few different ways to share files:

Future Plans / Not Yet Implemented

A keychain-sized server in a black, 3D printed case shown alongside a bare 5V UPS board.

#selfhosted

threaded - newest

mlfh@lm.mlfh.org on 10 Jul 15:59 next collapse

Very very cool! Would love to see it all in the case once you design and print it.

Valmond@lemmy.dbzer0.com on 10 Jul 16:13 next collapse

This is insane.

Insanely cool!

brap@lemmy.world on 10 Jul 16:33 next collapse

Very very nice. Some good inspiration in this post, especially the mobile Jellyfin part.

lemon@sh.itjust.works on 10 Jul 17:11 collapse

Can I please stand behind you in the airport security queue, just to see what happens?

IcedRaktajino@startrek.website on 10 Jul 17:37 collapse

Ha, yeah, that UPS board isn’t going on any plane. I’d just use an approved power bank in that case.