<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blog on Samirtech</title>
    <link>https://samirtech.org/posts/</link>
    <description>Recent content in Blog on Samirtech</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 06 Nov 2026 15:30:00 +0000</lastBuildDate><atom:link href="https://samirtech.org/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Segmenting a Home Network with OpenWrt, UniFi and Managed Switches</title>
      <link>https://samirtech.org/posts/segmenting-home-network-openwrt-unifi-managed-switches/</link>
      <pubDate>Fri, 06 Nov 2026 15:30:00 +0000</pubDate>
      
      <guid>https://samirtech.org/posts/segmenting-home-network-openwrt-unifi-managed-switches/</guid>
      <description>How do you separate homelab administration, household devices, less-trusted IoT equipment and guests without making ordinary home networking unnecessarily difficult? My first attempt at answering that question ran into a practical problem: a household phone needed selected home services, but putting it on an isolated IoT Wi-Fi blocked those services. Letting every wireless client into the server network would have solved the immediate problem by removing the boundary I wanted.</description>
      <content>&lt;p&gt;How do you separate homelab administration, household devices, less-trusted IoT equipment and guests without making ordinary home networking unnecessarily difficult? My first attempt at answering that question ran into a practical problem: a household phone needed selected home services, but putting it on an isolated IoT Wi-Fi blocked those services. Letting every wireless client into the server network would have solved the immediate problem by removing the boundary I wanted.&lt;/p&gt;
&lt;p&gt;The useful question became &lt;strong&gt;which devices need which services&lt;/strong&gt;, rather than whether a device is wired or wireless. I use four network roles as a design guide:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;What belongs there&lt;/th&gt;
&lt;th&gt;Intended access&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trusted network&lt;/td&gt;
&lt;td&gt;Administration computer, servers and network management&lt;/td&gt;
&lt;td&gt;Management access, kept away from general-purpose clients&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Household network&lt;/td&gt;
&lt;td&gt;Selected personal devices&lt;/td&gt;
&lt;td&gt;Approved home services, not blanket server administration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IoT network&lt;/td&gt;
&lt;td&gt;Less-trusted connected devices&lt;/td&gt;
&lt;td&gt;Internet and only specifically required local services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guest network&lt;/td&gt;
&lt;td&gt;Visitors&lt;/td&gt;
&lt;td&gt;Internet; local access only as a deliberate, narrow exception&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;These are &lt;strong&gt;roles&lt;/strong&gt;, not a claim that I have four independently validated homelab VLANs. In particular, the servers share the trusted network rather than a separately demonstrated homelab VLAN. A network name or a configured interface is not proof of end-to-end isolation.&lt;/p&gt;
&lt;h2 id=&#34;who-does-what&#34;&gt;Who does what&lt;/h2&gt;
&lt;p&gt;OpenWrt is the router: it owns interfaces, DHCP, routing and firewall policy. UniFi provides the Wi-Fi networks and associates wireless clients with the intended network. Managed switches, including third-party switches, carry the relevant Ethernet traffic between the router and access point. Every link in that path must agree about which traffic is untagged and which VLANs are tagged; the router&amp;rsquo;s firewall then determines whether traffic may cross between networks.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/mixed-trunk-diagram.png&#34; alt=&#34;Generic diagram of a Wi-Fi client, access point, managed switches and OpenWrt router carrying an example tagged client VLAN&#34;&gt;&lt;/p&gt;
&lt;p&gt;The diagram uses an &lt;strong&gt;example&lt;/strong&gt; VLAN number, not my live VLAN ID, port map, address plan or SSID. The earlier &lt;a href=&#34;https://samirtech.org/posts/carrying-an-isolated-wifi-vlan-across-openwrt-and-managed-switches/&#34;&gt;walkthrough of carrying an isolated Wi-Fi VLAN across OpenWrt and managed switches&lt;/a&gt; covers the tagging and switch-port details. This article is about deciding where access should and should not exist.&lt;/p&gt;
&lt;p&gt;A separate SSID is useful for choosing which network a device joins. It is not, by itself, an access-control policy. Likewise, assigning an address and reaching the internet show that basic connectivity works; they do not establish that management interfaces are blocked.&lt;/p&gt;
&lt;h2 id=&#34;why-the-household-network-matters&#34;&gt;Why the household network matters&lt;/h2&gt;
&lt;p&gt;An IoT network designed to keep clients away from local infrastructure is an awkward home for a phone that genuinely needs selected services. Weakening that network for every IoT device would trade away isolation for convenience. Moving all phones onto the trusted network would grant more access than they need.&lt;/p&gt;
&lt;p&gt;The household role provides a place to define a narrower policy: allow the particular service destinations and ports that are needed, while denying general access to router, switch, access-point and server administration. That is a policy goal, not a claim that every such rule has been independently tested. Application authentication still matters even when the firewall permits a connection.&lt;/p&gt;
&lt;p&gt;There are a couple of less obvious failure modes. A service may work by direct HTTPS address while casting or automatic discovery fails across subnets; discovery protocols may require separate handling. Conversely, a client can obtain an IP address yet fail to reach a permitted service because forwarding or the return route is wrong. Container-network address overlaps can also misroute replies. I check the actual path in both directions rather than assuming an SSID proves the whole design.&lt;/p&gt;
&lt;h2 id=&#34;the-test-that-counts&#34;&gt;The test that counts&lt;/h2&gt;
&lt;p&gt;I evaluate each network from a &lt;strong&gt;real client connected to that network&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Confirm the client receives an address and has the expected internet and DNS connectivity.&lt;/li&gt;
&lt;li&gt;From the household network, check that approved services work and management destinations do not.&lt;/li&gt;
&lt;li&gt;From IoT and guest networks, check that private destinations are inaccessible except for explicitly allowed exceptions.&lt;/li&gt;
&lt;li&gt;Check whether wireless clients can communicate with one another separately from inter-network restrictions.&lt;/li&gt;
&lt;li&gt;Test discovery and casting separately from direct application access, where those features are actually required.&lt;/li&gt;
&lt;li&gt;Check router firewall rules and the return route; don&amp;rsquo;t infer isolation solely from successful Wi-Fi association or a VLAN label.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before changing switch membership or management VLAN settings, keep a tested path back to the devices and a saved configuration. A broken trunk can take away the management connection needed to fix it.&lt;/p&gt;
&lt;p&gt;The end state I want is straightforward: everyday devices can reach the few things they need, less-trusted devices cannot wander into homelab administration, and guests do not inherit access merely because they share the same physical access point. &lt;strong&gt;Separate by trust and required access, then verify from each client network.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Privacy note: network roles, diagram labels and example VLAN values here are generic. No live SSIDs, addresses, device names, physical port assignments or management screenshots are published.&lt;/em&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>I Turned an Old Raspberry Pi 3B into a Live Aircraft Tracker</title>
      <link>https://samirtech.org/posts/raspberry-pi-adsb-aircraft-tracker/</link>
      <pubDate>Wed, 28 Oct 2026 11:04:23 +0000</pubDate>
      
      <guid>https://samirtech.org/posts/raspberry-pi-adsb-aircraft-tracker/</guid>
      <description>The first military aircraft I watched appear live on my own map was DESTRO41, an RAF Eurofighter Typhoon. By then, the receiver had quietly recorded several other military aircraft without me noticing.
That moment made the project feel different from opening a commercial flight-tracking app. The aircraft on the screen had been received directly by a small antenna in my home, decoded by an old Raspberry Pi 3B and plotted on a map running on my own network.</description>
      <content>&lt;p&gt;The first military aircraft I watched appear live on my own map was &lt;strong&gt;DESTRO41&lt;/strong&gt;, an RAF Eurofighter Typhoon. By then, the receiver had quietly recorded several other military aircraft without me noticing.&lt;/p&gt;
&lt;p&gt;That moment made the project feel different from opening a commercial flight-tracking app. The aircraft on the screen had been received directly by a small antenna in my home, decoded by an old Raspberry Pi 3B and plotted on a map running on my own network.&lt;/p&gt;
&lt;p&gt;I built the receiver with an &lt;a href=&#34;https://www.rtl-sdr.com/buy-rtl-sdr-dvb-t-dongles/&#34;&gt;RTL-SDR Blog V3&lt;/a&gt; and the prebuilt &lt;a href=&#34;https://adsb.im/&#34;&gt;ADSB.im&lt;/a&gt; image. It now runs headlessly over Wi-Fi, shares reception data with &lt;a href=&#34;https://adsb.lol/&#34;&gt;adsb.lol&lt;/a&gt; and sends me Gotify alerts when it detects military or unidentified aircraft.&lt;/p&gt;
&lt;h2 id=&#34;hardware-and-cost&#34;&gt;Hardware and cost&lt;/h2&gt;
&lt;p&gt;I already owned the Raspberry Pi 3B, microSD card, power supply and network equipment. The main purchase was an RTL-SDR Blog V3 kit for about &lt;strong&gt;£51&lt;/strong&gt;. It included the USB receiver, a dipole antenna, coax and mounting hardware.&lt;/p&gt;
&lt;p&gt;A stable 5 V supply matters on a Pi 3B, especially with a USB radio attached. I connected the SDR directly to the Pi and kept the antenna cable as short as practical. If I move the receiver into the loft, I will extend the mains side rather than depend on a long, poor-quality micro-USB lead.&lt;/p&gt;
&lt;h2 id=&#34;how-ads-b-reception-works&#34;&gt;How ADS-B reception works&lt;/h2&gt;
&lt;p&gt;Many aircraft broadcast their identity, altitude, position and movement using Automatic Dependent Surveillance–Broadcast, or ADS-B. In the UK and much of Europe, the main frequency is &lt;strong&gt;1090 MHz&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The RTL-SDR only receives; it does not transmit. Software on the Pi decodes the broadcasts, plots aircraft on a local map and forwards reception reports to a feeder network. What appears on my map depends on what the antenna can hear, so aircraft altitude, terrain, buildings, antenna position and cable loss all affect the result.&lt;/p&gt;
&lt;h2 id=&#34;preparing-the-antenna&#34;&gt;Preparing the antenna&lt;/h2&gt;
&lt;p&gt;At 1090 MHz, a quarter wavelength is about &lt;strong&gt;6.9 cm&lt;/strong&gt;. I extended each half of the supplied dipole to roughly that length and mounted it vertically, with one element pointing up and the other down.&lt;/p&gt;
&lt;p&gt;The receiver worked indoors, but antenna position made the biggest difference to range. A higher position with a clearer view of the horizon should outperform almost any software adjustment. Thick walls, metal objects and nearby electronics can all weaken reception, while long coax runs introduce additional loss at 1090 MHz.&lt;/p&gt;
&lt;h2 id=&#34;installing-adsbim&#34;&gt;Installing ADSB.im&lt;/h2&gt;
&lt;p&gt;I used the prebuilt 64-bit ADSB.im image for Raspberry Pi models 2, 3, 4 and 5 instead of assembling the decoder, map and feeder containers manually. I checked the downloaded &lt;code&gt;img.xz&lt;/code&gt; archive, carefully confirmed the microSD card&amp;rsquo;s device name and then wrote the image to it.&lt;/p&gt;
&lt;p&gt;That device check is worth taking seriously: writing an image destroys the existing contents of whichever disk is selected. I waited for buffered writes to finish and safely ejected the card before moving it to the Pi.&lt;/p&gt;
&lt;h3 id=&#34;the-headless-wi-fi-fallback&#34;&gt;The headless Wi-Fi fallback&lt;/h3&gt;
&lt;p&gt;I initially tried to preload the Wi-Fi configuration on the boot partition. It did not connect on the first boot, so ADSB.im created its temporary setup hotspot instead.&lt;/p&gt;
&lt;p&gt;I joined that network from a phone, opened the setup page and entered the normal 2.4 GHz Wi-Fi details. The Pi then joined the home network without needing a monitor or keyboard. The fallback made the failed preconfiguration an inconvenience rather than a blocked installation.&lt;/p&gt;
&lt;h2 id=&#34;the-first-live-results&#34;&gt;The first live results&lt;/h2&gt;
&lt;p&gt;Once the radio was detected, the dashboard began showing messages, positions and aircraft. The bias tee remained off because the bundled dipole is passive, and the decoder reported no dropped SDR samples.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/adsb/adsb-feeder-dashboard.webp&#34; alt=&#34;Sanitised ADSB.im dashboard showing receiver and feeder health&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The ADSB.im dashboard confirmed that the decoder was receiving aircraft and sending data to the configured feeder. The private device name has been removed.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I left the receiver running overnight in an ordinary indoor position. It stayed online without USB faults, container restarts or memory failures. During that initial run it decoded &lt;strong&gt;more than 429,000 valid messages&lt;/strong&gt;, produced &lt;strong&gt;more than 18,000 positions&lt;/strong&gt; and built &lt;strong&gt;1,778 tracks&lt;/strong&gt;. Its best range was about &lt;strong&gt;77 km (48 miles)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Those are not spectacular figures for a roof-mounted ADS-B antenna, but that was not the point of the first test. It proved that the old Pi, SDR, image, Wi-Fi connection and data feed all worked together reliably.&lt;/p&gt;
&lt;h2 id=&#34;the-local-aircraft-map&#34;&gt;The local aircraft map&lt;/h2&gt;
&lt;p&gt;The included tar1090 interface turns the received messages into a responsive local map. It shows aircraft identity, altitude, speed, track, signal source and distance from the receiver. Its range outline also makes the effect of walls and terrain visible: indoor reception is rarely symmetrical.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/adsb/tar1090-coverage-map.webp&#34; alt=&#34;Sanitised tar1090 map showing live aircraft and the receiver&amp;amp;rsquo;s coverage&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Live aircraft received by the Pi. The receiver marker and surrounding area are deliberately concealed; the image reveals only the broad region.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The map is available only on my local networks. Household devices can reach a restricted map view, while administration remains limited to a trusted management device.&lt;/p&gt;
&lt;h2 id=&#34;sharing-data-and-using-mlat&#34;&gt;Sharing data and using MLAT&lt;/h2&gt;
&lt;p&gt;I configured the receiver to feed &lt;a href=&#34;https://adsb.lol/&#34;&gt;adsb.lol&lt;/a&gt;. The normal ADS-B feed has remained healthy.&lt;/p&gt;
&lt;p&gt;MLAT, or multilateration, is an additional process that estimates an aircraft&amp;rsquo;s position by comparing the arrival time of its transponder messages at several receivers. It has occasionally disconnected and reconnected on the Pi 3B, but that does not stop direct ADS-B reception. The older Pi is adequate for this project, although its timing is less ideal than newer hardware for MLAT.&lt;/p&gt;
&lt;p&gt;I kept the number of feeder services modest and use ADS-B as the radio&amp;rsquo;s normal job. A single tuner cannot listen to 1090 MHz aircraft transmissions and an unrelated radio band at the same time. For short experiments, a controller stops the ADS-B decoder, releases the tuner, runs the other task for a fixed period and then restores the decoder automatically. I tested that approach with FM reception and scheduled Meteor-M weather-satellite passes, but ADS-B remains the default.&lt;/p&gt;
&lt;h2 id=&#34;military-and-unidentified-aircraft-alerts&#34;&gt;Military and unidentified-aircraft alerts&lt;/h2&gt;
&lt;p&gt;Seeing DESTRO41 live made me check the receiver&amp;rsquo;s stored history. It had recorded four military airframes in total at that point, including the Eurofighter, a Canadian military aircraft and two RAF training aircraft.&lt;/p&gt;
&lt;p&gt;The live map later caught two UK military Eurofighters: &lt;strong&gt;DESTRO41&lt;/strong&gt; (ZK379) and &lt;strong&gt;DESTRO42&lt;/strong&gt; (ZK367). Both were shown at 14,000 feet and positioned through MLAT rather than a directly broadcast ADS-B position.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/adsb/military-typhoons.webp&#34; alt=&#34;Aircraft panels identifying DESTRO41 and DESTRO42 as military Eurofighters&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Two Eurofighter Typhoons received by the Pi. The source screenshots were cropped to retain the aircraft identities while excluding the map and location-related telemetry.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The alerts continued through the afternoon. The watcher recorded ten distinct military aircraft identities between 11:40 and 16:58 UTC. They included two Eurofighters, two Grob trainers, an Airbus Voyager tanker, an Airbus Helicopters EC135/635, two Apache helicopters, an Irish Air Corps Falcon 6X and a Bahrain Royal Flight Gulfstream G600.&lt;/p&gt;
&lt;p&gt;One Eurofighter, ZK379, later appeared under the callsign &lt;strong&gt;ROGUE041&lt;/strong&gt;. The Irish Air Corps aircraft appeared as &lt;strong&gt;IRL290&lt;/strong&gt; at 41,000 feet, giving me a useful example of a military alert that was not a fast jet or trainer.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/adsb/military-alerts-later.webp&#34; alt=&#34;Cropped aircraft panels for ROGUE041 and Irish Air Corps IRL290&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Later military detections received by the same Pi. The crop retains the aircraft identity and type while omitting coordinates and location-related telemetry.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I added a small watcher that reads the receiver&amp;rsquo;s aircraft data every 15 seconds and sends a &lt;a href=&#34;https://gotify.net/&#34;&gt;Gotify&lt;/a&gt; notification when it finds something interesting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;aircraft marked as military trigger an immediate alert;&lt;/li&gt;
&lt;li&gt;unidentified targets trigger after remaining unidentified for 60 seconds;&lt;/li&gt;
&lt;li&gt;repeat notifications for the same aircraft and category are suppressed for 12 hours; and&lt;/li&gt;
&lt;li&gt;each alert includes the available ICAO address, callsign, registration, type, altitude and tracking source.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here, &lt;strong&gt;unidentified&lt;/strong&gt; has a precise and fairly ordinary meaning: the receiver has a transponder target but no callsign, registration, aircraft type or description for it. It does not mean the receiver has discovered an extraterrestrial craft. Sometimes the missing identity appears a little later, which is why the watcher waits before alerting.&lt;/p&gt;
&lt;h2 id=&#34;network-and-security&#34;&gt;Network and security&lt;/h2&gt;
&lt;p&gt;The receiver sits on an isolated device network rather than the same network as my main computers. The router initially blocked management access across that boundary, so I added a narrow rule for one trusted computer instead of weakening isolation for every device.&lt;/p&gt;
&lt;p&gt;I also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;assigned the Pi a fixed private address outside the automatic allocation pool;&lt;/li&gt;
&lt;li&gt;created a non-root administrator account;&lt;/li&gt;
&lt;li&gt;enabled SSH public-key authentication;&lt;/li&gt;
&lt;li&gt;disabled password and root SSH login;&lt;/li&gt;
&lt;li&gt;restricted access with router and host firewall rules;&lt;/li&gt;
&lt;li&gt;enabled automatic security updates without automatic reboots; and&lt;/li&gt;
&lt;li&gt;confirmed that the receiver had no internet-facing port forwards.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The map needed to remain convenient on phones and tablets. I exposed a restricted, map-only path to the isolated household network instead of granting those devices general access to the Pi or trusted LAN.&lt;/p&gt;
&lt;p&gt;Private addresses, hostnames, Wi-Fi details and the receiver&amp;rsquo;s exact map location are intentionally absent from this article and its screenshots.&lt;/p&gt;
&lt;h2 id=&#34;monitoring-the-receiver&#34;&gt;Monitoring the receiver&lt;/h2&gt;
&lt;p&gt;A small health collector records a sample every five minutes. It checks receiver and feeder state, decoder statistics, Pi temperature, memory use, load, Wi-Fi, time synchronisation, container state and recent MLAT events.&lt;/p&gt;
&lt;p&gt;The first version broke after I hardened SSH because it still expected root access. The public statistics remained available, but the private system checks failed. I changed it to use the restricted administrator account and limited &lt;code&gt;sudo&lt;/code&gt; to the Docker checks that actually needed it.&lt;/p&gt;
&lt;p&gt;That was a useful reminder: a security improvement is not complete until the monitoring and recovery paths have been tested again.&lt;/p&gt;
&lt;h2 id=&#34;problems-and-fixes&#34;&gt;Problems and fixes&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;What fixed it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Preloaded Wi-Fi settings did not connect&lt;/td&gt;
&lt;td&gt;I used the temporary ADSB.im setup hotspot.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The management computer could not reach the isolated Pi&lt;/td&gt;
&lt;td&gt;I added one narrow router rule instead of removing network isolation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The Pi&amp;rsquo;s address changed&lt;/td&gt;
&lt;td&gt;I assigned a fixed private address outside the DHCP pool and updated the related rules.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root SSH access was still partly enabled&lt;/td&gt;
&lt;td&gt;I checked the effective OpenSSH configuration, corrected the ordering and verified that root login was rejected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Isolated tablets could not open the map&lt;/td&gt;
&lt;td&gt;I added a restricted map-only route rather than general network access.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MLAT occasionally disconnected&lt;/td&gt;
&lt;td&gt;I confirmed direct ADS-B remained healthy and that MLAT later reconnected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monitoring failed after SSH hardening&lt;/td&gt;
&lt;td&gt;I moved it to the restricted account and narrowly scoped the required &lt;code&gt;sudo&lt;/code&gt; access.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The Pi reported undervoltage and became unstable&lt;/td&gt;
&lt;td&gt;I replaced the long, thin micro-USB lead with a short, thicker cable and rechecked the receiver after rebooting.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;is-the-raspberry-pi-3b-still-enough&#34;&gt;Is the Raspberry Pi 3B still enough?&lt;/h2&gt;
&lt;p&gt;For this job, yes. The Pi 3B is old, but it can run the decoder, local map, modest feeder workload, health checks and alert watcher without becoming the bottleneck.&lt;/p&gt;
&lt;p&gt;Stable power, storage, Wi-Fi and antenna placement matter more than replacing it simply because a newer Pi exists. A newer model would provide more headroom and might improve MLAT consistency, but the current receiver does not need an upgrade to perform its main task. I would avoid loading it with unrelated, CPU-heavy services.&lt;/p&gt;
&lt;p&gt;The same applies to replacing the RTL-SDR Blog V3 with a V4. For a dedicated 1090 MHz receiver, antenna height, cable loss, local interference and filtering are likely to matter more than changing between those dongles.&lt;/p&gt;
&lt;h2 id=&#34;what-i-would-improve-next&#34;&gt;What I would improve next&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Move the antenna to a higher, safely secured position with a clearer view of the horizon.&lt;/li&gt;
&lt;li&gt;Keep the coax short and away from large metal objects.&lt;/li&gt;
&lt;li&gt;Compare message rate, aircraft count and maximum range before and after moving it.&lt;/li&gt;
&lt;li&gt;Check temperature, voltage and Wi-Fi stability after relocation.&lt;/li&gt;
&lt;li&gt;Consider a 1090 MHz filter or low-noise amplifier only if the new position reveals a problem they would solve.&lt;/li&gt;
&lt;li&gt;Keep any single-SDR experiments time-limited and verify that ADS-B resumes automatically afterwards.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;was-it-worth-doing&#34;&gt;Was it worth doing?&lt;/h2&gt;
&lt;p&gt;Yes. The Pi boots without a monitor, reconnects to Wi-Fi, detects the SDR, decodes aircraft, updates its local map, shares data and alerts me when it sees selected targets. It achieved all of that with hardware I already owned apart from the £51 radio kit.&lt;/p&gt;
&lt;p&gt;The indoor test proved the complete system. The first live military detection made it memorable. The next meaningful upgrade is not a new computer or another software rebuild; it is simply giving the antenna a better view of the sky.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Updating a Modded Nintendo Switch: Firmware 17.0.1 to 23.0.1, Atmosphère Crashes and Homebrew Troubleshooting</title>
      <link>https://samirtech.org/posts/updating-a-modded-nintendo-switch/</link>
      <pubDate>Tue, 20 Oct 2026 00:00:00 +0000</pubDate>
      
      <guid>https://samirtech.org/posts/updating-a-modded-nintendo-switch/</guid>
      <description>With Christmas and the holidays approaching, I started thinking about the Nintendo Switch I barely use anymore. Rather than spending the break endlessly scrolling through my phone, I wanted to pick up a dedicated gaming device again, revisit some older games and see what else my modded Switch could do. It seemed like a good excuse to bring it back to life instead of leaving it in a drawer.
There was one catch: the Switch was still on firmware 17.</description>
      <content>&lt;p&gt;With Christmas and the holidays approaching, I started thinking about the Nintendo Switch I barely use anymore. Rather than spending the break endlessly scrolling through my phone, I wanted to pick up a dedicated gaming device again, revisit some older games and see what else my modded Switch could do. It seemed like a good excuse to bring it back to life instead of leaving it in a drawer.&lt;/p&gt;
