<rss
      xmlns:atom="http://www.w3.org/2005/Atom"
      xmlns:media="http://search.yahoo.com/mrss/"
      xmlns:content="http://purl.org/rss/1.0/modules/content/"
      xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      version="2.0"
    >
      <channel>
        <title><![CDATA[COMPILADOS NOSTR]]></title>
        <description><![CDATA[Compilados de artigos, notícias e tutoriais publicados na rede Nostr em português.]]></description>
        <link>https://compilados.npub.pro/tag/raspberrypi/</link>
        <atom:link href="https://compilados.npub.pro/tag/raspberrypi/rss/" rel="self" type="application/rss+xml"/>
        <itunes:new-feed-url>https://compilados.npub.pro/tag/raspberrypi/rss/</itunes:new-feed-url>
        <itunes:author><![CDATA[idsera]]></itunes:author>
        <itunes:subtitle><![CDATA[Compilados de artigos, notícias e tutoriais publicados na rede Nostr em português.]]></itunes:subtitle>
        <itunes:type>episodic</itunes:type>
        <itunes:owner>
          <itunes:name><![CDATA[idsera]]></itunes:name>
          <itunes:email><![CDATA[idsera]]></itunes:email>
        </itunes:owner>
            
      <pubDate>Fri, 02 May 2025 03:50:46 GMT</pubDate>
      <lastBuildDate>Fri, 02 May 2025 03:50:46 GMT</lastBuildDate>
      
      <itunes:image href="https://pfp.nostr.build/d04bb7baa476bbb67c4b0bb02e676d0fb8cd20b809f6956ed68d2adc647b91b1.jpg" />
      <image>
        <title><![CDATA[COMPILADOS NOSTR]]></title>
        <link>https://compilados.npub.pro/tag/raspberrypi/</link>
        <url>https://pfp.nostr.build/d04bb7baa476bbb67c4b0bb02e676d0fb8cd20b809f6956ed68d2adc647b91b1.jpg</url>
      </image>
      <item>
      <title><![CDATA[Surviving the Raspberry Pi ZFS Kernel Trap: From Panic to Recovery]]></title>
      <description><![CDATA[⚠️ ZFS broke after a Raspberry Pi kernel upgrade? Don't reboot yet. Kernel 6.12 + ZFS 2.2.3 = disaster. This guide shows how to recover and avoid it next time.]]></description>
             <itunes:subtitle><![CDATA[⚠️ ZFS broke after a Raspberry Pi kernel upgrade? Don't reboot yet. Kernel 6.12 + ZFS 2.2.3 = disaster. This guide shows how to recover and avoid it next time.]]></itunes:subtitle>
      <pubDate>Fri, 02 May 2025 03:50:46 GMT</pubDate>
      <link>https://compilados.npub.pro/post/1746157452265/</link>
      <comments>https://compilados.npub.pro/post/1746157452265/</comments>
      <guid isPermaLink="false">naddr1qqxnzde5xccn2de5x5eryd34qgsrl7kr5my9n6423nwaktrsq2nwzzenal4e95p9k9826mu294jkv4crqsqqqa28n0u4dt</guid>
      <category>raspberrypi</category>
      
        <media:content url="https://haven.girino.org/dec05be5e34f01d57dc5c4baa2e542af59eeed467d300500d7ac2a724b25dadc.png" medium="image"/>
        <enclosure 
          url="https://haven.girino.org/dec05be5e34f01d57dc5c4baa2e542af59eeed467d300500d7ac2a724b25dadc.png" length="0" 
          type="image/png" 
        />
      <noteId>naddr1qqxnzde5xccn2de5x5eryd34qgsrl7kr5my9n6423nwaktrsq2nwzzenal4e95p9k9826mu294jkv4crqsqqqa28n0u4dt</noteId>
      <npub>npub18lav8fkgt8424rxamvk8qq4xuy9n8mltjtgztv2w44hc5tt9vets0hcfsz</npub>
      <dc:creator><![CDATA[Girino Vey!]]></dc:creator>
      <content:encoded><![CDATA[<p><strong>Introduction: Don't Despair—This Can Be Fixed (But Don't Reboot Yet)</strong></p>
<p>Running ZFS on a Raspberry Pi offers powerful features for home servers and personal NAS setups. But with power comes complexity, and in recent months, a quiet pitfall has emerged for Pi users who track kernel updates closely: upgrading to an unsupported kernel version breaks ZFS.</p>
<blockquote>
<p><strong>⚠️ Important Warning:</strong> If you've just upgraded your kernel and you're using ZFS, <strong>do not reboot</strong> yet. Rebooting without a working ZFS module can leave your system unbootable—even if you don't have critical partitions on ZFS. The system may hang because it tries to load the missing ZFS kernel module during boot and fails, halting the boot process.</p>
</blockquote>
<p>If you're already facing a broken setup or can't boot — don't panic. This guide outlines both the worst-case scenario and the ideal recovery strategy. Whether you're locked out or preparing for a smooth upgrade, we've got you covered.</p>
<hr>
<p><strong>The Problem: A Kernel Update Too Far</strong></p>
<p>As of ZFS version 2.2.3 (used in Debian-based Raspberry Pi OS), the filesystem supports Linux kernels up to <strong>6.7</strong>. However, Raspberry Pi OS backports recently began shipping <strong>6.12.x</strong> kernels. If you upgrade to 6.12 without precautions:</p>
<ul>
<li>ZFS will <strong>fail to compile</strong> against the new kernel</li>
<li>DKMS errors will appear during package updates</li>
<li>Your ZFS module will be missing after reboot</li>
<li>Your Raspberry Pi <strong>may fail to boot</strong>, even without ZFS-mounted root or critical paths, simply due to systemd or boot scripts expecting the kernel module to be present</li>
</ul>
<h3>Example ZFS Compilation Error:</h3>
<p>During package updates or installs, you'll see something like:</p>
<pre><code>checking whether bdev_open_by_path() exists... configure: error:
        *** None of the expected "blkdev_get_by_path()" interfaces were detected.
        *** This may be because your kernel version is newer than what is
        *** supported, or you are using a patched custom kernel with
        *** incompatible modifications.
        ***
        *** ZFS Version: zfs-2.2.3-1~bpo12+1~rpt1
        *** Compatible Kernels: 3.10 - 6.7
</code></pre>
<p>This error means ZFS cannot build its kernel module against Linux 6.12.x, making it unusable.</p>
<h3>Why This Happens: The Version Trap</h3>
<p>The key problem is that <strong>ZFS 2.2.3</strong> remains installed even after a kernel upgrade, and it doesn't get upgraded automatically during <code>apt upgrade</code>. Since ZFS 2.2.3 only supports up to kernel 6.7, it fails to compile against 6.12.x.</p>
<p>However, if you <strong>remove and then reinstall ZFS</strong>, the package manager installs <strong>ZFS 2.3.1</strong>, which does support Linux kernel 6.12.x. This version transition is what resolves the issue — but only if you explicitly purge and reinstall ZFS.</p>
<hr>
<p><strong>Worst Case: The System That Wouldn’t Boot</strong></p>
<p>After upgrading the kernel and rebooting, the system failed to boot properly. It showed errors like:</p>
<blockquote>
<p>cannot open access to console, the root account is locked</p>
</blockquote>
<p>Although the system did not have critical filesystems on ZFS, the boot process still stalled because system services attempted to load the ZFS kernel module, which was no longer available. This resulted in an unrecoverable boot failure.</p>
<p>The only way forward was to <strong>reformat and reinstall</strong> Raspberry Pi OS. However, the default Raspberry Pi OS image still comes with a 6.6.x kernel, which is incompatible with ZFS 2.3.1 and newer kernels unless upgraded. Therefore, the recovery process requires one crucial step:</p>
<ol>
<li><p><strong>First</strong>, perform a full system upgrade:</p>
<pre><code>sudo apt update &amp;&amp; sudo apt full-upgrade
</code></pre>
<p>This brings the kernel up to 6.12.x.</p>
</li>
<li><p><strong>Then</strong>, reinstall ZFS:</p>
<pre><code>sudo apt install zfs-dkms zfsutils-linux
</code></pre>
</li>
</ol>
<p>Once this is complete, your system will be running kernel 6.12 with ZFS 2.3.1, and you can safely import your pools and resume operations.</p>
<hr>
<p><strong>Best Case Recovery: Clean Cut, Clean Upgrade</strong></p>
<p>For users who can still log into their system, here's the cleanest and safest sequence to move forward:</p>
<ol>
<li><p><strong>Stop all services using ZFS</strong>, including Docker, NFS, Samba, backup tools, etc.</p>
</li>
<li><p><strong>Export all ZFS pools</strong>:</p>
<pre><code>sudo zpool export -a
</code></pre>
</li>
<li><p><strong>Disable swap</strong> if it lives on a ZFS vdev:</p>
<pre><code>sudo swapoff /dev/sdXn
</code></pre>
</li>
<li><p><strong>Purge ZFS packages</strong>:</p>
<pre><code>sudo apt purge zfsutils-linux zfs-dkms zfs-zed
sudo rm -rf /usr/src/zfs* /var/lib/dkms/zfs
</code></pre>
</li>
<li><p><strong>Update the kernel</strong> to the desired version:</p>
<pre><code>sudo apt update &amp;&amp; sudo apt full-upgrade
</code></pre>
</li>
<li><p><strong>Reboot into the new kernel</strong>:</p>
<pre><code>sudo reboot
</code></pre>
</li>
<li><p><strong>Reinstall ZFS</strong>:</p>
<pre><code>sudo apt install zfs-dkms zfsutils-linux
</code></pre>
</li>
<li><p><strong>Import your pool(s)</strong>:</p>
<pre><code>sudo zpool import poolname
</code></pre>
</li>
<li><p><strong>Restart services</strong> that depend on ZFS.</p>
</li>
</ol>
<hr>
<p><strong>Final Notes: Prevention Is Better Than Recovery</strong></p>
<p>To avoid this issue in the future:</p>
<ul>
<li><p><strong>Hold your current working kernel version</strong>:</p>
<pre><code>sudo apt-mark hold linux-image-rpi-v8 linux-headers-rpi-v8
</code></pre>
</li>
<li><p>Or track ZFS GitHub for kernel compatibility before upgrading</p>
</li>
<li><p>Or test upgrades on a second Pi or cloned SD card before rolling them out to production</p>
</li>
</ul>
<hr>
<p><strong>Conclusion: A Solvable Trap</strong></p>
<p>ZFS on the Raspberry Pi remains a powerful option, but it demands careful version tracking. If you upgrade responsibly, or recover cleanly as described above, you can continue benefiting from advanced features like snapshots, send/receive, and compression even on this tiny powerhouse.</p>
<p>Don’t let a kernel update ruin your storage plans—with preparation, the Pi + ZFS combo can remain stable and strong.</p>
]]></content:encoded>
      <itunes:author><![CDATA[Girino Vey!]]></itunes:author>
      <itunes:summary><![CDATA[<p><strong>Introduction: Don't Despair—This Can Be Fixed (But Don't Reboot Yet)</strong></p>
<p>Running ZFS on a Raspberry Pi offers powerful features for home servers and personal NAS setups. But with power comes complexity, and in recent months, a quiet pitfall has emerged for Pi users who track kernel updates closely: upgrading to an unsupported kernel version breaks ZFS.</p>
<blockquote>
<p><strong>⚠️ Important Warning:</strong> If you've just upgraded your kernel and you're using ZFS, <strong>do not reboot</strong> yet. Rebooting without a working ZFS module can leave your system unbootable—even if you don't have critical partitions on ZFS. The system may hang because it tries to load the missing ZFS kernel module during boot and fails, halting the boot process.</p>
</blockquote>
<p>If you're already facing a broken setup or can't boot — don't panic. This guide outlines both the worst-case scenario and the ideal recovery strategy. Whether you're locked out or preparing for a smooth upgrade, we've got you covered.</p>
<hr>
<p><strong>The Problem: A Kernel Update Too Far</strong></p>
<p>As of ZFS version 2.2.3 (used in Debian-based Raspberry Pi OS), the filesystem supports Linux kernels up to <strong>6.7</strong>. However, Raspberry Pi OS backports recently began shipping <strong>6.12.x</strong> kernels. If you upgrade to 6.12 without precautions:</p>
<ul>
<li>ZFS will <strong>fail to compile</strong> against the new kernel</li>
<li>DKMS errors will appear during package updates</li>
<li>Your ZFS module will be missing after reboot</li>
<li>Your Raspberry Pi <strong>may fail to boot</strong>, even without ZFS-mounted root or critical paths, simply due to systemd or boot scripts expecting the kernel module to be present</li>
</ul>
<h3>Example ZFS Compilation Error:</h3>
<p>During package updates or installs, you'll see something like:</p>
<pre><code>checking whether bdev_open_by_path() exists... configure: error:
        *** None of the expected "blkdev_get_by_path()" interfaces were detected.
        *** This may be because your kernel version is newer than what is
        *** supported, or you are using a patched custom kernel with
        *** incompatible modifications.
        ***
        *** ZFS Version: zfs-2.2.3-1~bpo12+1~rpt1
        *** Compatible Kernels: 3.10 - 6.7
</code></pre>
<p>This error means ZFS cannot build its kernel module against Linux 6.12.x, making it unusable.</p>
<h3>Why This Happens: The Version Trap</h3>
<p>The key problem is that <strong>ZFS 2.2.3</strong> remains installed even after a kernel upgrade, and it doesn't get upgraded automatically during <code>apt upgrade</code>. Since ZFS 2.2.3 only supports up to kernel 6.7, it fails to compile against 6.12.x.</p>
<p>However, if you <strong>remove and then reinstall ZFS</strong>, the package manager installs <strong>ZFS 2.3.1</strong>, which does support Linux kernel 6.12.x. This version transition is what resolves the issue — but only if you explicitly purge and reinstall ZFS.</p>
<hr>
<p><strong>Worst Case: The System That Wouldn’t Boot</strong></p>
<p>After upgrading the kernel and rebooting, the system failed to boot properly. It showed errors like:</p>
<blockquote>
<p>cannot open access to console, the root account is locked</p>
</blockquote>
<p>Although the system did not have critical filesystems on ZFS, the boot process still stalled because system services attempted to load the ZFS kernel module, which was no longer available. This resulted in an unrecoverable boot failure.</p>
<p>The only way forward was to <strong>reformat and reinstall</strong> Raspberry Pi OS. However, the default Raspberry Pi OS image still comes with a 6.6.x kernel, which is incompatible with ZFS 2.3.1 and newer kernels unless upgraded. Therefore, the recovery process requires one crucial step:</p>
<ol>
<li><p><strong>First</strong>, perform a full system upgrade:</p>
<pre><code>sudo apt update &amp;&amp; sudo apt full-upgrade
</code></pre>
<p>This brings the kernel up to 6.12.x.</p>
</li>
<li><p><strong>Then</strong>, reinstall ZFS:</p>
<pre><code>sudo apt install zfs-dkms zfsutils-linux
</code></pre>
</li>
</ol>
<p>Once this is complete, your system will be running kernel 6.12 with ZFS 2.3.1, and you can safely import your pools and resume operations.</p>
<hr>
<p><strong>Best Case Recovery: Clean Cut, Clean Upgrade</strong></p>
<p>For users who can still log into their system, here's the cleanest and safest sequence to move forward:</p>
<ol>
<li><p><strong>Stop all services using ZFS</strong>, including Docker, NFS, Samba, backup tools, etc.</p>
</li>
<li><p><strong>Export all ZFS pools</strong>:</p>
<pre><code>sudo zpool export -a
</code></pre>
</li>
<li><p><strong>Disable swap</strong> if it lives on a ZFS vdev:</p>
<pre><code>sudo swapoff /dev/sdXn
</code></pre>
</li>
<li><p><strong>Purge ZFS packages</strong>:</p>
<pre><code>sudo apt purge zfsutils-linux zfs-dkms zfs-zed
sudo rm -rf /usr/src/zfs* /var/lib/dkms/zfs
</code></pre>
</li>
<li><p><strong>Update the kernel</strong> to the desired version:</p>
<pre><code>sudo apt update &amp;&amp; sudo apt full-upgrade
</code></pre>
</li>
<li><p><strong>Reboot into the new kernel</strong>:</p>
<pre><code>sudo reboot
</code></pre>
</li>
<li><p><strong>Reinstall ZFS</strong>:</p>
<pre><code>sudo apt install zfs-dkms zfsutils-linux
</code></pre>
</li>
<li><p><strong>Import your pool(s)</strong>:</p>
<pre><code>sudo zpool import poolname
</code></pre>
</li>
<li><p><strong>Restart services</strong> that depend on ZFS.</p>
</li>
</ol>
<hr>
<p><strong>Final Notes: Prevention Is Better Than Recovery</strong></p>
<p>To avoid this issue in the future:</p>
<ul>
<li><p><strong>Hold your current working kernel version</strong>:</p>
<pre><code>sudo apt-mark hold linux-image-rpi-v8 linux-headers-rpi-v8
</code></pre>
</li>
<li><p>Or track ZFS GitHub for kernel compatibility before upgrading</p>
</li>
<li><p>Or test upgrades on a second Pi or cloned SD card before rolling them out to production</p>
</li>
</ul>
<hr>
<p><strong>Conclusion: A Solvable Trap</strong></p>
<p>ZFS on the Raspberry Pi remains a powerful option, but it demands careful version tracking. If you upgrade responsibly, or recover cleanly as described above, you can continue benefiting from advanced features like snapshots, send/receive, and compression even on this tiny powerhouse.</p>
<p>Don’t let a kernel update ruin your storage plans—with preparation, the Pi + ZFS combo can remain stable and strong.</p>
]]></itunes:summary>
      <itunes:image href="https://haven.girino.org/dec05be5e34f01d57dc5c4baa2e542af59eeed467d300500d7ac2a724b25dadc.png"/>
      </item>
      
      <item>
      <title><![CDATA[🛡️ Running a Secure Lightning Node on Raspberry Pi 5]]></title>
      <description><![CDATA[This guide explains how to build a secure, privacy-respecting Bitcoin and Lightning Network node on a Raspberry Pi 5. Using Docker, ZFS, Tor, I2P, and Cloudflare Tunnel, you’ll achieve strong isolation, encrypted communication, and controlled public access.]]></description>
             <itunes:subtitle><![CDATA[This guide explains how to build a secure, privacy-respecting Bitcoin and Lightning Network node on a Raspberry Pi 5. Using Docker, ZFS, Tor, I2P, and Cloudflare Tunnel, you’ll achieve strong isolation, encrypted communication, and controlled public access.]]></itunes:subtitle>
      <pubDate>Wed, 23 Apr 2025 01:57:53 GMT</pubDate>
      <link>https://compilados.npub.pro/post/1745372780948/</link>
      <comments>https://compilados.npub.pro/post/1745372780948/</comments>
      <guid isPermaLink="false">naddr1qqxnzde5x5enwv3h8qcrjdpcqgsrl7kr5my9n6423nwaktrsq2nwzzenal4e95p9k9826mu294jkv4crqsqqqa28hzgv35</guid>
      <category>Bitcoin</category>
      
        <media:content url=" https://haven.girino.org/3cd2c25c6e227d0ac0c69e73b4112aeccc3dc8a8782543895e167b9cf2412126.png" medium="image"/>
        <enclosure 
          url=" https://haven.girino.org/3cd2c25c6e227d0ac0c69e73b4112aeccc3dc8a8782543895e167b9cf2412126.png" length="0" 
          type="image/png" 
        />
      <noteId>naddr1qqxnzde5x5enwv3h8qcrjdpcqgsrl7kr5my9n6423nwaktrsq2nwzzenal4e95p9k9826mu294jkv4crqsqqqa28hzgv35</noteId>
      <npub>npub18lav8fkgt8424rxamvk8qq4xuy9n8mltjtgztv2w44hc5tt9vets0hcfsz</npub>
      <dc:creator><![CDATA[Girino Vey!]]></dc:creator>
      <content:encoded><![CDATA[<h2>🔧 Infrastructure Overview</h2>
<ul>
<li><strong>Hardware</strong>: Raspberry Pi 5 with PCIe NVMe HAT and 2TB NVMe SSD</li>
<li><strong>Filesystem</strong>: ZFS with separate datasets for each service</li>
<li><strong>Networking</strong>: Docker bridge networks for service segmentation</li>
<li><strong>Privacy</strong>: Tor and I2P routing for anonymous communication</li>
<li><strong>Public Access</strong>: Cloudflare Tunnel to securely expose LNbits</li>
</ul>
<h2>📊 Architecture Diagram</h2>
<p><img src="https://haven.girino.org/56ccad7f49c6c9b73bf1377277cef91a3e5f09bc1ff1bbe7eef0c686a2b7cd31.png" alt="Architecture Diagram"></p>
<h2>🛠️ Setup Steps</h2>
<h3>1. Prepare the System</h3>
<ul>
<li>Install Raspberry Pi OS (64-bit)</li>
<li>Set up ZFS on the NVMe disk</li>
<li>Create a ZFS dataset for each service (e.g., <code>bitcoin</code>, <code>lnd</code>, <code>rtl</code>, <code>lnbits</code>, <code>tor-data</code>)</li>
<li>Install Docker and Docker Compose</li>
</ul>
<h3>2. Create Shared Docker Network and Privacy Layers</h3>
<p>Create a shared Docker bridge network:</p>
<pre><code class="language-bash">docker network create \
  --driver=bridge \
  --subnet=192.168.100.0/24 \
  bitcoin-net
</code></pre>
<blockquote>
<p><strong>Note:</strong> Connect <code>bitcoind</code>, <code>lnd</code>, <code>rtl</code>, internal <code>lnbits</code>, <code>tor</code>, and <code>i2p</code> to this <code>bitcoin-net</code> network.</p>
</blockquote>
<h4>Tor</h4>
<ul>
<li>Run Tor in a container</li>
<li>Configure it to expose LND's gRPC and REST ports via hidden services:<pre><code>HiddenServicePort 10009 192.168.100.31:10009
HiddenServicePort 8080  192.168.100.31:8080
</code></pre>
</li>
<li>Set correct permissions:<pre><code class="language-bash">sudo chown -R 102:102 /zfs/datasets/tor-data
</code></pre>
</li>
</ul>
<h4>I2P</h4>
<ul>
<li>Run I2P in a container with SAM and SOCKS proxies</li>
<li>Update <code>bitcoin.conf</code>:<pre><code>i2psam=192.168.100.20:7656
i2pacceptincoming=1
</code></pre>
</li>
</ul>
<h3>3. Set Up Bitcoin Core</h3>
<ul>
<li>Create a <code>bitcoin.conf</code> with Tor/I2P/proxy settings and ZMQ enabled</li>
<li>Sync the blockchain in a container using its ZFS dataset</li>
</ul>
<h3>4. Set Up LND</h3>
<ul>
<li>Configure <code>lnd.conf</code> to connect to <code>bitcoind</code> and use Tor:<pre><code class="language-ini">[Bitcoind]
bitcoind.rpchost=bitcoin:8332
bitcoind.rpcuser=bitcoin
bitcoind.rpcpass=very-hard-password
bitcoind.zmqpubrawblock=tcp://bitcoin:28332
bitcoind.zmqpubrawtx=tcp://bitcoin:28333

[Application Options]
externalip=xxxxxxxx.onion
</code></pre>
</li>
<li>Don’t expose gRPC or REST ports publicly</li>
<li>Mount the ZFS dataset at <code>/root/.lnd</code></li>
<li>Optionally enable Watchtower</li>
</ul>
<h3>5. Set Up RTL</h3>
<ul>
<li>Mount <code>RTL-Config.json</code> and data volumes</li>
<li>Expose RTL's web interface locally:<pre><code class="language-yaml">ports:
  - "3000:3000"
</code></pre>
</li>
</ul>
<h3>6. Set Up Internal LNbits</h3>
<ul>
<li>Connect the LNbits container to <code>bitcoin-net</code></li>
<li>Mount the data directory and LND cert/macaroons (read-only)</li>
<li>Expose the LNbits UI on the local network:<pre><code class="language-yaml">ports:
  - "5000:5000"
</code></pre>
</li>
<li>In the web UI, configure the funding source to point to the LND REST <code>.onion</code> address and paste the hex macaroon</li>
<li>Create and fund a wallet, and copy its Admin Key for external use</li>
</ul>
<h3>7. Set Up External LNbits + Cloudflare Tunnel</h3>
<ul>
<li>Run another LNbits container on a separate Docker network</li>
<li>Access the internal LNbits via the host IP and port 5000</li>
<li>Use the Admin Key from the internal wallet to configure funding</li>
<li>In the Cloudflare Zero Trust dashboard:<ul>
<li>Create a tunnel</li>
<li>Select Docker, copy the <code>--token</code> command</li>
<li>Add to Docker Compose:<pre><code class="language-yaml">command: tunnel --no-autoupdate run --token eyJ...your_token...
</code></pre>
</li>
</ul>
</li>
</ul>
<h2>💾 Backup Strategy</h2>
<ul>
<li><strong>Bitcoin Core</strong>: hourly ZFS snapshots, retained for 6 hours</li>
<li><strong>Other Services</strong>: hourly snapshots with remote <code>.tar.gz</code> backups<ul>
<li>Retention: 7d hourly, 30d daily, 12mo weekly, monthly forever</li>
</ul>
</li>
<li>Back up ZFS snapshots to avoid inconsistencies</li>
</ul>
<h2>🔐 Security Isolation Benefits</h2>
<p>This architecture isolates services by scope and function:</p>
<ul>
<li>Internal traffic stays on <code>bitcoin-net</code></li>
<li>Sensitive APIs (gRPC, REST) are reachable only via Tor</li>
<li>Public access is controlled by Cloudflare Tunnel</li>
</ul>
<blockquote>
<p><strong>Extra Security</strong>: Host the public LNbits on a separate machine (e.g., hardened VPS) with strict firewall rules:</p>
<ul>
<li>Allow only Cloudflare egress</li>
<li>Allow ingress from your local IP</li>
<li>Allow outbound access to internal LNbits (port 5000)</li>
</ul>
</blockquote>
<p>Use <strong>WireGuard VPN</strong> to secure the connection between external and internal LNbits:</p>
<ul>
<li>Ensures encrypted communication</li>
<li>Restricts access to authenticated VPN peers</li>
<li>Keeps the internal interface isolated from the public internet</li>
</ul>
<h2>✅ Final Notes</h2>
<ul>
<li>Internal services communicate over <code>bitcoin-net</code></li>
<li>LND interfaces are accessed via Tor only</li>
<li>LNbits and RTL UIs are locally accessible</li>
<li>Cloudflare Tunnel secures external access to LNbits</li>
</ul>
<p>Monitor system health using <code>monit</code>, <code>watchtower</code>, or Prometheus.</p>
<p>Create all configuration files manually (<code>bitcoin.conf</code>, <code>lnd.conf</code>, <code>RTL-Config.json</code>), and keep credentials secure. Test every component locally before exposing it externally.</p>
<p>⚡</p>
]]></content:encoded>
      <itunes:author><![CDATA[Girino Vey!]]></itunes:author>
      <itunes:summary><![CDATA[<h2>🔧 Infrastructure Overview</h2>
<ul>
<li><strong>Hardware</strong>: Raspberry Pi 5 with PCIe NVMe HAT and 2TB NVMe SSD</li>
<li><strong>Filesystem</strong>: ZFS with separate datasets for each service</li>
<li><strong>Networking</strong>: Docker bridge networks for service segmentation</li>
<li><strong>Privacy</strong>: Tor and I2P routing for anonymous communication</li>
<li><strong>Public Access</strong>: Cloudflare Tunnel to securely expose LNbits</li>
</ul>
<h2>📊 Architecture Diagram</h2>
<p><img src="https://haven.girino.org/56ccad7f49c6c9b73bf1377277cef91a3e5f09bc1ff1bbe7eef0c686a2b7cd31.png" alt="Architecture Diagram"></p>
<h2>🛠️ Setup Steps</h2>
<h3>1. Prepare the System</h3>
<ul>
<li>Install Raspberry Pi OS (64-bit)</li>
<li>Set up ZFS on the NVMe disk</li>
<li>Create a ZFS dataset for each service (e.g., <code>bitcoin</code>, <code>lnd</code>, <code>rtl</code>, <code>lnbits</code>, <code>tor-data</code>)</li>
<li>Install Docker and Docker Compose</li>
</ul>
<h3>2. Create Shared Docker Network and Privacy Layers</h3>
<p>Create a shared Docker bridge network:</p>
<pre><code class="language-bash">docker network create \
  --driver=bridge \
  --subnet=192.168.100.0/24 \
  bitcoin-net
</code></pre>
<blockquote>
<p><strong>Note:</strong> Connect <code>bitcoind</code>, <code>lnd</code>, <code>rtl</code>, internal <code>lnbits</code>, <code>tor</code>, and <code>i2p</code> to this <code>bitcoin-net</code> network.</p>
</blockquote>
<h4>Tor</h4>
<ul>
<li>Run Tor in a container</li>
<li>Configure it to expose LND's gRPC and REST ports via hidden services:<pre><code>HiddenServicePort 10009 192.168.100.31:10009
HiddenServicePort 8080  192.168.100.31:8080
</code></pre>
</li>
<li>Set correct permissions:<pre><code class="language-bash">sudo chown -R 102:102 /zfs/datasets/tor-data
</code></pre>
</li>
</ul>
<h4>I2P</h4>
<ul>
<li>Run I2P in a container with SAM and SOCKS proxies</li>
<li>Update <code>bitcoin.conf</code>:<pre><code>i2psam=192.168.100.20:7656
i2pacceptincoming=1
</code></pre>
</li>
</ul>
<h3>3. Set Up Bitcoin Core</h3>
<ul>
<li>Create a <code>bitcoin.conf</code> with Tor/I2P/proxy settings and ZMQ enabled</li>
<li>Sync the blockchain in a container using its ZFS dataset</li>
</ul>
<h3>4. Set Up LND</h3>
<ul>
<li>Configure <code>lnd.conf</code> to connect to <code>bitcoind</code> and use Tor:<pre><code class="language-ini">[Bitcoind]
bitcoind.rpchost=bitcoin:8332
bitcoind.rpcuser=bitcoin
bitcoind.rpcpass=very-hard-password
bitcoind.zmqpubrawblock=tcp://bitcoin:28332
bitcoind.zmqpubrawtx=tcp://bitcoin:28333

[Application Options]
externalip=xxxxxxxx.onion
</code></pre>
</li>
<li>Don’t expose gRPC or REST ports publicly</li>
<li>Mount the ZFS dataset at <code>/root/.lnd</code></li>
<li>Optionally enable Watchtower</li>
</ul>
<h3>5. Set Up RTL</h3>
<ul>
<li>Mount <code>RTL-Config.json</code> and data volumes</li>
<li>Expose RTL's web interface locally:<pre><code class="language-yaml">ports:
  - "3000:3000"
</code></pre>
</li>
</ul>
<h3>6. Set Up Internal LNbits</h3>
<ul>
<li>Connect the LNbits container to <code>bitcoin-net</code></li>
<li>Mount the data directory and LND cert/macaroons (read-only)</li>
<li>Expose the LNbits UI on the local network:<pre><code class="language-yaml">ports:
  - "5000:5000"
</code></pre>
</li>
<li>In the web UI, configure the funding source to point to the LND REST <code>.onion</code> address and paste the hex macaroon</li>
<li>Create and fund a wallet, and copy its Admin Key for external use</li>
</ul>
<h3>7. Set Up External LNbits + Cloudflare Tunnel</h3>
<ul>
<li>Run another LNbits container on a separate Docker network</li>
<li>Access the internal LNbits via the host IP and port 5000</li>
<li>Use the Admin Key from the internal wallet to configure funding</li>
<li>In the Cloudflare Zero Trust dashboard:<ul>
<li>Create a tunnel</li>
<li>Select Docker, copy the <code>--token</code> command</li>
<li>Add to Docker Compose:<pre><code class="language-yaml">command: tunnel --no-autoupdate run --token eyJ...your_token...
</code></pre>
</li>
</ul>
</li>
</ul>
<h2>💾 Backup Strategy</h2>
<ul>
<li><strong>Bitcoin Core</strong>: hourly ZFS snapshots, retained for 6 hours</li>
<li><strong>Other Services</strong>: hourly snapshots with remote <code>.tar.gz</code> backups<ul>
<li>Retention: 7d hourly, 30d daily, 12mo weekly, monthly forever</li>
</ul>
</li>
<li>Back up ZFS snapshots to avoid inconsistencies</li>
</ul>
<h2>🔐 Security Isolation Benefits</h2>
<p>This architecture isolates services by scope and function:</p>
<ul>
<li>Internal traffic stays on <code>bitcoin-net</code></li>
<li>Sensitive APIs (gRPC, REST) are reachable only via Tor</li>
<li>Public access is controlled by Cloudflare Tunnel</li>
</ul>
<blockquote>
<p><strong>Extra Security</strong>: Host the public LNbits on a separate machine (e.g., hardened VPS) with strict firewall rules:</p>
<ul>
<li>Allow only Cloudflare egress</li>
<li>Allow ingress from your local IP</li>
<li>Allow outbound access to internal LNbits (port 5000)</li>
</ul>
</blockquote>
<p>Use <strong>WireGuard VPN</strong> to secure the connection between external and internal LNbits:</p>
<ul>
<li>Ensures encrypted communication</li>
<li>Restricts access to authenticated VPN peers</li>
<li>Keeps the internal interface isolated from the public internet</li>
</ul>
<h2>✅ Final Notes</h2>
<ul>
<li>Internal services communicate over <code>bitcoin-net</code></li>
<li>LND interfaces are accessed via Tor only</li>
<li>LNbits and RTL UIs are locally accessible</li>
<li>Cloudflare Tunnel secures external access to LNbits</li>
</ul>
<p>Monitor system health using <code>monit</code>, <code>watchtower</code>, or Prometheus.</p>
<p>Create all configuration files manually (<code>bitcoin.conf</code>, <code>lnd.conf</code>, <code>RTL-Config.json</code>), and keep credentials secure. Test every component locally before exposing it externally.</p>
<p>⚡</p>
]]></itunes:summary>
      <itunes:image href=" https://haven.girino.org/3cd2c25c6e227d0ac0c69e73b4112aeccc3dc8a8782543895e167b9cf2412126.png"/>
      </item>
      
      </channel>
      </rss>
    