&lt;p&gt;There was one catch: the Switch was still on &lt;strong&gt;firmware 17.0.1&lt;/strong&gt;, running &lt;strong&gt;Atmosphère 1.6.2&lt;/strong&gt; and &lt;strong&gt;Hekate 6.1.0&lt;/strong&gt;. I brought the system firmware up to &lt;strong&gt;23.0.1&lt;/strong&gt; and refreshed the custom firmware components. What followed was not a clean, one-click upgrade: first there were game-launch problems, then an Atmosphère boot crash while experimenting with homebrew, and finally successful Jellyfin music and video tests. The GameCube problem turned out to be a file-format mismatch with the version of Tico I was using.&lt;/p&gt;
&lt;p&gt;This is a &lt;strong&gt;troubleshooting diary&lt;/strong&gt; rather than a step-by-step upgrade tutorial. It follows the errors I saw, the changes I tried and the fixes that worked.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/version-history.png&#34; alt=&#34;Nintendo Switch custom firmware version comparison from before to after the upgrade&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Version history: original firmware and custom firmware compared with the upgraded versions.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&#34;starting-point-a-big-firmware-jump&#34;&gt;Starting point: a big firmware jump&lt;/h2&gt;
&lt;p&gt;My Switch went from:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After / observed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Nintendo Switch system firmware&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;17.0.1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;23.0.1&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Atmosphère&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.6.2&lt;/strong&gt; (AMS 1.6.2 E, shown in the original System Settings screenshot)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.12.1&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hekate&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6.1.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Downloaded an updated release; new version not recorded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Patches&lt;/td&gt;
&lt;td&gt;Previous versions not recorded&lt;/td&gt;
&lt;td&gt;Downloaded updated patches; source and precise set not recorded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SD card management&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Fedora Linux&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hekate IPL launch configuration&lt;/td&gt;
&lt;td&gt;Custom emuMMC entry&lt;/td&gt;
&lt;td&gt;Existing &lt;code&gt;bootloader/hekate_ipl.ini&lt;/code&gt; retained for Launch menu&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The original System Settings photo displayed &lt;strong&gt;17.0.1 | AMS 1.6.2 E&lt;/strong&gt;, confirming both the system firmware and custom firmware versions before the upgrade. The post-update photo displayed &lt;strong&gt;23.0.1 | AMS 1.12.1 E&lt;/strong&gt;. The &lt;strong&gt;E&lt;/strong&gt; suffix indicates the emuMMC environment. The comparison image above is cropped to the relevant part of each screen and contains no embedded EXIF or GPS metadata.&lt;/p&gt;
&lt;h2 id=&#34;getting-back-into-the-switch-rcm-and-payload-injection-on-fedora&#34;&gt;Getting back into the Switch: RCM and payload injection on Fedora&lt;/h2&gt;
&lt;p&gt;The first hurdle was simply getting the modded Switch booted again. It had been sitting unused for a long time, and I needed to get back into Hekate before dealing with the larger firmware upgrade. I connected the console to my Fedora machine in &lt;strong&gt;RCM (Recovery Mode)&lt;/strong&gt; over USB.&lt;/p&gt;
&lt;p&gt;I first used &lt;code&gt;lsusb&lt;/code&gt; in a Fedora terminal to check that the USB connection was actually detecting the console in RCM:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;lsusb
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The relevant device appeared as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0955:7321 NVIDIA Corp. Switch [Tegra Erista] recovery mode
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The console was presenting itself in RCM, even though it wasn&amp;rsquo;t showing a normal boot screen.&lt;/p&gt;
&lt;h3 id=&#34;first-attempt-fusee-launcher-and-a-newer-hekate-payload&#34;&gt;First attempt: fusee-launcher and a newer Hekate payload&lt;/h3&gt;
&lt;p&gt;I tried the Linux Python-based &lt;a href=&#34;https://github.com/soup6020/fusee-launcher&#34;&gt;fusee-launcher&lt;/a&gt;. The dependencies and checkout used in the investigation were:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo dnf install git python3 python3-pyusb libusb1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/soup6020/fusee-launcher.git
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;One of the attempted injection commands was:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo python3 fusee-launcher.py hekate_ctcaer_6.5.4.bin
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That newer Hekate payload &lt;strong&gt;did not get me to a usable menu: the screen stayed black&lt;/strong&gt;. The screen gave no clue whether the problem was the payload, the injection method or the existing SD-card configuration.&lt;/p&gt;
&lt;h3 id=&#34;finding-the-existing-payload-instead-of-guessing&#34;&gt;Finding the existing payload instead of guessing&lt;/h3&gt;
&lt;p&gt;I then examined the &lt;code&gt;payload.bin&lt;/code&gt; already associated with the setup. Inspecting its embedded text revealed identifiers including:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;*-2023, CTCaer
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Spec Version
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Those strings pointed to an &lt;strong&gt;older Hekate payload&lt;/strong&gt;. Although they did not reveal its exact version, they gave me a useful lead: the old configuration might still depend on that file.&lt;/p&gt;
&lt;h3 id=&#34;installing-java-25-and-switching-to-ns-usbloader&#34;&gt;Installing Java 25 and switching to NS-USBloader&lt;/h3&gt;
&lt;p&gt;Before I could use the Java-based loader, I also &lt;strong&gt;downloaded JDK 25 (Java Development Kit 25)&lt;/strong&gt; on Fedora. This was required to run NS-USBloader, not to update the Switch firmware. My notes only include the command used to check the active Java runtime:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;java -version
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I then used &lt;strong&gt;NS-USBloader 7.3&lt;/strong&gt; to inject the existing &lt;code&gt;payload.bin&lt;/code&gt;, rather than the newer payload that had produced a black screen. One attempt through the graphical interface simply reported &lt;code&gt;Failed&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/ns-usbloader-failed.png&#34; alt=&#34;NS-USBloader 7.3 showing a failed payload-injection attempt&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A failed attempt in the NS-USBloader interface. The terminal command below was the combination that worked for me.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The working command from my Fedora session was:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo java -jar ~/Downloads/ns-usbloader-7.3.jar &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --rcm ~/switch/fusee-launcher/payload.bin
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;This got the console back into Hekate.&lt;/strong&gt; The existing payload through NS-USBloader was the combination that worked with my Switch.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;existing payload restored access first&lt;/strong&gt;; the updated Hekate files came later as part of the upgrade.&lt;/p&gt;
&lt;h2 id=&#34;keeping-my-hekate-launch-button-and-emummc-configuration&#34;&gt;Keeping my Hekate launch button and emuMMC configuration&lt;/h2&gt;
&lt;p&gt;One small file was particularly important when replacing the Hekate files: &lt;strong&gt;&lt;code&gt;bootloader/hekate_ipl.ini&lt;/code&gt;&lt;/strong&gt;. I needed to &lt;strong&gt;keep my existing IPL configuration&lt;/strong&gt; so that my custom launch button would still appear in Hekate, show the &lt;strong&gt;emuMMC&lt;/strong&gt; option and let me boot into the environment I was already using. Simply copying across the new bootloader files without preserving the configuration could have left me with Hekate itself working, but without my familiar launch entry.&lt;/p&gt;
&lt;p&gt;Despite the name &lt;em&gt;IPL&lt;/em&gt;, this is an &lt;strong&gt;&lt;code&gt;.ini&lt;/code&gt; file&lt;/strong&gt;, not a &lt;code&gt;.ipl&lt;/code&gt; file. Hekate reads entries in &lt;code&gt;bootloader/hekate_ipl.ini&lt;/code&gt; for its &lt;strong&gt;Launch&lt;/strong&gt; menu; separate configurations under &lt;code&gt;bootloader/ini/&lt;/code&gt; appear in &lt;strong&gt;More configs&lt;/strong&gt;. Before replacing the bootloader folder, I kept a backup of the existing configuration and made sure it was present afterwards:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;bootloader/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── hekate_ipl.ini       # Main Launch menu and custom boot entries
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;└── ini/                 # Optional entries shown under More configs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On Fedora, I preserved it &lt;em&gt;before copying in new Hekate files&lt;/em&gt; with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;SD&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/path/to/mounted-switch-sd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir -p &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/switch-config-backup&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cp &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SD&lt;span style=&#34;color:#e6db74&#34;&gt;/bootloader/hekate_ipl.ini&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/switch-config-backup/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the update replaces the file, compare the old and new versions and restore or merge the &lt;strong&gt;working launch entry&lt;/strong&gt; rather than blindly overwriting a newer configuration. I checked the result on the console: &lt;strong&gt;Hekate → Launch → my emuMMC entry → boots successfully&lt;/strong&gt;. The &lt;strong&gt;&lt;code&gt;E&lt;/code&gt;&lt;/strong&gt; indicator in System Settings confirmed the emuMMC environment.&lt;/p&gt;
&lt;p&gt;I did not record the exact contents or label of the custom launch entry. The practical lesson is to &lt;strong&gt;retain &lt;code&gt;hekate_ipl.ini&lt;/code&gt; and check the emuMMC launch path before troubleshooting Atmosphère itself&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;researching-the-update-youtube-hats-and-patches&#34;&gt;Researching the update: YouTube, HATS and patches&lt;/h2&gt;
&lt;p&gt;Because this was a jump across several firmware generations, I watched YouTube videos before proceeding rather than relying on my memory of an older Switch setup. These included videos from &lt;strong&gt;dammitjeff&lt;/strong&gt;, as well as &lt;a href=&#34;https://www.youtube.com/watch?v=ru1PLy-i3FI&#34;&gt;“Latest HATS Pack for Firmware 23.0.1 with Hekatos 6.5.4 &amp;amp; Atmosphere 1.12.1!!!”&lt;/a&gt;. The latter matched my target firmware and Atmosphère versions.&lt;/p&gt;
&lt;p&gt;The upgrade involved several parts of the modded environment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hekate:&lt;/strong&gt; the bootloader used to access and boot the configuration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Atmosphère:&lt;/strong&gt; the custom firmware that had been running at version 1.6.2 before the upgrade.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Patches:&lt;/strong&gt; additional files used by the existing setup. Their version and compatibility matter when updating firmware and custom firmware.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HATS:&lt;/strong&gt; a package that groups Hekate, Atmosphère and associated components, referenced by the linked video.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I downloaded updated &lt;strong&gt;Hekate&lt;/strong&gt;, &lt;strong&gt;Atmosphère&lt;/strong&gt; and &lt;strong&gt;patches&lt;/strong&gt; during the upgrade and used Fedora to manage the microSD card. My notes do not include the patch archive or final Hekate version. The video title mentions &lt;strong&gt;Hekate 6.5.4&lt;/strong&gt;, but I did not record whether that was the version that ultimately booted.&lt;/p&gt;
&lt;p&gt;The update patches were part of the initial preparation. Later, after the startup crash, I inspected the existing folders under &lt;code&gt;atmosphere/exefs_patches/&lt;/code&gt; as a separate troubleshooting step.&lt;/p&gt;
&lt;p&gt;I did not photograph every installation screen, so the story continues with my post-update tests.&lt;/p&gt;
&lt;p&gt;Updating the console firmware and custom firmware components does not automatically make every older homebrew sysmodule or patch compatible. I copied the important SD-card configuration and recorded the component versions before making changes.&lt;/p&gt;
&lt;h2 id=&#34;early-testing-one-game-failed-while-another-worked&#34;&gt;Early testing: one game failed while another worked&lt;/h2&gt;
&lt;p&gt;Before I started investigating music streaming, I had an issue launching &lt;strong&gt;Vampire Survivors&lt;/strong&gt;. It wouldn&amp;rsquo;t load, while &lt;strong&gt;Super Smash Bros.&lt;/strong&gt; did launch. Initially, the failure appeared to be specific to Vampire Survivors rather than a general inability to run games.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Later update:&lt;/strong&gt; I installed Vampire Survivors again and &lt;strong&gt;it worked&lt;/strong&gt;. That resolves the original game-launch symptom in practice, although I didn&amp;rsquo;t capture a specific error code or identify whether the earlier issue was a bad installation, incompatible files or something else. It was a &lt;strong&gt;separate symptom&lt;/strong&gt;, not the later Atmosphère fatal error.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/vampire-survivors-working.jpg&#34; alt=&#34;Vampire Survivors running again after being reinstalled&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;adding-streamfin-atmosphère-stopped-reaching-home&#34;&gt;Adding Streamfin: Atmosphère stopped reaching HOME&lt;/h2&gt;
&lt;p&gt;After the upgrade and the earlier game testing, I tried &lt;a href=&#34;https://github.com/dammitjeff/streamfin-switch/releases/tag/v1.1.0&#34;&gt;Streamfin v1.1.0&lt;/a&gt;, a homebrew overlay intended to interact with a Jellyfin music library.&lt;/p&gt;
&lt;p&gt;This is where the more serious problem began. After adding its files, Atmosphère failed during startup and showed:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Error Code: 2021-0003 (0x615)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Program:    0100000000000023
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/atmosphere-crash.jpg&#34; alt=&#34;Atmosphère 1.12.1 crash screen showing error 2021-0003 and program 0100000000000023&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The crash screen after the firmware update and homebrew changes.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The program ID belongs to the Switch&amp;rsquo;s &lt;strong&gt;Application Manager&lt;/strong&gt;, while the specific third-party file responsible still had to be found.&lt;/p&gt;
&lt;p&gt;Rather than immediately reinstalling the entire card, I looked at two important directories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/atmosphere/exefs_patches/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/atmosphere/contents/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;checking-patches-first&#34;&gt;Checking patches first&lt;/h3&gt;
&lt;p&gt;The patch folder contained several existing patch sets, including Bluetooth-related patches, NXThemesInstaller and SaltyNX fixes. A common suggestion was to check for an &lt;code&gt;am&lt;/code&gt; patch folder, but &lt;strong&gt;there wasn&amp;rsquo;t one in my setup&lt;/strong&gt;, so removing an &lt;code&gt;am&lt;/code&gt; folder was not a relevant fix for this case.&lt;/p&gt;
&lt;h3 id=&#34;finding-the-suspect-content-folder&#34;&gt;Finding the suspect content folder&lt;/h3&gt;
&lt;p&gt;From Fedora I listed the contents folder. The commands below use a &lt;strong&gt;placeholder path&lt;/strong&gt;, not my real Linux username or mount point:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;SD&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/path/to/mounted-switch-sd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ls -lah &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SD&lt;span style=&#34;color:#e6db74&#34;&gt;/atmosphere/contents/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;One newly added title-ID directory stood out:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;420000000046494E
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Removing that directory from &lt;code&gt;atmosphere/contents&lt;/code&gt; let Atmosphère &lt;strong&gt;reach the HOME screen again&lt;/strong&gt;. That is the clearest confirmed recovery in this investigation.&lt;/p&gt;
&lt;p&gt;For anyone reproducing the investigation, &lt;strong&gt;back up rather than delete&lt;/strong&gt; a suspect directory. For example, &lt;em&gt;only if you have identified this exact folder in your own installation&lt;/em&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;SD&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/path/to/mounted-switch-sd&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir -p &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/switch-module-backups&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mv &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SD&lt;span style=&#34;color:#e6db74&#34;&gt;/atmosphere/contents/420000000046494E&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;   &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/switch-module-backups/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do not blindly remove other title-ID directories. They may belong to completely different system modifications.&lt;/p&gt;
&lt;h2 id=&#34;the-next-error-streamfins-overlay-opened-but-its-module-failed&#34;&gt;The next error: Streamfin&amp;rsquo;s overlay opened, but its module failed&lt;/h2&gt;
&lt;p&gt;With Atmosphère booting again, Streamfin was visible through Ultrahand. But it now displayed:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Failed to launch sysmodule
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2008-0005
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This mattered because &lt;strong&gt;the overlay UI and its background sysmodule are not the same thing&lt;/strong&gt;. Opening an overlay successfully doesn&amp;rsquo;t necessarily mean the underlying audio service has started.&lt;/p&gt;
&lt;p&gt;I had also installed &lt;strong&gt;sys-tune before Streamfin&lt;/strong&gt;, which made overlapping audio modules the next thing to investigate.&lt;/p&gt;
&lt;p&gt;Removing sys-tune from the homebrew app store did &lt;strong&gt;not&lt;/strong&gt; guarantee that every related Atmosphère file had been cleared. To inspect the still-installed boot modules, I ran:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;find &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SD&lt;span style=&#34;color:#e6db74&#34;&gt;/atmosphere/contents&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -maxdepth &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt; -type f &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#ae81ff&#34;&gt;\(&lt;/span&gt; -name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*.nsp&amp;#34;&lt;/span&gt; -o -name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*.flag&amp;#34;&lt;/span&gt; -o -name &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*.ini&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\)&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -print
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The sys-tune directory was still present as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;4200000000000000
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I moved that directory to a backup location too:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir -p &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/switch-module-backups&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mv &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SD&lt;span style=&#34;color:#e6db74&#34;&gt;/atmosphere/contents/4200000000000000&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;   &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/switch-module-backups/&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After further testing, &lt;strong&gt;the Streamfin overlay loaded and I successfully played music from Jellyfin&lt;/strong&gt;. Increasing Ultrahand overlay memory from 4 MB to 8 MB also stopped the crashes I had experienced while browsing the Jellyfin artist library. The test did not isolate which earlier change resolved the boot and sysmodule errors.&lt;/p&gt;
&lt;h2 id=&#34;ultrahand-memory-the-4-mb-setting-that-wouldnt-change&#34;&gt;Ultrahand memory: the 4 MB setting that wouldn&amp;rsquo;t change&lt;/h2&gt;
&lt;p&gt;At &lt;strong&gt;4 MB&lt;/strong&gt; of overlay memory, Streamfin crashed when I browsed my Jellyfin library, particularly while moving through artists. Initially I thought Ultrahand would not let me change the 4 MB value. The trick was simply to &lt;strong&gt;press A to select the memory setting&lt;/strong&gt;, then adjust it to &lt;strong&gt;8 MB&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;After increasing the allocation to 8 MB, I could browse Streamfin and the Jellyfin artist library without the earlier crashes. I also played songs successfully.&lt;/strong&gt; That was a tested improvement, not just a case of the overlay opening.&lt;/p&gt;
&lt;p&gt;There was no need to hex-edit files or force the setting manually. Overlay memory and background sysmodule memory are separate settings; 8 MB worked for my configuration.&lt;/p&gt;
&lt;h2 id=&#34;watching-tv-and-anime-through-jellyfin&#34;&gt;Watching TV and anime through Jellyfin&lt;/h2&gt;
&lt;p&gt;Streamfin covers music, but it is not the full Jellyfin video client. I also tried &lt;a href=&#34;https://github.com/dragonflylee/switchfin&#34;&gt;Switchfin&lt;/a&gt;, the separate native Jellyfin app for the Switch. It has been great in use: I watched TV programmes and anime from my Jellyfin server on the console, and playback worked well in my testing.&lt;/p&gt;
&lt;p&gt;That makes the Switch more useful to me than I expected. It is a handheld for games again and a convenient screen for the media I already keep in Jellyfin. Switchfin is still an early-stage project, so codec and subtitle compatibility may vary.&lt;/p&gt;
&lt;h2 id=&#34;retro-gaming-with-tico-testing-gamecube-wii-psp-psx-and-game-boy-color&#34;&gt;Retro gaming with Tico: testing GameCube, Wii, PSP, PSX and Game Boy Color&lt;/h2&gt;
&lt;p&gt;I tested games across GameCube, Wii, PSP, PlayStation (PSX), Game Boy Color and several other systems. They all worked in my testing, although some of the more demanding games needed an overclock. &lt;strong&gt;God of War: Chains of Olympus&lt;/strong&gt; on PSP was one example, while &lt;strong&gt;Mario Kart: Double Dash!!&lt;/strong&gt; ran well on GameCube without the same trouble.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/tico-library.jpg&#34; alt=&#34;Tico library showing Persona 3 Portable and several available emulated systems&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/metal-gear-solid-psx.jpg&#34; alt=&#34;Metal Gear Solid running through the PlayStation side of the Tico setup&#34;&gt;&lt;/p&gt;
&lt;p&gt;Getting the GameCube library working required one extra step. The system appeared in Tico, but its library initially showed &lt;strong&gt;0 games&lt;/strong&gt;, despite these three files being on the microSD card:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/tico/roms/gc/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── Animal Crossing (USA, Canada).ciso
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;├── Fire Emblem - Path of Radiance (USA).ciso
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;└── Luigi&amp;#39;s Mansion (USA, Canada).ciso
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A directory listing from Fedora confirmed they existed. I also found the Dolphin core file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/tico/cores/tico-dolphin.nro
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I checked for it with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;find &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$SD&lt;span style=&#34;color:#e6db74&#34;&gt;/tico/cores&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#ae81ff&#34;&gt;\(&lt;/span&gt; -iname &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;*dolphin*&amp;#39;&lt;/span&gt; -o -iname &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;*gc*&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The explanation was the version I had installed: &lt;strong&gt;Tico 0.7.9, the latest public release, showed RVZ files for GameCube, not my CISO files&lt;/strong&gt;. The folder and Dolphin core were present, but the library scanner did not index those &lt;code&gt;.ciso&lt;/code&gt; images. After using &lt;code&gt;.rvz&lt;/code&gt; files instead, I could test the GameCube side properly, including a successful run of Mario Kart: Double Dash!!.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/modded-switch/mario-kart-double-dash.jpg&#34; alt=&#34;Mario Kart Double Dash running successfully from an RVZ GameCube image&#34;&gt;&lt;/p&gt;
&lt;p&gt;The Tico wiki currently describes an unreleased 0.8.0 and lists both &lt;code&gt;.rvz&lt;/code&gt; and &lt;code&gt;.ciso&lt;/code&gt;, with RVZ recommended. That does not match the latest public release or what its scanner showed on my Switch, so I followed the formats displayed by Tico 0.7.9 itself.&lt;/p&gt;
&lt;h2 id=&#34;confirmed-results-versus-open-questions&#34;&gt;Confirmed results versus open questions&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Current result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Firmware upgrade&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;17.0.1 / AMS 1.6.2 E&lt;/strong&gt; before; &lt;strong&gt;23.0.1 / Atmosphère 1.12.1&lt;/strong&gt; after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hekate Launch menu&lt;/td&gt;
&lt;td&gt;Existing IPL configuration retained so the custom emuMMC launch option remained available&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vampire Survivors&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Working after reinstalling&lt;/strong&gt;; original failure cause unknown&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Super Smash Bros.&lt;/td&gt;
&lt;td&gt;Launched during the same testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Atmosphère crash &lt;code&gt;2021-0003&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Boot restored&lt;/strong&gt; after removing &lt;code&gt;420000000046494E&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Streamfin error &lt;code&gt;2008-0005&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Seen earlier; later overlay browsing and Jellyfin music playback worked&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sys-tune&lt;/td&gt;
&lt;td&gt;Its leftover folder was backed up and removed from active &lt;code&gt;contents&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ultrahand overlay memory&lt;/td&gt;
&lt;td&gt;Changed from &lt;strong&gt;4 MB to 8 MB&lt;/strong&gt; with A; artist browsing stopped crashing in testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Streamfin/Jellyfin playback&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Verified: songs played successfully&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Switchfin/Jellyfin video&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Verified: TV programmes and anime played successfully&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tico emulation&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;GameCube, Wii, PSP, PSX, Game Boy Color and other tested games worked&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Demanding PSP games&lt;/td&gt;
&lt;td&gt;Some needed an overclock, including &lt;strong&gt;God of War: Chains of Olympus&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tico 0.7.9 GameCube scanning&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.ciso&lt;/code&gt; files were not shown; &lt;code&gt;.rvz&lt;/code&gt; worked, including &lt;strong&gt;Mario Kart: Double Dash!!&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;lessons-learned&#34;&gt;Lessons learned&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keep &lt;code&gt;bootloader/hekate_ipl.ini&lt;/code&gt;.&lt;/strong&gt; It contains the custom Hekate Launch entries, including the emuMMC boot option. Back it up before replacing Hekate files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Write down the starting versions.&lt;/strong&gt; A jump from 17.0.1 to 23.0.1 involves more than updating one file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep errors separate.&lt;/strong&gt; A single game failing, a system boot error and an emulator showing no games are different problems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Back up before modifying &lt;code&gt;atmosphere/contents&lt;/code&gt;.&lt;/strong&gt; A reversible move is better than deleting unknown sysmodules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;App uninstallers may leave background modules behind.&lt;/strong&gt; Verify what remains on the SD card.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An overlay loading is not proof its background component works.&lt;/strong&gt; Test actual functionality before declaring victory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check emulator formats against the installed release.&lt;/strong&gt; Tico 0.7.9 is the latest public version and showed RVZ for GameCube in my setup; the wiki is already documenting an unreleased 0.8.0.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Separate observed fixes from suspected causes.&lt;/strong&gt; The Atmosphère recovery was verified; the precise cause of the Streamfin conflict remains unclear.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What started as a way to spend more of the Christmas break playing games and less time on my phone turned into an unexpectedly technical project. The Switch now boots again, Vampire Survivors works after reinstalling, and Streamfin plays music from Jellyfin. With the overlay memory set to 8 MB, I could browse Jellyfin artists without crashing. Switchfin has also been great for watching TV programmes and anime. Tico successfully ran the GameCube, Wii, PSP, PSX, Game Boy Color and other games I tested. Some demanding titles, such as God of War: Chains of Olympus, benefited from an overclock, while Mario Kart: Double Dash!! ran well after I replaced the unrecognised CISO files with RVZ versions.&lt;/p&gt;
&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/Atmosphere-NX/Atmosphere&#34;&gt;Atmosphère&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/CTCaer/hekate&#34;&gt;Hekate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/dammitjeff/streamfin-switch/releases/tag/v1.1.0&#34;&gt;Streamfin v1.1.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/dragonflylee/switchfin&#34;&gt;Switchfin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ticohq/tico/releases/tag/0.7.9&#34;&gt;Tico 0.7.9 release&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://ticoverse.com/wiki/library-and-roms/supported-rom-formats&#34;&gt;Tico supported ROM formats&lt;/a&gt; — documents the unreleased 0.8.0 rather than the latest public release, 0.7.9&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/@dammitjeff&#34;&gt;dammitjeff on YouTube&lt;/a&gt; — videos consulted during the project (specific video URLs not captured)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=ru1PLy-i3FI&#34;&gt;Latest HATS Pack for Firmware 23.0.1 with Hekatos 6.5.4 &amp;amp; Atmosphere 1.12.1!!!&lt;/a&gt; — upgrade reference video&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
    <item>
      <title>My Threat Model, Written Down</title>
      <link>https://samirtech.org/posts/my-threat-model-written-down/</link>
      <pubDate>Mon, 12 Oct 2026 12:15:08 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/my-threat-model-written-down/</guid>
      <description>Most homelab security writing skips the first question and goes straight to tools: a firewall, a VLAN, a fail2ban rule, a hardened kernel. But every one of those defends against something specific, and if you never say what, you cannot tell whether the tool is doing its job or just making you feel careful.
This is my answer to the question I rarely see asked: defend against what?
The threats I actually face A threat model is a list of what could go wrong, ranked by how much I care and how likely it is.</description>
      <content>&lt;p&gt;Most homelab security writing skips the first question and goes straight to tools: a firewall, a VLAN, a fail2ban rule, a hardened kernel. But every one of those defends against &lt;em&gt;something specific&lt;/em&gt;, and if you never say what, you cannot tell whether the tool is doing its job or just making you feel careful.&lt;/p&gt;
&lt;p&gt;This is my answer to the question I rarely see asked: &lt;strong&gt;defend against what?&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-threats-i-actually-face&#34;&gt;The threats I actually face&lt;/h2&gt;
&lt;p&gt;A threat model is a list of what could go wrong, ranked by how much I care and how likely it is. Mine is not a cybersecurity-specimen list; it is boring and specific.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A platform decides my data stops being mine.&lt;/strong&gt; A streaming service delists the thing I bought; a photo service changes its terms; a notes app sunsets. This is the threat that started the whole lab, and it is the one self-hosting genuinely answers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A hard drive or NAS dies.&lt;/strong&gt; Storage is the thing I most expect to fail, because storage always fails eventually. Backups are the answer, and they are the one area where I test rather than assume.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;I break something myself.&lt;/strong&gt; A bad command, a deleted dataset, an update that breaks a service. I am my own most likely cause of data loss, ahead of any attacker.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A service I expose is compromised.&lt;/strong&gt; Anything reachable beyond my home network is a target, however small. The answer here is to expose as little as possible and to isolate what must be exposed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Theft, fire, or a serious house problem.&lt;/strong&gt; Not exotic; it is why an off-site copy matters and why &amp;ldquo;another machine in the same house&amp;rdquo; is not a backup.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Unranked because I mostly accept them: targeted attacks by a determined adversary with resources and patience. A person who specifically wants &lt;em&gt;my&lt;/em&gt; data, and will spend months on it, is not a realistic threat for a homelab, and protecting against that would cost far more than the data is worth. Knowing that I am &lt;em&gt;not&lt;/em&gt; defending against it is what keeps the rest of the model sane.&lt;/p&gt;
&lt;h2 id=&#34;what-i-accept-instead-of-defending&#34;&gt;What I accept instead of defending&lt;/h2&gt;
&lt;p&gt;A threat model is also a list of things I deliberately do not try to solve, because the cost would outweigh the value.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;I do not run my own email.&lt;/strong&gt; Delivery, reputation, filtering, spam, security and recovery are operational work I will not take on. I accept a hosted provider here.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I do not chase perfect isolation.&lt;/strong&gt; A guest VLAN, scoped DNS and a reverse proxy that refuses non-local clients cover the realistic exposure. I do not need an enterprise zero-trust mesh at home.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I accept that convenience has a floor.&lt;/strong&gt; Some services are used from devices where I cannot enforce every setting, and I accept that boundary rather than pretending to control it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These acceptances are not failures. They are the part of the model that stops a homelab from becoming a second job.&lt;/p&gt;
&lt;h2 id=&#34;why-writing-it-down-matters&#34;&gt;Why writing it down matters&lt;/h2&gt;
&lt;p&gt;The moment I stop naming the threats, I start defending against &lt;em&gt;everything&lt;/em&gt;, which means defending against &lt;em&gt;nothing specific&lt;/em&gt;. A written list gives every security decision a standard to be measured against:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A new container that opens a port only makes sense if it answers one of the threats above.&lt;/li&gt;
&lt;li&gt;A new backup destination only earns its place if it protects a &lt;em&gt;named&lt;/em&gt; piece of data from a &lt;em&gt;named&lt;/em&gt; failure.&lt;/li&gt;
&lt;li&gt;A hardening tip I read online is only worth adopting if it moves the needle on something on this list.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The list also keeps me honest about the gaps. The Pi is now physically at a separate location, reachable over Tailscale, and scheduled backups have succeeded since the move. That is useful protection against threat five, but it is not the same as a tested full replacement-host recovery — and I would rather keep that remaining gap visible than let a tidy-looking setup imply otherwise.&lt;/p&gt;
&lt;h2 id=&#34;the-one-sentence-version&#34;&gt;The one-sentence version&lt;/h2&gt;
&lt;p&gt;Defend against losing my data and against casual exposure. Test the parts that fail reliably. Refuse to spend effort on threats that are not actually mine, and write the whole list down so the next security decision has somewhere to aim.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Enabling Intel N100 Hardware Transcoding for Plex and Jellyfin</title>
      <link>https://samirtech.org/posts/plex-jellyfin-hardware-transcoding-intel-n100/</link>
      <pubDate>Wed, 07 Oct 2026 14:39:08 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/plex-jellyfin-hardware-transcoding-intel-n100/</guid>
      <description>A film that plays perfectly on a television can still fail in a web browser. That was the symptom which sent me back into my Plex and Jellyfin setup.
The media files were healthy and direct play worked on compatible clients. The problem appeared when a client needed the server to convert the video. My small Intel N100 server has an integrated GPU designed for exactly this job, but having the hardware in the machine does not mean a container can use it.</description>
      <content>&lt;p&gt;A film that plays perfectly on a television can still fail in a web browser. That was the symptom which sent me back into my Plex and Jellyfin setup.&lt;/p&gt;
&lt;p&gt;The media files were healthy and direct play worked on compatible clients. The problem appeared when a client needed the server to convert the video. My small Intel N100 server has an integrated GPU designed for exactly this job, but having the hardware in the machine does not mean a container can use it.&lt;/p&gt;
&lt;p&gt;I found two different states:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Jellyfin could see the Intel render device, but its transcoding settings needed tightening and a real playback test.&lt;/li&gt;
&lt;li&gt;Plex had no GPU device inside its container at all, so hardware acceleration could never work regardless of the checkbox in its web interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The fix was not to buy a larger server. It was to connect each layer properly and verify the result from the application all the way down to the GPU.&lt;/p&gt;
&lt;h2 id=&#34;why-direct-play-hid-the-problem&#34;&gt;Why direct play hid the problem&lt;/h2&gt;
&lt;p&gt;A media server normally chooses one of three paths:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Direct play:&lt;/strong&gt; send the original video and audio untouched.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Direct stream:&lt;/strong&gt; repackage compatible streams into another container without re-encoding them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transcode:&lt;/strong&gt; decode and encode one or more streams into something the client accepts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Direct play is the cheapest option, but it only proves that the client understands the file. It says nothing about the transcoder.&lt;/p&gt;
&lt;p&gt;Browsers are useful test clients because their codec and container support is narrower than many television apps. In this case, deliberately lowering the browser&amp;rsquo;s playback quality forced a transcode and exposed the missing hardware path.&lt;/p&gt;
&lt;h2 id=&#34;the-complete-path-has-to-work&#34;&gt;The complete path has to work&lt;/h2&gt;
&lt;p&gt;For Intel Quick Sync to work in a container, all of these need to be true:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The host exposes the Intel Direct Rendering Infrastructure devices, normally under &lt;code&gt;/dev/dri&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The container receives those devices.&lt;/li&gt;
&lt;li&gt;The account running the media server can open the render device.&lt;/li&gt;
&lt;li&gt;The application is configured to use the correct acceleration method.&lt;/li&gt;
&lt;li&gt;The codec conversion being requested is supported by the hardware and application.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A green container status only proves that its main process is running. It does not prove any of the above.&lt;/p&gt;
&lt;p&gt;On the host I first checked for the devices:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ls -l /dev/dri
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The important entries were the card device and &lt;code&gt;renderD128&lt;/code&gt;. I then compared that with the view from each container:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec plex ls -l /dev/dri
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec jellyfin ls -l /dev/dri
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Jellyfin had the devices. Plex did not. That made the first Plex failure unambiguous.&lt;/p&gt;
&lt;h2 id=&#34;passing-the-intel-gpu-into-docker&#34;&gt;Passing the Intel GPU into Docker&lt;/h2&gt;
&lt;p&gt;My Compose definition now exposes the DRI directory to each media server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;plex&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;devices&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      - &lt;span style=&#34;color:#ae81ff&#34;&gt;/dev/dri:/dev/dri&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;jellyfin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;devices&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      - &lt;span style=&#34;color:#ae81ff&#34;&gt;/dev/dri:/dev/dri&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Depending on the image and host, the container account may also need membership of the host&amp;rsquo;s render or video group. Group IDs are host-specific, so copying someone else&amp;rsquo;s number is a poor shortcut. Check the ownership of the actual device and the identity inside the container instead:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;getent group render
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;getent group video
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec plex id
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec jellyfin id
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After changing a Compose definition, I recreated only the affected container rather than restarting unrelated services.&lt;/p&gt;
&lt;h2 id=&#34;jellyfin-quick-sync-and-tone-mapping&#34;&gt;Jellyfin: Quick Sync and tone mapping&lt;/h2&gt;
&lt;p&gt;In Jellyfin&amp;rsquo;s playback settings I selected &lt;strong&gt;Intel Quick Sync (QSV)&lt;/strong&gt; and the Intel render device. I enabled the hardware decoders appropriate for the library, hardware encoding, and VPP tone mapping for HDR-to-SDR conversion.&lt;/p&gt;
&lt;p&gt;Tone mapping matters when an HDR source has to be displayed on an SDR client. It is also one of the fastest ways to turn a comfortable transcode into heavy CPU work if it falls back to software.&lt;/p&gt;
&lt;p&gt;I also enabled two practical controls:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;throttling, so Jellyfin does not transcode the entire film as fast as possible when the client is consuming it slowly;&lt;/li&gt;
&lt;li&gt;deletion of old transcode segments, so temporary files do not accumulate indefinitely.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those settings improve behaviour, but they are not proof of acceleration.&lt;/p&gt;
&lt;h2 id=&#34;plex-the-missing-device-was-the-real-issue&#34;&gt;Plex: the missing device was the real issue&lt;/h2&gt;
&lt;p&gt;Plex requires an active Plex Pass for hardware-accelerated streaming. With that available, the transcoder settings can enable:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;hardware acceleration when available;&lt;/li&gt;
&lt;li&gt;hardware-accelerated video encoding;&lt;/li&gt;
&lt;li&gt;HDR tone mapping where needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In my case, changing those settings alone would have achieved nothing because &lt;code&gt;/dev/dri&lt;/code&gt; was absent from the container. Once the device mapping was added and the Plex container recreated, the hardware path became available.&lt;/p&gt;
&lt;p&gt;That distinction is worth remembering: an application&amp;rsquo;s hardware-acceleration switch expresses intent. The container still needs permission and a device to carry it out.&lt;/p&gt;
&lt;h2 id=&#34;the-test-that-mattered&#34;&gt;The test that mattered&lt;/h2&gt;
&lt;p&gt;I used a normal film from my own library and opened it in a browser. I then selected a lower playback quality to force conversion instead of direct play.&lt;/p&gt;
&lt;p&gt;Jellyfin completed a real browser transcode and reported hardware processing. I also observed GPU activity on the host while playback was running.&lt;/p&gt;
&lt;p&gt;For Plex, I verified &lt;code&gt;/dev/dri&lt;/code&gt; access and completed a synthetic VAAPI H.264 encode with its bundled transcoder. I did not independently complete the final Plex playback check. That still needs a forced conversion whose active session is labelled &lt;code&gt;Transcode (hw)&lt;/code&gt; in Plex&amp;rsquo;s dashboard, not merely &lt;code&gt;Transcode&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A useful host-side observation tool is &lt;code&gt;intel_gpu_top&lt;/code&gt; from the Intel GPU tools package:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo intel_gpu_top
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Run it while a forced transcode is active. Video engine activity is stronger evidence than a successful page load or a low CPU percentage on its own.&lt;/p&gt;
&lt;h2 id=&#34;a-compact-verification-checklist&#34;&gt;A compact verification checklist&lt;/h2&gt;
&lt;p&gt;This is the order I would use next time:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Confirm &lt;code&gt;/dev/dri/renderD128&lt;/code&gt; exists on the host.&lt;/li&gt;
&lt;li&gt;Confirm the same device exists inside the media-server container.&lt;/li&gt;
&lt;li&gt;Check the container process identity and render-device permissions.&lt;/li&gt;
&lt;li&gt;Select QSV or hardware acceleration in the application.&lt;/li&gt;
&lt;li&gt;Start with one ordinary SDR H.264 transcode.&lt;/li&gt;
&lt;li&gt;Confirm the application reports hardware decoding or encoding.&lt;/li&gt;
&lt;li&gt;Observe Intel GPU activity on the host.&lt;/li&gt;
&lt;li&gt;Then test HEVC, subtitles and HDR tone mapping separately.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Testing one complication at a time matters. A subtitle burn-in, unsupported audio format or tone-mapping stage can change the pipeline even when basic hardware transcoding is working.&lt;/p&gt;
&lt;h2 id=&#34;what-this-fixedand-what-it-did-not&#34;&gt;What this fixed—and what it did not&lt;/h2&gt;
&lt;p&gt;The Intel N100 is now doing the work it was bought to do for Jellyfin, which completed a real hardware-accelerated browser transcode. Plex&amp;rsquo;s container gained the previously missing &lt;code&gt;/dev/dri&lt;/code&gt; access and its bundled transcoder completed a synthetic VAAPI H.264 encode. A real Plex playback session still needs to show &lt;code&gt;Transcode (hw)&lt;/code&gt; before I can call its end-to-end path verified.&lt;/p&gt;
&lt;p&gt;This does not guarantee that every file will direct play or that every possible conversion is supported. Client capability, subtitle format, audio conversion, HDR metadata and codec profiles still affect the decision.&lt;/p&gt;
&lt;p&gt;The lesson was simpler: &lt;strong&gt;verify the whole path&lt;/strong&gt;. Check the host, container, permissions, application settings and a real playback session. Hardware acceleration is not working because a box is ticked. It is working when the requested stream uses the GPU and the client receives playable video.&lt;/p&gt;
&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://jellyfin.org/docs/general/post-install/transcoding/hardware-acceleration/&#34;&gt;Jellyfin hardware acceleration documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://jellyfin.org/docs/general/post-install/transcoding/hardware-acceleration/intel/&#34;&gt;Jellyfin Intel GPU documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/&#34;&gt;Plex: Using hardware-accelerated streaming&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
    <item>
      <title>Carrying an Isolated Wi-Fi VLAN Across OpenWrt and Managed Switches</title>
      <link>https://samirtech.org/posts/carrying-an-isolated-wifi-vlan-across-openwrt-and-managed-switches/</link>
      <pubDate>Tue, 29 Sep 2026 14:48:04 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/carrying-an-isolated-wifi-vlan-across-openwrt-and-managed-switches/</guid>
      <description>I wanted ordinary wireless and IoT clients separated from the network used to manage my homelab. The router already provided the isolated network, so the job was to carry it to a UniFi access point without moving the access point or switches onto it.
The useful part was not the particular hardware. It was making several vendors agree on one simple Ethernet contract:
Management network native / untagged Isolated Wi-Fi VLAN tagged Here, native/untagged is a property of each Ethernet link, not of a VLAN everywhere.</description>
      <content>&lt;p&gt;I wanted ordinary wireless and IoT clients separated from the network used to manage my homelab. The router already provided the isolated network, so the job was to carry it to a UniFi access point without moving the access point or switches onto it.&lt;/p&gt;
&lt;p&gt;The useful part was not the particular hardware. It was making several vendors agree on one simple Ethernet contract:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Management network    native / untagged
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Isolated Wi-Fi VLAN   tagged
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, &lt;strong&gt;native/untagged is a property of each Ethernet link&lt;/strong&gt;, not of a VLAN everywhere. On these links, management frames leave without an 802.1Q tag, while isolated-network frames leave with the example VLAN tag. The receiving port classifies incoming untagged frames into the management VLAN using its PVID.&lt;/p&gt;
&lt;p&gt;I have deliberately replaced my addresses, VLAN number, SSID, port numbers and device identifiers with examples. The method matters; publishing a map of my own network does not.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/mixed-trunk-diagram.png&#34; alt=&#34;Diagram of an access point and managed switches carrying an untagged management network and tagged example client VLAN&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-design&#34;&gt;The design&lt;/h2&gt;
&lt;p&gt;The router remains responsible for DHCP, routing and firewall policy. UniFi defines the Wi-Fi network and adds the VLAN tag, while every managed switch in the path carries that tag unchanged.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Wi-Fi client
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;UniFi access point
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |  management untagged + isolated Wi-Fi tagged
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;managed switch path
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;OpenWrt router
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |-- management bridge
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    `-- tagged VLAN device -&amp;gt; isolated bridge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the examples below, I use VLAN &lt;code&gt;30&lt;/code&gt;. Substitute the VLAN ID chosen for your own network.&lt;/p&gt;
&lt;p&gt;The access point itself remains on the untagged management network. Only client traffic from the isolated SSID uses the tagged VLAN.&lt;/p&gt;
&lt;h2 id=&#34;prepare-a-rollback-path-before-changing-vlans&#34;&gt;Prepare a rollback path before changing VLANs&lt;/h2&gt;
&lt;p&gt;I export the router and switch configurations before changing membership, PVIDs or management addressing. I also record the original values and keep a laptop on a known untagged management port with a tested local administrator login. Where the hardware permits it, a serial console or other direct-management path is safer than depending on the Wi-Fi or trunk being changed.&lt;/p&gt;
&lt;p&gt;The rollback is decided before applying anything: change one device at a time, use an apply-with-rollback timer where available, and keep the old management VLAN until the new path works from a second session. If management disappears, I stop and restore the saved configuration through the direct path instead of making more remote guesses. This is slower than changing the whole path at once and much less likely to turn a VLAN mistake into a physical recovery visit.&lt;/p&gt;
&lt;h2 id=&#34;1-define-the-network-in-unifi&#34;&gt;1. Define the network in UniFi&lt;/h2&gt;
&lt;p&gt;Because OpenWrt, not UniFi, is the gateway, I created the VLAN in UniFi as a &lt;strong&gt;third-party gateway&lt;/strong&gt; network. Older UniFi versions called this a &lt;strong&gt;VLAN-only&lt;/strong&gt; network. I then assigned a temporary test SSID to it.&lt;/p&gt;
&lt;p&gt;This definition tells the access point to tag traffic from the SSID. It does not make UniFi the gateway or give it responsibility for DHCP and firewall policy.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/unifi-ssid-vlan-redacted.png&#34; alt=&#34;Redacted UniFi excerpt showing a placeholder test SSID assigned to example VLAN 30&#34;&gt;&lt;/p&gt;
&lt;p&gt;The screenshot above is deliberately redacted and relabelled. &lt;code&gt;TEST-WIFI&lt;/code&gt; and VLAN &lt;code&gt;30&lt;/code&gt; are examples, not my live values.&lt;/p&gt;
&lt;p&gt;On the access-point uplink and every switch-to-switch link in the path, the intended policy is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Native network: management network
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Tagged networks: allow VLAN 30
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A temporary SSID makes testing safer because it does not disturb an existing wireless network. Its name does not need to describe the real network or its purpose.&lt;/p&gt;
&lt;h2 id=&#34;2-configure-every-managed-switch-link&#34;&gt;2. Configure every managed-switch link&lt;/h2&gt;
&lt;p&gt;On a third-party managed switch, I enabled advanced 802.1Q VLAN handling and configured both ends of each trunk consistently:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Management VLAN  -&amp;gt; untagged, management PVID
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;VLAN 30          -&amp;gt; tagged
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/managed-switch-trunk-example.png&#34; alt=&#34;Example managed-switch trunk contract with management untagged and the isolated Wi-Fi VLAN tagged&#34;&gt;&lt;/p&gt;
&lt;p&gt;The exact menus differ by vendor, but three values matter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;membership&lt;/strong&gt; decides whether a VLAN is allowed on a port;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;tagged or untagged&lt;/strong&gt; decides how frames leave that port;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PVID&lt;/strong&gt; is the VLAN classification assigned to untagged frames arriving on that port. It does not decide whether frames leave tagged or untagged; that is a separate egress setting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a mixed trunk, the management network stays untagged and the isolated client VLAN stays tagged. An inconsistent setting on any link can let the access point remain manageable while preventing its wireless clients from obtaining an address.&lt;/p&gt;
&lt;h2 id=&#34;3-terminate-the-tag-on-the-openwrt-bridge&#34;&gt;3. Terminate the tag on the OpenWrt bridge&lt;/h2&gt;
&lt;p&gt;My first attempt created an 802.1Q device directly on a physical LAN port:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;lan-port.30 -&amp;gt; isolated bridge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A client could authenticate to Wi-Fi but reported an IP-configuration failure. The VLAN device received no useful traffic.&lt;/p&gt;
&lt;p&gt;On this DSA-based OpenWrt setup, the physical port was already a member of the main LAN bridge. The working Layer-3 endpoint therefore sat above that bridge rather than directly on the enslaved port:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Device type: VLAN (802.1q)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Base device: br-lan
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;VLAN ID: 30
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Device name: br-lan.30
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/openwrt-vlan-device-example.png&#34; alt=&#34;Recreated OpenWrt VLAN-device fields using placeholder VLAN 30&#34;&gt;&lt;/p&gt;
&lt;p&gt;I then added the logical VLAN device &lt;code&gt;br-lan.30&lt;/code&gt; to the existing isolated bridge:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/openwrt-bridge-port-example.png&#34; alt=&#34;Recreated OpenWrt bridge fields showing the example VLAN device attached to an isolated bridge&#34;&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;physical LAN port
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     br-lan
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       |-- untagged management traffic
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       `-- br-lan.30 -&amp;gt; isolated bridge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The existing isolated interface remained the single Layer-3 gateway and DHCP-serving interface. Adding &lt;code&gt;br-lan.30&lt;/code&gt; extended that same network onto Ethernet; it did not create another subnet, gateway or DHCP server.&lt;/p&gt;
&lt;p&gt;Verify which bridge mode is active before using this pattern. With &lt;strong&gt;bridge VLAN filtering disabled&lt;/strong&gt;, &lt;code&gt;br-lan&lt;/code&gt; can carry tags transparently, but it may also forward the tagged VLAN through other member ports. With &lt;strong&gt;bridge VLAN filtering enabled&lt;/strong&gt;, add an explicit bridge-VLAN membership row and mark only the intended trunk port or ports as tagged for VLAN &lt;code&gt;30&lt;/code&gt;; OpenWrt may then generate &lt;code&gt;br-lan.30&lt;/code&gt; from that row, in which case you should not create a second device with the same name. Creating a VLAN device defines the router endpoint, but it does not replace the per-port trunk policy.&lt;/p&gt;
&lt;p&gt;This detail is platform-specific rather than a universal rule. OpenWrt devices can expose switching in different ways, and older instructions may describe &lt;code&gt;swconfig&lt;/code&gt; rather than DSA. Check how the target device represents its ports and bridges before copying an interface layout.&lt;/p&gt;
&lt;h2 id=&#34;4-verify-the-physical-path-before-redesigning-it&#34;&gt;4. Verify the physical path before redesigning it&lt;/h2&gt;
&lt;p&gt;One fault was much less technical: the cable connected to the configured switch port was not the uplink I thought it was.&lt;/p&gt;
&lt;p&gt;That is easy to miss in a mixed-vendor network. A correct VLAN configuration on the wrong physical port is still a broken configuration.&lt;/p&gt;
&lt;p&gt;Before changing bridges, DHCP or firewall rules, verify:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;which physical port leads toward the router;&lt;/li&gt;
&lt;li&gt;which port leads to the next switch;&lt;/li&gt;
&lt;li&gt;which port leads to the access point;&lt;/li&gt;
&lt;li&gt;whether link state and the switch MAC table support that map;&lt;/li&gt;
&lt;li&gt;whether labels match the cables that are actually connected.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;5-test-one-layer-at-a-time&#34;&gt;5. Test one layer at a time&lt;/h2&gt;
&lt;p&gt;A successful Wi-Fi association proves only that the radio and authentication worked. It does not prove that the tagged Ethernet path, DHCP, routing or isolation works.&lt;/p&gt;
&lt;p&gt;I tested in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Association:&lt;/strong&gt; the client joins the temporary SSID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;VLAN transport:&lt;/strong&gt; tagged traffic reaches the router-side VLAN device.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DHCP:&lt;/strong&gt; the client receives an address from the isolated network&amp;rsquo;s DHCP server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internet access:&lt;/strong&gt; DNS and normal outbound traffic work as intended.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Isolation:&lt;/strong&gt; access to the management network is blocked unless a narrow rule explicitly permits it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Management:&lt;/strong&gt; the access point and switches remain reachable through the untagged management network.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;An &lt;strong&gt;IP configuration failure&lt;/strong&gt; shows that Wi-Fi association succeeded but address configuration did not. A missing VLAN on a trunk is one common cause, but so are an incorrectly bound or disabled DHCP server, firewall rules blocking DHCP to the router, an exhausted address pool or a rogue DHCP server. Check whether the client&amp;rsquo;s DHCP Discover reaches the VLAN endpoint and whether an Offer returns through the same path.&lt;/p&gt;
&lt;h2 id=&#34;firewall-policy-still-matters&#34;&gt;Firewall policy still matters&lt;/h2&gt;
&lt;p&gt;A VLAN separates broadcast domains, but it is not automatically a security boundary. If the router forwards freely between networks, a separate VLAN provides organisation without meaningful isolation.&lt;/p&gt;
&lt;p&gt;The isolated zone allows only the required traffic &lt;strong&gt;to the router&lt;/strong&gt;, such as DHCP and router-hosted DNS, and permits forwarding to the WAN. It has no broad forwarding permission to the management zone. Router administration services such as LuCI and SSH are blocked from the isolated zone unless explicitly allowed. If IPv6 is enabled, test and enforce the same policy over IPv6 rather than checking IPv4 alone.&lt;/p&gt;
&lt;p&gt;This policy isolates the VLAN from management networks. It does not automatically prevent clients on the isolated SSID from communicating with one another; peer isolation is a separate access-point or firewall design choice.&lt;/p&gt;
&lt;p&gt;Test the negative case from an actual client. A working internet connection does not prove that private destinations are blocked.&lt;/p&gt;
&lt;h2 id=&#34;the-reusable-lesson&#34;&gt;The reusable lesson&lt;/h2&gt;
&lt;p&gt;Multi-vendor VLANs work when every link agrees on the same contract. Write that contract down before opening any control panel:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;What stays untagged?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Which VLAN IDs must be tagged?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Which device supplies DHCP and routing?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Where is inter-VLAN access blocked?
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then test from the client toward the router, one layer at a time. In my case, the two most useful fixes were terminating the VLAN on the OpenWrt bridge rather than the enslaved physical port, and checking the real cable path before changing more configuration.&lt;/p&gt;
&lt;h3 id=&#34;official-references&#34;&gt;Official references&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/9761080275607-Creating-Virtual-Networks-VLANs&#34;&gt;Ubiquiti: Creating Virtual Networks (VLANs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/26136823938583-Creating-WiFi-and-Broadcasting-VLANs&#34;&gt;Ubiquiti: Creating UniFi WiFi SSIDs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/26136855808919-Switch-Port-VLAN-Assignment-Trunk-Access-Ports&#34;&gt;Ubiquiti: Switch Port VLAN Assignment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/9592924981911-Virtual-Network-VLAN-Troubleshooting&#34;&gt;Ubiquiti: Virtual Network (VLAN) Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://openwrt.org/docs/guide-user/network/dsa/dsa-mini-tutorial&#34;&gt;OpenWrt: DSA mini tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developers.redhat.com/articles/2022/04/06/introduction-linux-bridging-commands-and-features&#34;&gt;Red Hat Developers: Introduction to Linux bridging commands and features&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
    <item>
      <title>Authentik with Jellyfin and Navidrome: Two Different Paths to One Identity</title>
      <link>https://samirtech.org/posts/authentik-with-jellyfin-and-navidrome/</link>
      <pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate>
      
      <guid>https://samirtech.org/posts/authentik-with-jellyfin-and-navidrome/</guid>
      <description>Jellyfin and Navidrome can use the same Authentik directory, but they do not authenticate in the same way.
In my setup, Jellyfin uses LDAP. Navidrome&amp;rsquo;s web interface sits behind Authentik and Caddy, with the authenticated username passed in an HTTP header. Navidrome&amp;rsquo;s OpenSubsonic API remains separate so applications such as Symfonium and Feishin can use native credentials.
That distinction is the key to making the arrangement understandable and safe.
The three authentication paths Jellyfin -&amp;gt; LDAP plugin -&amp;gt; Authentik LDAP outpost Browser -&amp;gt; Caddy -&amp;gt; Authentik forward auth -&amp;gt; Navidrome OpenSubsonic client -&amp;gt; /rest/* -&amp;gt; Navidrome credentials Trying to force all three through one browser-oriented SSO flow causes problems.</description>
      <content>&lt;p&gt;Jellyfin and Navidrome can use the same Authentik directory, but they do not authenticate in the same way.&lt;/p&gt;
&lt;p&gt;In my setup, Jellyfin uses LDAP. Navidrome&amp;rsquo;s web interface sits behind Authentik and Caddy, with the authenticated username passed in an HTTP header. Navidrome&amp;rsquo;s OpenSubsonic API remains separate so applications such as Symfonium and Feishin can use native credentials.&lt;/p&gt;
&lt;p&gt;That distinction is the key to making the arrangement understandable and safe.&lt;/p&gt;
&lt;h2 id=&#34;the-three-authentication-paths&#34;&gt;The three authentication paths&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Jellyfin -&amp;gt; LDAP plugin -&amp;gt; Authentik LDAP outpost
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Browser -&amp;gt; Caddy -&amp;gt; Authentik forward auth -&amp;gt; Navidrome
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;OpenSubsonic client -&amp;gt; /rest/* -&amp;gt; Navidrome credentials
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Trying to force all three through one browser-oriented SSO flow causes problems. Native media clients expect an API response, not an HTML login page or a redirect.&lt;/p&gt;
&lt;h2 id=&#34;jellyfin-ldap-needs-an-ldap-service&#34;&gt;Jellyfin: LDAP needs an LDAP service&lt;/h2&gt;
&lt;p&gt;Installing Jellyfin&amp;rsquo;s LDAP plugin is only the client half of the job. Authentik must already have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an LDAP provider;&lt;/li&gt;
&lt;li&gt;an LDAP outpost serving that provider;&lt;/li&gt;
&lt;li&gt;a bind account for Jellyfin;&lt;/li&gt;
&lt;li&gt;a user search base and attribute that match the directory; and&lt;/li&gt;
&lt;li&gt;an explicit rule for which users may log in.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The outpost must be reachable from Jellyfin&amp;rsquo;s own network namespace. A connection test from a laptop does not prove that a container can resolve or reach the same endpoint.&lt;/p&gt;
&lt;p&gt;The useful troubleshooting order is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;confirm that the LDAP outpost is healthy;&lt;/li&gt;
&lt;li&gt;test DNS and the LDAP port from Jellyfin&amp;rsquo;s network;&lt;/li&gt;
&lt;li&gt;verify TLS trust, if TLS is enabled;&lt;/li&gt;
&lt;li&gt;verify the bind DN and secret;&lt;/li&gt;
&lt;li&gt;check the user base, username attribute and filter; and&lt;/li&gt;
&lt;li&gt;inspect both the Jellyfin and outpost logs during one login attempt.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If every user fails, the transport, bind or search configuration is probably wrong. If valid users can authenticate but the wrong users are also admitted, the connection works and the scope is too broad.&lt;/p&gt;
&lt;h2 id=&#34;use-an-allow-list-not-a-guest-deny-list&#34;&gt;Use an allow-list, not a guest deny-list&lt;/h2&gt;
&lt;p&gt;I did not want every Authentik account to inherit Jellyfin access. In particular, guest identities needed to remain restricted.&lt;/p&gt;
&lt;p&gt;The safer model is an approved media group. The Authentik provider can expose only the intended users, while Jellyfin&amp;rsquo;s LDAP configuration also requires membership of that group. This is easier to audit than maintaining a growing list of exclusions.&lt;/p&gt;
&lt;p&gt;A generic user filter might resemble:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-ldap&#34; data-lang=&#34;ldap&#34;&gt;(&amp;amp;(objectClass=&amp;lt;USER_OBJECT_CLASS&amp;gt;)(&amp;lt;USERNAME_ATTRIBUTE&amp;gt;={0}))
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A group restriction depends on the schema exposed by the installed Authentik version and the syntax expected by the Jellyfin plugin. Copying a filter from another directory without inspecting the actual attributes is unreliable.&lt;/p&gt;
&lt;p&gt;Test four cases before considering it finished:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an approved user with the correct password;&lt;/li&gt;
&lt;li&gt;a valid Authentik user outside the media group;&lt;/li&gt;
&lt;li&gt;a guest account; and&lt;/li&gt;
&lt;li&gt;an approved user with the wrong password.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Only the first should succeed.&lt;/p&gt;
&lt;p&gt;LDAP authentication also does not define every Jellyfin policy. Library access and administrator privileges still need to be reviewed on the resulting Jellyfin user.&lt;/p&gt;
&lt;h2 id=&#34;navidrome-forward-authentication-through-caddy&#34;&gt;Navidrome: forward authentication through Caddy&lt;/h2&gt;
&lt;p&gt;Navidrome can trust a username header supplied by an approved reverse proxy. In outline, its external-authentication settings look like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;environment&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;ND_EXTAUTH_USERHEADER&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;X-Authentik-Username&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;ND_EXTAUTH_TRUSTEDSOURCES&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;CADDY_SOURCE_ADDRESS&amp;gt;/32&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;ND_EXTAUTH_AUTOUSERCREATION&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;true&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check the names against the installed Navidrome release before applying them.&lt;/p&gt;
&lt;p&gt;Caddy asks Authentik to authorise the browser request and copies the returned identity headers:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-caddyfile&#34; data-lang=&#34;caddyfile&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;music.example.invalid {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;route&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;reverse_proxy&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;/outpost.goauthentik.io/*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;lt;AUTHENTIK_OUTPOST&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#a6e22e&#34;&gt;@browser&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;not&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;path&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/rest/*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/share/*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/outpost.goauthentik.io/*&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;forward_auth&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;@browser&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;lt;AUTHENTIK_OUTPOST&amp;gt;&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;uri&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/outpost.goauthentik.io/auth/caddy&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;copy_headers&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Authentik-Username&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Authentik-Groups&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Authentik-Email&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;reverse_proxy&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;lt;NAVIDROME_UPSTREAM&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is an architectural example, not a drop-in configuration. The recommended outpost route can change between Authentik versions.&lt;/p&gt;
&lt;p&gt;With automatic user creation enabled, a successful browser login creates a corresponding Navidrome account. On a fresh database, &lt;a href=&#34;https://www.navidrome.org/docs/usage/integration/authentication/&#34;&gt;Navidrome&amp;rsquo;s documented bootstrap behaviour&lt;/a&gt; makes the first externally authenticated user an administrator. I therefore restrict the Authentik application, create and verify the intended administrator first, and only then allow ordinary media users through SSO. New accounts should still be checked to ensure their role is correct.&lt;/p&gt;
&lt;h2 id=&#34;the-trusted-source-trap&#34;&gt;The trusted-source trap&lt;/h2&gt;
&lt;p&gt;The username header is not proof of identity by itself. Any client can try to send &lt;code&gt;X-Authentik-Username&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It becomes trustworthy only when:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Caddy ignores or replaces any client-supplied identity header;&lt;/li&gt;
&lt;li&gt;Authentik validates the request;&lt;/li&gt;
&lt;li&gt;Caddy inserts the identity returned by Authentik; and&lt;/li&gt;
&lt;li&gt;Navidrome accepts the header only from Caddy&amp;rsquo;s actual network source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The last point caused the most misleading failure. The address Navidrome sees may be a container address, bridge gateway or host address depending on the network path. It is not necessarily the address used in a browser.&lt;/p&gt;
&lt;p&gt;When the trusted source is wrong, Authentik succeeds and Caddy forwards the header, but Navidrome ignores it and presents its own login screen. Navidrome&amp;rsquo;s log entry about an untrusted source is more useful than guessing.&lt;/p&gt;
&lt;p&gt;Trust the narrowest stable address or CIDR possible. Do not use &lt;code&gt;0.0.0.0/0&lt;/code&gt; simply to make the warning disappear, and do not expose Navidrome directly to an untrusted network while it accepts proxy identity headers.&lt;/p&gt;
&lt;h2 id=&#34;keep-rest-outside-browser-sso&#34;&gt;Keep &lt;code&gt;/rest&lt;/code&gt; outside browser SSO&lt;/h2&gt;
&lt;p&gt;OpenSubsonic clients use Navidrome&amp;rsquo;s &lt;code&gt;/rest&lt;/code&gt; API. They do not complete Authentik&amp;rsquo;s browser redirect flow.&lt;/p&gt;
&lt;p&gt;Caddy therefore needs a narrow exception for the API path before applying forward authentication to browser routes. This does not make the API anonymous: Navidrome still validates the OpenSubsonic username and password.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;/rest&lt;/code&gt; is sent through forward authentication, clients may receive an Authentik page or redirect instead of the expected API response.&lt;/p&gt;
&lt;h2 id=&#34;one-user-two-passwords&#34;&gt;One user, two passwords&lt;/h2&gt;
&lt;p&gt;An account created by the SSO flow can use Authentik in a browser without having a usable Navidrome password. Native clients need a password known to Navidrome.&lt;/p&gt;
&lt;p&gt;The setup for a new user is therefore:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;sign in through Authentik in a browser, creating the Navidrome account;&lt;/li&gt;
&lt;li&gt;set a separate password for that account in Navidrome; and&lt;/li&gt;
&lt;li&gt;use the Navidrome username and password in the OpenSubsonic client.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For Symfonium, select its Subsonic or OpenSubsonic provider. In Feishin, OpenSubsonic mode worked with this arrangement; its Navidrome-native mode followed a different path and conflicted with the proxy SSO configuration.&lt;/p&gt;
&lt;p&gt;The Authentik password should not be entered into those clients. SSO and API credentials serve different protocols and should remain separate.&lt;/p&gt;
&lt;h2 id=&#34;deprovision-both-authentication-paths&#34;&gt;Deprovision both authentication paths&lt;/h2&gt;
&lt;p&gt;Removing a person from Navidrome alone is not enough while Authentik can still authorise them and automatic user creation remains enabled. I first remove the person from the approved media group or Authentik policy, then remove the matching Navidrome account through the administration UI. On releases with the &lt;a href=&#34;https://www.navidrome.org/docs/usage/admin/cli/user/&#34;&gt;documented user CLI&lt;/a&gt;, the equivalent is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;navidrome user list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;navidrome user delete --user &amp;lt;username-or-id&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The delete command does not ask for confirmation, so I verify the target and take the normal database backup first. I then test that the public SSO route is denied and that the old Navidrome credential no longer works through the private OpenSubsonic path. Revoking only the SSO route leaves a native password usable; deleting only the Navidrome row allows an authorised SSO login to create it again.&lt;/p&gt;
&lt;h2 id=&#34;verification-checklist&#34;&gt;Verification checklist&lt;/h2&gt;
&lt;h3 id=&#34;jellyfin&#34;&gt;Jellyfin&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The LDAP outpost is reachable from Jellyfin.&lt;/li&gt;
&lt;li&gt;An approved user can sign in.&lt;/li&gt;
&lt;li&gt;Valid but unauthorised and guest users cannot sign in.&lt;/li&gt;
&lt;li&gt;A wrong password fails.&lt;/li&gt;
&lt;li&gt;Local Jellyfin library and administrator policies remain correct.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;navidrome-browser&#34;&gt;Navidrome browser&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;A signed-out browser is redirected to Authentik.&lt;/li&gt;
&lt;li&gt;A successful login reaches the expected Navidrome account.&lt;/li&gt;
&lt;li&gt;A forged client identity header cannot bypass Authentik.&lt;/li&gt;
&lt;li&gt;Navidrome trusts only the source from which Caddy actually connects.&lt;/li&gt;
&lt;li&gt;Direct access is blocked or uses Navidrome&amp;rsquo;s own authentication.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;opensubsonic&#34;&gt;OpenSubsonic&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/rest/*&lt;/code&gt; does not redirect to Authentik.&lt;/li&gt;
&lt;li&gt;The client works with a Navidrome password.&lt;/li&gt;
&lt;li&gt;An incorrect Navidrome password fails.&lt;/li&gt;
&lt;li&gt;The SSO exemption does not include unrelated browser routes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;the-lesson&#34;&gt;The lesson&lt;/h2&gt;
&lt;p&gt;A shared identity system does not require every application to use the same protocol.&lt;/p&gt;
&lt;p&gt;Jellyfin needs a correctly scoped LDAP provider and outpost. Navidrome&amp;rsquo;s browser interface needs a trusted reverse proxy and carefully controlled identity header. OpenSubsonic clients need Navidrome&amp;rsquo;s native API credentials.&lt;/p&gt;
&lt;p&gt;Once those paths are treated separately, the setup stops feeling like one mysterious login problem and becomes three small, testable boundaries.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Docker, NFS and TrueNAS: Getting Permissions and ACLs Right</title>
      <link>https://samirtech.org/posts/docker-nfs-truenas-permissions-and-acls/</link>
      <pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate>
      
      <guid>https://samirtech.org/posts/docker-nfs-truenas-permissions-and-acls/</guid>
      <description>An NFS share can mount successfully, show every file and still refuse to let a container create, rename or delete anything.
The confusing part is that the failure crosses three systems:
container process -&amp;gt; bind mount on the Docker host -&amp;gt; NFS client identity -&amp;gt; TrueNAS share mapping -&amp;gt; dataset ACL In my case, the ordinary account on the Docker host used UID and GID 1000:1000, while the established TrueNAS account used 3000:3000.</description>
      <content>&lt;p&gt;An NFS share can mount successfully, show every file and still refuse to let a container create, rename or delete anything.&lt;/p&gt;
&lt;p&gt;The confusing part is that the failure crosses three systems:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;container process
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  -&amp;gt; bind mount on the Docker host
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  -&amp;gt; NFS client identity
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  -&amp;gt; TrueNAS share mapping
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  -&amp;gt; dataset ACL
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In my case, the ordinary account on the Docker host used UID and GID &lt;code&gt;1000:1000&lt;/code&gt;, while the established TrueNAS account used &lt;code&gt;3000:3000&lt;/code&gt;. The names could match, but those numbers did not.&lt;/p&gt;
&lt;p&gt;The safe solution was not to renumber either machine. It was to make the server-side identity handling and ACL explicit, then test the effective access through the same path the application uses.&lt;/p&gt;
&lt;h2 id=&#34;names-are-for-people-ids-cross-the-wire&#34;&gt;Names are for people; IDs cross the wire&lt;/h2&gt;
&lt;p&gt;Traditional Unix permission checks are based primarily on numeric user and group IDs. These two identities are not automatically equivalent:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Docker host: media -&amp;gt; 1000:1000
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;TrueNAS:     media -&amp;gt; 3000:3000
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;NFSv4 can support name-based identity mapping in a deliberately configured environment, but using NFSv4 does not prove that mapping is working. The useful question is not what the account is called. It is which identity TrueNAS sees for the request.&lt;/p&gt;
&lt;p&gt;With ordinary NFS &lt;code&gt;AUTH_SYS&lt;/code&gt;, this is also a trust boundary rather than only a naming detail. The client sends numeric UID and GID claims and the server normally uses those claims for access checks; &lt;code&gt;AUTH_SYS&lt;/code&gt; does not cryptographically prove that the remote process is really that user. Matching or remapping IDs can make permissions line up, but &lt;strong&gt;UID mapping is not authentication&lt;/strong&gt;. I restrict exports to trusted clients and networks, retain appropriate root squashing, and would use an authenticated NFS security flavour such as Kerberos where the threat model requires identity assurance.&lt;/p&gt;
&lt;h2 id=&#34;why-i-did-not-change-every-uid&#34;&gt;Why I did not change every UID&lt;/h2&gt;
&lt;p&gt;Renumbering an established account can affect far more than one share:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;existing dataset ownership;&lt;/li&gt;
&lt;li&gt;local bind mounts and container configuration;&lt;/li&gt;
&lt;li&gt;SMB access;&lt;/li&gt;
&lt;li&gt;application databases;&lt;/li&gt;
&lt;li&gt;backups and replication jobs;&lt;/li&gt;
&lt;li&gt;snapshots containing old ownership; and&lt;/li&gt;
&lt;li&gt;other NFS clients.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A recursive &lt;code&gt;chown&lt;/code&gt; is especially risky on shared data. It can destroy intentional ownership boundaries or interact badly with inherited ACL entries.&lt;/p&gt;
&lt;p&gt;Changing IDs may be appropriate during a planned migration, but it is a poor first response to one permission error.&lt;/p&gt;
&lt;h2 id=&#34;let-truenas-define-the-access-policy&#34;&gt;Let TrueNAS define the access policy&lt;/h2&gt;
&lt;p&gt;TrueNAS is authoritative for the exported dataset. Depending on the design, the right solution may be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an ACL entry for the identity arriving from the Docker host;&lt;/li&gt;
&lt;li&gt;access through a shared group;&lt;/li&gt;
&lt;li&gt;a narrowly scoped NFS user or group mapping;&lt;/li&gt;
&lt;li&gt;deliberately configured NFSv4 identity mapping; or&lt;/li&gt;
&lt;li&gt;a dedicated dataset for one application&amp;rsquo;s data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Map-root and map-all style settings have very different consequences. Root mapping controls how remote root is represented. Mapping all requests to one account can suit a tightly scoped single-purpose export, but it also removes useful attribution and can grant more access than intended.&lt;/p&gt;
&lt;p&gt;Use the narrowest option that works, on the smallest practical export. Identity mapping does not replace the dataset ACL: the resulting server-side identity must still have the required permissions.&lt;/p&gt;
&lt;h2 id=&#34;container-identity-is-a-separate-decision&#34;&gt;Container identity is a separate decision&lt;/h2&gt;
&lt;p&gt;Some images accept &lt;code&gt;PUID&lt;/code&gt; and &lt;code&gt;PGID&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;application&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;image&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&amp;lt;IMAGE&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;environment&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;PUID&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;1000&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;PGID&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;1000&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;volumes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      - &lt;span style=&#34;color:#ae81ff&#34;&gt;/mnt/&amp;lt;share&amp;gt;/&amp;lt;directory&amp;gt;:/data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These variables are image conventions, not Docker features. Other images use Compose&amp;rsquo;s &lt;code&gt;user&lt;/code&gt; setting, and some start as one account before dropping privileges to another.&lt;/p&gt;
&lt;p&gt;Verify the running process rather than trusting the Compose file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec &amp;lt;container&amp;gt; id
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec &amp;lt;container&amp;gt; ps -eo user,group,pid,args
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Changing a container to &lt;code&gt;3000:3000&lt;/code&gt; might make one NFS write succeed while breaking its local configuration directories. Server-side mapping or ACLs are often less disruptive.&lt;/p&gt;
&lt;h2 id=&#34;root-in-a-container-is-not-necessarily-root-on-the-nas&#34;&gt;Root in a container is not necessarily root on the NAS&lt;/h2&gt;
&lt;p&gt;NFS commonly applies root squash. A request from client UID &lt;code&gt;0&lt;/code&gt; becomes an anonymous or restricted identity on the server.&lt;/p&gt;
&lt;p&gt;That is a security boundary, not an inconvenience to disable casually. A root container may be able to read or create files yet fail to change ownership. First establish whether the application truly needs &lt;code&gt;chown&lt;/code&gt;, or merely needs create, write, rename and delete access.&lt;/p&gt;
&lt;p&gt;If elevated mapping is genuinely required, keep it limited to a dedicated export and trusted clients.&lt;/p&gt;
&lt;h2 id=&#34;posix-mode-bits-are-not-the-whole-acl&#34;&gt;POSIX mode bits are not the whole ACL&lt;/h2&gt;
&lt;p&gt;Commands such as these remain useful:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ls -ldn /mnt/&amp;lt;share&amp;gt;/&amp;lt;directory&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;stat -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;%u:%g %a %n&amp;#39;&lt;/span&gt; /mnt/&amp;lt;share&amp;gt;/&amp;lt;directory&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;They show numeric ownership and POSIX mode bits. They do not necessarily show the complete policy on a dataset using NFSv4 ACLs.&lt;/p&gt;
&lt;p&gt;An NFSv4 ACL can contain named users and groups, allow and deny entries, inheritance flags, and distinct rights for creating, deleting and traversing. It should not be treated as a verbose version of &lt;code&gt;chmod&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Inspect and modify the dataset with tools appropriate to its configured ACL type. Do not use recursive &lt;code&gt;chmod&lt;/code&gt;, &lt;code&gt;chown&lt;/code&gt; or ACL replacement as a substitute for understanding the existing policy.&lt;/p&gt;
&lt;h2 id=&#34;inheritance-matters&#34;&gt;Inheritance matters&lt;/h2&gt;
&lt;p&gt;Fixing access to the top-level directory is not enough. Newly created files and subdirectories need suitable inherited entries.&lt;/p&gt;
&lt;p&gt;Test that the intended identity can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;traverse each parent directory;&lt;/li&gt;
&lt;li&gt;create a file and a directory;&lt;/li&gt;
&lt;li&gt;append to and rename the file;&lt;/li&gt;
&lt;li&gt;delete it from the directory; and&lt;/li&gt;
&lt;li&gt;create content another intended service can subsequently read or modify.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A parent ACL can permit creation while producing a child that another service cannot process. Existing children also do not necessarily inherit a newly added rule retrospectively.&lt;/p&gt;
&lt;h2 id=&#34;test-the-direct-path&#34;&gt;Test the direct path&lt;/h2&gt;
&lt;p&gt;A successful write in the TrueNAS shell proves little about a request made by a container. Test each layer.&lt;/p&gt;
&lt;h3 id=&#34;on-the-docker-host&#34;&gt;On the Docker host&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;findmnt -T /mnt/&amp;lt;share&amp;gt;/&amp;lt;directory&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;findmnt -no SOURCE,FSTYPE,OPTIONS -T /mnt/&amp;lt;share&amp;gt;/&amp;lt;directory&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ls -ldn /mnt/&amp;lt;share&amp;gt;/&amp;lt;directory&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then perform a harmless test as the relevant host account in a disposable directory:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo -u &amp;lt;host-user&amp;gt; sh -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  f=&amp;#34;/mnt/&amp;lt;share&amp;gt;/&amp;lt;test-directory&amp;gt;/.permission-test-$$&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  : &amp;gt; &amp;#34;$f&amp;#34; &amp;amp;&amp;amp; printf &amp;#34;test\n&amp;#34; &amp;gt;&amp;gt; &amp;#34;$f&amp;#34; &amp;amp;&amp;amp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  mv &amp;#34;$f&amp;#34; &amp;#34;$f.renamed&amp;#34; &amp;amp;&amp;amp; rm -- &amp;#34;$f.renamed&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;inside-the-container&#34;&gt;Inside the container&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec &amp;lt;container&amp;gt; id
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec &amp;lt;container&amp;gt; sh -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  d=&amp;#34;&amp;lt;container-test-path&amp;gt;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  f=&amp;#34;$d/.permission-test-$$&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  : &amp;gt; &amp;#34;$f&amp;#34; &amp;amp;&amp;amp; printf &amp;#34;test\n&amp;#34; &amp;gt;&amp;gt; &amp;#34;$f&amp;#34; &amp;amp;&amp;amp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;  mv &amp;#34;$f&amp;#34; &amp;#34;$f.renamed&amp;#34; &amp;amp;&amp;amp; rm -- &amp;#34;$f.renamed&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is the decisive test because it uses the effective process identity, bind mount and NFS route used by the application.&lt;/p&gt;
&lt;p&gt;Where possible, also reproduce the application&amp;rsquo;s real operations. Creating a file and renaming one can require different ACL rights.&lt;/p&gt;
&lt;h2 id=&#34;a-safe-diagnostic-sequence&#34;&gt;A safe diagnostic sequence&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Record the host user&amp;rsquo;s numeric identity with &lt;code&gt;id &amp;lt;host-user&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Record the container&amp;rsquo;s effective UID, GID and supplementary groups.&lt;/li&gt;
&lt;li&gt;Confirm that the expected NFS mount backs the exact host path.&lt;/li&gt;
&lt;li&gt;Confirm that neither the NFS nor container mount is read-only.&lt;/li&gt;
&lt;li&gt;Identify the dataset&amp;rsquo;s ACL type.&lt;/li&gt;
&lt;li&gt;Review the complete dataset ACL and inheritance flags.&lt;/li&gt;
&lt;li&gt;Review map-root, map-all and anonymous identity settings.&lt;/li&gt;
&lt;li&gt;Determine which identity TrueNAS sees after mapping.&lt;/li&gt;
&lt;li&gt;Test create, append, rename, delete, &lt;code&gt;mkdir&lt;/code&gt; and &lt;code&gt;rmdir&lt;/code&gt; on the host.&lt;/li&gt;
&lt;li&gt;Repeat the test inside the container.&lt;/li&gt;
&lt;li&gt;Inspect the owner and ACL of newly created objects.&lt;/li&gt;
&lt;li&gt;Change one layer at a time and repeat the same tests.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before changing a share or ACL, preserve its configuration. Test against a non-production directory and avoid broad recursive operations.&lt;/p&gt;
&lt;h2 id=&#34;the-resulting-design&#34;&gt;The resulting design&lt;/h2&gt;
&lt;p&gt;For this kind of environment, a maintainable design is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;keep the Docker host&amp;rsquo;s established &lt;code&gt;1000:1000&lt;/code&gt; identity;&lt;/li&gt;
&lt;li&gt;keep the TrueNAS user&amp;rsquo;s established &lt;code&gt;3000:3000&lt;/code&gt; identity;&lt;/li&gt;
&lt;li&gt;run each container with a deliberate, documented account;&lt;/li&gt;
&lt;li&gt;translate or authorise that access on the TrueNAS side;&lt;/li&gt;
&lt;li&gt;preserve root squash;&lt;/li&gt;
&lt;li&gt;apply and verify suitable inheritance; and&lt;/li&gt;
&lt;li&gt;test access through the actual container path.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The aim is not to make every number identical. It is to make the server&amp;rsquo;s interpretation of each request explicit, narrow and testable.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Nextcloud Desktop Sync Exclusions and Diagnosis on Linux</title>
      <link>https://samirtech.org/posts/nextcloud-sync-exclusions-and-diagnosis/</link>
      <pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate>
      
      <guid>https://samirtech.org/posts/nextcloud-sync-exclusions-and-diagnosis/</guid>
      <description>Nextcloud Desktop normally works quietly, which makes a bad folder mapping easy to miss. A connection can report success while another connection handles the same remote path, or remain permanently busy because an active application keeps rewriting files beneath it.
My Linux setup has a broad Nextcloud connection and separate connections for Documents and Pictures. It also excludes game data and phone-import staging folders. The important lesson was that exclusions only make sense after each path has one clear owner.</description>
      <content>&lt;p&gt;Nextcloud Desktop normally works quietly, which makes a bad folder mapping easy to miss. A connection can report success while another connection handles the same remote path, or remain permanently busy because an active application keeps rewriting files beneath it.&lt;/p&gt;
&lt;p&gt;My Linux setup has a broad Nextcloud connection and separate connections for Documents and Pictures. It also excludes game data and phone-import staging folders. The important lesson was that exclusions only make sense after each path has one clear owner.&lt;/p&gt;
&lt;h2 id=&#34;know-the-client-state&#34;&gt;Know the client state&lt;/h2&gt;
&lt;p&gt;On my installation, the useful locations are:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;~/.config/Nextcloud/nextcloud.cfg
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;~/.local/share/Nextcloud/{folder}_sync.log
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;sync-root&amp;gt;/.sync_*.db
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sync-exclude.lst
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Their roles differ:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nextcloud.cfg&lt;/code&gt; describes accounts and folder connections;&lt;/li&gt;
&lt;li&gt;each &lt;code&gt;{folder}_sync.log&lt;/code&gt; records activity for a connection;&lt;/li&gt;
&lt;li&gt;the hidden journal database stores the client&amp;rsquo;s local sync state; and&lt;/li&gt;
&lt;li&gt;the client&amp;rsquo;s global &lt;code&gt;sync-exclude.lst&lt;/code&gt; provides fixed exclusion definitions; user patterns can be managed through &lt;strong&gt;Edit Ignored Files&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This global list is stored outside the synchronised tree and should not be confused with selective sync or a manually created per-directory &lt;code&gt;.sync-exclude.lst&lt;/code&gt;. The client does not necessarily create a separate exclusion file for every folder connection. Exact names and locations can vary by package and client version, so inspect the existing configuration rather than copying a path blindly. Configuration and logs may also contain private server names, usernames and filenames, so redact them before sharing.&lt;/p&gt;
&lt;h2 id=&#34;map-every-connection-first&#34;&gt;Map every connection first&lt;/h2&gt;
&lt;p&gt;Write each connection as a local-to-remote mapping:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Connection&lt;/th&gt;
&lt;th&gt;Local root&lt;/th&gt;
&lt;th&gt;Remote root&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Main&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Nextcloud&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Documents&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Documents&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/Documents&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pictures&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Pictures&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/Pictures&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Those local roots do not overlap, but the remote roots do. A main connection pointed at &lt;code&gt;/&lt;/code&gt; also includes &lt;code&gt;/Documents&lt;/code&gt; and &lt;code&gt;/Pictures&lt;/code&gt; unless those directories are excluded from it.&lt;/p&gt;
&lt;p&gt;A local overlap is more obvious:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;~/Nextcloud          &amp;lt;-&amp;gt; /
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;~/Nextcloud/Pictures &amp;lt;-&amp;gt; /Pictures
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Both arrangements can give two journals responsibility for the same remote content. Symptoms include duplicated downloads, repeated uploads, conflicts, files returning after deletion and exclusions that appear inconsistent.&lt;/p&gt;
&lt;p&gt;There are three different controls here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Global ignored-file definitions&lt;/strong&gt; include the client&amp;rsquo;s fixed patterns and user patterns entered through &lt;strong&gt;Edit Ignored Files&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Selective sync&lt;/strong&gt; uses &lt;strong&gt;Choose what to sync&lt;/strong&gt; to include or omit server folders for one folder connection. This is the right control for giving &lt;code&gt;/Documents&lt;/code&gt; or &lt;code&gt;/Pictures&lt;/code&gt; to a dedicated connection.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A manually created per-directory &lt;code&gt;.sync-exclude.lst&lt;/code&gt;&lt;/strong&gt; may add recursive rules below its location. Client source documents this mechanism, but behaviour has varied by client version and virtual-file mode. I test it against the exact installed client rather than assuming it works everywhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These controls have different scopes. A selective-sync choice for one connection does not govern another, while global ignored-file patterns are not evidence that every connection owns its own list file.&lt;/p&gt;
&lt;h2 id=&#34;give-each-path-one-owner&#34;&gt;Give each path one owner&lt;/h2&gt;
&lt;p&gt;For a broad main connection plus dedicated Documents and Pictures connections, the main connection should exclude:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Documents/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pictures/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The narrower connections then own those remote subtrees. The alternative is one broad connection with no dedicated connections. Either can work; the unstable arrangement is allowing both designs to cover the same content.&lt;/p&gt;
&lt;p&gt;For each path, answer two questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Which folder connection owns it?&lt;/li&gt;
&lt;li&gt;Is it omitted by selective sync, a global/user ignored-file pattern, or a tested per-directory rule?&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;exclude-working-data-not-just-large-data&#34;&gt;Exclude working data, not just large data&lt;/h2&gt;
&lt;p&gt;Some directories are poor candidates for live two-way sync even when their size is modest.&lt;/p&gt;
&lt;p&gt;Game launchers and games may keep databases, caches and lock files open, while also using their own cloud synchronisation. Syncing those working files can create conflicts or preserve a state that was never internally consistent.&lt;/p&gt;
&lt;p&gt;Phone imports have a similar problem. Import tools may rename, rotate, deduplicate or move photographs while Nextcloud is scanning them.&lt;/p&gt;
&lt;p&gt;A calmer layout is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;~/Pictures/Phone Import  # local staging, excluded
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;~/Pictures/Library       # completed collection, synchronised
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finish the import first, then move the settled files into the synchronised library.&lt;/p&gt;
&lt;p&gt;If game saves need protection, identify the stable save files and back them up when the game is closed. Do not assume that syncing an active application directory is a safe backup.&lt;/p&gt;
&lt;h2 id=&#34;exclusion-syntax-needs-testing&#34;&gt;Exclusion syntax needs testing&lt;/h2&gt;
&lt;p&gt;Do not assume that the ignored-file pattern syntax, or a manually created &lt;code&gt;.sync-exclude.lst&lt;/code&gt;, uses exactly the same rules as &lt;code&gt;.gitignore&lt;/code&gt;, a shell glob or an &lt;code&gt;rsync&lt;/code&gt; filter. Client versions can differ in their handling of path separators, wildcards, spaces and directory-only matches.&lt;/p&gt;
&lt;p&gt;Start with a simple path relative to that connection&amp;rsquo;s root:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Games/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Phone Import/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do not automatically add shell quoting or escaping:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;#34;Phone Import/&amp;#34;   # the quotes may become literal
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Phone\ Import/     # this is not necessarily shell syntax
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the same directory name occurs in several places, test a path-specific rule supported by the installed client instead of using an over-broad name match.&lt;/p&gt;
&lt;p&gt;After changing &lt;strong&gt;Edit Ignored Files&lt;/strong&gt;, selective sync or a per-directory list, restart the client or pause and resume the affected connection, then use a disposable file to verify the result both locally and in the server UI. An exclusion normally prevents future synchronisation; it is not an instruction to delete a copy already present on the server. A rule appearing in a dialogue or file is not proof that this client version applied it.&lt;/p&gt;
&lt;h2 id=&#34;read-the-matching-log&#34;&gt;Read the matching log&lt;/h2&gt;
&lt;p&gt;When Pictures misbehaves, read the Pictures connection log, not only the main one:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;less ~/.local/share/Nextcloud/Pictures_sync.log
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Search for repeated evidence around the time of a test:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;grep -Ei &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;error|warning|excluded|ignored|conflict|permission|database|journal|locked&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  ~/.local/share/Nextcloud/Pictures_sync.log
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Useful clues include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a path matched by an exclusion;&lt;/li&gt;
&lt;li&gt;a missing or inaccessible local root;&lt;/li&gt;
&lt;li&gt;a server-side lock;&lt;/li&gt;
&lt;li&gt;an unsupported filename;&lt;/li&gt;
&lt;li&gt;a journal or transaction error;&lt;/li&gt;
&lt;li&gt;a missing remote path; or&lt;/li&gt;
&lt;li&gt;the same content discovered by two connections.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The client&amp;rsquo;s activity view also distinguishes excluded, ignored, conflicted and errored items. Those states are not interchangeable.&lt;/p&gt;
&lt;h2 id=&#34;treat-the-journal-as-state-not-a-cache-to-delete&#34;&gt;Treat the journal as state, not a cache to delete&lt;/h2&gt;
&lt;p&gt;The journal records what the client believes it has already seen. It helps distinguish a new file from a rename, deletion or conflict.&lt;/p&gt;
&lt;p&gt;A damaged journal can cause repeated full scans, items that remain pending, transaction errors or changes that are never recognised. Deleting it should still be a last resort.&lt;/p&gt;
&lt;p&gt;Rebuilding a journal forces the client to reconcile the local and remote trees again. That can surface old deletions and conflicts. Before attempting it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;stop the desktop client;&lt;/li&gt;
&lt;li&gt;confirm the exact connection and journal path;&lt;/li&gt;
&lt;li&gt;make sure important files have an independent backup;&lt;/li&gt;
&lt;li&gt;preserve the original database by copying or renaming it; and&lt;/li&gt;
&lt;li&gt;expect a complete rescan.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Do not open or modify the database while the client is running.&lt;/p&gt;
&lt;h2 id=&#34;a-disciplined-diagnosis&#34;&gt;A disciplined diagnosis&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Pause every connection involved in an overlap.&lt;/li&gt;
&lt;li&gt;Record all local and remote roots in a table.&lt;/li&gt;
&lt;li&gt;Check for local nesting and remote nesting separately.&lt;/li&gt;
&lt;li&gt;Confirm that each local root exists and has the expected ownership.&lt;/li&gt;
&lt;li&gt;Inspect global/user ignored-file patterns and each connection&amp;rsquo;s selective-sync choices.&lt;/li&gt;
&lt;li&gt;If using a per-directory &lt;code&gt;.sync-exclude.lst&lt;/code&gt;, test its rules relative to that directory on the installed client.&lt;/li&gt;
&lt;li&gt;Resume one connection at a time.&lt;/li&gt;
&lt;li&gt;Create a disposable file in an included path and one in an excluded path.&lt;/li&gt;
&lt;li&gt;Match the test time to the correct connection log.&lt;/li&gt;
&lt;li&gt;Change one thing at a time.&lt;/li&gt;
&lt;li&gt;Consider a journal rebuild only after mappings, permissions and exclusions have been ruled out.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A simple local-root check is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; path in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/Nextcloud&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/Documents&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/Pictures&amp;#34;&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt; -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$path&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        printf &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;OK:      %s\n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$path&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        printf &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;MISSING: %s\n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$path&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For exclusions, create obviously disposable test files and remove them after verification. Do not experiment with valuable documents or photographs.&lt;/p&gt;
&lt;h2 id=&#34;common-failure-patterns&#34;&gt;Common failure patterns&lt;/h2&gt;
&lt;h3 id=&#34;an-excluded-directory-still-uploads&#34;&gt;An excluded directory still uploads&lt;/h3&gt;
&lt;p&gt;The rule may belong to the wrong connection, another connection may cover the same path, the pattern may be relative to a different root, or the client may not have reloaded it. Content uploaded before the rule was added can also remain on the server.&lt;/p&gt;
&lt;h3 id=&#34;documents-or-pictures-appear-twice&#34;&gt;Documents or Pictures appear twice&lt;/h3&gt;
&lt;p&gt;A main connection probably owns &lt;code&gt;/&lt;/code&gt; while a dedicated connection also owns &lt;code&gt;/Documents&lt;/code&gt; or &lt;code&gt;/Pictures&lt;/code&gt;. Exclude the subtree from the main connection or simplify the setup to one connection.&lt;/p&gt;
&lt;h3 id=&#34;a-phone-import-never-settles&#34;&gt;A phone import never settles&lt;/h3&gt;
&lt;p&gt;The import process and Nextcloud are both changing the directory. Use a non-synchronised staging area and move completed files afterwards.&lt;/p&gt;
&lt;h3 id=&#34;game-files-repeatedly-conflict&#34;&gt;Game files repeatedly conflict&lt;/h3&gt;
&lt;p&gt;Exclude active caches, lock files and databases. Protect stable saves with a suitable backup rather than syncing a live application state.&lt;/p&gt;
&lt;h3 id=&#34;logs-report-database-errors&#34;&gt;Logs report database errors&lt;/h3&gt;
&lt;p&gt;Stop the client, then check storage space, filesystem health and permissions before touching the journal. Preserve the original database if a rebuild becomes necessary.&lt;/p&gt;
&lt;h2 id=&#34;sync-is-not-backup&#34;&gt;Sync is not backup&lt;/h2&gt;
&lt;p&gt;A two-way sync can propagate accidental deletion, unwanted edits, corruption and ransomware-encrypted files. Server-side versioning and deleted-file retention can help, but their usefulness depends on configured limits and available space.&lt;/p&gt;
&lt;p&gt;A backup should be stored independently, retain versions, resist ordinary sync operations and be tested by restoring files.&lt;/p&gt;
&lt;p&gt;Use Nextcloud to make working files available on several devices. Use a backup to make them recoverable after the synchronised copy has gone wrong.&lt;/p&gt;
&lt;h2 id=&#34;a-stable-target-layout&#34;&gt;A stable target layout&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Main connection
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Local:  ~/Nextcloud
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Remote: /
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Excludes:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Documents/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Pictures/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Games/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Documents connection
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Local:  ~/Documents
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Remote: /Documents
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Excludes:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    application caches and temporary data
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Pictures connection
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Local:  ~/Pictures
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Remote: /Pictures
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Excludes:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Phone Import/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Camera Imports/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The exact paths are less important than the rule behind them: every synchronised path should belong to one folder connection, and every exclusion should be attached to the connection that actually sees it.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>How to Rename a Homelab Server Without Breaking Everything</title>
      <link>https://samirtech.org/posts/rename-a-homelab-server-without-breaking-everything/</link>
      <pubDate>Thu, 24 Sep 2026 00:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/rename-a-homelab-server-without-breaking-everything/</guid>
      <description>Renaming a homelab server sounds cosmetic. Change /etc/hostname, reboot, and move on.
In practice, a hostname becomes an identifier shared by several systems. SSH remembers it. Backup jobs record it. Monitoring uses it in alerts. Overlay networks display it. Scripts may contain it as a destination or a lock-file label. Changing the visible name while leaving those dependencies behind creates a machine with two identities: the new one on the prompt and the old one everywhere that matters.</description>
      <content>&lt;p&gt;Renaming a homelab server sounds cosmetic. Change &lt;code&gt;/etc/hostname&lt;/code&gt;, reboot, and move on.&lt;/p&gt;
&lt;p&gt;In practice, a hostname becomes an identifier shared by several systems. SSH remembers it. Backup jobs record it. Monitoring uses it in alerts. Overlay networks display it. Scripts may contain it as a destination or a lock-file label. Changing the visible name while leaving those dependencies behind creates a machine with two identities: the new one on the prompt and the old one everywhere that matters.&lt;/p&gt;
&lt;p&gt;I recently renamed a small remote backup server. The Linux change took seconds. The useful work was proving that everything around it still worked.&lt;/p&gt;
&lt;h2 id=&#34;inventory-the-old-name-first&#34;&gt;Inventory the old name first&lt;/h2&gt;
&lt;p&gt;Before changing anything, search the places that may treat the hostname as data:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rg -n &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;old-hostname&amp;#39;&lt;/span&gt; ~/.ssh ~/.config ~/.local/bin
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On the server, check scheduled jobs, service definitions and application configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;crontab -l
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl list-unit-files --state&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;enabled
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rg -n &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;old-hostname&amp;#39;&lt;/span&gt; ~/.config ~/.local /etc/systemd 2&amp;gt;/dev/null
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The important question is not only “where is this string used?” It is “what role does it play here?”&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A label in a dashboard can be changed freely.&lt;/li&gt;
&lt;li&gt;A backup repository&amp;rsquo;s recorded host field affects how snapshots are filtered.&lt;/li&gt;
&lt;li&gt;An SSH alias can be preserved while its destination changes.&lt;/li&gt;
&lt;li&gt;A TLS certificate or DNS record may require a deliberate migration.&lt;/li&gt;
&lt;li&gt;A script may use the name as both a connection target and a human-readable label.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Write the dependencies down before editing them. That list becomes the verification plan.&lt;/p&gt;
&lt;h2 id=&#34;separate-the-kinds-of-name&#34;&gt;Separate the kinds of name&lt;/h2&gt;
&lt;p&gt;A homelab machine can have several names at once:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The operating-system hostname&lt;/strong&gt; returned by &lt;code&gt;hostnamectl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A DNS name&lt;/strong&gt; used by other devices on the LAN.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An overlay-network name&lt;/strong&gt; used away from home.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An SSH alias&lt;/strong&gt; in the client&amp;rsquo;s config.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An application label&lt;/strong&gt; used in alerts, dashboards and backup metadata.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;They do not have to be identical. In fact, treating the SSH alias as a stable interface can make a rename safer. Scripts can continue connecting to a familiar alias while the alias points at the new DNS or overlay name.&lt;/p&gt;
&lt;p&gt;A simple SSH entry keeps that indirection explicit:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-sshconfig&#34; data-lang=&#34;sshconfig&#34;&gt;Host remote-backup
    HostName new-hostname.example.invalid
    User backup-user
    IdentityFile ~/.ssh/remote-backup
    IdentitiesOnly yes
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The script uses &lt;code&gt;remote-backup&lt;/code&gt;; the physical machine can be renamed again without another sweep through every command.&lt;/p&gt;
&lt;h2 id=&#34;change-the-machine-then-the-surrounding-systems&#34;&gt;Change the machine, then the surrounding systems&lt;/h2&gt;
&lt;p&gt;On a normal systemd-based Linux host, the operating-system rename is straightforward:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo hostnamectl hostname new-hostname
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;hostnamectl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Some services read the hostname only when they start. A reboot is the cleanest boundary when it is convenient, but I do not treat the reboot itself as verification. After the machine returns, I check the name locally and reconnect through every intended route.&lt;/p&gt;
&lt;p&gt;Then I update the surrounding systems deliberately:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the overlay-network device name;&lt;/li&gt;
&lt;li&gt;DNS records, if the hostname is used in DNS;&lt;/li&gt;
&lt;li&gt;SSH aliases and pinned host entries;&lt;/li&gt;
&lt;li&gt;backup job labels and filters;&lt;/li&gt;
&lt;li&gt;monitoring target names and alert text;&lt;/li&gt;
&lt;li&gt;dashboards and inventory notes;&lt;/li&gt;
&lt;li&gt;any wake-on-LAN or recovery scripts that display the old name.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I do not blindly delete the old SSH host key. First I compare the key received through the new name with the key already pinned for the old one. A rename should not silently weaken host verification.&lt;/p&gt;
&lt;h2 id=&#34;backups-need-more-than-a-connection-test&#34;&gt;Backups need more than a connection test&lt;/h2&gt;
&lt;p&gt;A successful SSH login proves authentication and reachability. It does not prove that the backup path, repository permissions or backup metadata still behave as intended.&lt;/p&gt;
&lt;p&gt;For a backup host, my minimum post-rename test is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Connect non-interactively with the same identity the scheduled job uses.&lt;/li&gt;
&lt;li&gt;Check that the destination path is readable and writable as that account.&lt;/li&gt;
&lt;li&gt;Run the real backup command.&lt;/li&gt;
&lt;li&gt;Confirm that a new snapshot exists.&lt;/li&gt;
&lt;li&gt;Run the repository integrity check.&lt;/li&gt;
&lt;li&gt;Read the monitoring result generated by that run.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If the backup tool records a host field, decide whether new snapshots should use the new name. Historical snapshots keeping the old hostname is not corruption; it is history. What matters is knowing that filters and retention rules do not accidentally ignore one side of the rename.&lt;/p&gt;
&lt;h2 id=&#34;keep-compatibility-temporary-and-visible&#34;&gt;Keep compatibility temporary and visible&lt;/h2&gt;
&lt;p&gt;Sometimes the safest migration keeps the old alias working for a short period. That is useful when several clients cannot be updated together.&lt;/p&gt;
&lt;p&gt;Compatibility should be explicit, not mysterious. Add a comment saying why the alias exists and when it can be removed. Otherwise the old name becomes permanent because nobody knows whether it is still needed.&lt;/p&gt;
&lt;p&gt;I remove a compatibility alias only after searches for the old name return either nothing or intentionally retained historical references.&lt;/p&gt;
&lt;h2 id=&#34;my-final-checklist&#34;&gt;My final checklist&lt;/h2&gt;
&lt;p&gt;I consider a rename complete only when all of these are true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;hostnamectl&lt;/code&gt; reports the new name;&lt;/li&gt;
&lt;li&gt;LAN and remote access resolve the intended target;&lt;/li&gt;
&lt;li&gt;SSH host-key verification still works;&lt;/li&gt;
&lt;li&gt;scheduled jobs reference a stable, tested destination;&lt;/li&gt;
&lt;li&gt;monitoring uses the new human-readable label;&lt;/li&gt;
&lt;li&gt;a real backup completes;&lt;/li&gt;
&lt;li&gt;the new snapshot is visible;&lt;/li&gt;
&lt;li&gt;the repository check passes;&lt;/li&gt;
&lt;li&gt;the old name appears only in documented compatibility entries or history.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The command that changes a hostname is the smallest part of the job. The real task is tracing the name through every place where it became an assumption, then replacing those assumptions with stable interfaces and tests.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Monitoring the Monitor with Atomic Status Files</title>
      <link>https://samirtech.org/posts/monitoring-the-monitor-with-atomic-status-files/</link>
      <pubDate>Thu, 24 Sep 2026 00:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/monitoring-the-monitor-with-atomic-status-files/</guid>
      <description>A monitoring script can be running on schedule and still leave you with no trustworthy monitoring data.
I hit a simple example: the process that generated a JSON health report started correctly, but the published report was zero bytes. Anything reading that file either failed to parse it or had no state to display. The scheduler was healthy. The monitoring output was not.
The cause was a common shell pattern:</description>
      <content>&lt;p&gt;A monitoring script can be running on schedule and still leave you with no trustworthy monitoring data.&lt;/p&gt;
&lt;p&gt;I hit a simple example: the process that generated a JSON health report started correctly, but the published report was zero bytes. Anything reading that file either failed to parse it or had no state to display. The scheduler was healthy. The monitoring output was not.&lt;/p&gt;
&lt;p&gt;The cause was a common shell pattern:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;health-report &amp;gt; last-report.json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The shell opens &lt;code&gt;last-report.json&lt;/code&gt; and truncates it &lt;em&gt;before&lt;/em&gt; &lt;code&gt;health-report&lt;/code&gt; starts. If the command crashes, is killed or fails while writing, the previous valid report is already gone.&lt;/p&gt;
&lt;h2 id=&#34;the-final-filename-is-an-interface&#34;&gt;The final filename is an interface&lt;/h2&gt;
&lt;p&gt;A status file is not merely a log. Other programs treat its name as an interface: dashboards read it, alerting scripts parse it and people use it during incidents.&lt;/p&gt;
&lt;p&gt;That means readers should see one of two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;the complete previous report; or&lt;/li&gt;
&lt;li&gt;the complete new report.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;They should never see a half-written transition between them.&lt;/p&gt;
&lt;p&gt;The standard fix is to write beside the final file and rename only after validation:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;set -eu
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state_dir&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$HOME&lt;span style=&#34;color:#e6db74&#34;&gt;/.local/state/infra-health&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;final&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$state_dir&lt;span style=&#34;color:#e6db74&#34;&gt;/last-report.json&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;tmp&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;mktemp &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$state_dir&lt;span style=&#34;color:#e6db74&#34;&gt;/.last-report.XXXXXX&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trap &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;rm -f &amp;#34;$tmp&amp;#34;&amp;#39;&lt;/span&gt; EXIT
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;health-report &amp;gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$tmp&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;test -s &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$tmp&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python3 -m json.tool &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$tmp&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &amp;gt;/dev/null
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;600&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$tmp&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mv -f &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$tmp&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$final&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;trap - EXIT
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On the same filesystem, &lt;code&gt;rename&lt;/code&gt; is atomic. Readers see the old inode until the new one replaces it; they do not observe a partially written report.&lt;/p&gt;
&lt;p&gt;Creating the temporary file in the destination directory is important. A move across filesystems may fall back to copy-and-delete semantics and lose the atomic guarantee.&lt;/p&gt;
&lt;p&gt;Atomic publication has two important limits. First, rename atomicity does not itself guarantee crash durability. A power loss can still discard data that existed only in cache; code that requires that guarantee must flush and &lt;code&gt;fsync&lt;/code&gt; the temporary file before renaming it, then &lt;code&gt;fsync&lt;/code&gt; the containing directory, while accounting for filesystem-specific behaviour. Second, atomic rename does not serialize concurrent writers. Two jobs can each publish a complete file and the last rename wins, even if it contains older data. I use one writer, a lock or generation checks when runs can overlap; unique temporary names prevent temporary-file collisions but not this race.&lt;/p&gt;
&lt;h2 id=&#34;validate-meaning-not-only-syntax&#34;&gt;Validate meaning, not only syntax&lt;/h2&gt;
&lt;p&gt;Non-empty valid JSON is the minimum gate, not always the complete one. A report can be syntactically valid and operationally useless.&lt;/p&gt;
&lt;p&gt;For a richer report I also validate required fields:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; json
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; pathlib &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; Path
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;p &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Path(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;candidate.json&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;data &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; json&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;loads(p&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;read_text())
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;required &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;generated_at&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;overall_state&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;checks&amp;#34;&lt;/span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;missing &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; required &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; data&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;keys()
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; missing:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;raise&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;SystemExit&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;f&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;missing fields: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&lt;/span&gt;sorted(missing)&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;not&lt;/span&gt; isinstance(data[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;checks&amp;#34;&lt;/span&gt;], list):
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;raise&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;SystemExit&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;checks must be a list&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The producer should exit non-zero when it cannot produce a complete report. A wrapper can then preserve the last good file and alert on the failed attempt.&lt;/p&gt;
&lt;h2 id=&#34;keep-generation-state-separate-from-observed-state&#34;&gt;Keep generation state separate from observed state&lt;/h2&gt;
&lt;p&gt;The report tells me what the checks found. It should not be the only evidence that report generation itself is working.&lt;/p&gt;
&lt;p&gt;I track three independent signals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;content:&lt;/strong&gt; the latest valid report says healthy or unhealthy;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;freshness:&lt;/strong&gt; its generation time is recent enough for the schedule;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;execution:&lt;/strong&gt; the scheduler last ran the producer and recorded its exit status.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A healthy but stale file is a monitoring failure. So is a fresh file that omits required checks. And a failed producer should not replace yesterday&amp;rsquo;s useful report with an empty one.&lt;/p&gt;
&lt;p&gt;A simple freshness probe might look like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; pathlib &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; Path
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; time
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;report &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Path(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;last-report.json&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;max_age &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;20&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;60&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;age &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; time&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;time() &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; report&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;stat()&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;st_mtime
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; age &lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; max_age:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;raise&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;SystemExit&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;f&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;report is stale: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&lt;/span&gt;age&lt;span style=&#34;color:#e6db74&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.0f&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;s&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The threshold must match the real schedule and allow a sensible grace period. A five-minute freshness threshold for an hourly job creates noise, while a ten-day threshold for a daily job hides failures.&lt;/p&gt;
&lt;h2 id=&#34;do-not-destroy-the-evidence-on-failure&#34;&gt;Do not destroy the evidence on failure&lt;/h2&gt;
&lt;p&gt;When generation fails, I keep both kinds of evidence:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the previous valid report remains at the stable path;&lt;/li&gt;
&lt;li&gt;a small failure record captures when the attempt failed and the command&amp;rsquo;s exit status.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I do not copy raw command output into alerts by default. Health commands can accidentally expose paths, hostnames or credentials. A concise allowlisted summary is safer, with detailed logs retained privately and with bounded size.&lt;/p&gt;
&lt;p&gt;The wrapper can also record the failure atomically:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; ! health-report &amp;gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$tmp&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    printf &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;{&amp;#34;failed_at&amp;#34;:&amp;#34;%s&amp;#34;,&amp;#34;exit&amp;#34;:1}\n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;date --iso-8601&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;seconds&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        &amp;gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$state_dir&lt;span style=&#34;color:#e6db74&#34;&gt;/.last-failure.tmp&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    mv -f &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$state_dir&lt;span style=&#34;color:#e6db74&#34;&gt;/.last-failure.tmp&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$state_dir&lt;span style=&#34;color:#e6db74&#34;&gt;/last-failure.json&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    exit &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In production I pass through the real exit status and validate this JSON too. The shortened example shows the separation: failed attempt metadata does not overwrite the last known-good health report.&lt;/p&gt;
&lt;h2 id=&#34;test-the-failure-path-deliberately&#34;&gt;Test the failure path deliberately&lt;/h2&gt;
&lt;p&gt;A success-only test misses the problem this design is meant to solve. I test at least four cases in a scratch directory:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;the producer writes valid JSON and the final file changes;&lt;/li&gt;
&lt;li&gt;the producer exits non-zero and the prior report remains byte-for-byte identical;&lt;/li&gt;
&lt;li&gt;the producer writes empty output and validation rejects it;&lt;/li&gt;
&lt;li&gt;the producer writes malformed JSON and validation rejects it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I also run a reader repeatedly while replacing the file, checking that it only ever parses the old or new complete document.&lt;/p&gt;
&lt;p&gt;Finally, I let the real scheduler run once and confirm the final file&amp;rsquo;s timestamp and content changed. A manual run proves the script; a scheduled run proves the installed path, environment and permissions.&lt;/p&gt;
&lt;h2 id=&#34;the-rule-i-now-use&#34;&gt;The rule I now use&lt;/h2&gt;
&lt;p&gt;Anything consumed under a stable filename is published data. Generate it privately, validate it, then replace it atomically.&lt;/p&gt;
&lt;p&gt;That rule applies to health reports, backup manifests, checksums, generated configuration, feed caches and dashboard data. The implementation is small, but it changes a monitoring system from “the command probably ran” into an interface that fails without destroying its last useful answer.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>My Post-Backup Verification Checklist</title>
      <link>https://samirtech.org/posts/post-backup-verification-checklist/</link>
      <pubDate>Thu, 24 Sep 2026 00:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/post-backup-verification-checklist/</guid>
      <description>A green backup job is useful evidence, but it is not the finish line. It may prove that a command exited successfully while leaving important questions unanswered: Was a new snapshot created? Did it contain the intended paths? Can the repository be read? Did monitoring record the result? Can a file actually be restored?
I use a short post-backup checklist to turn “the job ran” into evidence that the recovery path still works.</description>
      <content>&lt;p&gt;A green backup job is useful evidence, but it is not the finish line. It may prove that a command exited successfully while leaving important questions unanswered: Was a new snapshot created? Did it contain the intended paths? Can the repository be read? Did monitoring record the result? Can a file actually be restored?&lt;/p&gt;
&lt;p&gt;I use a short post-backup checklist to turn “the job ran” into evidence that the recovery path still works.&lt;/p&gt;
&lt;h2 id=&#34;1-read-the-jobs-own-result&#34;&gt;1. Read the job&amp;rsquo;s own result&lt;/h2&gt;
&lt;p&gt;Start with the complete job output, not only the scheduler&amp;rsquo;s exit code. I want to see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how many files and directories were processed;&lt;/li&gt;
&lt;li&gt;how much data was added;&lt;/li&gt;
&lt;li&gt;whether any source paths were skipped;&lt;/li&gt;
&lt;li&gt;warnings about unreadable files;&lt;/li&gt;
&lt;li&gt;the final snapshot identifier;&lt;/li&gt;
&lt;li&gt;the command&amp;rsquo;s exit status.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An archive warning about a credential file or database is not harmless just because most other files were copied. If the missing file is required to restore the application, the backup is incomplete.&lt;/p&gt;
&lt;p&gt;I keep logs bounded, but not so aggressively that the final summary or first useful error disappears.&lt;/p&gt;
&lt;h2 id=&#34;2-query-the-repository-independently&#34;&gt;2. Query the repository independently&lt;/h2&gt;
&lt;p&gt;Next I ask the repository what it contains. This is separate from trusting the output that claimed a snapshot was saved.&lt;/p&gt;
&lt;p&gt;With Restic, that can be as simple as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic snapshots --latest &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For repositories with several tags or source hosts, I filter by the exact stream I am checking:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic snapshots --tag selected-data --latest &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The newest snapshot should have the expected time, host label, paths and tags. A fresh snapshot for one tag does not prove that another tag is fresh. I track each backup stream separately because they often have different schedules and different failure modes.&lt;/p&gt;
&lt;h2 id=&#34;3-run-an-integrity-check&#34;&gt;3. Run an integrity check&lt;/h2&gt;
&lt;p&gt;A snapshot listing proves that metadata can be read. It does not prove that the repository&amp;rsquo;s packs and trees are internally consistent.&lt;/p&gt;
&lt;p&gt;My routine check is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic check
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This validates the repository structure. Depending on repository size and available bandwidth, deeper data reads may belong on a less frequent schedule. The point is to choose the level deliberately rather than assuming that a successful upload validated everything.&lt;/p&gt;
&lt;p&gt;Warnings need classification. For example, duplicate data left for a later prune is different from a damaged pack. I record the distinction instead of flattening every warning into either “fine” or “failed.”&lt;/p&gt;
&lt;h2 id=&#34;4-confirm-the-status-record-changed&#34;&gt;4. Confirm the status record changed&lt;/h2&gt;
&lt;p&gt;My scheduled jobs write a machine-readable status record for monitoring. After a backup, I check that the record is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;present;&lt;/li&gt;
&lt;li&gt;valid JSON;&lt;/li&gt;
&lt;li&gt;non-empty;&lt;/li&gt;
&lt;li&gt;newer than the run;&lt;/li&gt;
&lt;li&gt;associated with the correct backup tag;&lt;/li&gt;
&lt;li&gt;marked with the actual success or failure state.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A notification saying “success” is secondary evidence. The durable status record is what later freshness checks should evaluate.&lt;/p&gt;
&lt;p&gt;When several backup types share one status file, I read the per-tag timestamp. A daily transfer cannot make a weekly source snapshot newer, and one successful tag must not hide another stale one.&lt;/p&gt;
&lt;h2 id=&#34;5-verify-the-notification-path&#34;&gt;5. Verify the notification path&lt;/h2&gt;
&lt;p&gt;If the job is meant to report through Telegram, email or another service, I verify that the recipient accepted a message and that the summary identifies the correct job.&lt;/p&gt;
&lt;p&gt;This proves delivery for that run. It does not prove that a future missing job will be detected. Silence detection is a separate test: temporarily stop only the heartbeat or schedule, wait for the configured grace period, confirm the DOWN alert, restore the job, and confirm recovery.&lt;/p&gt;
&lt;p&gt;That distinction matters. “The success message arrived” and “I will be warned if the job never starts” are different guarantees.&lt;/p&gt;
&lt;h2 id=&#34;6-restore-something-representative&#34;&gt;6. Restore something representative&lt;/h2&gt;
&lt;p&gt;A repository check is not a restore test. Periodically I restore a small representative sample into a new private directory rather than over live data.&lt;/p&gt;
&lt;p&gt;For ordinary files, I verify more than the filename:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sha256sum original/example.jpg restored/example.jpg
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For a picture, I also make sure it decodes. For application configuration, I inspect the restored tree and validate structured files, such as a Compose file, with the appropriate parser.&lt;/p&gt;
&lt;p&gt;Those checks prove file recovery. They do not prove that a database can start or that a complete application has been recovered. I describe the evidence at the level actually tested.&lt;/p&gt;
&lt;h2 id=&#34;7-clean-up-temporary-machinery&#34;&gt;7. Clean up temporary machinery&lt;/h2&gt;
&lt;p&gt;One-off recovery and migration work often leaves behind temporary timers, lock files, scratch restores or compatibility aliases. Once verification is complete, I remove only the temporary pieces and leave the durable schedule intact.&lt;/p&gt;
&lt;p&gt;Then I read back the final scheduler configuration. Cleanup is part of the operation; forgotten temporary jobs can produce duplicate backups, lock contention or confusing notifications later.&lt;/p&gt;
&lt;h2 id=&#34;the-checklist-i-keep-beside-the-job&#34;&gt;The checklist I keep beside the job&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; The backup command completed without relevant skipped files.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; A new snapshot exists for the correct tag and source.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; The snapshot contains the expected paths.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; The repository integrity check passed or its warning was classified.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; The per-job status record is valid and fresh.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; The expected notification was delivered.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; A representative restore has succeeded on the agreed schedule.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; Temporary jobs and scratch data have been removed.&lt;/li&gt;
&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; The final schedule has been read back.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The value of this list is not complexity. It is that each line answers a different failure mode. A backup command protects data only when the repository, monitoring and recovery path agree that it worked.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Practical Docker Hardening for a Homelab That Is Already Running</title>
      <link>https://samirtech.org/posts/practical-docker-hardening-for-a-running-homelab/</link>
      <pubDate>Thu, 24 Sep 2026 00:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/practical-docker-hardening-for-a-running-homelab/</guid>
      <description>Most Docker hardening guides begin with an empty server. Mine was already running useful services, which changes the problem.
On a live homelab, the goal is not to apply every possible security control in one maintenance window. It is to reduce known failure modes without breaking dependencies, losing application state or turning a working server into an experiment.
My approach is incremental: inventory first, make one bounded class of change, recreate only affected services, and verify application behaviour rather than stopping at docker ps.</description>
      <content>&lt;p&gt;Most Docker hardening guides begin with an empty server. Mine was already running useful services, which changes the problem.&lt;/p&gt;
&lt;p&gt;On a live homelab, the goal is not to apply every possible security control in one maintenance window. It is to reduce known failure modes without breaking dependencies, losing application state or turning a working server into an experiment.&lt;/p&gt;
&lt;p&gt;My approach is incremental: inventory first, make one bounded class of change, recreate only affected services, and verify application behaviour rather than stopping at &lt;code&gt;docker ps&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;start-with-declared-and-effective-state&#34;&gt;Start with declared and effective state&lt;/h2&gt;
&lt;p&gt;Compose files show intent. Docker&amp;rsquo;s live state shows what actually happened. I inspect both without dumping resolved environment variables or secret-bearing configuration.&lt;/p&gt;
&lt;p&gt;For each container I care about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;image and Compose project;&lt;/li&gt;
&lt;li&gt;state, health, restart count and OOM status;&lt;/li&gt;
&lt;li&gt;restart policy;&lt;/li&gt;
&lt;li&gt;logging driver and limits;&lt;/li&gt;
&lt;li&gt;CPU and memory limits, if any;&lt;/li&gt;
&lt;li&gt;published ports and network mode;&lt;/li&gt;
&lt;li&gt;mounts and whether their sources exist;&lt;/li&gt;
&lt;li&gt;privileged mode, capabilities and devices;&lt;/li&gt;
&lt;li&gt;health-check definition;&lt;/li&gt;
&lt;li&gt;the authoritative Compose file path.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A running container is not the same as a working application. I also probe the service&amp;rsquo;s real local endpoint and its important dependencies.&lt;/p&gt;
&lt;h2 id=&#34;bound-logs-before-they-become-a-disk-incident&#34;&gt;Bound logs before they become a disk incident&lt;/h2&gt;
&lt;p&gt;Unbounded JSON logs can consume the host filesystem quietly. Compose makes the limit explicit:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;example&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;image&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;example/image:1.2.3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;logging&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;driver&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;json-file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      &lt;span style=&#34;color:#f92672&#34;&gt;options&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;max-size&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;10m&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;max-file&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;3&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is not a substitute for centralized logs where I need history. It is a safety boundary on the local copy.&lt;/p&gt;
&lt;p&gt;Changing the Compose file does not alter an existing container. I validate the file, recreate only the affected service, then inspect the live logging configuration. I avoid broad &lt;code&gt;docker compose up -d&lt;/code&gt; commands across unrelated projects.&lt;/p&gt;
&lt;h2 id=&#34;choose-restart-policies-by-role&#34;&gt;Choose restart policies by role&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;restart: unless-stopped&lt;/code&gt; is a sensible default for long-running services that should return after a crash or host reboot:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;restart&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;unless-stopped&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is not correct for everything. One-shot jobs should finish and stay finished. Maintenance containers may need an external scheduler. A crash-looping service should not be treated as healthy merely because Docker keeps restarting it.&lt;/p&gt;
&lt;p&gt;After changing a restart policy, I read the effective policy from Docker and make sure an intentionally stopped service remains intentional.&lt;/p&gt;
&lt;h2 id=&#34;add-health-checks-that-prove-something&#34;&gt;Add health checks that prove something&lt;/h2&gt;
&lt;p&gt;A process-level check often proves only that a binary exists. A useful health check exercises the narrowest endpoint that represents readiness.&lt;/p&gt;
&lt;p&gt;For an HTTP application:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;healthcheck&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;test&lt;/span&gt;: [&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;CMD&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;wget&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;-q&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;--spider&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;http://127.0.0.1:8080/health&amp;#34;&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;interval&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;30s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;timeout&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;retries&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;start_period&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;30s&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The exact path matters. Some services correctly return &lt;code&gt;404&lt;/code&gt; at &lt;code&gt;/&lt;/code&gt; while exposing dedicated health and readiness endpoints elsewhere.&lt;/p&gt;
&lt;p&gt;Health checks also have limits. A web interface returning &lt;code&gt;200&lt;/code&gt; may still have a broken database, inaccessible storage or a failed background scheduler. I use dependency-aware checks where the application provides them, and keep external monitoring for user-visible availability.&lt;/p&gt;
&lt;h2 id=&#34;be-cautious-with-memory-limits&#34;&gt;Be cautious with memory limits&lt;/h2&gt;
&lt;p&gt;Tight memory limits look like hardening but can create outages when chosen from a single quiet-period measurement. Databases, media processing and indexing workloads are bursty.&lt;/p&gt;
&lt;p&gt;I first collect normal and peak behaviour, check prior OOM events, and classify the service. Then I add a limit only when I understand the consequence of hitting it. A monitoring alert on unusual growth is often a safer first step than an arbitrary cap.&lt;/p&gt;
&lt;p&gt;The goal is to prevent one service from consuming the host, not to make every graph look tidy.&lt;/p&gt;
&lt;h2 id=&#34;reduce-exposure-without-breaking-access&#34;&gt;Reduce exposure without breaking access&lt;/h2&gt;
&lt;p&gt;For every published port I ask who actually needs it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the local machine only;&lt;/li&gt;
&lt;li&gt;the LAN;&lt;/li&gt;
&lt;li&gt;a private overlay network;&lt;/li&gt;
&lt;li&gt;a reverse proxy;&lt;/li&gt;
&lt;li&gt;the public internet;&lt;/li&gt;
&lt;li&gt;nobody, because only another Compose service uses it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An internal dependency normally needs a Docker network, not a host port. A management interface may be bound to a specific private address rather than every interface.&lt;/p&gt;
&lt;p&gt;I inventory all real access paths before tightening bindings. Media discovery, guest-network routing, reverse proxies and overlay access can depend on different interfaces. A successful request from the Docker host does not prove that the intended client can connect.&lt;/p&gt;
&lt;p&gt;I also treat a read-write Docker socket mount as host-equivalent privilege. Services that only need selected Docker metadata should use a constrained socket proxy where practical.&lt;/p&gt;
&lt;p&gt;Docker-published ports need an extra check. Docker installs its own NAT and firewall rules, so published traffic can bypass the path I expected from ordinary UFW or firewalld policy, depending on the host&amp;rsquo;s firewall backend. I do not assume a host rule has restricted a published port: I inspect the effective Docker rules and test the port from another machine on each relevant network. Where possible, I bind to a specific trusted address, use an internal Docker network or publish no host port at all.&lt;/p&gt;
&lt;h2 id=&#34;remove-container-privileges-where-the-image-permits-it&#34;&gt;Remove container privileges where the image permits it&lt;/h2&gt;
&lt;p&gt;These controls are useful, but they are application-specific rather than safe bulk edits:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;app&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;user&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;1000:1000&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;cap_drop&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      - &lt;span style=&#34;color:#ae81ff&#34;&gt;ALL&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;security_opt&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      - &lt;span style=&#34;color:#66d9ef&#34;&gt;no&lt;/span&gt;-&lt;span style=&#34;color:#ae81ff&#34;&gt;new-privileges:true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;read_only&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;tmpfs&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      - &lt;span style=&#34;color:#ae81ff&#34;&gt;/tmp&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Run as a non-root numeric UID/GID when the image supports it, with only the required mounts writable.&lt;/li&gt;
&lt;li&gt;Drop all Linux capabilities, then add back only a capability the application demonstrably requires.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;no-new-privileges&lt;/code&gt; prevents a process gaining extra privilege through setuid or setgid binaries.&lt;/li&gt;
&lt;li&gt;A read-only root filesystem limits persistence, but the application may need explicit volumes or &lt;code&gt;tmpfs&lt;/code&gt; mounts for caches, PID files and temporary data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I apply one control at a time, recreate the container, inspect its logs and exercise the real application. Some vendor images start as root so an entrypoint can adjust permissions before dropping privilege; forcing &lt;code&gt;user:&lt;/code&gt; without checking that design can break initialisation or upgrades. I avoid &lt;code&gt;privileged: true&lt;/code&gt;, host PID or network namespaces and broad device mounts unless a documented requirement justifies them.&lt;/p&gt;
&lt;h2 id=&#34;protect-state-before-recreating-containers&#34;&gt;Protect state before recreating containers&lt;/h2&gt;
&lt;p&gt;Before changing a stateful service I identify:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;bind mounts and named volumes;&lt;/li&gt;
&lt;li&gt;its database type;&lt;/li&gt;
&lt;li&gt;whether a live filesystem copy is consistent;&lt;/li&gt;
&lt;li&gt;the existing backup and restore method;&lt;/li&gt;
&lt;li&gt;any dependency order needed during shutdown and startup.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A folder full of copied database files is not automatically a usable database backup. Native dumps or an application-consistent quiesced copy are safer, and the restore procedure should be tested away from live data.&lt;/p&gt;
&lt;p&gt;I make a narrow backup before the change, validate the Compose file, and keep the previous configuration available for rollback.&lt;/p&gt;
&lt;h2 id=&#34;recreate-narrowly-then-verify-broadly&#34;&gt;Recreate narrowly, then verify broadly&lt;/h2&gt;
&lt;p&gt;My change loop is deliberately repetitive:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Back up the affected configuration and state.&lt;/li&gt;
&lt;li&gt;Edit the authoritative Compose file.&lt;/li&gt;
&lt;li&gt;Parse and validate it without printing secrets.&lt;/li&gt;
&lt;li&gt;Recreate only the affected service and necessary dependencies.&lt;/li&gt;
&lt;li&gt;Wait for any startup period.&lt;/li&gt;
&lt;li&gt;Check container state, health, restarts and OOM status.&lt;/li&gt;
&lt;li&gt;Exercise the actual application endpoint.&lt;/li&gt;
&lt;li&gt;Test its critical dependency or scheduled function.&lt;/li&gt;
&lt;li&gt;Inspect fresh bounded logs for new errors.&lt;/li&gt;
&lt;li&gt;Read back the effective Docker policy.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A bind-mounted configuration deserves special attention. Some editors replace a file atomically, leaving a running container attached to the old inode. If the host and in-container files differ, a reload may say “unchanged” because the container cannot see the replacement. After validating the new file, I recreate only that service so the mount binds to the current inode.&lt;/p&gt;
&lt;h2 id=&#34;the-order-that-gave-me-the-most-value&#34;&gt;The order that gave me the most value&lt;/h2&gt;
&lt;p&gt;For an existing host, I prioritize changes like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Repair confirmed broken dependencies and scheduled jobs.&lt;/li&gt;
&lt;li&gt;Verify backups and a representative restore.&lt;/li&gt;
&lt;li&gt;Bound local logs.&lt;/li&gt;
&lt;li&gt;Fix unsuitable restart policies.&lt;/li&gt;
&lt;li&gt;Add meaningful health checks.&lt;/li&gt;
&lt;li&gt;Reduce unnecessary port and Docker-socket exposure.&lt;/li&gt;
&lt;li&gt;Add resource limits only from measured evidence.&lt;/li&gt;
&lt;li&gt;Move floating image updates toward a deliberate review process.&lt;/li&gt;
&lt;li&gt;Prune only objects proven unused.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is slower than rewriting the stack around an ideal template. It is also safer. Hardening a live homelab is operations work: preserve what already works, make the smallest justified change, and prove that the application—not merely the container—still does its job.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>The Backup Layers, Explained by What Each One Survives</title>
      <link>https://samirtech.org/posts/the-backup-layers-explained-by-what-each-one-survives/</link>
      <pubDate>Tue, 22 Sep 2026 00:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/the-backup-layers-explained-by-what-each-one-survives/</guid>
      <description>A backup design fails when you cannot say, for any given piece of data, which copy protects it, how old that copy is, what unlocks it, and what has been recovered from it. This is my attempt to write all four answers down in one place.
The point of listing layers is not to collect destinations. It is to stop pretending that several vague &amp;ldquo;backups&amp;rdquo; add up to safety when they might all protect different things, or the same thing at different ages, or nothing that has ever been tested.</description>
      <content>&lt;p&gt;A backup design fails when you cannot say, for any given piece of data, &lt;em&gt;which copy protects it, how old that copy is, what unlocks it, and what has been recovered from it&lt;/em&gt;. This is my attempt to write all four answers down in one place.&lt;/p&gt;
&lt;p&gt;The point of listing layers is not to collect destinations. It is to stop pretending that several vague &amp;ldquo;backups&amp;rdquo; add up to safety when they might all protect different things, or the same thing at different ages, or nothing that has ever been tested.&lt;/p&gt;
&lt;h2 id=&#34;the-layers&#34;&gt;The layers&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;What it protects&lt;/th&gt;
&lt;th&gt;Freshness&lt;/th&gt;
&lt;th&gt;Survives&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Immich live data&lt;/td&gt;
&lt;td&gt;Original media + PostgreSQL database&lt;/td&gt;
&lt;td&gt;Real time&lt;/td&gt;
&lt;td&gt;Nothing — it is the thing being protected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TrueNAS snapshots&lt;/td&gt;
&lt;td&gt;Short-term rollback of the photo library&lt;/td&gt;
&lt;td&gt;Hourly, retained two weeks&lt;/td&gt;
&lt;td&gt;Accidental deletion or bad edit on the same storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TrueNAS cloud-sync&lt;/td&gt;
&lt;td&gt;Encrypted copy of Immich data to B2&lt;/td&gt;
&lt;td&gt;Daily, with a source snapshot&lt;/td&gt;
&lt;td&gt;Loss of the whole NAS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server configuration backup&lt;/td&gt;
&lt;td&gt;Docker host config and selected app data to a Restic repository&lt;/td&gt;
&lt;td&gt;Weekly (Sunday 04:15)&lt;/td&gt;
&lt;td&gt;Broken host or container config, not the media itself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Off-site Pi backup&lt;/td&gt;
&lt;td&gt;Selected irreplaceable files to an encrypted Restic repo&lt;/td&gt;
&lt;td&gt;Daily (06:15); a successful scheduled post-relocation run was documented on 12 October 2026&lt;/td&gt;
&lt;td&gt;Loss of the house; the Pi is now physically at a separate location&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Second NAS (Borgcube)&lt;/td&gt;
&lt;td&gt;Local recovery destination&lt;/td&gt;
&lt;td&gt;Powered off when idle&lt;/td&gt;
&lt;td&gt;Fast local recovery, not a scheduled guarantee&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two caveats keep this list honest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The second NAS&lt;/strong&gt; is a recovery destination I have used during restores, but it is normally powered off or suspended. Local replication &lt;em&gt;should&lt;/em&gt; be part of the design, but I do not describe it as a current scheduled guarantee without checking its enabled tasks, scope and latest successful run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Pi is physically off-site and remotely reachable.&lt;/strong&gt; Scheduled backups have succeeded after relocation; the latest documented run on 12 October 2026 reported 46 snapshots, and a repository integrity check completed without errors. A picture and Docker-project files had previously been restored and verified locally from the Pi. Those are distinct checks: location, connectivity, a scheduled backup, repository integrity and a sample file restore do not amount to a full replacement-host or application-and-database recovery.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;what-each-layer-is-not&#34;&gt;What each layer is &lt;em&gt;not&lt;/em&gt;&lt;/h2&gt;
&lt;p&gt;Freshness is not the same as independence. Copying a weekly snapshot daily does not create daily recovery points — it moves an already-old snapshot more often. Each Pi snapshot group has its own schedule and source freshness, so a fresh run for one group says nothing about another.&lt;/p&gt;
&lt;p&gt;Encryption is not immutability. An encrypted repository still allows an authorized client to delete or damage it. Encryption protects a copy from being read, not from being destroyed.&lt;/p&gt;
&lt;p&gt;A passing repository integrity check is useful evidence about the repository structure, but it is not a full restore test. A successful scheduled run proves the job completed; a sample file restore proves only the selected files could be recovered; neither proves that database dumps are consistent or that a replacement host can run every application.&lt;/p&gt;
&lt;h2 id=&#34;how-to-read-this-correctly&#34;&gt;How to read this correctly&lt;/h2&gt;
&lt;p&gt;The one sentence that matters: &lt;strong&gt;which copy protects which data, how old it is, what key opens it, and whether a restore from it has actually succeeded.&lt;/strong&gt; Any backup story that cannot answer all four is a hope, not a plan.&lt;/p&gt;
&lt;p&gt;The layers above are my current honest answer, with their limits kept explicit rather than smoothed over. That is the whole discipline: keep the gaps visible, so the next recovery test targets them instead of assuming they are already handled.&lt;/p&gt;
&lt;p&gt;For the practical checks and recovery sequence, see &lt;a href=&#34;https://samirtech.org/posts/post-backup-verification-checklist/&#34;&gt;My Post-Backup Verification Checklist&lt;/a&gt;, &lt;a href=&#34;https://samirtech.org/posts/restoring-an-application-from-backup/&#34;&gt;Restoring an Application from Backup&lt;/a&gt; and &lt;a href=&#34;https://samirtech.org/posts/using-a-second-nas-and-an-off-site-raspberry-pi/&#34;&gt;Using a Second NAS and an Off-Site Raspberry Pi&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Restoring an Application from Backup</title>
      <link>https://samirtech.org/posts/restoring-an-application-from-backup/</link>
      <pubDate>Thu, 17 Sep 2026 09:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/restoring-an-application-from-backup/</guid>
      <description>Getting files back is not the same as getting an application back. A database might be readable as a file while the application cannot open it. A container might start successfully while its users and library records are missing.
On 9 September 2026, I went beyond restoring files: I started an isolated Navidrome instance using a recovered copy of its SQLite database. This article records that rehearsal, checked against its saved execution output on 17 September.</description>
      <content>&lt;p&gt;Getting files back is not the same as getting an application back. A database might be readable as a file while the application cannot open it. A container might start successfully while its users and library records are missing.&lt;/p&gt;
&lt;p&gt;On &lt;strong&gt;9 September 2026&lt;/strong&gt;, I went beyond restoring files: I started an isolated &lt;a href=&#34;https://www.navidrome.org/&#34;&gt;Navidrome&lt;/a&gt; instance using a recovered copy of its SQLite database. This article records that rehearsal, checked against its saved execution output on 17 September. It is not a new test performed today.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The result was a successful application/database recovery rehearsal within a deliberately narrow scope.&lt;/strong&gt; The replacement served its HTML interface, and the selected database record counts were unchanged after shutdown. Login and playback remain the next test.&lt;/p&gt;
&lt;h2 id=&#34;what-i-was-trying-to-prove&#34;&gt;What I was trying to prove&lt;/h2&gt;
&lt;p&gt;My &lt;a href=&#34;https://samirtech.org/posts/testing-a-restore-before-disaster-strikes/&#34;&gt;earlier restore article&lt;/a&gt; explains why I test backups. Here the narrower question was: &lt;strong&gt;can the application start against its backed-up database without disturbing the live service?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The source was a 6 September Restic configuration/application-data snapshot. The recorded restore recovered 8.065 GiB into a separate directory and verified 37,003 files. The next stage was to see whether Navidrome could actually use its recovered database.&lt;/p&gt;
&lt;p&gt;From that restored tree, the rehearsal copied Navidrome&amp;rsquo;s database and any accompanying SQLite journal files into a second, disposable working directory. It did not point the replacement at the live database.&lt;/p&gt;
&lt;p&gt;SQLite is an embedded database, so there was no separate database-server container or SQL dump import. PostgreSQL applications, including Immich, need a different recovery procedure.&lt;/p&gt;
&lt;h2 id=&#34;isolation-came-before-startup&#34;&gt;Isolation came before startup&lt;/h2&gt;
&lt;p&gt;Starting the original Compose project unchanged would have been the wrong shortcut. Its ports, names, mounts and external integrations could collide with production.&lt;/p&gt;
&lt;p&gt;The replacement instead used:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A separate container name and a scratch database directory.&lt;/li&gt;
&lt;li&gt;The exact locally available image used by the live instance, with image pulling disabled.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No external networking and no published ports.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;An empty, read-only music directory—not the live music library.&lt;/li&gt;
&lt;li&gt;A read-only container root filesystem, with a small writable temporary filesystem.&lt;/li&gt;
&lt;li&gt;No restart policy, dropped Linux capabilities and a no-new-privileges setting.&lt;/li&gt;
&lt;li&gt;Memory and CPU limits.&lt;/li&gt;
&lt;li&gt;Settings requesting disabled scanning, external services, plugins and playlist auto-import.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An empty music directory is useful for isolation but potentially dangerous to a library database if a scanner runs against it. That is why this was a disposable copy, not a substitute production service.&lt;/p&gt;
&lt;p&gt;The saved report did &lt;strong&gt;not&lt;/strong&gt; contain the expected scanner-disabled log message. The settings were supplied and the selected counts survived the short run, but the log did not independently confirm that safeguard.&lt;/p&gt;
&lt;h2 id=&#34;the-commands-with-private-details-removed&#34;&gt;The commands, with private details removed&lt;/h2&gt;
&lt;p&gt;These are generalized excerpts of the executed rehearsal, not a universal recovery script. The paths below are deliberately supplied through variables; they must refer to inspected scratch directories. No commands in this article were rerun for publication.&lt;/p&gt;
&lt;p&gt;The setup copied &lt;code&gt;navidrome.db&lt;/code&gt; and any existing &lt;code&gt;-wal&lt;/code&gt;, &lt;code&gt;-shm&lt;/code&gt; or &lt;code&gt;-journal&lt;/code&gt; companions from the restored backup tree. It counted records before startup, then launched the test container with this shape:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Required: IMAGE is the exact locally available image ID used in the test.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# DATA is the disposable recovered database directory.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# EMPTY_MUSIC is a separate empty directory, not your real music library.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;IMAGE:?Set the verified local image ID&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;DATA:?Set the absolute scratch database directory&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;EMPTY_MUSIC:?Set the absolute empty scratch music directory&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker run -d --name navidrome-recovery-test &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --pull&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;never --network none --restart no &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --user &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;id -u&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;id -g&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --read-only --tmpfs /tmp:rw,nosuid,nodev,size&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;64m &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --cap-drop ALL --security-opt no-new-privileges &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --memory 512m --cpus &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -v &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$DATA&lt;span style=&#34;color:#e6db74&#34;&gt;:/data&amp;#34;&lt;/span&gt; -v &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$EMPTY_MUSIC&lt;span style=&#34;color:#e6db74&#34;&gt;:/music:ro&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_SCANNER_ENABLED&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_SCANNER_SCANONSTARTUP&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_SCANNER_SCHEDULE&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_ENABLEEXTERNALSERVICES&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_PLUGINS_ENABLED&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_AUTOIMPORTPLAYLISTS&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;false &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -e ND_DATAFOLDER&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/data -e ND_MUSICFOLDER&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/music &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$IMAGE&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These settings describe the image tested at the time. Before repeating the procedure with a different release, check its supported configuration and database compatibility. Do not combine a recovery rehearsal with an unplanned version upgrade.&lt;/p&gt;
&lt;p&gt;Because no port was published, the HTTP check ran &lt;strong&gt;inside&lt;/strong&gt; the container:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker exec navidrome-recovery-test &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  wget -qO- http://127.0.0.1:4533/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The test retried during startup and required returned content containing an HTML marker. This confirmed that Navidrome reached its web interface; authenticated use and playback were outside the rehearsal.&lt;/p&gt;
&lt;p&gt;The test then stopped the replacement before recounting database records:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker stop --time &lt;span style=&#34;color:#ae81ff&#34;&gt;15&lt;/span&gt; navidrome-recovery-test
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For each selected table, the test ran a &lt;code&gt;SELECT count(*)&lt;/code&gt; query against the scratch database. For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;count&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;user&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;count&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;media_file&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;count&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;album&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;count&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;artist&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;count&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;) &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;playlist&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally it removed only the named replacement container. The scratch evidence remained separate from production. There was no promotion of recovered data into the live service.&lt;/p&gt;
&lt;h2 id=&#34;what-the-saved-result-actually-showed&#34;&gt;What the saved result actually showed&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Recorded result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Replacement HTTP check&lt;/td&gt;
&lt;td&gt;HTML returned successfully&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User records&lt;/td&gt;
&lt;td&gt;1 before and after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Media-file records&lt;/td&gt;
&lt;td&gt;1,331 before and after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Album records&lt;/td&gt;
&lt;td&gt;71 before and after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Artist records&lt;/td&gt;
&lt;td&gt;242 before and after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Playlist records&lt;/td&gt;
&lt;td&gt;9 before and after&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production music mounted in the replacement&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Published replacement ports&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Replacement network mode&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Live Navidrome start timestamp and restart count&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expected scanner-disabled log message detected&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The rehearsal command exited successfully. These are recorded results, not illustrative numbers.&lt;/p&gt;
&lt;p&gt;Matching counts checked for obvious loss or an unintended rescan. Unchanged production start and restart values also confirmed that the rehearsal had not restarted the live container.&lt;/p&gt;
&lt;h2 id=&#34;what-this-rehearsal-did-not-cover&#34;&gt;What this rehearsal did not cover&lt;/h2&gt;
&lt;p&gt;I did not verify:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Logging into the replacement with a recovered account.&lt;/li&gt;
&lt;li&gt;Browsing an authenticated library or opening individual playlists.&lt;/li&gt;
&lt;li&gt;Playing a recovered audio file, transcoding, or using a phone client.&lt;/li&gt;
&lt;li&gt;Restoring the music files as part of this application rehearsal.&lt;/li&gt;
&lt;li&gt;Recovery on a new host with no access to the original image cache.&lt;/li&gt;
&lt;li&gt;A production cutover, reverse proxy, DNS changes or remote-site access.&lt;/li&gt;
&lt;li&gt;Any PostgreSQL application or a whole-server rebuild.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The later Pi exercise was a separate file-level test: it recovered a picture and Glance project files, checked hashes and validated Compose syntax, but did not start a replacement application.&lt;/p&gt;
&lt;h2 id=&#34;a-manageable-next-rehearsal&#34;&gt;A manageable next rehearsal&lt;/h2&gt;
&lt;p&gt;The next useful step would be a separately approved test with a small recovered music sample, isolated credentials and a deliberately controlled access path. Success would mean logging in, inspecting known records and playing that sample, while confirming production remained untouched.&lt;/p&gt;
&lt;p&gt;Before doing that, I would document the exact backup, compatible image, ownership requirements, mount boundaries, network restrictions and cleanup steps. Private credentials and recovery locations belong in a protected runbook outside this website.&lt;/p&gt;
&lt;p&gt;For the backup layers themselves, see &lt;a href=&#34;https://samirtech.org/posts/how-my-restic-backup-protects-the-homelab/&#34;&gt;How My Restic Backup Protects the Homelab&lt;/a&gt;. The operational lesson here is smaller: &lt;strong&gt;restore into isolation, start the application against the recovered copy, and state precisely what the checks prove.&lt;/strong&gt; A limited test with honest boundaries is more useful than calling a successful file copy a complete recovery.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Is My Homelab Actually Working? Glance, Gatus, Grafana and Useful Alerts</title>
      <link>https://samirtech.org/posts/how-i-monitor-and-protect-my-homelab/</link>
      <pubDate>Wed, 16 Sep 2026 10:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/how-i-monitor-and-protect-my-homelab/</guid>
      <description>Installing an application is the easy part. Knowing whether it still works a week later is a different job.
Once I had several services running, opening each one to check it became tedious. A photo library might load its homepage but fail to access storage. A container might be running while its application is stuck. Several perfectly healthy apps might appear offline because the shared DNS server or reverse proxy has failed.</description>
      <content>&lt;p&gt;Installing an application is the easy part. Knowing whether it still works a week later is a different job.&lt;/p&gt;
&lt;p&gt;Once I had several services running, opening each one to check it became tedious. A photo library might load its homepage but fail to access storage. A container might be running while its application is stuck. Several perfectly healthy apps might appear offline because the shared DNS server or reverse proxy has failed.&lt;/p&gt;
&lt;p&gt;I wanted a simple way to answer three questions: &lt;strong&gt;what can I use, what has gone wrong, and does it need my attention now?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;My setup uses Glance, Gatus and Grafana for different parts of that job, with Gotify for local monitoring notifications and an external Healthchecks.io heartbeat that alerts me directly through Telegram. Security monitoring sits alongside availability monitoring, rather than being confused with it.&lt;/p&gt;
&lt;h2 id=&#34;the-short-version&#34;&gt;The short version&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What I use it for&lt;/th&gt;
&lt;th&gt;What it does not prove&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Glance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;My everyday starting page: app links and quick availability indicators&lt;/td&gt;
&lt;td&gt;That every feature behind a working page is healthy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gatus&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Repeated endpoint checks, response times and a record of availability&lt;/td&gt;
&lt;td&gt;That a successful HTTP request means a complete application workflow works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Grafana&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Looking at metrics and logs to understand a problem or a trend&lt;/td&gt;
&lt;td&gt;That a graph without errors guarantees a secure system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gotify&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Bringing selected notifications to my attention&lt;/td&gt;
&lt;td&gt;That every failure has an alert rule, or that a delivered message was read&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Healthchecks.io → Telegram&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Warning me when the server stops reporting to an independent service&lt;/td&gt;
&lt;td&gt;Which dependency failed, or whether individual applications still work&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The distinction matters. A dashboard is somewhere I look. A notification is something that comes to me. Neither is useful unless the underlying checks mean something.&lt;/p&gt;
&lt;h2 id=&#34;glance-the-page-i-open-first&#34;&gt;Glance: the page I open first&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/glanceapp/glance&#34;&gt;Glance&lt;/a&gt; is the front door to the lab. It gives me a manageable set of bookmarks and monitor widgets instead of a collection of addresses and ports to remember.&lt;/p&gt;
&lt;p&gt;My configuration groups checks by the services on the Docker host and the NAS web interfaces. That makes it easier to see whether one app needs attention or whether several services on the same machine have stopped responding.&lt;/p&gt;
&lt;p&gt;It is particularly useful from a phone: open one page, find the service, then follow its link. I do not need a full metrics dashboard just to open the music library.&lt;/p&gt;
&lt;p&gt;But I treat a green indicator as a narrow statement: &lt;strong&gt;the configured check succeeded&lt;/strong&gt;. It is not a promise that login, playback, uploads, background jobs and storage access all work. A bookmark alone is not a health check either.&lt;/p&gt;
&lt;h2 id=&#34;gatus-checking-rather-than-guessing&#34;&gt;Gatus: checking rather than guessing&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/TwiN/gatus&#34;&gt;Gatus&lt;/a&gt; performs recurring checks and keeps the results. This is where I look when I want more than a quick current-state indicator.&lt;/p&gt;
&lt;p&gt;The checks in my setup include application web endpoints, the HTTPS route to Grafana, and DNS checks for both local names and upstream resolution. They test expected response conditions and response-time limits.&lt;/p&gt;
&lt;p&gt;That helps separate failures which otherwise look identical in a browser:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One application fails:&lt;/strong&gt; start with that service and its dependencies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Several friendly URLs fail together:&lt;/strong&gt; investigate shared DNS and proxy dependencies before restarting every app.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A direct application route works but its friendly URL does not:&lt;/strong&gt; the access path may be broken even though the application is running.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A page responds but is consistently slow:&lt;/strong&gt; there may be a developing problem rather than a complete outage.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Where the check runs matters too. A server-side check cannot prove that a phone using different DNS settings, another network or a VPN will get the same result. When a device has a problem, I still test from that device.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;An important detail in my current setup:&lt;/strong&gt; Gatus is providing status checks, but its configuration does not currently define alert providers. A failed Gatus check therefore should not be described as automatically producing a Gotify notification. That is a separate integration to configure and test if I want it.&lt;/p&gt;
&lt;h2 id=&#34;grafana-understanding-why&#34;&gt;Grafana: understanding why&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://grafana.com/oss/grafana/&#34;&gt;Grafana&lt;/a&gt; is where I go for more detail. Glance is the starting page; Gatus records whether checks pass; Grafana helps me investigate what was happening around a failure.&lt;/p&gt;
&lt;p&gt;Behind Grafana, Prometheus collects metrics and Loki stores logs. Exporters and collectors make host, container and other infrastructure information available to those systems. Grafana displays the data; it does not create reliable measurements simply because a dashboard exists.&lt;/p&gt;
&lt;p&gt;My provisioned dashboards cover areas such as server health, the Docker fleet, storage, NAS applications, internet connection health and container logs.&lt;/p&gt;
&lt;p&gt;The useful questions are practical:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Was memory pressure building before the application stopped responding?&lt;/li&gt;
&lt;li&gt;Is the disk getting full, or is storage activity unusually high?&lt;/li&gt;
&lt;li&gt;Did the slowdown affect the whole host or just one container?&lt;/li&gt;
&lt;li&gt;Did errors appear around the time of an update?&lt;/li&gt;
&lt;li&gt;Is an internet problem affecting several otherwise unrelated services?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A graph can show a trend that a green status dot misses. A service can still respond while its remaining disk space is steadily disappearing.&lt;/p&gt;
&lt;p&gt;I also need to distinguish &lt;strong&gt;no data&lt;/strong&gt; from &lt;strong&gt;everything is fine&lt;/strong&gt;. If an exporter stops reporting, or a dashboard query no longer matches the available metrics, an empty panel is not evidence of good health. Check the data source and timestamps before trusting the picture.&lt;/p&gt;
&lt;h2 id=&#34;notifications-useful-enough-that-i-keep-reading-them&#34;&gt;Notifications: useful enough that I keep reading them&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://gotify.net/&#34;&gt;Gotify&lt;/a&gt; is the notification hub in this setup. It gives separate monitoring jobs somewhere to send a short, actionable message rather than requiring me to watch dashboards all day.&lt;/p&gt;
&lt;p&gt;The surrounding setup includes container-health notifications, image-update monitoring and a dedicated security-notification collector. These are separate paths; their coverage is not identical to the list of checks shown in Gatus.&lt;/p&gt;
&lt;p&gt;An image-update notice means a new image is available for review. It does not mean the running version is compromised, and it is not permission to update every stateful service automatically. I want to know what changed, check any migration requirements, and have a recovery path first.&lt;/p&gt;
&lt;p&gt;For security notifications, the design is deliberately low-noise: grouped CrowdSec decisions, repeated SSH failures rather than every individual failed attempt, and selected higher-severity Falco events. Filtering is a trade-off, not complete coverage. Lower-severity events may still deserve investigation even when they do not generate an immediate notification.&lt;/p&gt;
&lt;p&gt;A useful alert should tell me:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Which service or security component needs attention.&lt;/li&gt;
&lt;li&gt;What was observed, without overstating what it proves.&lt;/li&gt;
&lt;li&gt;When it happened and where I can investigate.&lt;/li&gt;
&lt;li&gt;Whether the condition has recovered, when recovery reporting is supported.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Repeated copies of the same message do not make the system safer. Grouping, sensible thresholds and cooldowns help keep notifications readable. Failed delivery needs retry handling, and a labelled test message is how I check the delivery path—not an assumption that a configured URL must work.&lt;/p&gt;
&lt;h2 id=&#34;security-is-a-separate-layer&#34;&gt;Security is a separate layer&lt;/h2&gt;
&lt;p&gt;Availability monitoring asks, “Does this respond?” Security monitoring asks, “Is something happening that should not be?” A service can answer every health check while being misconfigured or compromised.&lt;/p&gt;
&lt;p&gt;My broader approach combines restricted access, SSH keys, protected credentials, deliberate updates and recoverable backups with monitoring. The local HTTPS arrangement is explained in &lt;a href=&#34;https://samirtech.org/posts/local-https-without-exposing-my-homelab/&#34;&gt;Local HTTPS Without Exposing My Homelab to the Internet&lt;/a&gt;. A certificate encrypts and authenticates a connection; it does not decide who is allowed to reach the service.&lt;/p&gt;
&lt;p&gt;Two security tools in the setup have distinct roles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://www.crowdsec.net/&#34;&gt;CrowdSec&lt;/a&gt;&lt;/strong&gt; analyses supported activity and can create decisions about suspicious sources. A decision is not proof that traffic was blocked: enforcement depends on a correctly configured and functioning remediation component, often called a bouncer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://falco.org/&#34;&gt;Falco&lt;/a&gt;&lt;/strong&gt; detects runtime behaviour against rules. An alert is a reason to investigate the event, application and timing—not automatic proof of malware, and not something to dismiss just because the container looks healthy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I do not want raw command arguments, tokens or sensitive log contents copied into phone notifications. The notification should identify the problem; detailed evidence can stay in the protected system where it belongs.&lt;/p&gt;
&lt;p&gt;Dashboards need protection too. They can reveal application names, infrastructure layout, activity and logs. A monitoring page is not harmless just because it does not contain an obvious “delete” button.&lt;/p&gt;
&lt;h2 id=&#34;what-i-do-when-something-looks-wrong&#34;&gt;What I do when something looks wrong&lt;/h2&gt;
&lt;p&gt;For a photo-library problem, my investigation would look like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Start in Glance.&lt;/strong&gt; Is it one service or a wider group? Follow the link and confirm what actually fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check Gatus.&lt;/strong&gt; Did the endpoint fail, become slow, or remain reachable? Is DNS affected too?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use Grafana.&lt;/strong&gt; Compare the relevant time window with resource metrics, storage signals and logs. Check that the data is fresh.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read related notifications.&lt;/strong&gt; Look for a matching health event, security event or recent maintenance notice. Timing is evidence to investigate, not proof of a cause.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make the smallest justified change.&lt;/strong&gt; Avoid restarting the entire stack when the evidence points to one dependency.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verify the actual user task.&lt;/strong&gt; Load a photo, play a file or complete the action that originally failed. A recovered status dot alone is not enough.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is an example troubleshooting method, not a claim that a particular outage occurred or that every application has a synthetic end-to-end test.&lt;/p&gt;
&lt;h2 id=&#34;the-monitoring-system-can-fail-as-well&#34;&gt;The monitoring system can fail as well&lt;/h2&gt;
&lt;p&gt;There is an obvious limitation to running much of this on the same always-on host: if that host goes down, its dashboards and notification jobs may go down with it.&lt;/p&gt;
&lt;p&gt;No message does not necessarily mean no problem. It can mean the collector stopped, the network failed, or Gotify became unreachable.&lt;/p&gt;
&lt;h3 id=&#34;what-i-added-an-external-heartbeat&#34;&gt;What I added: an external heartbeat&lt;/h3&gt;
&lt;p&gt;I have now added a heartbeat to the hosted &lt;a href=&#34;https://healthchecks.io/&#34;&gt;Healthchecks.io&lt;/a&gt; service. A scheduled job on the always-on server sends an outbound HTTPS request every five minutes. If those requests stop arriving, Healthchecks can alert me directly through Telegram, without relying on the server or its Gotify instance to send the message.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Home server → outbound heartbeat → Healthchecks.io
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                                       │
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                              Missing or failed heartbeat
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                                       │
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                                       v
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                                    Telegram
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is sometimes called a &lt;em&gt;dead man’s switch&lt;/em&gt;: instead of trusting silence, an independent system expects regular evidence that the job is still running. It requires no new inbound port, public dashboard or second local monitoring stack.&lt;/p&gt;
&lt;p&gt;The installation preserved the existing scheduled jobs. The ping URL is kept in an owner-only configuration file outside the website repository, with bounded connection and request timeouts and retries. A private success timestamp is updated only after an accepted ping. The URL is a secret: anyone who knows it could send false heartbeats, so it does not belong in an article, screenshot or public configuration example.&lt;/p&gt;
&lt;h3 id=&#34;timing-and-what-it-actually-tells-me&#34;&gt;Timing and what it actually tells me&lt;/h3&gt;
&lt;p&gt;The server&amp;rsquo;s verified sending interval is &lt;strong&gt;five minutes&lt;/strong&gt;. The timing I settled on for the external check is a &lt;strong&gt;five-minute period with a thirty-minute grace window&lt;/strong&gt;. With those settings saved in Healthchecks, an alert is due about &lt;strong&gt;thirty-five minutes after the last successful ping&lt;/strong&gt;. The grace window avoids alerts for short interruptions, at the cost of slower warning.&lt;/p&gt;
&lt;p&gt;Those provider-side settings still need confirmation in the account dashboard; the ping URL can report success or failure but cannot read or change the check&amp;rsquo;s schedule. The server sending every five minutes does not, by itself, establish the alert deadline.&lt;/p&gt;
&lt;p&gt;A missing heartbeat can mean the server is down, its scheduler has failed, or the home internet or power connection is unavailable. It does not distinguish those causes. Telegram delivery also depends on Healthchecks, Telegram and my device having connectivity; during a home internet outage, a phone may need mobile data.&lt;/p&gt;
&lt;p&gt;This is a &lt;strong&gt;host-reporting check, not an application-health check&lt;/strong&gt;. It can keep succeeding while Docker or an individual app is broken. A separate heartbeat that reports success only after selected local health checks pass would be a useful next layer, but it has not been installed.&lt;/p&gt;
&lt;h3 id=&#34;the-test-i-actually-completed&#34;&gt;The test I actually completed&lt;/h3&gt;
&lt;p&gt;On 16 September 2026, the first ping was accepted and a subsequent scheduled run was independently observed. I then tested the notification path by sending an explicit failure signal to Healthchecks, followed by a successful recovery heartbeat. Healthchecks acknowledged the failure request, accepted the recovery, and I received both the &lt;strong&gt;DOWN&lt;/strong&gt; and &lt;strong&gt;UP&lt;/strong&gt; messages in Telegram.&lt;/p&gt;
&lt;p&gt;No server or application was stopped, and the normal five-minute schedule remained in place. This confirms the explicit failure-and-recovery notification path. It does &lt;strong&gt;not&lt;/strong&gt; yet prove the missing-heartbeat timeout: that needs a separate controlled pause of only the heartbeat job, leaving the Healthchecks check enabled, followed by restoring the job and confirming recovery.&lt;/p&gt;
&lt;p&gt;The external heartbeat reduces the silent-host-failure gap; it does not make the local services redundant. The same applies to DNS: monitoring one resolver does not remove it as a single point of failure.&lt;/p&gt;
&lt;p&gt;Monitoring configuration, dashboard definitions and alert rules also belong in the backup plan. Recovery instructions should remain accessible without relying entirely on the system being recovered.&lt;/p&gt;
&lt;h2 id=&#34;what-was-checked-for-this-draft&#34;&gt;What was checked for this draft&lt;/h2&gt;
&lt;p&gt;A read-only check on 16 September 2026 found Glance, Gatus, Grafana, Prometheus, Loki and Gotify running. Gatus&amp;rsquo;s returned latest results were successful for its configured endpoints, and Grafana&amp;rsquo;s health endpoint reported its database as OK. The configured checks, Glance widgets and dashboard definitions were also inspected.&lt;/p&gt;
&lt;p&gt;CrowdSec and Falco reported active. The dedicated security collector&amp;rsquo;s timer was enabled, and its most recent recorded run had a successful exit status. Those are operational checks, not proof that every security event is collected or that every notification reaches a device.&lt;/p&gt;
&lt;p&gt;The later Healthchecks failure-and-recovery test confirmed Telegram delivery as described above. It did not test the Gotify or security-alert delivery paths. This drafting work did not trigger a security event, verify CrowdSec enforcement, test every Grafana panel or audit the complete network boundary. Privileged SSH-policy inspection was unavailable, so this is not a fresh certification of the host&amp;rsquo;s effective SSH settings. The article describes the setup and its limits, not a security guarantee.&lt;/p&gt;
&lt;h2 id=&#34;why-i-think-this-matters&#34;&gt;Why I think this matters&lt;/h2&gt;
&lt;p&gt;The point is not to build an enterprise monitoring department at home. It is to stop discovering problems only when someone wants to use an application.&lt;/p&gt;
&lt;p&gt;Good monitoring gives me an earlier warning, a clearer place to start and less temptation to change things blindly. Useful notifications let me step away without pretending that I am watching every graph. Security checks help flag behaviour that an uptime check cannot see.&lt;/p&gt;
&lt;p&gt;Backups complete the picture, but they answer a different question: &lt;strong&gt;can I recover?&lt;/strong&gt; A green dashboard cannot answer that. That takes &lt;a href=&#34;https://samirtech.org/posts/testing-a-restore-before-disaster-strikes/&#34;&gt;a restore test&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;My rule is simple: &lt;strong&gt;Glance to get there, Gatus to check availability, Grafana to investigate, and notifications for the things worth interrupting me about.&lt;/strong&gt; Keep the checks honest, understand the gaps, and test the user-facing result.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Local HTTPS Without Exposing My Homelab to the Internet</title>
      <link>https://samirtech.org/posts/local-https-without-exposing-my-homelab/</link>
      <pubDate>Wed, 16 Sep 2026 03:18:48 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/local-https-without-exposing-my-homelab/</guid>
      <description>Remembering an address and a different port for every service gets old quickly. I wanted names I could bookmark, HTTPS that worked without certificate warnings, and no accidental public access to private applications.
Those are three separate problems. DNS supplies the address, TLS verifies and encrypts the connection, and routing and firewall rules determine who can reach the service. Solving one does not automatically solve the others.
The layout I use My always-on Docker host runs Caddy as the reverse proxy and CoreDNS for private service-name resolution.</description>
      <content>&lt;p&gt;Remembering an address and a different port for every service gets old quickly. I wanted names I could bookmark, HTTPS that worked without certificate warnings, and no accidental public access to private applications.&lt;/p&gt;
&lt;p&gt;Those are three separate problems. DNS supplies the address, TLS verifies and encrypts the connection, and routing and firewall rules determine who can reach the service. Solving one does not automatically solve the others.&lt;/p&gt;
&lt;h2 id=&#34;the-layout-i-use&#34;&gt;The layout I use&lt;/h2&gt;
&lt;p&gt;My always-on Docker host runs Caddy as the reverse proxy and CoreDNS for private service-name resolution. The applications keep their existing direct ports while the proxy provides the friendlier route.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Phone or computer
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ├─ DNS query → local resolver → private proxy address
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  └─ HTTPS request → Caddy → application on its existing port
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Certificate renewal
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  └─ Caddy → DNS-provider API → temporary public DNS challenge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For example, &lt;code&gt;photos.example.com&lt;/code&gt; could resolve to the proxy&amp;rsquo;s private address on the home network. The browser connects to Caddy, which forwards the request to the photo application. The example names here are placeholders, not my private configuration.&lt;/p&gt;
&lt;h2 id=&#34;a-public-certificate-does-not-require-a-public-application&#34;&gt;A public certificate does not require a public application&lt;/h2&gt;
&lt;p&gt;ACME DNS-01 validation proves control of a domain using a DNS TXT record. The certificate authority checks that record; it does not need to reach the private photo application.&lt;/p&gt;
&lt;p&gt;Caddy needs a build with the appropriate DNS-provider module. In my setup that is the Cloudflare module, with a restricted API token supplied through a private environment file. The token must not appear in Git, examples, screenshots or command output.&lt;/p&gt;
&lt;p&gt;This lets the proxy obtain a publicly trusted wildcard certificate without opening an inbound web port solely for certificate validation. It still needs outbound access to the certificate authority and DNS provider. Working renewal also depends on the token remaining valid and the proxy&amp;rsquo;s state surviving container replacement.&lt;/p&gt;
&lt;p&gt;The certificate does not enforce privacy. Router port forwards, firewall rules, tunnels and application authentication must still be checked separately. Some services may have deliberately configured remote access; adding a local certificate should not create or change that access accidentally.&lt;/p&gt;
&lt;p&gt;Publicly trusted certificates are recorded in certificate-transparency logs. A wildcard can avoid listing each individual service hostname, but the certificate&amp;rsquo;s domain name is not secret.&lt;/p&gt;
&lt;h2 id=&#34;why-the-client-dns-setting-matters&#34;&gt;Why the client DNS setting matters&lt;/h2&gt;
&lt;p&gt;A correct CoreDNS record is useful only if the device actually asks a resolver that knows about it.&lt;/p&gt;
&lt;p&gt;My workstation routes the relevant domain to the local resolver. Other clients need an equivalent arrangement, normally through the network&amp;rsquo;s DNS policy. A phone using a different resolver, an encrypted-DNS setting or a VPN may follow another path.&lt;/p&gt;
&lt;p&gt;That explains a common failure: the service works by its direct address, but its friendly name does not. Before changing the application, check which resolver the client is using.&lt;/p&gt;
&lt;p&gt;Do not rely on a public secondary DNS server as a fallback for private records. Clients do not necessarily consult servers in the order expected, and an authoritative negative answer is not a request to try somewhere else.&lt;/p&gt;
&lt;p&gt;When extending private resolution for a domain that also hosts a public website or email, preserve those public records. Only the intended service names should receive private answers; other queries need the correct forwarding path.&lt;/p&gt;
&lt;h2 id=&#34;why-not-just-use-a-private-certificate-authority&#34;&gt;Why not just use a private certificate authority?&lt;/h2&gt;
&lt;p&gt;That is a valid alternative. Names under &lt;code&gt;home.arpa&lt;/code&gt; can use a private CA, but each client must trust that CA. Trust stores may differ between browsers and operating systems, and some devices make importing a CA inconvenient.&lt;/p&gt;
&lt;p&gt;For my public-domain service names, DNS-01 certificates avoid that extra trust installation. Clients still need the right DNS and network access. My older private-CA aliases are a separate naming and trust arrangement, not interchangeable certificates.&lt;/p&gt;
&lt;p&gt;Avoid inventing &lt;code&gt;.local&lt;/code&gt; names for ordinary unicast DNS: &lt;code&gt;.local&lt;/code&gt; is reserved for multicast DNS.&lt;/p&gt;
&lt;h2 id=&#34;keep-the-original-access-route-during-the-change&#34;&gt;Keep the original access route during the change&lt;/h2&gt;
&lt;p&gt;I kept direct application ports available while introducing the proxy. That gave me a way to distinguish a proxy problem from an application problem without rebuilding the application.&lt;/p&gt;
&lt;p&gt;This is a migration safeguard, not a reason to expose every port widely. Direct access and proxied access each need an intentional firewall and authentication policy.&lt;/p&gt;
&lt;p&gt;The proxy should route only explicitly configured hostnames. Adding a wildcard certificate must not silently turn every management interface into a reachable website.&lt;/p&gt;
&lt;h2 id=&#34;checks-that-matter&#34;&gt;Checks that matter&lt;/h2&gt;
&lt;p&gt;For a setup like this, I would verify each layer separately:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;DNS:&lt;/strong&gt; the client&amp;rsquo;s normal resolver returns the intended private address.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS:&lt;/strong&gt; the browser or command-line client accepts the certificate without bypassing verification.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Routing:&lt;/strong&gt; Caddy sends the request to the correct application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application behavior:&lt;/strong&gt; login, redirects, uploads and any application-specific connections still work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Continuity:&lt;/strong&gt; existing direct routes and unrelated services still behave as before.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exposure:&lt;/strong&gt; router, firewall and tunnel configuration match the intended access policy.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These example commands are checks, not installation instructions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Replace the placeholder hostname with your own service.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;getent ahosts photos.example.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;curl --head --show-error https://photos.example.com/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do not add &lt;code&gt;--insecure&lt;/code&gt; to make a certificate error disappear. A redirect or authentication response may be expected; a successful HTTP response alone does not test every application feature. Some applications do not support HEAD requests, so use a normal browser request when appropriate.&lt;/p&gt;
&lt;p&gt;This article describes the deployed design, not a fresh security audit of every service or a claim that every household device has been configured.&lt;/p&gt;
&lt;h2 id=&#34;the-trade-off&#34;&gt;The trade-off&lt;/h2&gt;
&lt;p&gt;A shared proxy and resolver make access simpler, but they become shared dependencies. If either fails, several friendly URLs can stop working even while the applications remain healthy.&lt;/p&gt;
&lt;p&gt;Their configuration, certificate state and protected credentials belong in the recovery plan. Keep a private record of the direct access routes as well. The useful result is fewer addresses to remember—not a system that can only be repaired through the very proxy that has failed.&lt;/p&gt;
&lt;h3 id=&#34;official-references&#34;&gt;Official references&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://caddyserver.com/docs/automatic-https&#34;&gt;Caddy automatic HTTPS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/caddy-dns/cloudflare&#34;&gt;Caddy Cloudflare DNS module&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://letsencrypt.org/docs/challenge-types/&#34;&gt;Let&amp;rsquo;s Encrypt challenge types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://coredns.io/plugins/hosts/&#34;&gt;CoreDNS hosts plugin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My main lesson is simple: a trusted certificate proves a name, not a network boundary. Keep DNS, certificate trust and access control separate, then test them together from the device that will actually use the service.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>What I Would Do Differently If I Started Again</title>
      <link>https://samirtech.org/posts/what-i-would-do-differently-if-i-started-again/</link>
      <pubDate>Wed, 16 Sep 2026 03:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/what-i-would-do-differently-if-i-started-again/</guid>
      <description>The most important lesson is that I should have slowed down before selecting the TrueNAS reset option while moving home. I did not read carefully enough, and the result was a wipe of the system hosting my photo library.
If I started again, I would change the following.
I would separate data from experimentation I would make the consequences of destructive operations obvious before pressing the button. I would export configuration, confirm snapshots and check the target dataset before resetting or rebuilding anything.</description>
      <content>&lt;p&gt;The most important lesson is that I should have slowed down before selecting the TrueNAS reset option while moving home. I did not read carefully enough, and the result was a wipe of the system hosting my photo library.&lt;/p&gt;
&lt;p&gt;If I started again, I would change the following.&lt;/p&gt;
&lt;h2 id=&#34;i-would-separate-data-from-experimentation&#34;&gt;I would separate data from experimentation&lt;/h2&gt;
&lt;p&gt;I would make the consequences of destructive operations obvious before pressing the button. I would export configuration, confirm snapshots and check the target dataset before resetting or rebuilding anything.&lt;/p&gt;
&lt;h2 id=&#34;i-would-document-recovery-while-everything-worked&#34;&gt;I would document recovery while everything worked&lt;/h2&gt;
&lt;p&gt;I would record the TrueNAS dataset layout, Immich paths, database location, backup roots, B2 details and restore commands before an emergency. Recovery knowledge is hardest to reconstruct after a failure.&lt;/p&gt;
&lt;h2 id=&#34;i-would-protect-keys-first&#34;&gt;I would protect keys first&lt;/h2&gt;
&lt;p&gt;I would keep TrueNAS encryption keys and Duplicati/B2 passphrases in a password manager, encrypted offline archives and a second safe location. The keys would be labelled clearly so I knew which system and dataset each one belonged to.&lt;/p&gt;
&lt;h2 id=&#34;i-would-test-restores-regularly&#34;&gt;I would test restores regularly&lt;/h2&gt;
&lt;p&gt;I would restore a sample of old photos and videos, rebuild a test database and check hashes on a schedule. I would not wait for a disaster to discover that an old backup was incomplete or depended on missing software.&lt;/p&gt;
&lt;h2 id=&#34;i-would-keep-multiple-recovery-paths&#34;&gt;I would keep multiple recovery paths&lt;/h2&gt;
&lt;p&gt;The recovery worked because several imperfect sources overlapped: Voyager, Backblaze B2, Duplicati information, database dumps and older files. I would design those paths deliberately instead of discovering them after the loss.&lt;/p&gt;
&lt;h2 id=&#34;i-would-not-delete-old-sources-too-quickly&#34;&gt;I would not delete old sources too quickly&lt;/h2&gt;
&lt;p&gt;After a migration, I would keep the source untouched until I had checked counts, sizes, old years, originals, videos, albums and database health. A migration summary is not the same as a verified restore.&lt;/p&gt;
&lt;h2 id=&#34;i-would-make-the-plan-boring&#34;&gt;I would make the plan boring&lt;/h2&gt;
&lt;p&gt;The best backup system is not the cleverest one. It is the one that runs automatically, keeps more than one copy, stores its keys separately and has a restore procedure I can follow when tired and worried.&lt;/p&gt;
&lt;p&gt;I was fortunate to recover my photos, including family memories going back to 2009. I do not want the next recovery to depend on fortune.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Using a Second NAS and an Off-Site Raspberry Pi</title>
      <link>https://samirtech.org/posts/using-a-second-nas-and-an-off-site-raspberry-pi/</link>
      <pubDate>Tue, 15 Sep 2026 09:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/using-a-second-nas-and-an-off-site-raspberry-pi/</guid>
      <description>A second NAS is useful, but another copy in the same house is not protection against every disaster. My additional backup layer uses a Raspberry Pi 4 with attached storage that is now physically at a separate location.
This is no longer just a plan. The Pi is reachable over Tailscale and scheduled backups have succeeded since relocation; the latest documented run on 12 October 2026 reported 46 snapshots. A repository integrity check completed without errors.</description>
      <content>&lt;p&gt;A second NAS is useful, but another copy in the same house is not protection against every disaster. My additional backup layer uses a Raspberry Pi 4 with attached storage that is now physically at a separate location.&lt;/p&gt;
&lt;p&gt;This is no longer just a plan. The Pi is reachable over Tailscale and scheduled backups have succeeded since relocation; the latest documented run on 12 October 2026 reported 46 snapshots. A repository integrity check completed without errors. I had also previously restored a picture and a Docker application&amp;rsquo;s backed-up files into an isolated test folder on the backup host. These are separate pieces of evidence, and none is a complete replacement-server recovery.&lt;/p&gt;
&lt;h2 id=&#34;where-the-pi-fits&#34;&gt;Where the Pi fits&lt;/h2&gt;
&lt;p&gt;The main NAS holds live data. A second NAS provides another local recovery layer. The Pi is an additional destination for selected important files and configuration snapshots, alongside the existing encrypted cloud-backup layer.&lt;/p&gt;
&lt;p&gt;Two NAS systems in one house can still be affected by fire, theft, power problems or an administrator mistake. Replication can also propagate unwanted changes. Versioned backups and independent destinations serve different purposes; neither replaces checking that the data can actually be recovered.&lt;/p&gt;
&lt;p&gt;The Pi is a backup target, not a replacement application server. It does not need to run the entire homelab.&lt;/p&gt;
&lt;h2 id=&#34;what-is-implemented&#34;&gt;What is implemented&lt;/h2&gt;
&lt;p&gt;An always-on Linux Docker host orchestrates the job. It reads selected NAS data through read-only mounts and runs a digest-pinned Restic container. Restic encrypts and deduplicates the backup before sending it to the Pi over SFTP through Tailscale.&lt;/p&gt;
&lt;p&gt;The flow is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Selected NAS files ───────────────┐
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                                 ├─ Backup host → Restic → SFTP over Tailscale → Pi storage
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Existing configuration snapshots ┘
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The configuration snapshots are copied from an existing local Restic repository. The personal files are backed up directly as a separate snapshot group. Copying configuration snapshots does not create fresh database dumps or guarantee that every application&amp;rsquo;s state is consistent.&lt;/p&gt;
&lt;p&gt;The repository contains selected photo originals, a photo archive, important personal files, application configuration and existing database-backup files. It is not a backup of the entire NAS or every media collection. Regenerable thumbnails and transcoded video are not the priority.&lt;/p&gt;
&lt;h2 id=&#34;tailscale-dns-instead-of-a-fixed-address&#34;&gt;Tailscale DNS instead of a fixed address&lt;/h2&gt;
&lt;p&gt;The configured destination uses the Pi&amp;rsquo;s full Tailscale MagicDNS name rather than an IP address. DNS resolution and authenticated repository access work from the backup host at the Pi&amp;rsquo;s separate location. Scheduled post-relocation backups have also completed successfully, so remote connectivity and the normal backup path are both evidenced rather than inferred from a one-off connection test.&lt;/p&gt;
&lt;p&gt;A name makes the configuration easier to understand, but it does not remove prerequisites: the recovery machine needs working Tailscale access, suitable access rules and DNS resolution. The Pi must also be online.&lt;/p&gt;
&lt;p&gt;The actual tailnet name and addresses are deliberately omitted here. Changing the destination name must not be used as a reason to disable SSH host-key verification.&lt;/p&gt;
&lt;h2 id=&#34;security-and-file-permissions&#34;&gt;Security and file permissions&lt;/h2&gt;
&lt;p&gt;There are separate layers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Private connectivity:&lt;/strong&gt; Tailscale carries the connection without requiring a publicly exposed backup share.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSH authentication:&lt;/strong&gt; a dedicated key authenticates the backup client.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Destination verification:&lt;/strong&gt; a pinned SSH host alias and strict known-host checking verify the server even when the connection address changes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encrypted backup contents:&lt;/strong&gt; Restic uses a repository password supplied through a private file, not a password embedded in a command.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read-only sources:&lt;/strong&gt; the backup container reads the source data without write access through those mounts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The backup process uses the authorized numeric identity and supplementary groups needed for the NAS permissions. I did not change host account IDs or broadly relax source ACLs to make the backup work.&lt;/p&gt;
&lt;p&gt;Encryption is not immutability. A client with sufficient repository access can still damage its backup destination. The Pi therefore adds a layer; it does not make independent copies, restricted access or recovery-key management unnecessary.&lt;/p&gt;
&lt;h2 id=&#34;scheduling-and-failure-handling&#34;&gt;Scheduling and failure handling&lt;/h2&gt;
&lt;p&gt;The job is scheduled daily with an overall timeout. It follows a defined sequence:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Acquire a lock so scheduled and manual runs do not overlap.&lt;/li&gt;
&lt;li&gt;Check free space on the destination and stop below a safety threshold.&lt;/li&gt;
&lt;li&gt;Copy existing configuration snapshots while respecting the local repository&amp;rsquo;s backup lock.&lt;/li&gt;
&lt;li&gt;Back up the selected important files.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;restic check&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Record the outcome and send a completion or failure notification.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There is no automatic offsite pruning in this setup. That avoids deleting recovery points during initial setup, but it also means retention and capacity need deliberate review. Deduplication reduces repeated storage; it does not make storage unlimited.&lt;/p&gt;
&lt;p&gt;A completed scheduled backup, a repository integrity check and a restore test are different evidence. The successful post-relocation run proves the scheduled remote path worked at that time. The passing &lt;code&gt;restic check&lt;/code&gt; found no repository errors, but it was not a full read of every stored data block. The earlier sample restore proves only that those selected files could be recovered.&lt;/p&gt;
&lt;h2 id=&#34;the-restore-rehearsal-that-actually-ran&#34;&gt;The restore rehearsal that actually ran&lt;/h2&gt;
&lt;p&gt;I created a new private scratch directory on the backup host, separate from live application data. A recovery-only Restic container mounted the credentials read-only and the scratch directory as its output. It did not need the original NAS source mounts to retrieve the backup.&lt;/p&gt;
&lt;p&gt;Two restores were performed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A picture:&lt;/strong&gt; restored with Restic&amp;rsquo;s &lt;code&gt;--verify&lt;/code&gt;, independently compared by SHA-256 against a fresh repository extraction and the current original, then verified and fully decoded as a JPEG.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A Docker application&amp;rsquo;s project folder:&lt;/strong&gt; Glance&amp;rsquo;s backed-up Compose file, configuration, assets and environment file were restored. Every recovered regular file was independently compared against a fresh repository extraction. Compose validation passed without printing interpolated secrets.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No recovered application was started. Existing running containers retained their IDs, start timestamps and restart counts across the successful test. No live application directory or NAS file was overwritten.&lt;/p&gt;
&lt;p&gt;That last point matters: blindly running a recovered Compose project could reuse production container names, ports, networks or bind mounts. An isolated file restore is a safe first test, not permission to start the recovered stack unchanged.&lt;/p&gt;
&lt;h3 id=&#34;a-permissions-issue-worth-documenting&#34;&gt;A permissions issue worth documenting&lt;/h3&gt;
&lt;p&gt;The first attempts restored the data successfully, but inherited directory ownership and permissions blocked ordinary-user inspection. For the disposable inspection copies only, ownership and owner access were adjusted inside the scratch directory. Production permissions and NAS ACLs were not changed.&lt;/p&gt;
&lt;p&gt;That adjustment is not a general restoration recipe. When recovering a real service, original ownership and ACL requirements must be preserved or deliberately mapped. A conveniently readable test copy should not be copied straight into production without review.&lt;/p&gt;
&lt;h2 id=&#34;a-safe-recovery-sequence&#34;&gt;A safe recovery sequence&lt;/h2&gt;
&lt;p&gt;These commands illustrate Restic&amp;rsquo;s operations. They use placeholders, not my private repository configuration. Supply your repository, password file and verified SSH settings separately; do not paste passwords into commands.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Inspect available recovery points and the intended contents.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic snapshots
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic ls SNAPSHOT_ID
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Preview recovery into a new, empty scratch directory.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic restore SNAPSHOT_ID &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --include /path/in/snapshot &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --target /separate/recovery-directory &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --dry-run
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Recover and verify the selected files.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;restic restore SNAPSHOT_ID &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --include /path/in/snapshot &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --target /separate/recovery-directory &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --verify
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Choose an explicit snapshot after checking its contents. A repository with configuration and personal-data snapshots can make an unqualified &lt;code&gt;latest&lt;/code&gt; select the wrong kind of backup.&lt;/p&gt;
&lt;p&gt;For a recovered Compose project, a useful next check is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;docker compose &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  --project-directory /separate/recovered-project &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  -f /separate/recovered-project/docker-compose.yml &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;  config --quiet
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This checks Compose configuration without starting the application. It does not establish that external mounts, databases, credentials or application behavior are correct.&lt;/p&gt;
&lt;p&gt;Before a real replacement-server restore, check available disk space, recover credentials, verify source mounts where required, review each project&amp;rsquo;s paths and permissions, and start one reviewed service at a time. Do not overwrite an entire system configuration tree or start all recovered projects at once.&lt;/p&gt;
&lt;h2 id=&#34;what-remains-unproven&#34;&gt;What remains unproven&lt;/h2&gt;
&lt;p&gt;The tests establish that the selected picture and Docker-project files can be retrieved and verified. They do &lt;strong&gt;not&lt;/strong&gt; establish:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a successful live replacement application;&lt;/li&gt;
&lt;li&gt;a full Immich database restore, including users and albums;&lt;/li&gt;
&lt;li&gt;a complete server or NAS recovery;&lt;/li&gt;
&lt;li&gt;a full repository data-read verification; or&lt;/li&gt;
&lt;li&gt;a full replacement-host application-and-database recovery.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Photo originals recover the media, but Immich&amp;rsquo;s organization also depends on a compatible database backup. An existing dump directory is not proof that a current, compatible dump has been restored successfully.&lt;/p&gt;
&lt;p&gt;Finally, the repository password and required access material need independent secure storage. SSH access alone cannot decrypt a Restic repository. Keeping the only recovery secret on the machine being protected would undermine the whole design.&lt;/p&gt;
&lt;h2 id=&#34;the-practical-result&#34;&gt;The practical result&lt;/h2&gt;
&lt;p&gt;The Pi backup is now a physically off-site encrypted repository with working Tailscale connectivity, successful scheduled post-relocation backups, a passing repository integrity check and an earlier non-destructive sample restore. The next confidence step is a deliberately isolated replacement-host application-and-database rehearsal—not simply collecting more successful-upload notifications.&lt;/p&gt;
&lt;p&gt;Further reading: &lt;a href=&#34;https://restic.readthedocs.io/en/stable/&#34;&gt;Restic documentation&lt;/a&gt;, &lt;a href=&#34;https://tailscale.com/kb/1081/magicdns&#34;&gt;Tailscale MagicDNS&lt;/a&gt;, and &lt;a href=&#34;https://docs.docker.com/reference/cli/docker/compose/config/&#34;&gt;Docker Compose configuration validation&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Testing a Restore Before Disaster Strikes</title>
      <link>https://samirtech.org/posts/testing-a-restore-before-disaster-strikes/</link>
      <pubDate>Mon, 14 Sep 2026 09:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/testing-a-restore-before-disaster-strikes/</guid>
      <description>Before the TrueNAS reset, I had rarely tested a complete restore. The incident became the test, and it was much more complicated than I expected.
What I test now I do not only check that a scheduled job says “completed”. I test whether I can:
locate the backup; authenticate to it; unlock encrypted data; restore a sample and a larger set; rebuild the database; open original photographs and videos; identify missing or duplicate files; explain the procedure to myself later.</description>
      <content>&lt;p&gt;Before the TrueNAS reset, I had rarely tested a complete restore. The incident became the test, and it was much more complicated than I expected.&lt;/p&gt;
&lt;h2 id=&#34;what-i-test-now&#34;&gt;What I test now&lt;/h2&gt;
&lt;p&gt;I do not only check that a scheduled job says “completed”. I test whether I can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;locate the backup;&lt;/li&gt;
&lt;li&gt;authenticate to it;&lt;/li&gt;
&lt;li&gt;unlock encrypted data;&lt;/li&gt;
&lt;li&gt;restore a sample and a larger set;&lt;/li&gt;
&lt;li&gt;rebuild the database;&lt;/li&gt;
&lt;li&gt;open original photographs and videos;&lt;/li&gt;
&lt;li&gt;identify missing or duplicate files;&lt;/li&gt;
&lt;li&gt;explain the procedure to myself later.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;start-with-a-separate-restore-area&#34;&gt;Start with a separate restore area&lt;/h2&gt;
&lt;p&gt;Recovered files first went to a separate TrueNAS location. I did not write directly into the live Immich library while I was still working out which backup root and user folder were correct.&lt;/p&gt;
&lt;p&gt;That separation made retries safer and allowed me to compare the source and destination without confusing recovered data with live uploads.&lt;/p&gt;
&lt;h2 id=&#34;check-more-than-recent-files&#34;&gt;Check more than recent files&lt;/h2&gt;
&lt;p&gt;A restore can look successful because recent photos are present while older years are missing. I deliberately check different years, photos and videos, both users, and files from before the point where the original migration began.&lt;/p&gt;
&lt;p&gt;In my case, some items from before 2024 did not appear in the first migration attempt. Reviewing the timeline exposed that gap.&lt;/p&gt;
&lt;h2 id=&#34;hash-checks-and-application-checks&#34;&gt;Hash checks and application checks&lt;/h2&gt;
&lt;p&gt;I use SHA-256 for selected file comparisons. A matching hash shows that the copied file is byte-for-byte identical to the file tested at the source.&lt;/p&gt;
&lt;p&gt;That is only one part of the check. I also open the files, inspect the database, check albums and confirm that the active Immich app displays the results on the phone.&lt;/p&gt;
&lt;h2 id=&#34;record-the-result&#34;&gt;Record the result&lt;/h2&gt;
&lt;p&gt;A restore test should produce notes: what was restored, from where, with which key, how long it took, what failed and how it was fixed. Those notes become the recovery guide for the next incident.&lt;/p&gt;
&lt;p&gt;The best time to discover a missing key or broken restore command is during a planned test, not when the original server has already been wiped.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>How My Restic Backup Protects the Homelab</title>
      <link>https://samirtech.org/posts/how-my-restic-backup-protects-the-homelab/</link>
      <pubDate>Mon, 14 Sep 2026 08:30:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/how-my-restic-backup-protects-the-homelab/</guid>
      <description>Restic is one layer of my backup plan. It is not the backup for every file on every server, and understanding that boundary matters.
What this backup is for My Restic job protects the configuration needed to rebuild the surrounding homelab. That includes container definitions, stack files, service configuration and selected system settings such as scheduled jobs, mounts, remote-access configuration and security-related configuration.
The purpose is simple: if the host has to be rebuilt, I should not have to remember how every service was assembled.</description>
      <content>&lt;p&gt;Restic is one layer of my backup plan. It is not the backup for every file on every server, and understanding that boundary matters.&lt;/p&gt;
&lt;h2 id=&#34;what-this-backup-is-for&#34;&gt;What this backup is for&lt;/h2&gt;
&lt;p&gt;My Restic job protects the configuration needed to rebuild the surrounding homelab. That includes container definitions, stack files, service configuration and selected system settings such as scheduled jobs, mounts, remote-access configuration and security-related configuration.&lt;/p&gt;
&lt;p&gt;The purpose is simple: if the host has to be rebuilt, I should not have to remember how every service was assembled. I can recover the documented configuration, reinstall the software and bring the services back in a controlled order.&lt;/p&gt;
&lt;h2 id=&#34;what-it-does-not-replace&#34;&gt;What it does not replace&lt;/h2&gt;
&lt;p&gt;This Restic backup is not a substitute for the Immich backup. Immich photos and videos, its PostgreSQL data and its application recovery material need to be protected as a related recovery set through their own backup layers.&lt;/p&gt;
&lt;p&gt;That distinction prevents a common mistake: seeing a successful configuration backup and assuming the important application data is included. A backup only protects the sources it actually reads.&lt;/p&gt;
&lt;h2 id=&#34;schedule-and-backup-freshness&#34;&gt;Schedule and backup freshness&lt;/h2&gt;
&lt;p&gt;The configuration job runs weekly, on Sunday at 04:15 UK time. Its destination is a TrueNAS NFS mount, not just a similarly named local folder. Verifying that mount matters: if network storage disappears, a careless job can write to the host&amp;rsquo;s disk instead of the intended destination.&lt;/p&gt;
&lt;p&gt;The Pi job runs daily, but copies the configuration snapshots already present in this repository. A daily copy of a weekly snapshot is still a weekly recovery point. Changes made after the source backup are not protected by that configuration snapshot just because a later transfer succeeded.&lt;/p&gt;
&lt;p&gt;Selected personal files are backed up separately by the Pi job. Different snapshot groups have different scopes and ages; inspect the intended snapshot rather than assuming an unqualified &lt;code&gt;latest&lt;/code&gt; contains everything.&lt;/p&gt;
&lt;h2 id=&#34;last-verified-15-september-2026&#34;&gt;Last verified: 15 September 2026&lt;/h2&gt;
&lt;p&gt;The recorded read-only check confirmed the destination was mounted from TrueNAS, the weekly cron schedule was active, a structural repository check completed without errors, and Glance&amp;rsquo;s Compose file could be retrieved from the latest saved backup. That saved backup was dated 13 September.&lt;/p&gt;
&lt;p&gt;A separate &lt;a href=&#34;https://samirtech.org/posts/using-a-second-nas-and-an-off-site-raspberry-pi/&#34;&gt;Pi restore rehearsal&lt;/a&gt; recovered a picture and Glance&amp;rsquo;s project files into an isolated directory. File comparisons and Compose validation passed. No recovered service was started.&lt;/p&gt;
&lt;p&gt;These are dated results, not a live status dashboard. Neither a structural check nor a Compose-file readback proves that every stored data block is readable or that a replacement server can run all the applications.&lt;/p&gt;
&lt;h2 id=&#34;why-restic-is-useful&#34;&gt;Why Restic is useful&lt;/h2&gt;
&lt;p&gt;Restic provides encrypted, deduplicated, incremental backups. After the first run, later runs can reuse data already stored and upload only changed content. Encryption means the repository can be held on storage that is not itself trusted with readable copies of the configuration.&lt;/p&gt;
&lt;p&gt;The repository password is therefore part of the backup. Without it, the encrypted data is not a recovery plan. I keep the password and the recovery notes separately from the machine being backed up, with more than one protected copy.&lt;/p&gt;
&lt;h2 id=&#34;recovery-is-the-test&#34;&gt;Recovery is the test&lt;/h2&gt;
&lt;p&gt;A completed job is only evidence that a backup process ran. It does not prove that the repository can be opened or that the files needed for a rebuild are present.&lt;/p&gt;
&lt;p&gt;A useful test is to restore selected configuration into a temporary area, inspect the files, and confirm that the deployment notes are sufficient to identify the services, storage relationships and required secrets. I must not restore over live configuration while testing.&lt;/p&gt;
&lt;p&gt;For a real rebuild, I would restore the configuration first, reinstall the required applications, recover secrets through the protected process, and then restore each service&amp;rsquo;s data from the backup designed for that service.&lt;/p&gt;
&lt;h2 id=&#34;the-lesson&#34;&gt;The lesson&lt;/h2&gt;
&lt;p&gt;Restic is valuable because it preserves the instructions and configuration around the data. It reduces rebuild time and removes guesswork, but it works best as one clearly labelled layer beside the Immich media backup, database backup, TrueNAS snapshots and encrypted off-site copy.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Backing Up Immich Properly: Photos, Database and Encryption Keys</title>
      <link>https://samirtech.org/posts/backing-up-immich-properly/</link>
      <pubDate>Mon, 14 Sep 2026 08:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/backing-up-immich-properly/</guid>
      <description>Immich makes a self-hosted photo library feel simple, but the backup is more than the visible photo folders.
My recovery showed that I needed to protect more than the visible photo library. I need to protect the original media, the PostgreSQL database, the Immich application configuration and the credentials or keys required to access the backup.
Original media The originals are the irreplaceable part. They include photographs and videos uploaded over many years, including files that are no longer on current phones or computers.</description>
      <content>&lt;p&gt;Immich makes a self-hosted photo library feel simple, but the backup is more than the visible photo folders.&lt;/p&gt;
&lt;p&gt;My recovery showed that I needed to protect more than the visible photo library. I need to protect the original media, the PostgreSQL database, the Immich application configuration and the credentials or keys required to access the backup.&lt;/p&gt;
&lt;h2 id=&#34;original-media&#34;&gt;Original media&lt;/h2&gt;
&lt;p&gt;The originals are the irreplaceable part. They include photographs and videos uploaded over many years, including files that are no longer on current phones or computers.&lt;/p&gt;
&lt;p&gt;I now treat the Immich library as ordinary important data as well as application data. It needs copies that can be opened outside Immich, not only thumbnails that appear in the web interface.&lt;/p&gt;
&lt;h2 id=&#34;the-database&#34;&gt;The database&lt;/h2&gt;
&lt;p&gt;The database contains users, albums, metadata and the relationships between assets. Restoring only the media can recover the files, but it does not recreate the library experience.&lt;/p&gt;
&lt;p&gt;During recovery I created a PostgreSQL dump and checked the restored database. I also kept the restored Immich installation available as a source while migrating into the active server.&lt;/p&gt;
&lt;p&gt;The database must be backed up separately from the media. A dump that has never been restored is an assumption, not proof.&lt;/p&gt;
&lt;h2 id=&#34;how-the-backup-layers-fit-together&#34;&gt;How the backup layers fit together&lt;/h2&gt;
&lt;p&gt;The live Immich installation stores the original media and PostgreSQL data as separate parts of the system. They must be treated as one recovery set, even though they are backed up differently.&lt;/p&gt;
&lt;p&gt;Local TrueNAS copies provide a nearby recovery route when the primary storage or an individual service fails. They are useful for fast recovery, but they are not protection from every failure: both systems may be affected by the same mistake, physical event or missing encryption key.&lt;/p&gt;
&lt;h2 id=&#34;snapshots-and-cloud-sync&#34;&gt;Snapshots and cloud sync&lt;/h2&gt;
&lt;p&gt;The Immich storage has an enabled recursive TrueNAS snapshot task. It runs hourly and retains snapshots for two weeks. The snapshots use a dedicated naming pattern, making them easier to identify during recovery.&lt;/p&gt;
&lt;p&gt;Snapshots are useful for accidental deletion, corruption or a recent change, but they are not a complete backup. They remain on the same storage system and can be lost with the pool, hardware or encryption key. They also do not replace a tested database restore.&lt;/p&gt;
&lt;p&gt;There is also an enabled encrypted cloud-sync task for Immich. It pushes a copy to Backblaze B2 each day and creates a source snapshot as part of the transfer. This gives the photo library an off-site copy while keeping the transfer separate from the local snapshot schedule.&lt;/p&gt;
&lt;p&gt;The restore test confirmed that the encrypted cloud copy could be recovered successfully. The test task is now disabled because it served its purpose; future restores should still be performed in a separate recovery location without writing over the live library.&lt;/p&gt;
&lt;p&gt;The off-site copy is encrypted and stored in Backblaze B2 through the TrueNAS cloud-sync task. It is not a normal folder that can simply be browsed; recovery requires the correct protected configuration and encryption credentials before it produces ordinary recovered files.&lt;/p&gt;
&lt;p&gt;The wider server configuration is backed up separately with Restic. That backup helps rebuild the host, containers and supporting services, but it is not a substitute for backing up the Immich originals and PostgreSQL data.&lt;/p&gt;
&lt;h2 id=&#34;encryption-keys-and-passphrases&#34;&gt;Encryption keys and passphrases&lt;/h2&gt;
&lt;p&gt;My recovery involved two different encryption issues. Some TrueNAS-replicated datasets could not be opened because the required TrueNAS key was missing. The off-site cloud copy was recoverable because I still had the required encryption credentials.&lt;/p&gt;
&lt;p&gt;The lesson is straightforward: store dataset keys, backup passphrases, B2 credentials and administrator recovery details outside the NAS. Keep more than one protected copy and make sure the recovery instructions explain which key belongs to which system.&lt;/p&gt;
&lt;h2 id=&#34;a-practical-recovery-set&#34;&gt;A practical recovery set&lt;/h2&gt;
&lt;p&gt;For each Immich backup, I want the following available:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the original media;&lt;/li&gt;
&lt;li&gt;a recent PostgreSQL dump;&lt;/li&gt;
&lt;li&gt;the Immich version and deployment notes;&lt;/li&gt;
&lt;li&gt;configuration and environment details without exposing secrets publicly;&lt;/li&gt;
&lt;li&gt;TrueNAS dataset keys;&lt;/li&gt;
&lt;li&gt;B2 or backup-provider details;&lt;/li&gt;
&lt;li&gt;the encryption passphrase;&lt;/li&gt;
&lt;li&gt;a written restore procedure.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;verification&#34;&gt;Verification&lt;/h2&gt;
&lt;p&gt;I check photos and videos from different years, open originals outside Immich and compare selected files with SHA-256 hashes. I also check the Immich timeline and retry missing periods rather than assuming that a successful migration summary means everything arrived.&lt;/p&gt;
&lt;p&gt;The result is a backup that can be rebuilt as a service and also accessed as a collection of normal files if Immich itself is unavailable.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Building a 3-2-1 Backup System for My Homelab</title>
      <link>https://samirtech.org/posts/building-a-3-2-1-backup-system-for-my-homelab/</link>
      <pubDate>Sat, 12 Sep 2026 12:10:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/building-a-3-2-1-backup-system-for-my-homelab/</guid>
      <description>After recovering my photos, I needed a backup design that did not depend on luck. The familiar 3-2-1 rule gives me a useful structure:
3 copies of important data, including the working copy; 2 different media or storage types, rather than every copy depending on the same storage system; 1 copy off-site, outside the same physical failure zone. The numbers are a starting point, not proof of recoverability. Another folder on the same NAS is not an independent backup, and another machine in the same house is not an off-site copy.</description>
      <content>&lt;p&gt;After recovering my photos, I needed a backup design that did not depend on luck. The familiar 3-2-1 rule gives me a useful structure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;3 copies&lt;/strong&gt; of important data, including the working copy;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;2 different media or storage types&lt;/strong&gt;, rather than every copy depending on the same storage system;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1 copy off-site&lt;/strong&gt;, outside the same physical failure zone.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The numbers are a starting point, not proof of recoverability. Another folder on the same NAS is not an independent backup, and another machine in the same house is not an off-site copy.&lt;/p&gt;
&lt;h2 id=&#34;what-is-working-now&#34;&gt;What is working now&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Backup evidence reviewed: 12 October 2026.&lt;/strong&gt; This summary reflects the completed checks recorded in the linked articles. It is not a new full recovery test.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Immich:&lt;/strong&gt; original media and PostgreSQL data are separate parts of the live service. Both matter to recovery.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local snapshots:&lt;/strong&gt; the documented Immich snapshot task runs hourly and retains snapshots for two weeks. These provide rollback on the same storage system, not protection from losing that system.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encrypted cloud backup:&lt;/strong&gt; the documented daily TrueNAS cloud-sync task pushes Immich data to Backblaze B2 and creates a source snapshot. An encrypted cloud recovery test completed successfully.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Host configuration:&lt;/strong&gt; a weekly Restic job backs up the Docker host&amp;rsquo;s configuration and selected application data to TrueNAS. The destination mount, repository structure and retrieval of a backed-up Compose file were checked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Raspberry Pi:&lt;/strong&gt; it is physically at a separate location and reachable over Tailscale. Scheduled backups have succeeded since relocation; the latest documented run reported 46 snapshots, and a repository integrity check found no errors. A picture and Docker-project files had previously been restored and verified locally from its encrypted Restic repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Physical relocation, Tailscale connectivity, a successful scheduled backup, a passing repository integrity check and a sample file restore are distinct claims. All have evidence, but they do &lt;strong&gt;not&lt;/strong&gt; establish a complete replacement-host or application-and-database recovery.&lt;/p&gt;
&lt;h2 id=&#34;how-the-layers-fit-together&#34;&gt;How the layers fit together&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Live photo service
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ├─ Original media + PostgreSQL data
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ├─ Local snapshots: short-term rollback on the same storage
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  └─ Encrypted cloud copy: an independent off-site recovery route
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Docker host
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  └─ Weekly configuration/application-data snapshots → TrueNAS Restic repository
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Selected NAS files + existing configuration snapshots
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  └─ Daily Pi job → encrypted Restic repository
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                     physically off-site; scheduled remote path verified
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These branches do not all contain the same data. A successful host-configuration backup is not evidence that the entire photo library or a fresh, consistent database dump is included. The Pi copies existing configuration snapshots; it does not make those snapshots newer.&lt;/p&gt;
&lt;h2 id=&#34;the-second-nas-has-a-separate-role&#34;&gt;The second NAS has a separate role&lt;/h2&gt;
&lt;p&gt;A second TrueNAS machine provides a local recovery destination and has been used during recovery. It normally stays powered off or suspended. Local replication belongs in the design, but I should not describe it as a current scheduled recovery guarantee without checking its enabled tasks, scope and latest successful runs.&lt;/p&gt;
&lt;p&gt;Two NAS machines in one home still share risks: fire, theft, power problems and mistakes made with the same administrator access. Replication also needs an appropriate retention policy; propagating a change is not the same as preserving a recoverable older version.&lt;/p&gt;
&lt;h2 id=&#34;keys-are-part-of-the-backup&#34;&gt;Keys are part of the backup&lt;/h2&gt;
&lt;p&gt;The recovery taught me that dataset keys and backup passphrases must be stored separately from the data they unlock. Protected copies belong in more than one secure place, including a recovery route that does not depend on the failed server.&lt;/p&gt;
&lt;p&gt;Removable key storage is not another full data backup. It holds information required to unlock and rebuild the actual backups. Repository encryption also does not make a destination immutable: an authorized client may still be able to delete or damage it.&lt;/p&gt;
&lt;h2 id=&#34;what-the-tests-proveand-what-they-do-not&#34;&gt;What the tests prove—and what they do not&lt;/h2&gt;
&lt;p&gt;The completed cloud recovery and Pi sample restores are useful evidence. They show that those tested copies could be accessed, decrypted and recovered at the time of the tests.&lt;/p&gt;
&lt;p&gt;They do not establish a complete replacement-server recovery or a fresh end-to-end Immich database restore from every backup destination. A passing repository integrity check is also different from reading every stored data block or starting a recovered application against a restored database.&lt;/p&gt;
&lt;p&gt;My next confidence steps are an isolated application/database rehearsal and deliberate review of Pi retention and capacity. The Pi setup currently has no automatic off-site pruning.&lt;/p&gt;
&lt;h2 id=&#34;read-the-implementation-details&#34;&gt;Read the implementation details&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://samirtech.org/posts/backing-up-immich-properly/&#34;&gt;Backing up Immich properly&lt;/a&gt; explains the media, database and key dependencies.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://samirtech.org/posts/how-my-restic-backup-protects-the-homelab/&#34;&gt;How my Restic backup protects the homelab&lt;/a&gt; explains scope and backup freshness.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://samirtech.org/posts/using-a-second-nas-and-an-off-site-raspberry-pi/&#34;&gt;Using a second NAS and an off-site Raspberry Pi&lt;/a&gt; records the implementation and actual restore evidence.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://samirtech.org/posts/testing-a-restore-before-disaster-strikes/&#34;&gt;Testing a restore before disaster strikes&lt;/a&gt; describes the checks that turn a backup into a usable recovery path.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The goal is not to collect more destinations. It is to know which copy protects which data, how old it is, what unlocks it and what has actually been recovered from it.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Why a Backup Is More Than Just Another Copy</title>
      <link>https://samirtech.org/posts/why-a-backup-is-more-than-another-copy/</link>
      <pubDate>Fri, 11 Sep 2026 07:25:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/why-a-backup-is-more-than-another-copy/</guid>
      <description>Before I lost my main TrueNAS system, I thought I had backups. In a narrow sense, I did. There were replicas, cloud data and older copies scattered across different machines.
The problem was that I had not proved I could recover from them.
A copy is not automatically a backup A second copy can still fail as a backup if:
it is encrypted and the key is missing; it depends on software or a database you no longer have; you do not know which copy is complete; it has never been restored and tested; it is stored beside the original and can be destroyed at the same time; the credentials or passphrase exist only on the failed machine.</description>
      <content>&lt;p&gt;Before I lost my main TrueNAS system, I thought I had backups. In a narrow sense, I did. There were replicas, cloud data and older copies scattered across different machines.&lt;/p&gt;
&lt;p&gt;The problem was that I had not proved I could recover from them.&lt;/p&gt;
&lt;h2 id=&#34;a-copy-is-not-automatically-a-backup&#34;&gt;A copy is not automatically a backup&lt;/h2&gt;
&lt;p&gt;A second copy can still fail as a backup if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;it is encrypted and the key is missing;&lt;/li&gt;
&lt;li&gt;it depends on software or a database you no longer have;&lt;/li&gt;
&lt;li&gt;you do not know which copy is complete;&lt;/li&gt;
&lt;li&gt;it has never been restored and tested;&lt;/li&gt;
&lt;li&gt;it is stored beside the original and can be destroyed at the same time;&lt;/li&gt;
&lt;li&gt;the credentials or passphrase exist only on the failed machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That was my situation. One TrueNAS replica contained data I could not unlock because I no longer had the required encryption key. My Backblaze copy was recoverable only because I still had the Duplicati passphrase and could reconnect to the correct B2 backup location.&lt;/p&gt;
&lt;h2 id=&#34;the-backup-has-dependencies&#34;&gt;The backup has dependencies&lt;/h2&gt;
&lt;p&gt;For my Immich library, the backup was not just a folder of pictures. A usable recovery involved the original media, Immich&amp;rsquo;s database, the encryption settings, the B2 credentials, the backup passphrase and enough knowledge to rebuild the application.&lt;/p&gt;
&lt;p&gt;If any one of those is missing, recovery becomes harder or impossible.&lt;/p&gt;
&lt;h2 id=&#34;restore-is-the-real-test&#34;&gt;Restore is the real test&lt;/h2&gt;
&lt;p&gt;The first time I truly tested the backups was after the incident. I restored the old Immich instance, decrypted files from Backblaze, copied data with resumable transfers, migrated into the active server and checked originals with SHA-256 hashes.&lt;/p&gt;
&lt;p&gt;That process exposed missing items, duplicate assets, thumbnail errors and files that had not initially migrated. The backup job itself had never shown me that level of detail.&lt;/p&gt;
&lt;h2 id=&#34;what-i-believe-now&#34;&gt;What I believe now&lt;/h2&gt;
&lt;p&gt;A backup should answer five questions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Where is the copy?&lt;/li&gt;
&lt;li&gt;Is it complete?&lt;/li&gt;
&lt;li&gt;Can I unlock it?&lt;/li&gt;
&lt;li&gt;Can I restore the application and database?&lt;/li&gt;
&lt;li&gt;How do I know the restored files are correct?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The goal is not to own more copies. The goal is to have at least one copy that can be recovered when the original is gone.&lt;/p&gt;
&lt;p&gt;That is why the rest of my backup project is focused on documented restores, protected keys and regular verification—not simply creating more scheduled jobs.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Building a More Useful Homelab with Hermes Agent</title>
      <link>https://samirtech.org/posts/hermes-agent/</link>
      <pubDate>Thu, 10 Sep 2026 17:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/hermes-agent/</guid>
      <description>Working with Hermes Agent I started experimenting with Hermes Agent in September 2026. It is an AI agent that runs in the terminal and can use tools to inspect files, research documentation, operate on systems and help turn a vague idea into a tested result.
The interesting part is not simply asking an AI questions. Hermes can work alongside the systems I already use: Fedora and KDE on the desktop, Docker on the N100, TrueNAS for storage and Telegram for remote status updates.</description>
      <content>&lt;h1 id=&#34;working-with-hermes-agent&#34;&gt;Working with Hermes Agent&lt;/h1&gt;
&lt;p&gt;I started experimenting with Hermes Agent in September 2026. It is an AI agent that runs in the terminal and can use tools to inspect files, research documentation, operate on systems and help turn a vague idea into a tested result.&lt;/p&gt;
&lt;p&gt;The interesting part is not simply asking an AI questions. Hermes can work alongside the systems I already use: Fedora and KDE on the desktop, Docker on the N100, TrueNAS for storage and Telegram for remote status updates. The useful work happens when the agent checks the real system instead of guessing.&lt;/p&gt;
&lt;h2 id=&#34;what-we-have-been-doing&#34;&gt;What we have been doing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Auditing and maintaining the homelab without removing services destructively.&lt;/li&gt;
&lt;li&gt;Improving local HTTPS and friendly DNS names for services such as Immich, Jellyfin and Audiobookshelf.&lt;/li&gt;
&lt;li&gt;Adding container health checks, bounded logs and monitoring with WUD and Gotify.&lt;/li&gt;
&lt;li&gt;Building safer backup routines with encrypted Restic configuration backups and restore-focused documentation.&lt;/li&gt;
&lt;li&gt;Creating desktop workflows for focus time, meetings, virtual machines and end-of-day recovery.&lt;/li&gt;
&lt;li&gt;Writing reusable skills so hard-won procedures are available in later sessions.&lt;/li&gt;
&lt;li&gt;Inspecting and improving this website, including the backup learning series and this homelab showcase.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;the-important-habit-verify-everything&#34;&gt;The important habit: verify everything&lt;/h2&gt;
&lt;p&gt;An agent should not claim a change worked because a command returned successfully. For system changes, I want a read-back or health check. For backups, I want restore tests. For website changes, I want a real Hugo build and a check of the generated pages.&lt;/p&gt;
&lt;p&gt;That approach makes Hermes less like a chatbot and more like a careful technical colleague: it can move quickly, but the evidence still comes from the system being changed.&lt;/p&gt;
&lt;h2 id=&#34;what-comes-next&#34;&gt;What comes next&lt;/h2&gt;
&lt;p&gt;I am continuing to document the lab, add photographs and diagrams, and turn recurring maintenance into small, reviewable workflows. The goal is not to automate everything. It is to make the useful and repetitive parts safer while keeping important decisions visible.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>How I Got My Old Photos Back After Wiping My NAS</title>
      <link>https://samirtech.org/posts/how-i-got-my-old-photos-back/</link>
      <pubDate>Thu, 10 Sep 2026 09:00:00 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/how-i-got-my-old-photos-back/</guid>
      <description>There are some files you can download again. Family photos are not among them.
I recently learned that lesson in the most uncomfortable way possible. While moving to a new home, I reset my main TrueNAS server without properly reading what the reset operation would do. The result was that I wiped the system and thought I had lost years of photos and home videos.
This included the ordinary moments that become important only after time has passed—old computers, holidays, family pictures and photos of my son.</description>
      <content>&lt;p&gt;There are some files you can download again. Family photos are not among them.&lt;/p&gt;
&lt;p&gt;I recently learned that lesson in the most uncomfortable way possible. While moving to a new home, I reset my main TrueNAS server without properly reading what the reset operation would do. The result was that I wiped the system and thought I had lost years of photos and home videos.&lt;/p&gt;
&lt;p&gt;This included the ordinary moments that become important only after time has passed—old computers, holidays, family pictures and photos of my son. Some of the recovered photos went all the way back to 2009.&lt;/p&gt;
&lt;p&gt;I did eventually get them back, but not because I had a perfect backup system. I got them back because fragments of several old systems still existed and, after a lot of investigation, I managed to piece them together.&lt;/p&gt;
&lt;p&gt;This is what happened.&lt;/p&gt;
&lt;h2 id=&#34;the-mistake&#34;&gt;The mistake&lt;/h2&gt;
&lt;p&gt;My main storage server ran TrueNAS and hosted Immich, my self-hosted photo library. During our move to a new home, I was getting the homelab set up again and used the TrueNAS reset option. I did not stop and read carefully enough to understand exactly what would be reset or what the consequences would be.&lt;/p&gt;
&lt;p&gt;That mistake wiped the system I was relying on for my photo library. It was not a disk failure, ransomware attack or obscure software bug. It was a destructive action carried out by me during an already busy period, because I assumed I understood the option instead of verifying it first.&lt;/p&gt;
&lt;p&gt;Moving home meant equipment had been powered down, disconnected and relocated, and I was trying to bring several parts of the network and homelab back online. That context does not change the result, but it explains how easily a familiar-looking reset option turned into a serious data-loss incident.&lt;/p&gt;
&lt;p&gt;The full impact was not immediately obvious. The server could be rebuilt, containers could be redeployed and applications could be downloaded again. The irreplaceable part was the data: the original photos and videos behind Immich.&lt;/p&gt;
&lt;p&gt;I had backups—or at least I believed I did.&lt;/p&gt;
&lt;p&gt;That distinction became important very quickly.&lt;/p&gt;
&lt;h2 id=&#34;a-backup-existing-does-not-mean-it-can-be-restored&#34;&gt;A backup existing does not mean it can be restored&lt;/h2&gt;
&lt;p&gt;I had previously replicated data to a second TrueNAS machine. That sounded reassuring until I discovered that some of the replicated datasets were encrypted and I no longer had the required encryption key.&lt;/p&gt;
&lt;p&gt;The data was physically present, but parts of it were effectively locked away.&lt;/p&gt;
&lt;p&gt;I also had cloud backups in Backblaze B2, created using Duplicati. I no longer had the original Duplicati installation, but fortunately I had kept its passphrase. That gave me another possible route back to the files.&lt;/p&gt;
&lt;p&gt;At this point my recovery options looked something like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a second NAS containing replicas, some of which I could not unlock;&lt;/li&gt;
&lt;li&gt;Backblaze B2 data created by an application I no longer had running;&lt;/li&gt;
&lt;li&gt;more than one old Immich backup location;&lt;/li&gt;
&lt;li&gt;possible copies on older computers and external drives;&lt;/li&gt;
&lt;li&gt;a current Immich server that was already receiving new uploads.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It was not a clean backup. It was an archaeological dig.&lt;/p&gt;
&lt;h2 id=&#34;recovering-the-old-immich-system&#34;&gt;Recovering the old Immich system&lt;/h2&gt;
&lt;p&gt;I restored the older Immich installation on the second TrueNAS server and began checking what was actually there.&lt;/p&gt;
&lt;p&gt;That first successful login was a major relief. My wife&amp;rsquo;s photos appeared, and the oldest items in the library went back to 2009. Seeing the thumbnails was encouraging, but I did not yet treat that as proof of a successful recovery.&lt;/p&gt;
&lt;p&gt;An Immich library is more than a folder of images. It also has a PostgreSQL database containing users, albums, metadata and the relationships between assets. A working web interface can still hide missing originals, broken thumbnails or an incomplete database.&lt;/p&gt;
&lt;p&gt;Before doing more, I created a fresh database dump and ran checks against the restored database. The database appeared healthy, which meant the old instance could become a source for a safer migration.&lt;/p&gt;
&lt;h2 id=&#34;decrypting-and-pulling-the-files-back-from-backblaze&#34;&gt;Decrypting and pulling the files back from Backblaze&lt;/h2&gt;
&lt;p&gt;The Backblaze copy was not a normal folder that could simply be opened and copied. The files had been uploaded through Duplicati and were stored using its encrypted backup format.&lt;/p&gt;
&lt;p&gt;That meant the Backblaze bucket contained backup data, not immediately usable JPGs, MP4s and other originals. The encryption passphrase was therefore just as important as the B2 account details. Without it, I might have been looking at a complete cloud backup that I still could not restore.&lt;/p&gt;
&lt;p&gt;The recovery process was:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reconnect the backup software to the correct Backblaze B2 account, bucket and backup location.&lt;/li&gt;
&lt;li&gt;Add the original encryption setting and passphrase from the old backup configuration.&lt;/li&gt;
&lt;li&gt;Run a restore rather than copying the encrypted backup objects directly.&lt;/li&gt;
&lt;li&gt;Select the required photo and Immich backup folders.&lt;/li&gt;
&lt;li&gt;Restore them to a separate recovery location on TrueNAS.&lt;/li&gt;
&lt;li&gt;Confirm that the output consisted of normal files that could be opened independently of the backup software.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The backup application handled decryption during the restore. The files written to the recovery dataset were usable originals; they did not require Duplicati or Backblaze every time I wanted to view a photograph.&lt;/p&gt;
&lt;p&gt;I kept the recovered files separate from the live Immich library at first. That gave me a safe working copy and meant I could compare, inspect and retry the restore without damaging the source or the active server.&lt;/p&gt;
&lt;p&gt;The cloud restore took patience. Backblaze download limits were reached more than once, so the recovery could not be completed in one uninterrupted run.&lt;/p&gt;
&lt;p&gt;I used &lt;code&gt;rsync&lt;/code&gt; for the subsequent file copies because interrupted transfers could be resumed without starting everything again. That mattered: some runs stopped in the 80–90 percent range, and the photo directories contained tens of thousands of files spread across many subdirectories.&lt;/p&gt;
&lt;p&gt;I also found two different backup roots in B2. That was useful because one could contain files missing from the other, but it made the recovery harder to reason about. I had to compare, resume and verify rather than blindly copying one folder and assuming it was complete.&lt;/p&gt;
&lt;p&gt;This stage taught me an important difference:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Copying files is an activity. Verifying that the correct files arrived is the recovery.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;migrating-into-the-active-immich-server&#34;&gt;Migrating into the active Immich server&lt;/h2&gt;
&lt;p&gt;While I was recovering the old server, my active Immich instance was still receiving new phone uploads. I did not want to replace its database with an old one and risk losing everything added since the failure.&lt;/p&gt;
&lt;p&gt;Instead, I kept the restored Immich instance as the source and migrated its contents into the active instance using &lt;code&gt;immich-go&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The migration was not perfectly clean. Early attempts failed because the correct API access had not been configured. Later runs reported missing originals, server errors and thumbnail-related failures. The larger migration also produced many duplicates—which, in this case, was better than silently losing files.&lt;/p&gt;
&lt;p&gt;I reran the migration and reduced the remaining errors. By the final retries, my own library was down to a single failed upload caused by an empty file, while my wife&amp;rsquo;s migration had a much smaller number of remaining download errors to investigate.&lt;/p&gt;
&lt;p&gt;Most importantly, the old photographs began appearing in the current Immich mobile app. My wife&amp;rsquo;s library returned, then mine. Some thumbnails still needed to be regenerated, but opening the affected assets showed that many of the originals were present.&lt;/p&gt;
&lt;p&gt;That was the moment I could finally say: I have my photos back.&lt;/p&gt;
&lt;h2 id=&#34;verifying-that-the-recovery-was-real&#34;&gt;Verifying that the recovery was real&lt;/h2&gt;
&lt;p&gt;I did not rely only on Immich showing a thumbnail. Some thumbnails initially reported errors even though the original opened when selected. That is why I checked the restored files directly and compared selected files with SHA-256 hashes between the recovered Immich data and a separate restore-test copy.&lt;/p&gt;
&lt;p&gt;The verification included opening photographs and videos from different years, checking older material rather than only recent uploads, confirming that originals opened outside Immich, checking that the database was healthy, and making sure the active Immich server could display the migrated assets on the phone.&lt;/p&gt;
&lt;p&gt;This was also how I found that some items from before 2024 had not initially migrated. Seeing a library in the application was not enough; I had to check the timeline and retry the missing material.&lt;/p&gt;
&lt;h2 id=&#34;what-saved-the-photos&#34;&gt;What saved the photos&lt;/h2&gt;
&lt;p&gt;No single part of my setup saved me. Recovery was possible because several imperfect layers overlapped:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the second NAS still held a usable copy of the old Immich installation;&lt;/li&gt;
&lt;li&gt;I had retained the Duplicati encryption passphrase;&lt;/li&gt;
&lt;li&gt;Backblaze B2 contained files that could be restored;&lt;/li&gt;
&lt;li&gt;database backups preserved the structure of the Immich library;&lt;/li&gt;
&lt;li&gt;resumable tools let me continue large transfers after interruptions;&lt;/li&gt;
&lt;li&gt;I did not immediately delete the old sources after the first apparent success.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Any one of those could have been the difference between recovery and permanent loss.&lt;/p&gt;
&lt;h2 id=&#34;what-made-it-harder-than-it-needed-to-be&#34;&gt;What made it harder than it needed to be&lt;/h2&gt;
&lt;p&gt;I also made nearly every classic backup mistake:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I had encrypted replicas without being certain the recovery key was safely stored;&lt;/li&gt;
&lt;li&gt;I had not regularly tested a full restore;&lt;/li&gt;
&lt;li&gt;the backups were spread across different systems and folder structures;&lt;/li&gt;
&lt;li&gt;I was unsure which copy was the newest or most complete;&lt;/li&gt;
&lt;li&gt;the application, database and original media needed to be considered separately;&lt;/li&gt;
&lt;li&gt;my second NAS was usually powered off, so it was not a simple always-current replica;&lt;/li&gt;
&lt;li&gt;cloud download limits slowed recovery at exactly the time I most wanted it to be fast.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The problem was not that I had no backups. The problem was that I did not have a documented, tested recovery path.&lt;/p&gt;
&lt;h2 id=&#34;where-things-stand-now&#34;&gt;Where things stand now&lt;/h2&gt;
&lt;p&gt;The recovered photos have been migrated into the active Immich server. I have fresh database dumps, and I am keeping the restored server and old backup sets untouched until I have finished verification.&lt;/p&gt;
&lt;p&gt;There is also a separate collection of older family photographs recovered from a general Backblaze backup. I do not plan to import all of those into Immich. Instead, I will keep selected originals in a dedicated photos dataset so that an application is not the only way to access them.&lt;/p&gt;
&lt;p&gt;The next job is not glamorous, but it is important:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;verify totals and sample files from different years;&lt;/li&gt;
&lt;li&gt;confirm that original images and videos open, not just thumbnails;&lt;/li&gt;
&lt;li&gt;regenerate missing Immich thumbnails;&lt;/li&gt;
&lt;li&gt;create fresh, automated backups of both the media and database;&lt;/li&gt;
&lt;li&gt;keep an off-site copy;&lt;/li&gt;
&lt;li&gt;store the TrueNAS encryption keys and backup passphrases in more than one safe place;&lt;/li&gt;
&lt;li&gt;document the restore procedure and test it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Only after that will I remove old or inaccessible backup sets.&lt;/p&gt;
&lt;h2 id=&#34;the-lesson&#34;&gt;The lesson&lt;/h2&gt;
&lt;p&gt;Before this happened, I thought of backups mainly as copies. Now I think of them as a recoverable system.&lt;/p&gt;
&lt;p&gt;A backup is not proven because a scheduled job says it completed. It is proven when you can rebuild the service, unlock the data, restore the database, retrieve the original files and confirm that they open.&lt;/p&gt;
&lt;p&gt;I was lucky. I had enough pieces left to reconstruct years of memories, including photographs I had not seen for a long time. The experience was stressful, slow and sometimes confusing, but it has given me a much clearer idea of how I want to protect my family&amp;rsquo;s data in future.&lt;/p&gt;
&lt;p&gt;This article is the first in a series about rebuilding my backup strategy properly. Next I will cover why backups matter, what the 3-2-1 rule actually means for a home server, how to back up Immich&amp;rsquo;s media and database together, and the system I am putting in place so that recovering from the next failure does not depend on luck.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Hello World</title>
      <link>https://samirtech.org/posts/hello-world/</link>
      <pubDate>Sun, 07 May 2023 00:17:50 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/hello-world/</guid>
      <description>The first note on Samirtech.</description>
      <content>&lt;h1 id=&#34;hello-world&#34;&gt;Hello world&lt;/h1&gt;
&lt;h2 id=&#34;welcome-to-my-first-post&#34;&gt;Welcome to my first post&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;bracknell-capitol-building.jpg&#34; alt=&#34;office&#34;&gt;&lt;/p&gt;
&lt;p&gt;I hope to be adding more entries here. Please stay tuned.&lt;/p&gt;
</content>
    </item>
    
  </channel>
</rss>
