<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>criticalbasics</title>
      <link>https://criticalbasics.xyz</link>
      <description>Retro is now!</description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://criticalbasics.xyz/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Mon, 04 May 2026 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Dark&#x2F;Light-Mode Switcher for Arch Linux + i3wm</title>
          <pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/i3-dark-light-mode-switcher/</link>
          <guid>https://criticalbasics.xyz/posts/i3-dark-light-mode-switcher/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/i3-dark-light-mode-switcher/">&lt;p&gt;Welcome to this detailed guide showing you how to set up an effective Dark&#x2F;Light-Mode switcher for your Arch Linux system with i3wm. In a world where most applications have their own theming logic, we will build an orchestration solution that controls many components simultaneously to create a consistent experience.&lt;&#x2F;p&gt;
&lt;p&gt;We will integrate GTK, Qt, terminal, and even CLI applications into our theme switcher, all controlled by a single keypress.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-05-04&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Comprehensive guide for Dark&#x2F;Light-Mode switching on Arch Linux and i3wm.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;architectural-overview&quot;&gt;Architectural Overview&lt;&#x2F;h2&gt;
&lt;p&gt;i3wm itself does not provide global theme management. Styling is handled by various components such as GTK, Qt, Xresources, and individual applications. Our solution is based on an &lt;strong&gt;orchestrator architecture&lt;&#x2F;strong&gt; that uses &lt;code&gt;darkman&lt;&#x2F;code&gt; as the central control unit.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;darkman&lt;&#x2F;code&gt; performs two main tasks:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;It executes your customized hook scripts, which adapt specific applications and environments.&lt;&#x2F;li&gt;
&lt;li&gt;It propagates the dark mode status via the XDG-Desktop-Portal to modern applications (e.g., Firefox, Thunderbird), which then switch their theme without needing a restart.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$mod+Shift+d  →  darkman toggle  →  Hook Scripts  →  Individual Apps&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                       │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                       └──► XDG-Portal (Firefox, Thunderbird, etc. via Signal)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;quickstart-copy-paste&quot;&gt;Quickstart (Copy &amp;amp; Paste)&lt;&#x2F;h2&gt;
&lt;p&gt;If you just want a minimal, working setup — GTK + Firefox + i3 + Alacritty controlled by &lt;code&gt;$mod+Shift+d&lt;&#x2F;code&gt; — follow this Quickstart. You can extend with Polybar, VSCodium, neomutt, and Qt apps later by following the full guide below.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Install prerequisites&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; darkman xdg-desktop-portal xdg-desktop-portal-gtk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;               jq libnotify alacritty&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;yay&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dracula-gtk-theme&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;   # or fall back to Adwaita-dark (handled by hook)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Create directory layout&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;         ~&#x2F;.local&#x2F;share&#x2F;light-mode.d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;         ~&#x2F;.config&#x2F;themes&#x2F;{dracula,solarized-light}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;         ~&#x2F;.config&#x2F;alacritty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;         ~&#x2F;.config&#x2F;xdg-desktop-portal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Tell xdg-desktop-portal to use darkman as the Settings backend.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#    REQUIRED since xdg-desktop-portal 1.17.0 — without this, Firefox &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#    other portal-aware apps will not see darkman&amp;#39;s color-scheme.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;xdg-desktop-portal&#x2F;portals.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[preferred]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;org.freedesktop.impl.portal.Settings=darkman&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 4. Pull terminal theme files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;dracula&#x2F;alacritty&#x2F;master&#x2F;dracula.toml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&#x2F;alacritty.toml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;alacritty&#x2F;alacritty-theme&#x2F;master&#x2F;themes&#x2F;solarized_light.toml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;solarized-light&#x2F;alacritty.toml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 5. Wire up i3 (idempotent — safe to run twice)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;bindsym &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;mod+Shift+d exec --no-startup-id darkman toggle&amp;quot; ~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;bindsym $mod+Shift+d exec --no-startup-id darkman toggle&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;include ~&#x2F;.config&#x2F;i3&#x2F;theme.conf&amp;quot; ~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;include ~&#x2F;.config&#x2F;i3&#x2F;theme.conf&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 6. Enable the service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;systemctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --user&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; enable&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --now&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; darkman.service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 7. Quick smoke test&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#    Note: these only have a *visible* effect after you create the&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#    hook scripts in Steps 7 &amp;amp; 8. Until then darkman just flips an&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#    internal flag — nothing recolors yet.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;darkman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; get&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;      # current mode&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;darkman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; toggle&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;   # switch without using the keybinding&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then create the i3 theme stubs and the hook scripts as described in &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#step-7-the-dark-mode-hook-script&quot;&gt;Step 7&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#step-8-the-light-mode-hook-script&quot;&gt;Step 8&lt;&#x2F;a&gt;. After that, &lt;code&gt;$mod+Shift+d&lt;&#x2F;code&gt; should already give you a working basic switch.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Expected result after the Quickstart + minimal hooks:&lt;&#x2F;strong&gt; Pressing &lt;code&gt;$mod+Shift+d&lt;&#x2F;code&gt; (or running &lt;code&gt;darkman toggle&lt;&#x2F;code&gt;) should immediately recolor i3 borders, switch the Alacritty theme without restarting the terminal, and — if Firefox is open with &lt;code&gt;widget.use-xdg-desktop-portal.settings = 1&lt;&#x2F;code&gt; set in &lt;code&gt;about:config&lt;&#x2F;code&gt; — flip Firefox’s UI between light and dark. If any of these don’t react, see the &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#reality-check-verify-persistence&quot;&gt;Reality Check&lt;&#x2F;a&gt; section.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;recommended-approach-set-up-step-by-step&quot;&gt;Recommended Approach: Set up Step-by-Step&lt;&#x2F;h2&gt;
&lt;p&gt;To avoid frustration and facilitate troubleshooting, you should approach the setup in phases. This way, you’ll always know which component is responsible for problems.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Phase 1 — Basic:&lt;&#x2F;strong&gt; &lt;code&gt;darkman&lt;&#x2F;code&gt; + GTK + Firefox&#x2F;Thunderbird + i3 + Alacritty. These components are reliable and cover the majority of the visual interface.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Phase 2 — Extension:&lt;&#x2F;strong&gt; Polybar + VSCodium + neomutt. This requires a bit more configuration, but the functionality is stable.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Phase 3 — Problem Children:&lt;&#x2F;strong&gt; Qt apps (KeePassXC, nheko), Chromium, urxvt live-reload. These applications can present app-specific challenges and should be tested separately.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Follow this tutorial linearly and test the functionality after each phase before moving on to the next.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;theme-choice-dracula-solarized-light&quot;&gt;Theme Choice: Dracula ↔ Solarized Light&lt;&#x2F;h2&gt;
&lt;p&gt;For dark mode, we will use &lt;strong&gt;Dracula&lt;&#x2F;strong&gt;, a popular and well-supported theme. For the light mode counterpart, several options are available:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Solarized Light:&lt;&#x2F;strong&gt; A classic with well-documented color palettes for many tools, known for its good readability.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Catppuccin Latte:&lt;&#x2F;strong&gt; A modern alternative that aesthetically complements Catppuccin Mocha (if you decide to replace Dracula later).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;GitHub Light:&lt;&#x2F;strong&gt; A pragmatic choice, as many editor themes and browser extensions are available for it.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This guide will use the &lt;strong&gt;Dracula ↔ Solarized Light&lt;&#x2F;strong&gt; pair.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;migrating-from-a-hand-themed-setup&quot;&gt;Migrating from a hand-themed setup&lt;&#x2F;h2&gt;
&lt;p&gt;If you’ve already painstakingly themed each application by hand, read this section before running any of the hook scripts. The hooks are designed for a setup built &lt;em&gt;with&lt;&#x2F;em&gt; darkman in mind — applied to an existing setup, they will overwrite or symlink-replace several files without asking.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-the-hooks-will-overwrite-destructive&quot;&gt;What the hooks will overwrite (destructive)&lt;&#x2F;h3&gt;
&lt;p&gt;These files are rewritten in full on every toggle:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;gtk-3.0&#x2F;settings.ini&lt;&#x2F;code&gt; and &lt;code&gt;~&#x2F;.config&#x2F;gtk-4.0&#x2F;settings.ini&lt;&#x2F;code&gt; — replaced via &lt;code&gt;cat &amp;gt; ... &amp;lt;&amp;lt;EOF&lt;&#x2F;code&gt;. Any custom keys you have here (cursor theme, font name, dconf-style overrides) will be lost on first toggle.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;qt5ct&#x2F;qt5ct.conf&lt;&#x2F;code&gt;, &lt;code&gt;~&#x2F;.config&#x2F;qt6ct&#x2F;qt6ct.conf&lt;&#x2F;code&gt; — only the &lt;code&gt;color_scheme_path&lt;&#x2F;code&gt; line is rewritten via &lt;code&gt;sed&lt;&#x2F;code&gt;. The rest of the file is preserved.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;VSCodium&#x2F;User&#x2F;settings.json&lt;&#x2F;code&gt; — only the &lt;code&gt;workbench.colorTheme&lt;&#x2F;code&gt; key is updated via &lt;code&gt;jq&lt;&#x2F;code&gt;. &lt;strong&gt;Caveat:&lt;&#x2F;strong&gt; if your settings.json contains JSONC-style comments, &lt;code&gt;jq&lt;&#x2F;code&gt; will strip them.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;what-the-hooks-will-replace-via-symlink-non-destructive-but-pathing-changes&quot;&gt;What the hooks will replace via symlink (non-destructive but pathing changes)&lt;&#x2F;h3&gt;
&lt;p&gt;These paths become symlinks pointing into &lt;code&gt;~&#x2F;.config&#x2F;themes&#x2F;&amp;lt;theme&amp;gt;&#x2F;&lt;&#x2F;code&gt;. If a real file exists at the path, the symlink replaces it (the original file stays where it was, but is no longer reachable through the original path):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.Xresources&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;i3&#x2F;theme.conf&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;alacritty&#x2F;theme.toml&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;polybar&#x2F;config.ini&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;colors&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;nvim&#x2F;colorscheme.vim&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;what-is-changed-system-wide-via-gsettings&quot;&gt;What is changed system-wide via gsettings&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;code&gt;org.gnome.desktop.interface gtk-theme&lt;&#x2F;code&gt; and &lt;code&gt;color-scheme&lt;&#x2F;code&gt; — affects every GTK app on your system that reads gsettings, regardless of whether you intended to theme it through darkman.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-is-not-touched&quot;&gt;What is NOT touched&lt;&#x2F;h3&gt;
&lt;p&gt;Your main configuration files (&lt;code&gt;~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;code&gt;, &lt;code&gt;~&#x2F;.config&#x2F;alacritty&#x2F;alacritty.toml&lt;&#x2F;code&gt;, your Polybar bar layout, your &lt;code&gt;.muttrc&lt;&#x2F;code&gt;, your Neovim init, your shell rc files, Firefox&#x2F;Chromium profiles) are only &lt;em&gt;referenced&lt;&#x2F;em&gt; via &lt;code&gt;include&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;import&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;source&lt;&#x2F;code&gt; lines. They stay where they are.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;recommended-snapshot-before-the-first-toggle&quot;&gt;Recommended: snapshot before the first toggle&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;theme-switcher-backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ~&#x2F;.config&#x2F;gtk-3.0&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ~&#x2F;.config&#x2F;gtk-4.0&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ~&#x2F;.config&#x2F;qt5ct&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ~&#x2F;.config&#x2F;qt6ct&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ~&#x2F;.Xresources&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ~&#x2F;.config&#x2F;VSCodium&#x2F;User&#x2F;settings.json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]] &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; ~&#x2F;theme-switcher-backup&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After the first toggle, diff what changed:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;diff&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;theme-switcher-backup&#x2F;gtk-3.0 ~&#x2F;.config&#x2F;gtk-3.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you find that lines you cared about were lost, &lt;strong&gt;the right fix is not to protect your old config but to teach the hooks about your custom keys&lt;&#x2F;strong&gt; — open the hook scripts in &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#step-7-the-dark-mode-hook-script&quot;&gt;Step 7&lt;&#x2F;a&gt; and &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#step-8-the-light-mode-hook-script&quot;&gt;Step 8&lt;&#x2F;a&gt; and add your custom lines into the &lt;code&gt;cat &amp;gt; settings.ini &amp;lt;&amp;lt;EOF&lt;&#x2F;code&gt; blocks. Same logic applies to qt5ct, VSCodium, etc.: extend the hook, don’t fight it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-1-install-prerequisites&quot;&gt;Step 1: Install Prerequisites&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;darkman-and-portal-infrastructure&quot;&gt;&lt;code&gt;darkman&lt;&#x2F;code&gt; and Portal Infrastructure&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; darkman xdg-desktop-portal xdg-desktop-portal-gtk jq libnotify&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;systemctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --user&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; enable&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --now&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; darkman.service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;jq&lt;&#x2F;code&gt; is needed for patching VSCodium settings.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;libnotify&lt;&#x2F;code&gt; enables notifications via &lt;code&gt;notify-send&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;configure-xdg-desktop-portal-to-use-darkman-required&quot;&gt;Configure xdg-desktop-portal to use darkman (REQUIRED)&lt;&#x2F;h3&gt;
&lt;p&gt;This is the single most overlooked step in dark-mode setups. Since &lt;code&gt;xdg-desktop-portal 1.17.0&lt;&#x2F;code&gt;, the portal must be told &lt;em&gt;which&lt;&#x2F;em&gt; backend implements the Settings interface — otherwise Firefox, Thunderbird, and other portal-aware apps will never see darkman’s color-scheme value, no matter how correctly darkman itself is configured.&lt;&#x2F;p&gt;
&lt;p&gt;Create &lt;code&gt;~&#x2F;.config&#x2F;xdg-desktop-portal&#x2F;portals.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;xdg-desktop-portal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;xdg-desktop-portal&#x2F;portals.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[preferred]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;org.freedesktop.impl.portal.Settings=darkman&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can verify the portal really hands darkman’s value to clients with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gdbus&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --session \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  --dest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; org.freedesktop.portal.Desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  --object-path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;org&#x2F;freedesktop&#x2F;portal&#x2F;desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  --method&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; org.freedesktop.portal.Settings.ReadOne&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  org.freedesktop.appearance color-scheme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This should return &lt;code&gt;1&lt;&#x2F;code&gt; (dark) or &lt;code&gt;2&lt;&#x2F;code&gt; (light) depending on darkman’s current mode. If it returns &lt;code&gt;0&lt;&#x2F;code&gt; (“no preference”) or fails, your &lt;code&gt;portals.conf&lt;&#x2F;code&gt; isn’t being read — restart &lt;code&gt;xdg-desktop-portal.service&lt;&#x2F;code&gt; and check &lt;code&gt;XDG_CURRENT_DESKTOP&lt;&#x2F;code&gt; is set in your session environment.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Firefox-side counterpart:&lt;&#x2F;strong&gt; In &lt;code&gt;about:config&lt;&#x2F;code&gt;, also set &lt;code&gt;widget.use-xdg-desktop-portal.settings = 1&lt;&#x2F;code&gt;. Without both halves — system-side &lt;code&gt;portals.conf&lt;&#x2F;code&gt; AND Firefox-side preference — the bridge stays broken.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;gtk-theme&quot;&gt;GTK Theme&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;code&gt;Dracula&lt;&#x2F;code&gt; is not in the official Arch repository. You will need an AUR helper like &lt;code&gt;yay&lt;&#x2F;code&gt; or &lt;code&gt;paru&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;yay&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dracula-gtk-theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# or: paru -S dracula-gtk-theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you prefer not to use an AUR helper, the setup will automatically fall back to &lt;code&gt;Adwaita-dark&lt;&#x2F;code&gt; and &lt;code&gt;Adwaita&lt;&#x2F;code&gt; respectively (see hook script).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;qt-control-for-phase-3&quot;&gt;Qt Control (for Phase 3)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; qt5ct qt6ct kvantum&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;i3-keybinding&quot;&gt;i3 Keybinding&lt;&#x2F;h3&gt;
&lt;p&gt;Add the following keybinding to your i3 configuration file &lt;code&gt;~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;bindsym $mod+Shift+d exec --no-startup-id darkman toggle&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-2-create-directory-structure&quot;&gt;Step 2: Create Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;A clean directory structure is crucial for maintainability:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.local&#x2F;share&#x2F;light-mode.d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;{dracula,solarized-light}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;qt5ct&#x2F;colors ~&#x2F;.config&#x2F;qt6ct&#x2F;colors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the &lt;code&gt;~&#x2F;.config&#x2F;themes&#x2F;&lt;&#x2F;code&gt; directory, theme-specific files for each application will be stored. The hook scripts will then create symlinks to the currently desired theme files.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-3-prepare-qt-apps-keepassxc-nheko&quot;&gt;Step 3: Prepare Qt Apps (KeePassXC, nheko)&lt;&#x2F;h2&gt;
&lt;p&gt;Qt applications do not automatically follow GTK configuration or the XDG-Portal. You must set the &lt;code&gt;QT_QPA_PLATFORMTHEME&lt;&#x2F;code&gt; environment variable in &lt;strong&gt;&lt;code&gt;~&#x2F;.xprofile&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, as this file is reliably read by i3 at startup.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Pragmatic starting point — begin with &lt;code&gt;qt5ct&lt;&#x2F;code&gt; alone:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;export&lt;&#x2F;span&gt;&lt;span&gt; QT_QPA_PLATFORMTHEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;qt5ct&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This setting usually works most reliably in practice and often affects Qt6 applications via a compatibility path.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;If Qt6 apps ignore theming&lt;&#x2F;strong&gt; (e.g., KeePassXC remains unstyled), you can escalate to the following configuration:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;export&lt;&#x2F;span&gt;&lt;span&gt; QT_QPA_PLATFORMTHEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;qt5ct:qt6ct&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This combined syntax is officially supported from Qt 6.5, but its effectiveness can vary depending on the app’s build and Qt version. Only escalate if &lt;code&gt;qt5ct&lt;&#x2F;code&gt; alone is insufficient.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Note on path:&lt;&#x2F;strong&gt; &lt;code&gt;~&#x2F;.config&#x2F;environment.d&#x2F;&lt;&#x2F;code&gt; would be the “more modern” way, but it’s read by &lt;code&gt;systemd --user&lt;&#x2F;code&gt; and doesn’t reliably reach the X process in every i3 session – especially not in &lt;code&gt;startx&lt;&#x2F;code&gt; setups without a display manager. &lt;code&gt;.xprofile&lt;&#x2F;code&gt; is the more robust choice for i3 + X11.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;last-resort-fallback-per-app-wrapper&quot;&gt;Last-resort fallback: per-app wrapper&lt;&#x2F;h3&gt;
&lt;p&gt;If neither variable above gets a stubborn Qt6 app to pick up the theme, set the variable just for that one app:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;QT_QPA_PLATFORMTHEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;qt6ct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; keepassxc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can wrap this in a small shell script and place it in &lt;code&gt;~&#x2F;.local&#x2F;bin&#x2F;&lt;&#x2F;code&gt;, or make a desktop file with the env-var prepended in &lt;code&gt;Exec=&lt;&#x2F;code&gt;. Inelegant, but reliable when the global escalation chain fails.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;obtain-qt-color-schemes&quot;&gt;Obtain Qt Color Schemes&lt;&#x2F;h3&gt;
&lt;p&gt;Qt color schemes are stored as &lt;code&gt;.conf&lt;&#x2F;code&gt; files under &lt;strong&gt;&lt;code&gt;~&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; and &lt;strong&gt;&lt;code&gt;~&#x2F;.config&#x2F;qt6ct&#x2F;colors&#x2F;&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;. Do not store them under &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;qt5ct&#x2F;colors&#x2F;&lt;&#x2F;code&gt;, as these directories are reserved for system defaults and can be overwritten by Pacman updates.&lt;&#x2F;p&gt;
&lt;p&gt;For Dracula, an official Qt5ct color scheme exists in the Dracula project:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;dracula&#x2F;qt5&#x2F;master&#x2F;Dracula.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;Dracula.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;Dracula.conf ~&#x2F;.config&#x2F;qt6ct&#x2F;colors&#x2F;Dracula.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For Solarized Light, &lt;strong&gt;no official Qt5ct color scheme exists&lt;&#x2F;strong&gt;. The most reliable approach is to create one once via the GUI:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;qt5ct&lt;&#x2F;code&gt; from a terminal.&lt;&#x2F;li&gt;
&lt;li&gt;Tab “Style” → next to “Color scheme” click “Edit color scheme” → “Create”.&lt;&#x2F;li&gt;
&lt;li&gt;Set Window Background &lt;code&gt;#fdf6e3&lt;&#x2F;code&gt;, Window Text &lt;code&gt;#586e75&lt;&#x2F;code&gt;, Base &lt;code&gt;#fdf6e3&lt;&#x2F;code&gt;, Highlight &lt;code&gt;#268bd2&lt;&#x2F;code&gt;, etc. – the eight Solarized base values are documented at &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ethanschoonover.com&#x2F;solarized&quot;&gt;ethanschoonover.com&#x2F;solarized&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Save as &lt;code&gt;SolarizedLight.conf&lt;&#x2F;code&gt; under &lt;code&gt;~&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Copy the file to &lt;code&gt;~&#x2F;.config&#x2F;qt6ct&#x2F;colors&#x2F;SolarizedLight.conf&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Why not use a third-party Solarized Qt scheme?&lt;&#x2F;strong&gt; Various community ports exist, but their quality and maintenance vary, and the &lt;code&gt;qt5ct&lt;&#x2F;code&gt; &lt;code&gt;.conf&lt;&#x2F;code&gt; format is fairly strict. A one-time GUI creation gives you a result that exactly matches your other Solarized apps, without surprises.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;step-4-split-i3-config&quot;&gt;Step 4: Split i3 Config&lt;&#x2F;h2&gt;
&lt;p&gt;The i3 configuration cannot be recolored at runtime. You must switch it and reload.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;option-a-include-file-recommended-from-i3-4-20&quot;&gt;Option A: include file (recommended, from i3 4.20)&lt;&#x2F;h3&gt;
&lt;p&gt;Add the following line to &lt;code&gt;~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;include ~&#x2F;.config&#x2F;i3&#x2F;theme.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then create two theme-specific configuration files. Minimal working examples:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Dracula i3 theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&#x2F;i3-theme.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# class                 border  bground text    indicator child_border&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.focused          #6272a4 #44475a #f8f8f2 #bd93f9   #6272a4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.focused_inactive #44475a #44475a #f8f8f2 #44475a   #44475a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.unfocused        #282a36 #282a36 #bfbfbf #282a36   #282a36&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.urgent           #44475a #ff5555 #f8f8f2 #ff5555   #ff5555&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.placeholder      #282a36 #282a36 #f8f8f2 #282a36   #282a36&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.background       #282a36&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Solarized Light i3 theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;solarized-light&#x2F;i3-theme.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# class                 border  bground text    indicator child_border&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.focused          #268bd2 #eee8d5 #586e75 #268bd2   #268bd2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.focused_inactive #93a1a1 #eee8d5 #586e75 #93a1a1   #93a1a1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.unfocused        #fdf6e3 #fdf6e3 #93a1a1 #fdf6e3   #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.urgent           #93a1a1 #dc322f #fdf6e3 #dc322f   #dc322f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.placeholder      #fdf6e3 #fdf6e3 #586e75 #fdf6e3   #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;client.background       #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The hook script will then symlink the correct file to &lt;code&gt;~&#x2F;.config&#x2F;i3&#x2F;theme.conf&lt;&#x2F;code&gt; and execute &lt;code&gt;i3-msg reload&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;option-b-symlink-the-entire-config&quot;&gt;Option B: Symlink the entire config&lt;&#x2F;h3&gt;
&lt;p&gt;If you prefer not to use the &lt;code&gt;include&lt;&#x2F;code&gt; directive, you can symlink the entire i3 configuration file. This is less flexible but also works.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-5-integrate-polybar&quot;&gt;Step 5: Integrate Polybar&lt;&#x2F;h2&gt;
&lt;p&gt;Polybar loads its configuration at startup. There are two ways to restart Polybar:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;option-1-polybar-msg-cmd-restart-clean-from-polybar-3-6&quot;&gt;Option 1: &lt;code&gt;polybar-msg cmd restart&lt;&#x2F;code&gt; (clean, from Polybar 3.6)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;polybar-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cmd restart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;option-2-pkill-launch-script-universal&quot;&gt;Option 2: &lt;code&gt;pkill&lt;&#x2F;code&gt; + Launch Script (universal)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pkill&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0.3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.config&#x2F;polybar&#x2F;launch.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;minimal-theme-files&quot;&gt;Minimal theme files&lt;&#x2F;h3&gt;
&lt;p&gt;You’ll already have a working &lt;code&gt;~&#x2F;.config&#x2F;polybar&#x2F;config.ini&lt;&#x2F;code&gt; from your existing setup. The simplest approach is to extract just the colors into theme-specific files and &lt;code&gt;include-file&lt;&#x2F;code&gt; them. Minimal examples:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Dracula Polybar palette&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&#x2F;polybar.ini&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[colors]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;background = #282a36&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;background-alt = #44475a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;foreground = #f8f8f2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;foreground-alt = #6272a4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;primary = #bd93f9&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;secondary = #8be9fd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;alert = #ff5555&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;disabled = #6272a4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Solarized Light Polybar palette&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;solarized-light&#x2F;polybar.ini&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[colors]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;background = #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;background-alt = #eee8d5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;foreground = #586e75&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;foreground-alt = #93a1a1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;primary = #268bd2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;secondary = #2aa198&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;alert = #dc322f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;disabled = #93a1a1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In your main Polybar config, reference the colors via &lt;code&gt;include-file = ~&#x2F;.config&#x2F;polybar&#x2F;colors.ini&lt;&#x2F;code&gt;, and let the hook script symlink &lt;code&gt;colors.ini&lt;&#x2F;code&gt; to one of the two palette files. (If your existing config keeps colors and bar layout in a single file, store two complete copies in &lt;code&gt;~&#x2F;.config&#x2F;themes&#x2F;&amp;lt;theme&amp;gt;&#x2F;polybar.ini&lt;&#x2F;code&gt; and let the hook symlink the whole &lt;code&gt;config.ini&lt;&#x2F;code&gt; instead — both approaches work.)&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-6-chromium-flags&quot;&gt;Step 6: Chromium Flags&lt;&#x2F;h2&gt;
&lt;p&gt;Chromium does not react to theme changes at runtime. It’s important to &lt;strong&gt;clearly separate&lt;&#x2F;strong&gt; two things:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;UI-Dark-Mode:&lt;&#x2F;strong&gt; Affects the browser interface (toolbar, tabs, menus).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Webpage-Force-Dark:&lt;&#x2F;strong&gt; Forces a dark mode for every webpage. However, this can distort images, diagrams, and carefully designed pages.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;recommended-ui-dark-mode-only&quot;&gt;Recommended: UI-Dark-Mode only&lt;&#x2F;h3&gt;
&lt;p&gt;Create the file &lt;code&gt;~&#x2F;.config&#x2F;chromium-flags.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;--force-dark-mode&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;--gtk-version=4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;--gtk-version=4&lt;&#x2F;code&gt; ensures that Chromium respects the current GTK4 theme and colors its toolbar to match other GTK applications.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;optional-additionally-force-dark-content-for-webpages&quot;&gt;Optional: Additionally force dark content for webpages&lt;&#x2F;h3&gt;
&lt;p&gt;If you want to force dark mode for webpage content as well, add:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;--enable-features=WebContentsForceDark&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;&#x2F;strong&gt; This flag name has changed multiple times across Chromium versions (&lt;code&gt;WebContentsForceDark&lt;&#x2F;code&gt;, &lt;code&gt;ForceWebContentsDarkMode&lt;&#x2F;code&gt;, or only via &lt;code&gt;chrome:&#x2F;&#x2F;flags&lt;&#x2F;code&gt;). If it doesn’t work, check &lt;code&gt;chrome:&#x2F;&#x2F;flags&lt;&#x2F;code&gt; for “Force Dark Mode for Web Contents” and enable it there. The recommendation remains: only enable if you’re comfortable with potential content distortion.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;A true live toggle is not practical here without a browser restart.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-7-the-dark-mode-hook-script&quot;&gt;Step 7: The Dark-Mode Hook Script&lt;&#x2F;h2&gt;
&lt;p&gt;This script will be executed when &lt;code&gt;darkman&lt;&#x2F;code&gt; switches to dark mode.
Create the file &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&#x2F;apply-theme&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A note on hook directory layout:&lt;&#x2F;strong&gt; This guide uses &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&#x2F;&lt;&#x2F;code&gt; and &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;light-mode.d&#x2F;&lt;&#x2F;code&gt;, which the &lt;code&gt;darkman(1)&lt;&#x2F;code&gt; manpage describes as the &lt;em&gt;legacy&lt;&#x2F;em&gt; format (kept for backwards compatibility). The current format is a single &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;darkman&#x2F;&lt;&#x2F;code&gt; directory with one script that receives the mode as &lt;code&gt;$1&lt;&#x2F;code&gt;. Both formats work; the split-directory layout is used here because it makes the dark and light scripts easy to read side-by-side. If you want the modern single-script style, consolidate the two scripts and branch on &lt;code&gt;case &quot;$1&quot; in dark|light) ... esac&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Robustness: undefined vars are errors, but individual app errors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# should not abort the entire hook.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set -u&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;trap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;echo &amp;quot;Hook error in: $BASH_COMMAND&amp;quot; &amp;gt;&amp;amp;2&amp;#39; ERR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;themes&#x2F;dracula&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GTK_THEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Dracula&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Fallback if dracula-gtk-theme is not installed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if !&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;usr&#x2F;share&#x2F;themes&#x2F;Dracula &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|| -d ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.themes&#x2F;Dracula ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    GTK_THEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Adwaita-dark&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── GTK 3 &#x2F; GTK 4 ──────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;gtk-3.0 ~&#x2F;.config&#x2F;gtk-4.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;gtk-3.0&#x2F;settings.ini&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[Settings]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;gtk-theme-name=&lt;&#x2F;span&gt;&lt;span&gt;$GTK_THEME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;gtk-icon-theme-name=Adwaita&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;gtk-application-prefer-dark-theme=1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;gtk-3.0&#x2F;settings.ini ~&#x2F;.config&#x2F;gtk-4.0&#x2F;settings.ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Also via gsettings (for apps that read this)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gsettings&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; set org.gnome.desktop.interface gtk-theme &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$GTK_THEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gsettings&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; set org.gnome.desktop.interface color-scheme &amp;#39;prefer-dark&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Qt5 &#x2F; Qt6 ──────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Redirect ColorScheme path in qt5ct&#x2F;qt6ct — user config, not &#x2F;usr&#x2F;share!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.config&#x2F;qt5ct&#x2F;qt5ct.conf ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s|^color_scheme_path=.*|color_scheme_path=&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;Dracula.conf|&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        ~&#x2F;.config&#x2F;qt5ct&#x2F;qt5ct.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.config&#x2F;qt6ct&#x2F;qt6ct.conf ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s|^color_scheme_path=.*|color_scheme_path=&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;qt6ct&#x2F;colors&#x2F;Dracula.conf|&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        ~&#x2F;.config&#x2F;qt6ct&#x2F;qt6ct.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Xresources &#x2F; urxvt ─────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;Xresources&amp;quot; ~&#x2F;.Xresources&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;xrdb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -merge&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.Xresources&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Recolor running urxvt instances via escape sequences (best effort).&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# -O tests if the executing user is the owner of the PTS — protects in&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# multi-user&#x2F;SSH setups from writing to foreign terminals.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Note: These sequences only change Background&#x2F;Foreground, not ANSI colors.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;pts&#x2F;[0-9&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;amp;&amp;amp; -w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        printf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;\033]708;#282a36\007\033]11;#282a36\007\033]10;#f8f8f2\007&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Alacritty ──────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;alacritty.toml&amp;quot; ~&#x2F;.config&#x2F;alacritty&#x2F;theme.toml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Alacritty reloads automatically with live_config_reload=true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── i3 Theme ───────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;i3-theme.conf&amp;quot; ~&#x2F;.config&#x2F;i3&#x2F;theme.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;i3-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; reload&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Polybar ────────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;polybar.ini&amp;quot; ~&#x2F;.config&#x2F;polybar&#x2F;config.ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    polybar-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cmd restart&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1 ||&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        pkill&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0.3&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; ~&#x2F;.config&#x2F;polybar&#x2F;launch.sh&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    pkill&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0.3&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; ~&#x2F;.config&#x2F;polybar&#x2F;launch.sh&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── neomutt ────────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;neomutt-colors&amp;quot; ~&#x2F;.config&#x2F;neomutt&#x2F;colors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Running neomutt instances require :source ~&#x2F;.config&#x2F;neomutt&#x2F;colors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── VSCodium ───────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Patch settings.json. VSCodium usually reacts live via file watcher,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# in rare cases a &amp;quot;Reload Window&amp;quot; (Ctrl+Shift+P) is needed.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;VSCodium&#x2F;User&#x2F;settings.json&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]] &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    tmp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mktemp&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.&amp;quot;workbench.colorTheme&amp;quot; = &amp;quot;Dracula&amp;quot;&amp;#39; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; mv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Vim&#x2F;Neovim (if used) ───────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;nvim-colorscheme.vim&amp;quot; ~&#x2F;.config&#x2F;nvim&#x2F;colorscheme.vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Firefox &#x2F; Thunderbird ──────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Nothing to do — they follow darkman&amp;#39;s XDG-Portal automatically.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Prerequisite: in about:config widget.use-xdg-desktop-portal.settings = 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Chromium ───────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Does not react live; flags in ~&#x2F;.config&#x2F;chromium-flags.conf take effect&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# on next start. See Step 6.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── User Notification ──────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;notify-send&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; weather-clear-night &amp;quot;Theme&amp;quot; &amp;quot;Dark Mode activated (Dracula)&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Dark mode activated (Dracula)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make the script executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x ~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&#x2F;apply-theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-8-the-light-mode-hook-script&quot;&gt;Step 8: The Light-Mode Hook Script&lt;&#x2F;h2&gt;
&lt;p&gt;This script will be executed when &lt;code&gt;darkman&lt;&#x2F;code&gt; switches to light mode.
Create the file &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;light-mode.d&#x2F;apply-theme&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set -u&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;trap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;echo &amp;quot;Hook error in: $BASH_COMMAND&amp;quot; &amp;gt;&amp;amp;2&amp;#39; ERR&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;themes&#x2F;solarized-light&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GTK_THEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Adwaita&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── GTK 3 &#x2F; GTK 4 ──────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;gtk-3.0 ~&#x2F;.config&#x2F;gtk-4.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;gtk-3.0&#x2F;settings.ini&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[Settings]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;gtk-theme-name=&lt;&#x2F;span&gt;&lt;span&gt;$GTK_THEME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;gtk-icon-theme-name=Adwaita&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;gtk-application-prefer-dark-theme=0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;gtk-3.0&#x2F;settings.ini ~&#x2F;.config&#x2F;gtk-4.0&#x2F;settings.ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gsettings&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; set org.gnome.desktop.interface gtk-theme &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$GTK_THEME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gsettings&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; set org.gnome.desktop.interface color-scheme &amp;#39;prefer-light&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Qt5 &#x2F; Qt6 ──────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.config&#x2F;qt5ct&#x2F;qt5ct.conf ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s|^color_scheme_path=.*|color_scheme_path=&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;SolarizedLight.conf|&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        ~&#x2F;.config&#x2F;qt5ct&#x2F;qt5ct.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f ~&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;.config&#x2F;qt6ct&#x2F;qt6ct.conf ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s|^color_scheme_path=.*|color_scheme_path=&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;qt6ct&#x2F;colors&#x2F;SolarizedLight.conf|&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        ~&#x2F;.config&#x2F;qt6ct&#x2F;qt6ct.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Xresources &#x2F; urxvt ─────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;Xresources&amp;quot; ~&#x2F;.Xresources&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;xrdb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -merge&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.Xresources&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;pts&#x2F;[0-9&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;amp;&amp;amp; -w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        printf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;\033]708;#fdf6e3\007\033]11;#fdf6e3\007\033]10;#586e75\007&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$pts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Alacritty ──────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;alacritty.toml&amp;quot; ~&#x2F;.config&#x2F;alacritty&#x2F;theme.toml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── i3 ─────────────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;i3-theme.conf&amp;quot; ~&#x2F;.config&#x2F;i3&#x2F;theme.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;i3-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; reload&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Polybar ────────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;polybar.ini&amp;quot; ~&#x2F;.config&#x2F;polybar&#x2F;config.ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    polybar-msg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cmd restart&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1 ||&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        pkill&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0.3&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; ~&#x2F;.config&#x2F;polybar&#x2F;launch.sh&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    pkill&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; polybar&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0.3&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; ~&#x2F;.config&#x2F;polybar&#x2F;launch.sh&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── neomutt ────────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;neomutt-colors&amp;quot; ~&#x2F;.config&#x2F;neomutt&#x2F;colors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── VSCodium ───────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;.config&#x2F;VSCodium&#x2F;User&#x2F;settings.json&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]] &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    tmp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mktemp&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.&amp;quot;workbench.colorTheme&amp;quot; = &amp;quot;Solarized Light&amp;quot;&amp;#39; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; mv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SETTINGS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── Neovim ─────────────────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ln&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$THEME_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;nvim-colorscheme.vim&amp;quot; ~&#x2F;.config&#x2F;nvim&#x2F;colorscheme.vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ─── User Notification ──────────────────────────────────────────&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;notify-send&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; weather-clear &amp;quot;Theme&amp;quot; &amp;quot;Light Mode activated (Solarized Light)&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Light mode activated (Solarized Light)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make the script executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x ~&#x2F;.local&#x2F;share&#x2F;light-mode.d&#x2F;apply-theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-9-initial-state-and-persistence-on-login&quot;&gt;Step 9: Initial State and Persistence on Login&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;darkman&lt;&#x2F;code&gt; is designed as a user service that &lt;strong&gt;persists its own state&lt;&#x2F;strong&gt;. The service typically remembers the last mode after a restart and executes the corresponding hooks at startup.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important — no hardcoded &lt;code&gt;darkman set&lt;&#x2F;code&gt; calls in &lt;code&gt;.xprofile&lt;&#x2F;code&gt;!&lt;&#x2F;strong&gt;
It might be tempting to write &lt;code&gt;darkman set dark&lt;&#x2F;code&gt; in &lt;code&gt;.xprofile&lt;&#x2F;code&gt; to “always start with Dark mode.” However, this is counterproductive:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;It overwrites the last manual toggle on every login.&lt;&#x2F;li&gt;
&lt;li&gt;It &lt;strong&gt;completely disables auto-switching based on sunrise&#x2F;sunset&lt;&#x2F;strong&gt;, if you enable it later.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Just let the service run.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;reality-check-verify-persistence&quot;&gt;Reality Check: Verify Persistence&lt;&#x2F;h3&gt;
&lt;p&gt;In practice, reliable persistence depends on the interplay between the user service, login manager, and XDG state directory. &lt;strong&gt;Do not blindly trust it – check it after the first login cycle&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# What does darkman currently think?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;darkman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; get&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Was the service started cleanly at login and did it trigger hooks?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;journalctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --user -u&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; darkman.service&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If &lt;code&gt;darkman get&lt;&#x2F;code&gt; returns a different mode than expected, or if the hook scripts were not executed at login, you have a persistence problem (see next section).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;if-persistence-is-unreliable&quot;&gt;If Persistence is Unreliable&lt;&#x2F;h3&gt;
&lt;p&gt;Some possible countermeasures:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Ensure &lt;code&gt;darkman.service&lt;&#x2F;code&gt; is truly enabled: &lt;code&gt;systemctl --user is-enabled darkman.service&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;In rare setups (TTY login + &lt;code&gt;startx&lt;&#x2F;code&gt;, no display manager), it helps to set &lt;code&gt;dbus-update-activation-environment --systemd DISPLAY XAUTHORITY&lt;&#x2F;code&gt; in &lt;code&gt;.xprofile&lt;&#x2F;code&gt; so that user services can see the X session.&lt;&#x2F;li&gt;
&lt;li&gt;Workaround: In &lt;code&gt;.xprofile&lt;&#x2F;code&gt;, call &lt;strong&gt;&lt;code&gt;darkman get&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; once and only set a fallback mode if it’s empty. However, this is a hack – it’s better to address the root cause of the problem.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;optional-auto-switching-based-on-sunrise-sunset&quot;&gt;Optional: Auto-Switching Based on Sunrise&#x2F;Sunset&lt;&#x2F;h3&gt;
&lt;p&gt;If &lt;code&gt;darkman&lt;&#x2F;code&gt; should automatically switch based on time of day, create the file &lt;code&gt;~&#x2F;.config&#x2F;darkman&#x2F;config.yaml&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;lat&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 48.2082&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;lng&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 16.3738&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;usegeoclue&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;(The coordinates provided here are for Vienna – adjust them to your location.)&lt;&#x2F;p&gt;
&lt;p&gt;The service calculates sunrise and sunset times from this and automatically triggers the hooks.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;if-you-really-need-a-default-value-on-the-very-first-start&quot;&gt;If you really need a default value on the very first start&lt;&#x2F;h3&gt;
&lt;p&gt;If you’ve just installed &lt;code&gt;darkman&lt;&#x2F;code&gt; and want a defined initial state for the very first toggle, perform this &lt;strong&gt;manually once&lt;&#x2F;strong&gt; in the shell:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;darkman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; set dark&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;— not in &lt;code&gt;.xprofile&lt;&#x2F;code&gt;. From the next login onwards, the service will remember.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-10-obtain-theme-files&quot;&gt;Step 10: Obtain Theme Files&lt;&#x2F;h2&gt;
&lt;p&gt;For each application, place a dark and a light variant in &lt;code&gt;~&#x2F;.config&#x2F;themes&#x2F;&amp;lt;theme&amp;gt;&#x2F;&lt;&#x2F;code&gt;. The following commands cover most cases. You can paste these directly:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;alacritty&quot;&gt;Alacritty&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;dracula&#x2F;alacritty&#x2F;master&#x2F;dracula.toml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&#x2F;alacritty.toml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;alacritty&#x2F;alacritty-theme&#x2F;master&#x2F;themes&#x2F;solarized_light.toml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;solarized-light&#x2F;alacritty.toml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In your main &lt;code&gt;~&#x2F;.config&#x2F;alacritty&#x2F;alacritty.toml&lt;&#x2F;code&gt;, import the symlink the hook will manage and confirm live-reload is on. Live-reload defaults to enabled in current Alacritty versions, but being explicit avoids confusion if a future upstream change flips the default:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;toml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;import = [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;~&#x2F;.config&#x2F;alacritty&#x2F;theme.toml&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;general&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;live_config_reload =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;   # default; explicit for clarity&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TOML note:&lt;&#x2F;strong&gt; Pre-0.13 Alacritty used a top-level &lt;code&gt;live_config_reload = true&lt;&#x2F;code&gt;. From 0.13 onward, it lives under &lt;code&gt;[general]&lt;&#x2F;code&gt;. If your Alacritty is older, drop the &lt;code&gt;[general]&lt;&#x2F;code&gt; table.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;xresources-urxvt&quot;&gt;Xresources &#x2F; urxvt&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Dracula&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;dracula&#x2F;xresources&#x2F;master&#x2F;Xresources&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&#x2F;Xresources&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For Solarized Light, the upstream &lt;code&gt;solarized&#x2F;xresources&lt;&#x2F;code&gt; file uses C preprocessor &lt;code&gt;#define&lt;&#x2F;code&gt; statements. Many display managers and login flows invoke &lt;code&gt;xrdb&lt;&#x2F;code&gt; with &lt;code&gt;-nocpp&lt;&#x2F;code&gt;, which silently strips these defines and leaves you with default colors. To avoid this entirely, write a flat (preprocessor-free) version directly:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;solarized-light&#x2F;Xresources&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! Solarized Light — flat, no #define preprocessing required&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*background:            #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*foreground:            #657b83&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*fadeColor:             #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*cursorColor:           #586e75&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*pointerColorBackground:#93a1a1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*pointerColorForeground:#586e75&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! black&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color0:  #073642&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color8:  #002b36&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! red&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color1:  #dc322f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color9:  #cb4b16&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! green&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color2:  #859900&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color10: #586e75&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! yellow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color3:  #b58900&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color11: #657b83&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! blue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color4:  #268bd2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color12: #839496&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! magenta&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color5:  #d33682&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color13: #6c71c4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! cyan&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color6:  #2aa198&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color14: #93a1a1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;! white&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color7:  #eee8d5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;*color15: #fdf6e3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The values above are taken from the canonical Solarized palette and match the structure of the upstream file with the &lt;code&gt;#define&lt;&#x2F;code&gt;s already resolved.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;polybar&quot;&gt;Polybar&lt;&#x2F;h3&gt;
&lt;p&gt;See &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#step-5-integrate-polybar&quot;&gt;Step 5&lt;&#x2F;a&gt; — minimal Dracula and Solarized Light palettes are inlined there. Copy them into &lt;code&gt;~&#x2F;.config&#x2F;themes&#x2F;&amp;lt;theme&amp;gt;&#x2F;polybar.ini&lt;&#x2F;code&gt; if you haven’t already.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;neomutt&quot;&gt;neomutt&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Dracula&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;dracula&#x2F;mutt&#x2F;master&#x2F;dracula.muttrc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;dracula&#x2F;neomutt-colors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Solarized Light (16-color version recommended for terminal accuracy)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fsSL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;altercation&#x2F;mutt-colors-solarized&#x2F;master&#x2F;mutt-colors-solarized-light-16.muttrc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;     -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;themes&#x2F;solarized-light&#x2F;neomutt-colors&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;vscodium&quot;&gt;VSCodium&lt;&#x2F;h3&gt;
&lt;p&gt;VSCodium (like VS Code) ships with &lt;strong&gt;Solarized Light&lt;&#x2F;strong&gt; and &lt;strong&gt;Solarized Dark&lt;&#x2F;strong&gt; as built-in themes — no extension required. Dracula, however, must be installed separately:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;codium&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --install-extension&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dracula-theme.theme-dracula&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The hook scripts already set the correct theme name via &lt;code&gt;jq&lt;&#x2F;code&gt;. If your VSCodium uses a different binary name (e.g., &lt;code&gt;vscodium&lt;&#x2F;code&gt;), adjust the command accordingly.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;gtk-and-qt&quot;&gt;GTK and Qt&lt;&#x2F;h3&gt;
&lt;p&gt;GTK Dracula via AUR (&lt;code&gt;yay -S dracula-gtk-theme&lt;&#x2F;code&gt;); Adwaita is shipped by default. Qt color schemes: see &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;i3-dark-light-mode-switcher&#x2F;#step-3-prepare-qt-apps-keepassxc-nheko&quot;&gt;Step 3&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;reference-table&quot;&gt;Reference table&lt;&#x2F;h3&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;App&lt;&#x2F;th&gt;&lt;th&gt;File&lt;&#x2F;th&gt;&lt;th&gt;Source&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;GTK&lt;&#x2F;td&gt;&lt;td&gt;Theme via AUR&#x2F;Pacman&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;dracula-gtk-theme&lt;&#x2F;code&gt;, Adwaita is default&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Xresources&#x2F;urxvt&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;Xresources&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;dracula&#x2F;xresources&lt;&#x2F;code&gt;, &lt;code&gt;solarized&#x2F;xresources&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Alacritty&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;alacritty.toml&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;dracula&#x2F;alacritty&lt;&#x2F;code&gt;, &lt;code&gt;alacritty&#x2F;alacritty-theme&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;i3&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;i3-theme.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;inlined examples in Step 4&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Polybar&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;polybar.ini&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;inlined examples in Step 5&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;neomutt&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;neomutt-colors&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;dracula&#x2F;mutt&lt;&#x2F;code&gt;, &lt;code&gt;altercation&#x2F;mutt-colors-solarized&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;VSCodium&lt;&#x2F;td&gt;&lt;td&gt;built-in &#x2F; Extension&lt;&#x2F;td&gt;&lt;td&gt;Solarized built-in, “Dracula Official” via marketplace&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;qt5ct&#x2F;qt6ct&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;*.conf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;dracula&#x2F;qt5&lt;&#x2F;code&gt;, Solarized via qt5ct GUI&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;You can find Dracula themes collected at &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;draculatheme.com&quot;&gt;https:&#x2F;&#x2F;draculatheme.com&lt;&#x2F;a&gt; – Solarized at &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ethanschoonover.com&#x2F;solarized&quot;&gt;https:&#x2F;&#x2F;ethanschoonover.com&#x2F;solarized&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;caveats-and-honest-expectations&quot;&gt;Caveats and Honest Expectations&lt;&#x2F;h2&gt;
&lt;p&gt;What &lt;strong&gt;switches live&lt;&#x2F;strong&gt; (without restart):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;GTK apps via gsettings&#x2F;portal: Thunar, Firefox, Thunderbird (with Portal setting)&lt;&#x2F;li&gt;
&lt;li&gt;Alacritty (with &lt;code&gt;live_config_reload = true&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;i3 (after &lt;code&gt;reload&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Polybar (after restart)&lt;&#x2F;li&gt;
&lt;li&gt;VSCodium (mostly, via file watcher on settings.json)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;What &lt;strong&gt;requires an app restart&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;KeePassXC, nheko (Qt apps do not react live)&lt;&#x2F;li&gt;
&lt;li&gt;GIMP, LibreOffice (own theme logic)&lt;&#x2F;li&gt;
&lt;li&gt;urxvt terminals (except with escape sequence trick, which only affects Background&#x2F;Foreground, not ANSI colors)&lt;&#x2F;li&gt;
&lt;li&gt;neomutt (or &lt;code&gt;:source&lt;&#x2F;code&gt; within the session)&lt;&#x2F;li&gt;
&lt;li&gt;Chromium (flags file takes effect on start)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;What &lt;strong&gt;needs to be configured manually&lt;&#x2F;strong&gt; within the app:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;LibreOffice: set Light&#x2F;Dark once in &lt;code&gt;Tools → Options → Application Colors&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;GIMP: has its own theme system under &lt;code&gt;Preferences → Theme&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Inkscape: follows GTK, but restart required&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;tips&quot;&gt;Tips&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Geo-based Auto-Switching:&lt;&#x2F;strong&gt; &lt;code&gt;darkman&lt;&#x2F;code&gt; can do this automatically based on sunrise&#x2F;sunset – see Step 9.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Debugging:&lt;&#x2F;strong&gt; &lt;code&gt;journalctl --user -u darkman.service -f&lt;&#x2F;code&gt; shows if hooks are being executed.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Manual Hook Testing:&lt;&#x2F;strong&gt; Execute &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&#x2F;apply-theme&lt;&#x2F;code&gt; directly to see errors in isolation.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Consistency Across Multiple Machines:&lt;&#x2F;strong&gt; Version &lt;code&gt;~&#x2F;.config&#x2F;themes&#x2F;&lt;&#x2F;code&gt;, &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;dark-mode.d&#x2F;&lt;&#x2F;code&gt;, &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;light-mode.d&#x2F;&lt;&#x2F;code&gt;, and &lt;code&gt;~&#x2F;.config&#x2F;qt5ct&#x2F;colors&#x2F;&lt;&#x2F;code&gt; in your dotfiles repository.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Forced KeePassXC Reload (optional, usually undesirable):&lt;&#x2F;strong&gt; If you absolutely need the KeePassXC theme to update at the moment of switching, you can include &lt;code&gt;pkill keepassxc&lt;&#x2F;code&gt; in the hook – but remember that this will lose all unsaved changes and the open database. Realistically: just let it switch on the next start.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;extension-ideas&quot;&gt;Extension Ideas&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;base16-Framework&lt;&#x2F;strong&gt; instead of Dracula&#x2F;Solarized: Generate a unified scheme for hundreds of apps from a single palette (&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;chriskempson&#x2F;base16&quot;&gt;https:&#x2F;&#x2F;github.com&#x2F;chriskempson&#x2F;base16&lt;&#x2F;a&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Per-Workspace-Themes&lt;&#x2F;strong&gt;: Theoretically possible via i3-IPC, but rarely practical.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Polybar Module&lt;&#x2F;strong&gt; with current theme status as an indicator.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;The implemented architecture is:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;darkman (Trigger + Portal + Persistence)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ├── Hooks → GTK, Qt, Xresources, App Configs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ├── Live-Reload: i3, Polybar, Alacritty, GTK Apps via Portal, VSCodium&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    └── Accepted: Some apps require restart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You switch with &lt;code&gt;$mod+Shift+d&lt;&#x2F;code&gt;. Most apps react immediately, some require a restart – this is the current state of Linux desktop reality, not a flaw in your setup.&lt;&#x2F;p&gt;
&lt;p&gt;When setting up for the first time, it’s worthwhile to follow the phased strategy from the beginning of the tutorial: first the basics (GTK, Firefox, i3, Alacritty), then extensions, and finally the “problem children.” This way, you can more easily identify the cause of problems if they arise.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;wiki.archlinux.org&amp;#x2F;title&amp;#x2F;Dark_mode_theme_switching&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;ARCH WIKI: DARK MODE THEME SWITCHING&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;mwh&amp;#x2F;darkman&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;💻&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;DARKMAN PROJECT ON GITHUB&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Server Security Audit Script for Debian&#x2F;Ubuntu</title>
          <pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/server-security-audit-script/</link>
          <guid>https://criticalbasics.xyz/posts/server-security-audit-script/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/server-security-audit-script/">&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-05-04&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Full audit script with comprehensive explanations.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;introduction-to-the-server-security-audit-script&quot;&gt;Introduction to the Server Security Audit Script&lt;&#x2F;h2&gt;
&lt;p&gt;When you provision a new server, especially in a cloud environment using tools like cloud-init, it’s crucial to verify that all intended security measures have been correctly applied. Manual checks can be time-consuming and error-prone. This Bash script automates a significant portion of this auditing process, providing a quick overview of your server’s security posture on Debian or Ubuntu-based systems.&lt;&#x2F;p&gt;
&lt;p&gt;This script is designed to be run with root privileges and will:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Check System Fundamentals:&lt;&#x2F;strong&gt; Hostname, timezone, kernel, pending updates, and reboot status.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Audit User &amp;amp; Authentication:&lt;&#x2F;strong&gt; Verify the existence and &lt;code&gt;sudo&lt;&#x2F;code&gt; privileges of a dedicated admin user, check root password status, and identify accounts with UID 0 or empty passwords.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Harden SSH:&lt;&#x2F;strong&gt; Scrutinize your SSH daemon’s configuration for best practices like disabled root login, password authentication, X11 forwarding, and the use of strong key algorithms. It also checks for the presence of SSH keys for your admin user.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Firewall Configuration (UFW):&lt;&#x2F;strong&gt; Confirm UFW’s active status, default policies, specific rule sets (e.g., rate-limiting for SSH), and log redirection.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Intrusion Prevention (Fail2Ban):&lt;&#x2F;strong&gt; Validate that Fail2Ban is running, its SSH jail is active, and it’s monitoring the correct SSH port.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Automated Updates:&lt;&#x2F;strong&gt; Ensure &lt;code&gt;unattended-upgrades&lt;&#x2F;code&gt; is installed and configured to keep your system patched.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Docker Security:&lt;&#x2F;strong&gt; If Docker is installed, it checks daemon status, Docker Compose presence, user group membership, and critically, Docker’s log rotation settings and network configuration.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Log Rotation:&lt;&#x2F;strong&gt; Verify persistent journaling and &lt;code&gt;logrotate&lt;&#x2F;code&gt; configurations for Traefik and UFW logs.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Network &amp;amp; Open Ports:&lt;&#x2F;strong&gt; List actively listening ports and check for known insecure legacy services.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Filesystem Security:&lt;&#x2F;strong&gt; Scan for world-writable files in critical directories and report disk usage.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;At the end, it provides a summary of &lt;code&gt;PASS&lt;&#x2F;code&gt;, &lt;code&gt;WARN&lt;&#x2F;code&gt;, and &lt;code&gt;FAIL&lt;&#x2F;code&gt; counts, giving you an immediate understanding of areas needing attention.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Why is this important?&lt;&#x2F;strong&gt;
Even with cloud-init or automated provisioning, misconfigurations can occur. This script acts as your second line of defense, ensuring that your server adheres to a baseline of security best practices before it goes into production.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;how-to-use-the-script&quot;&gt;How to Use the Script&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Save the script:&lt;&#x2F;strong&gt; Copy the entire script content into a file, for example, &lt;code&gt;server-audit.sh&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Make it executable:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x server-audit.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Run with &lt;code&gt;sudo&lt;&#x2F;code&gt;:&lt;&#x2F;strong&gt; The script requires root privileges to access system configurations and logs.&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .&#x2F;server-audit.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Review the output:&lt;&#x2F;strong&gt; Pay close attention to &lt;code&gt;[FAIL]&lt;&#x2F;code&gt; and &lt;code&gt;[WARN]&lt;&#x2F;code&gt; messages, which indicate potential security vulnerabilities or areas for improvement.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;the-server-security-audit-script&quot;&gt;The Server Security Audit Script&lt;&#x2F;h2&gt;
&lt;p&gt;Here is the complete script. You can customize the &lt;code&gt;ADMIN_USER&lt;&#x2F;code&gt; variable at the beginning to match your dedicated administrative username.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#!&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Server Security Audit Script&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Checks if the cloud-init setup has been correctly applied and if current&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# security standards are met.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Usage: sudo bash server-audit.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set -u&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Colors &amp;amp; Symbols --------------------------------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GREEN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;\033[0;32m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;RED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;\033[0;31m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;YELLOW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;\033[0;33m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;CYAN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;\033[0;36m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;\033[1m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;\033[0m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PASS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;GREEN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}PASS${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;FAIL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;RED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}FAIL${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;WARN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;YELLOW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}WARN${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;INFO&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;CYAN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}INFO${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pass_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;fail_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;warn_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_pass&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  [${&lt;&#x2F;span&gt;&lt;span&gt;PASS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}]  &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;; ((pass_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;++&lt;&#x2F;span&gt;&lt;span&gt;)); }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_fail&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  [${&lt;&#x2F;span&gt;&lt;span&gt;FAIL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}]  &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;; ((fail_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;++&lt;&#x2F;span&gt;&lt;span&gt;)); }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_warn&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  [${&lt;&#x2F;span&gt;&lt;span&gt;WARN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}]  &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;; ((warn_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;++&lt;&#x2F;span&gt;&lt;span&gt;)); }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  [${&lt;&#x2F;span&gt;&lt;span&gt;INFO&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}]  &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;\n${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}=== &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ===${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Root Check --------------------------------------------------------------&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[ $EUID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -ne&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;RED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}This script must be run with sudo.${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;delightfuldude&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # &amp;lt;--- CUSTOMIZE THIS TO YOUR ADMIN USERNAME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;============================================================&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  Server Security Audit - $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;+%Y-%m-%d %H:%M:%S&amp;#39;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;============================================================&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. SYSTEM FUNDAMENTALS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;1. System Fundamentals&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Hostname&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;CURRENT_HOSTNAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;hostnamectl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --static&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; hostname&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$CURRENT_HOSTNAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;localhost&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;amp;&amp;amp; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$CURRENT_HOSTNAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Hostname set: ${&lt;&#x2F;span&gt;&lt;span&gt;CURRENT_HOSTNAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Hostname is still on default&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Timezone&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;CURRENT_TZ&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;timedatectl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; show&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Timezone&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --value&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc&#x2F;timezone&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;unknown&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$CURRENT_TZ&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Europe&#x2F;Berlin&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Timezone: ${&lt;&#x2F;span&gt;&lt;span&gt;CURRENT_TZ&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Timezone is ${&lt;&#x2F;span&gt;&lt;span&gt;CURRENT_TZ&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} (expected: Europe&#x2F;Berlin)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Kernel &amp;amp; OS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;OS: $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; PRETTY_NAME &#x2F;etc&#x2F;os-release&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d= -f2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;&amp;quot;&amp;#39;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Kernel: $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;uname&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Uptime&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Uptime: $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;uptime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Pending Updates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;UPDATES&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;apt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; list&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --upgradable&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; upgradable&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$UPDATES&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No pending package updates&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;UPDATES&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} package update(s) available&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Reboot required?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;var&#x2F;run&#x2F;reboot-required ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;System reboot required&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No reboot required&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. USER &amp;amp; AUTHENTICATION&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;2. User &amp;amp; Authentication&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Admin user exists&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; id&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;User &amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; exists&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;User &amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; does NOT exist&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# sudo group&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; groups&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -qw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; is in the sudo group&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; is NOT in the sudo group&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# NOPASSWD in sudoers (accepted for cloud-init without password)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;NOPASSWD&amp;quot; &#x2F;etc&#x2F;sudoers &#x2F;etc&#x2F;sudoers.d&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^#&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; has NOPASSWD (intended, as cloud-init doesn&amp;#39;t set a password)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No NOPASSWD for &amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; - sudo requires password&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Root password (should be locked or random, not empty)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ROOT_PW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;passwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;case&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ROOT_PW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #DBEDFF;&quot;&gt;    L&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Root account is locked&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #DBEDFF;&quot;&gt;    P&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Root has a password set (randomized by cloud-init)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #DBEDFF;&quot;&gt;    NP&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Root has NO password!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    *)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Root password status: ${&lt;&#x2F;span&gt;&lt;span&gt;ROOT_PW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;esac&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Accounts with empty password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;EMPTY_PW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -F:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;($2 == &amp;quot;&amp;quot; ) { print $1 }&amp;#39; &#x2F;etc&#x2F;shadow&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -z&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$EMPTY_PW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No accounts with empty password&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Accounts with empty password: ${&lt;&#x2F;span&gt;&lt;span&gt;EMPTY_PW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# UID-0 accounts (only root should have UID 0)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ROOT_ACCOUNTS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -F:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;($3 == 0) { print $1 }&amp;#39; &#x2F;etc&#x2F;passwd&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ROOT_ACCOUNTS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;root&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Only &amp;#39;root&amp;#39; has UID 0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Multiple accounts with UID 0: ${&lt;&#x2F;span&gt;&lt;span&gt;ROOT_ACCOUNTS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. SSH HARDENING&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;3. SSH Hardening&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Read effective SSH configuration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sshd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -z&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Cannot read SSH configuration (sshd -T failed)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^port &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;22&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH port changed: ${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH is running on default port 22&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Root Login&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ROOT_LOGIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^permitrootlogin &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ROOT_LOGIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;no&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Root login disabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Root login is &amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ROOT_LOGIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; (should be &amp;#39;no&amp;#39;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Password Auth&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    PW_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^passwordauthentication &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$PW_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;no&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Password authentication disabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Password authentication is enabled!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Pubkey Auth&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    PUBKEY_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^pubkeyauthentication &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$PUBKEY_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;yes&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Public-key authentication enabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Public-key authentication is disabled!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # MaxAuthTries&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    MAX_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^maxauthtries &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$MAX_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -le&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 3&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;MaxAuthTries: ${&lt;&#x2F;span&gt;&lt;span&gt;MAX_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;MaxAuthTries is ${&lt;&#x2F;span&gt;&lt;span&gt;MAX_AUTH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} (recommended: &amp;lt;=3)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # LoginGraceTime&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    GRACE_TIME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^logingracetime &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$GRACE_TIME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -le&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 60&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;LoginGraceTime: ${&lt;&#x2F;span&gt;&lt;span&gt;GRACE_TIME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}s&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;LoginGraceTime is ${&lt;&#x2F;span&gt;&lt;span&gt;GRACE_TIME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}s (recommended: &amp;lt;=60)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # X11Forwarding&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    X11&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^x11forwarding &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$X11&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;no&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;X11Forwarding disabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;X11Forwarding is enabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # TCP Forwarding&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    TCP_FWD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^allowtcpforwarding &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$TCP_FWD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;no&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;TCP-Forwarding disabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;TCP-Forwarding is enabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Agent Forwarding&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    AGENT_FWD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^allowagentforwarding &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $2}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$AGENT_FWD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;no&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Agent-Forwarding disabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Agent-Forwarding is enabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # AllowUsers set&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ALLOW_USERS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^allowusers &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{$1=&amp;quot;&amp;quot;; print $0}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; xargs&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ALLOW_USERS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;AllowUsers restricted to: ${&lt;&#x2F;span&gt;&lt;span&gt;ALLOW_USERS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;AllowUsers is not set (all users can use SSH)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Check if insecure Key Algorithms are accepted&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ACCEPTED_ALGOS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSHD_CONFIG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^pubkeyacceptedalgorithms &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{$1=&amp;quot;&amp;quot;; print $0}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; xargs&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ACCEPTED_ALGOS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ACCEPTED_ALGOS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -qw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;ssh-rsa&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;ssh-rsa (SHA-1) is still allowed - use rsa-sha2-* only!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Only modern Key Algorithms allowed&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Allowed Algorithms: ${&lt;&#x2F;span&gt;&lt;span&gt;ACCEPTED_ALGOS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;PubkeyAcceptedAlgorithms: System Default (SHA-1 blocked since OpenSSH 8.8)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# SSH Key present for Admin User&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ADMIN_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; echo ~&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;.ssh&#x2F;authorized_keys&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    KEY_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^ssh-&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;.ssh&#x2F;authorized_keys&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$KEY_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -gt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;KEY_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} SSH key(s) stored for &amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        while&lt;&#x2F;span&gt;&lt;span&gt; IFS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; read -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; line&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            KEY_TYPE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $1}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            KEY_COMMENT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $3}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            KEY_BITS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh-keygen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -l -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;stdin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $1}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  Key: ${&lt;&#x2F;span&gt;&lt;span&gt;KEY_TYPE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} ${&lt;&#x2F;span&gt;&lt;span&gt;KEY_BITS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;?} bit (${&lt;&#x2F;span&gt;&lt;span&gt;KEY_COMMENT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;no comment&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;})&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        done &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;lt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^ssh-&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_HOME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;.ssh&#x2F;authorized_keys&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No SSH keys in authorized_keys!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No authorized_keys file for &amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39;!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SSH_VERSION&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -V&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH Version: ${&lt;&#x2F;span&gt;&lt;span&gt;SSH_VERSION&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 4. FIREWALL (UFW)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;4. Firewall (UFW)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# SSH_PORT for later use (if sshd -T failed)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;${SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;8496}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Fallback to a common custom port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    UFW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ufw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$UFW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Status: active&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;UFW is active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Default Policies&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        UFW_VERBOSE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ufw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status verbose&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$UFW_VERBOSE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;deny (incoming)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default policy incoming: deny&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default policy incoming is NOT deny!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$UFW_VERBOSE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;allow (outgoing)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default policy outgoing: allow&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default policy outgoing is not &amp;#39;allow&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # List open ports&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Active rules:&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        ufw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status numbered&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -E&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^\[&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; | while&lt;&#x2F;span&gt;&lt;span&gt; IFS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; read -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rule&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;         ${&lt;&#x2F;span&gt;&lt;span&gt;rule&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # SSH port with rate-limit?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$UFW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}.*LIMIT&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH port ${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} has Rate-Limiting&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        elif&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$UFW_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH port ${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} is open, but WITHOUT Rate-Limiting&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH port ${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} is not explicitly in UFW&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;UFW is NOT active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # UFW Logging Redirect (VNC Console fix)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;rsyslog.d&#x2F;20-ufw.conf ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;UFW logs are redirected to &#x2F;var&#x2F;log&#x2F;ufw.log (console remains clean)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;UFW logs not redirected - VNC console will be flooded with [UFW BLOCK]&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;UFW is not installed&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 5. FAIL2BAN&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;5. Fail2Ban&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fail2ban-client&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; systemctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; is-active&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --quiet&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fail2ban&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Fail2Ban is running&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # SSH Jail active?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; fail2ban-client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status sshd&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH Jail is active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            F2B_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;fail2ban-client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status sshd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            BANNED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$F2B_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Currently banned&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $NF}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            TOTAL_BANNED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$F2B_STATUS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Total banned&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $NF}&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Currently banned: ${&lt;&#x2F;span&gt;&lt;span&gt;BANNED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}, Total banned: ${&lt;&#x2F;span&gt;&lt;span&gt;TOTAL_BANNED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SSH Jail is NOT active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Check configuration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        F2B_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^port&amp;quot; &#x2F;etc&#x2F;fail2ban&#x2F;jail.local&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $NF}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$F2B_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Fail2Ban monitors correct SSH port (${&lt;&#x2F;span&gt;&lt;span&gt;F2B_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;})&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        elif&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$F2B_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Fail2Ban monitors port ${&lt;&#x2F;span&gt;&lt;span&gt;F2B_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}, SSH runs on ${&lt;&#x2F;span&gt;&lt;span&gt;SSH_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Fail2Ban is installed, but NOT active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Fail2Ban is not installed&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 6. AUTOMATIC UPDATES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;6. Automatic Updates&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; dpkg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -l&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; unattended-upgrades&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;unattended-upgrades is installed&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;apt&#x2F;apt.conf.d&#x2F;20auto-upgrades ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;Unattended-Upgrade &amp;quot;1&amp;quot;&amp;#39; &#x2F;etc&#x2F;apt&#x2F;apt.conf.d&#x2F;20auto-upgrades&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Automatic upgrades are enabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;20auto-upgrades exists, but upgrades appear disabled&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;20auto-upgrades configuration is missing&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;unattended-upgrades is not installed&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 7. DOCKER&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;7. Docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker is installed: $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --version&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; systemctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; is-active&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --quiet&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker daemon is running&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker daemon is not active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Docker Compose&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose version&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;dev&#x2F;null;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker Compose: $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose version&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker Compose Plugin not found&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # User in docker group&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; groups&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -qw&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; is in the docker group&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;#39;${&lt;&#x2F;span&gt;&lt;span&gt;ADMIN_USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;#39; is NOT in the docker group&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Log rotation configured?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;docker&#x2F;daemon.json ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;max-size&amp;quot; &#x2F;etc&#x2F;docker&#x2F;daemon.json&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker Log rotation configured&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            MAX_SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;max-size&amp;quot; &#x2F;etc&#x2F;docker&#x2F;daemon.json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39; &amp;quot;,&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d: -f2&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            MAX_FILE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;max-file&amp;quot; &#x2F;etc&#x2F;docker&#x2F;daemon.json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39; &amp;quot;,&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d: -f2&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;max-size: ${&lt;&#x2F;span&gt;&lt;span&gt;MAX_SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}, max-file: ${&lt;&#x2F;span&gt;&lt;span&gt;MAX_FILE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;daemon.json exists, but no Log rotation configured&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No daemon.json - Docker logs can grow indefinitely!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Proxy network&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; network ls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;proxy&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker network &amp;#39;proxy&amp;#39; exists&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker network &amp;#39;proxy&amp;#39; is missing&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker is not installed&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 8. TRAEFIK PREPARATION&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;8. Traefik Stack Preparation&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Directory ${&lt;&#x2F;span&gt;&lt;span&gt;TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} exists&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Subdirectories&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&#x2F;dynamic traefik&#x2F;logs traefik&#x2F;certs crowdsec&#x2F;config crowdsec&#x2F;data&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;${&lt;&#x2F;span&gt;&lt;span&gt;dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  ${&lt;&#x2F;span&gt;&lt;span&gt;dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F; is present&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  ${&lt;&#x2F;span&gt;&lt;span&gt;dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F; is missing&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # acme.json Permissions&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;traefik&#x2F;certs&#x2F;acme.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        ACME_PERMS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;stat -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;%a&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;traefik&#x2F;certs&#x2F;acme.json&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ACME_PERMS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;600&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;acme.json has correct permissions (600)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;acme.json has permissions ${&lt;&#x2F;span&gt;&lt;span&gt;ACME_PERMS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} (should be 600)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;acme.json does not exist yet&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Directory ${&lt;&#x2F;span&gt;&lt;span&gt;TRAEFIK_DIR&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} is missing&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 9. LOG ROTATION&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;9. Log Rotation&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Persistent Journal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;var&#x2F;log&#x2F;journal ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Persistent Journal activated&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    JOURNAL_SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;journalctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --disk-usage&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -oP&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;[\d.]+\w+&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Journal size: ${&lt;&#x2F;span&gt;&lt;span&gt;JOURNAL_SIZE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;unknown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Journal is NOT persistent (logs are lost on reboot)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Logrotate: Traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;logrotate.d&#x2F;traefik ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Logrotate for Traefik configured&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Logrotate for Traefik is missing&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Logrotate: UFW&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;logrotate.d&#x2F;ufw-custom ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Logrotate for UFW logs configured&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;elif&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;logrotate.d&#x2F;ufw ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Logrotate for UFW logs configured (system default)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Logrotate for UFW logs is missing - &#x2F;var&#x2F;log&#x2F;ufw.log can grow indefinitely!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Docker Log Rotation (Summary)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;etc&#x2F;docker&#x2F;daemon.json ]] &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;max-size&amp;quot; &#x2F;etc&#x2F;docker&#x2F;daemon.json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker Container logs rotated&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Docker Container logs are not rotated&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 10. NETWORK &amp;amp; OPEN PORTS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;10. Network &amp;amp; Open Ports&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Listening ports (externally accessible):&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ss&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -tlnp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;127.0.0&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;LISTEN&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; | while&lt;&#x2F;span&gt;&lt;span&gt; IFS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; read -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; line&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{print $4}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; rev&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d: -f1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; rev&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    PROC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$line&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -oP&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;users:\(\(&amp;quot;\K[^&amp;quot;]+&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;unknown&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;         Port ${&lt;&#x2F;span&gt;&lt;span&gt;PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} (${&lt;&#x2F;span&gt;&lt;span&gt;PROC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;})&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check for known insecure services&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;INSECURE_FOUND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;for&lt;&#x2F;span&gt;&lt;span&gt; svc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; telnetd rshd rlogind vsftpd proftpd&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; systemctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; is-active&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --quiet&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$svc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Insecure service running: ${&lt;&#x2F;span&gt;&lt;span&gt;svc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        INSECURE_FOUND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$INSECURE_FOUND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No insecure legacy services active&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 11. FILESYSTEM SECURITY&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;11. Filesystem&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# World-writable files in critical directories&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;WW_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;find&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc &#x2F;usr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -xdev -type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -perm -o+w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; wc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -l&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$WW_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;No world-writable files in &#x2F;etc and &#x2F;usr&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;WW_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} world-writable file(s) in &#x2F;etc or &#x2F;usr&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# SUID Binaries (informative)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SUID_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;find&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -xdev -type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -perm -4000&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; wc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -l&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;log_info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;SUID binaries found: ${&lt;&#x2F;span&gt;&lt;span&gt;SUID_COUNT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} (manual review if needed)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Disk Usage&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DISK_USAGE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;df&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;NR==2 {print $5}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;%&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$DISK_USAGE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -lt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 80&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_pass&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Disk usage: ${&lt;&#x2F;span&gt;&lt;span&gt;DISK_USAGE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}%&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;elif&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$DISK_USAGE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -lt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 90&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_warn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Disk usage: ${&lt;&#x2F;span&gt;&lt;span&gt;DISK_USAGE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}% (getting low)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    log_fail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Disk usage: ${&lt;&#x2F;span&gt;&lt;span&gt;DISK_USAGE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}% (critical!)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# SUMMARY&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# =============================================================================&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}============================================================${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}  SUMMARY${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}============================================================${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  ${&lt;&#x2F;span&gt;&lt;span&gt;GREEN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}Passed:${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}   ${&lt;&#x2F;span&gt;&lt;span&gt;pass_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  ${&lt;&#x2F;span&gt;&lt;span&gt;YELLOW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}Warnings:${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;} ${&lt;&#x2F;span&gt;&lt;span&gt;warn_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  ${&lt;&#x2F;span&gt;&lt;span&gt;RED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}Failed:${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}    ${&lt;&#x2F;span&gt;&lt;span&gt;fail_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}============================================================${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$fail_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$warn_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;\n${&lt;&#x2F;span&gt;&lt;span&gt;GREEN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}Excellent! All checks passed.${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;elif&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$fail_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;\n${&lt;&#x2F;span&gt;&lt;span&gt;YELLOW&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}Good - no critical failures, but review warnings.${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;\n${&lt;&#x2F;span&gt;&lt;span&gt;RED&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}${&lt;&#x2F;span&gt;&lt;span&gt;BOLD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}Attention - there are critical failures that should be resolved!${&lt;&#x2F;span&gt;&lt;span&gt;NC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$fail_count&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</description>
      </item>
      <item>
          <title>Self-Hosting Plausible Analytics with Docker and Traefik</title>
          <pubDate>Wed, 11 Mar 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/plausible-analytics-selfhosted/</link>
          <guid>https://criticalbasics.xyz/posts/plausible-analytics-selfhosted/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/plausible-analytics-selfhosted/">&lt;p&gt;This guide walks you through deploying a fully self-hosted &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;plausible.io&#x2F;&quot;&gt;Plausible Analytics&lt;&#x2F;a&gt; instance. Plausible is a lightweight, privacy-friendly alternative to Google Analytics — it doesn’t use cookies, is fully GDPR-compliant, and respects the privacy of your visitors. By self-hosting it, you retain complete ownership of your data while keeping your analytics costs predictable.&lt;&#x2F;p&gt;
&lt;p&gt;We use the &lt;strong&gt;official Plausible Community Edition repository&lt;&#x2F;strong&gt; as the foundation and integrate it with our existing Traefik v3 reverse proxy via a &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt;. This approach keeps the original &lt;code&gt;compose.yml&lt;&#x2F;code&gt; untouched, making future updates clean and painless.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-03-11&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created for self-hosting Plausible CE v3.2.0 behind Traefik v3 with CrowdSec, based on the official repository.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide builds upon a secure Docker environment. Before you begin, you must have a fully functional Traefik v3 and CrowdSec stack.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik stack running as described in the prerequisite guide.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik_v3_crowdsec_tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our public-facing reverse proxy and security.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A dedicated subdomain for your Plausible instance (e.g., &lt;code&gt;plausible.your-domain.com&lt;&#x2F;code&gt;) pointed to your server’s IP address.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;git&lt;&#x2F;code&gt; and the &lt;code&gt;openssl&lt;&#x2F;code&gt; utility (&lt;code&gt;sudo apt install git openssl&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-clone-the-official-repository&quot;&gt;2. Clone the Official Repository&lt;&#x2F;h2&gt;
&lt;p&gt;Instead of building our own Docker Compose configuration from scratch, we clone the official Plausible CE repository. It ships with a tested &lt;code&gt;compose.yml&lt;&#x2F;code&gt; and pre-configured ClickHouse settings (including IPv4-only mode and resource-friendly defaults).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git clone&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; v3.2.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --single-branch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;github.com&#x2F;plausible&#x2F;community-edition plausible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The repository contains the following structure:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;plausible&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── clickhouse&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   ├── default-profile-low-resources-overrides.xml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   ├── ipv4-only.xml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   ├── logs.xml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   └── low-resources.xml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── compose.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── LICENSE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;└── README.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHY NOT A CUSTOM COMPOSE FILE?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The official &lt;code&gt;compose.yml&lt;&#x2F;code&gt; includes battle-tested ClickHouse configuration, proper healthchecks, and sensible defaults. Building a custom Compose file from scratch is error-prone and makes updates harder. Instead, we use a &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt; to add only our Traefik-specific configuration — Docker Compose merges both files automatically.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;3-configuration&quot;&gt;3. Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;We only need to create two files: an &lt;code&gt;.env&lt;&#x2F;code&gt; file with your settings and a &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt; for Traefik integration.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-generate-secrets&quot;&gt;3.1. Generate Secrets&lt;&#x2F;h3&gt;
&lt;p&gt;Plausible requires a secret key base for signing tokens and a TOTP vault key for two-factor authentication.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Generate the secret key base (at least 64 bytes)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;SECRET_KEY_BASE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -base64 48&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your Secret Key Base is: &lt;&#x2F;span&gt;&lt;span&gt;$SECRET_KEY_BASE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Generate the TOTP vault key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TOTP_VAULT_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -base64 32&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your TOTP Vault Key is: &lt;&#x2F;span&gt;&lt;span&gt;$TOTP_VAULT_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            SAVE THESE SECRETS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Copy these generated values into a temporary text file. You will need to paste them into the &lt;code&gt;.env&lt;&#x2F;code&gt; file in the next step.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-2-environment-configuration-env&quot;&gt;3.2. Environment Configuration (&lt;code&gt;.env&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This single file holds all your instance-specific settings. Create it in the repository root:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Required Settings ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Replace with your actual domain, including https:&#x2F;&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;BASE_URL=https:&#x2F;&#x2F;plausible.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Paste the secret key base generated in step 3.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;SECRET_KEY_BASE=PASTE-YOUR-SECRET-KEY-BASE-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Paste the TOTP vault key generated in step 3.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;TOTP_VAULT_KEY=PASTE-YOUR-TOTP-VAULT-KEY-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Registration ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# &amp;quot;invite_only&amp;quot; = only you can invite users. &amp;quot;true&amp;quot; = no new signups at all.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Remove this line entirely to allow open registration.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DISABLE_REGISTRATION=invite_only&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Email &#x2F; SMTP (Optional but recommended) ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Without SMTP, features like password resets and weekly reports will not work.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# The &amp;quot;From:&amp;quot; address shown in emails sent by Plausible.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Use your SMTP login address or an alias your mail server accepts.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;MAILER_EMAIL=plausible@your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Your SMTP server address, e.g. smtp.mailbox.org or mail.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;SMTP_HOST_ADDR=your-mail-server.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Your SMTP port: typically 587 (STARTTLS) or 465 (SSL)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;SMTP_HOST_PORT=587&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Your SMTP username — usually your full email address&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;SMTP_USER_NAME=your-smtp-username&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Your SMTP password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;SMTP_USER_PWD=your-smtp-password&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Set to &amp;quot;true&amp;quot; only if your port is 465 (implicit SSL). For port 587, keep &amp;quot;false&amp;quot;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;SMTP_HOST_SSL_ENABLED=false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            BASE_URL MUST BE CORRECT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;BASE_URL&lt;&#x2F;code&gt; must match your public URL exactly, including &lt;code&gt;https:&#x2F;&#x2F;&lt;&#x2F;code&gt;. A mismatch will cause tracking scripts to fail and break the dashboard.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            REGISTRATION POLICY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;DISABLE_REGISTRATION=invite_only&lt;&#x2F;code&gt; setting means that only you (the admin) can invite new users. This is the recommended setting for personal instances. Set it to &lt;code&gt;true&lt;&#x2F;code&gt; to completely disable new signups, or remove the line entirely to allow open registration.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-3-traefik-integration-compose-override-yml&quot;&gt;3.3. Traefik Integration (&lt;code&gt;compose.override.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file adds the Traefik labels and network connection to the Plausible service. Docker Compose merges it automatically with the official &lt;code&gt;compose.yml&lt;&#x2F;code&gt; — no need to modify the original file.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose.override.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  plausible:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Replace plausible.your-domain.com with your actual domain.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # This tells Traefik which incoming requests to route to this container.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.plausible.rule=Host(`plausible.your-domain.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.plausible.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.plausible.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.plausible.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.plausible.loadbalancer.server.port=8000&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.docker.network=proxy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHY DOES THE DOMAIN APPEAR TWICE?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;&lt;code&gt;BASE_URL&lt;&#x2F;code&gt; in &lt;code&gt;.env&lt;&#x2F;code&gt; tells &lt;strong&gt;Plausible&lt;&#x2F;strong&gt; which URL it runs under — for generating correct links, cookies, and tracking scripts. The Traefik &lt;code&gt;Host()&lt;&#x2F;code&gt; label in &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt; tells &lt;strong&gt;Traefik&lt;&#x2F;strong&gt; which incoming requests to route to the Plausible container. These are two independent systems that don’t read each other’s configuration, so both need the domain separately.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-4-update-configuration-with-your-values&quot;&gt;3.4. Update Configuration with Your Values&lt;&#x2F;h3&gt;
&lt;p&gt;Replace all placeholders in the two files you just created. Every value that needs your input is marked with inline comments.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Domain Name:&lt;&#x2F;strong&gt; In &lt;code&gt;.env&lt;&#x2F;code&gt; (&lt;code&gt;BASE_URL&lt;&#x2F;code&gt;) and &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt; (Traefik &lt;code&gt;Host&lt;&#x2F;code&gt; label), replace &lt;code&gt;plausible.your-domain.com&lt;&#x2F;code&gt; with your actual domain.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Secrets:&lt;&#x2F;strong&gt; In &lt;code&gt;.env&lt;&#x2F;code&gt;, paste the &lt;code&gt;SECRET_KEY_BASE&lt;&#x2F;code&gt; and &lt;code&gt;TOTP_VAULT_KEY&lt;&#x2F;code&gt; you generated in step 3.1.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Email Settings:&lt;&#x2F;strong&gt; In &lt;code&gt;.env&lt;&#x2F;code&gt;, update the SMTP section with your mail server details. Each field has an inline comment explaining what to enter.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;4-launch-the-stack&quot;&gt;4. Launch the Stack&lt;&#x2F;h2&gt;
&lt;p&gt;With both files in place, start the stack:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From within the &#x2F;opt&#x2F;containers&#x2F;plausible directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The first launch will take a few minutes as Docker pulls the images and Plausible runs its initial database migrations. You can monitor the progress with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Press &lt;code&gt;CTRL+C&lt;&#x2F;code&gt; to exit the logs view once all services are stable. You should see Plausible report that it is ready.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;5-verify-the-installation&quot;&gt;5. Verify the Installation&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check Running Containers:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --format&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{{.Names}}&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You should see three containers running: &lt;code&gt;plausible-plausible-1&lt;&#x2F;code&gt;, &lt;code&gt;plausible-plausible_db-1&lt;&#x2F;code&gt; (PostgreSQL), and &lt;code&gt;plausible-plausible_events_db-1&lt;&#x2F;code&gt; (ClickHouse).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access the Dashboard:&lt;&#x2F;strong&gt;
Open a web browser and navigate to &lt;code&gt;https:&#x2F;&#x2F;plausible.your-domain.com&lt;&#x2F;code&gt;. You should see the Plausible registration page.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create Your Admin Account:&lt;&#x2F;strong&gt;
Register with your email address and a strong password. Since we set &lt;code&gt;DISABLE_REGISTRATION=invite_only&lt;&#x2F;code&gt;, this first account becomes the admin. All future registrations will require an invitation from you.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            EMAIL VERIFICATION WITHOUT SMTP
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;If you skipped the SMTP configuration, you can manually verify your email address by running:
&lt;code&gt;sudo docker compose exec plausible_db psql -U postgres -h localhost -d plausible_db -c &quot;UPDATE users SET email_verified = true;&quot;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;6-add-plausible-to-your-website&quot;&gt;6. Add Plausible to Your Website&lt;&#x2F;h2&gt;
&lt;p&gt;After logging in and creating your first site in the dashboard, Plausible will provide a tracking snippet. Starting with v3, Plausible generates a &lt;strong&gt;dynamic, site-specific script&lt;&#x2F;strong&gt; for each site you add. Simply copy the snippet from the site settings and add it to the &lt;code&gt;&amp;lt;head&amp;gt;&lt;&#x2F;code&gt; section of your website.&lt;&#x2F;p&gt;
&lt;p&gt;For a Zola-based site, add the provided snippet to your &lt;code&gt;templates&#x2F;base.html&lt;&#x2F;code&gt; (or equivalent template). It will look something like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;lt;!-- Replace both domains: plausible.your-domain.com = your Plausible instance, your-website.com = the site you want to track --&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;script&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; defer src&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;https:&#x2F;&#x2F;plausible.your-domain.com&#x2F;js&#x2F;script.js&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; data-domain&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;your-website.com&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;script&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            NEW DYNAMIC SNIPPET IN V3
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Plausible v3 introduced a new, more configurable tracking snippet that is specific to each site. Legacy &lt;code&gt;script.js&lt;&#x2F;code&gt; snippets from older versions will continue to work, but new sites will receive the dynamic format. You can configure tracking options (outbound links, file downloads, tagged events, etc.) directly in the site settings without changing the script URL.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;7-maintenance&quot;&gt;7. Maintenance&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;updating-plausible&quot;&gt;Updating Plausible&lt;&#x2F;h3&gt;
&lt;p&gt;Since we cloned the official repository, updating involves fetching the new version tag and restarting. Your &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt; and &lt;code&gt;.env&lt;&#x2F;code&gt; remain untouched.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;plausible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Fetch the latest tags from the repository&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git fetch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check out the new version (replace v3.x.x with the actual new version tag)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git checkout v3.x.x&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Re-apply your override (it&amp;#39;s preserved — just verify it&amp;#39;s still there)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose.override.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Pull the new images and restart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --remove-orphans&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            CHECK RELEASE NOTES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Always consult the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;plausible&#x2F;analytics&#x2F;releases&quot;&gt;official Plausible release notes&lt;&#x2F;a&gt; before updating. Major version upgrades may require changes to your &lt;code&gt;.env&lt;&#x2F;code&gt; or introduce new configuration options.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;backing-up&quot;&gt;Backing Up&lt;&#x2F;h3&gt;
&lt;p&gt;A complete backup consists of the PostgreSQL database (user data, site settings) and the ClickHouse database (analytics events). Since the official setup uses Docker named volumes, we back up via the running containers.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From your &#x2F;opt&#x2F;containers&#x2F;plausible directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Back up the PostgreSQL database&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_db pg_dump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; postgres&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_db&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; gzip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_pg_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.sql.gz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Back up the ClickHouse data via a temporary Alpine container&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rm \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_event-data:&#x2F;data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  -v&lt;&#x2F;span&gt;&lt;span&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;pwd&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;:&#x2F;backup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  alpine tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -czvf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;backup&#x2F;plausible_clickhouse_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.tar.gz&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;data .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Backup complete.&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            BACKUP STRATEGY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;For a production instance, consider automating this with a cron job. The PostgreSQL dump can run against the live database without stopping services. For ClickHouse, a file-level backup of the named volume is sufficient for smaller instances.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;restoring-from-backup&quot;&gt;Restoring from Backup&lt;&#x2F;h3&gt;
&lt;p&gt;To restore your instance from a backup:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;plausible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Stop the main application&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose stop plausible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Restore PostgreSQL&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gunzip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_pg_backup_YYYY-MM-DD.sql.gz&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_db psql&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; postgres&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_db&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Restore ClickHouse (stop ClickHouse first)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose stop plausible_events_db&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rm \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; plausible_event-data:&#x2F;data&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  -v&lt;&#x2F;span&gt;&lt;span&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;pwd&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;:&#x2F;backup&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  alpine sh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;rm -rf &#x2F;data&#x2F;* &amp;amp;&amp;amp; tar -xzvf &#x2F;backup&#x2F;plausible_clickhouse_backup_YYYY-MM-DD.tar.gz -C &#x2F;data&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose start plausible_events_db&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 4. Start everything&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose start plausible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You now have a fully self-hosted, privacy-respecting analytics platform running behind your secure Traefik and CrowdSec stack. By using the official Plausible CE repository as a foundation and adding only a lightweight &lt;code&gt;compose.override.yml&lt;&#x2F;code&gt; for Traefik, your setup is easy to maintain and update — closely following the upstream project without custom workarounds.&lt;&#x2F;p&gt;
&lt;p&gt;Plausible gives you all the essential web analytics insights — page views, referrers, locations, devices — without compromising your visitors’ privacy or relying on third-party services. Your data stays on your server, under your control.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;plausible.io&amp;#x2F;docs&amp;#x2F;self-hosting&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;PLAUSIBLE SELF-HOSTING DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;plausible&amp;#x2F;community-edition&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;PLAUSIBLE CE ON GITHUB&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Essential Initial Setup for a Secure Debian Server</title>
          <pubDate>Tue, 03 Mar 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/debian-server-initial-setup/</link>
          <guid>https://criticalbasics.xyz/posts/debian-server-initial-setup/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/debian-server-initial-setup/">&lt;p&gt;Welcome to the essential security guide for any new Debian server. A fresh installation is a blank slate, and taking the right steps immediately after setup is crucial for protecting your server from threats. This guide provides a logical, step-by-step process to establish a strong security baseline.&lt;&#x2F;p&gt;
&lt;p&gt;We will cover user management, hardening SSH access, configuring a firewall, setting up automatic intrusion prevention, and enabling automatic security updates.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            FOLLOW THE ORDER
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;These steps are designed to be followed sequentially. For example, we will set up SSH key authentication &lt;em&gt;before&lt;&#x2F;em&gt; disabling password logins to ensure you don’t lock yourself out.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-03-03&lt;&#x2F;td&gt;&lt;td&gt;Comprehensive update: hardened SSH config, added backup strategy, monitoring, and WireGuard.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-07-10&lt;&#x2F;td&gt;&lt;td&gt;Initial version of the comprehensive Debian hardening guide.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-1-initial-login-update-and-hostname&quot;&gt;Step 1: Initial Login, Update and Hostname&lt;&#x2F;h2&gt;
&lt;p&gt;First, log into your new server as the &lt;code&gt;root&lt;&#x2F;code&gt; user. Your cloud provider will have supplied you with the initial IP address and password.&lt;&#x2F;p&gt;
&lt;p&gt;The very first action should always be to update the package list and upgrade all installed packages. For a fresh server, we use &lt;code&gt;full-upgrade&lt;&#x2F;code&gt; to ensure even kernel updates and new dependencies are handled.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Log in as root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; root@your_server_ip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Update package lists&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;apt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; update&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Upgrade all installed packages (including kernel updates)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;apt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; full-upgrade&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Reboot to ensure the new kernel and all updates are active&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;reboot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After the reboot, log back in. It’s best practice to set the hostname immediately so all subsequent logs reflect the correct name.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Set your server&amp;#39;s hostname&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; hostnamectl set-hostname my-awesome-server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You should also edit &lt;code&gt;&#x2F;etc&#x2F;hosts&lt;&#x2F;code&gt; to associate the new hostname with &lt;code&gt;127.0.1.1&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-2-create-a-dedicated-admin-user&quot;&gt;Step 2: Create a Dedicated Admin User&lt;&#x2F;h2&gt;
&lt;p&gt;Operating directly as the &lt;code&gt;root&lt;&#x2F;code&gt; user is risky. We will create a new user account with administrative privileges via the &lt;code&gt;sudo&lt;&#x2F;code&gt; command. This improves security and provides better auditing.&lt;&#x2F;p&gt;
&lt;p&gt;Replace &lt;code&gt;adminuser&lt;&#x2F;code&gt; with a username of your choice.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create a new user&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;adduser&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; adminuser&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# You will be prompted to set a password and fill in user information.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add the new user to the &amp;#39;sudo&amp;#39; group&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;usermod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -aG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sudo adminuser&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Log out from the root session&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            SUDO PASSWORD SECURITY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;By default, &lt;code&gt;sudo&lt;&#x2F;code&gt; will ask for your user password before executing administrative commands. Do not configure &lt;code&gt;NOPASSWD&lt;&#x2F;code&gt; for your admin user. This password prompt prevents accidental destructive commands and is an additional authentication layer if your SSH session is compromised.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;From now on, you will log in as this new user and prefix any administrative commands with &lt;code&gt;sudo&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-3-harden-ssh-access&quot;&gt;Step 3: Harden SSH Access&lt;&#x2F;h2&gt;
&lt;p&gt;Securing SSH is the single most effective thing you can do to protect your server. While we will change the default port to reduce log noise from automated scanners, the real security comes from key-only authentication and the hardening settings below.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-set-up-ssh-key-authentication&quot;&gt;3.1. Set Up SSH Key Authentication&lt;&#x2F;h3&gt;
&lt;p&gt;SSH keys are far more secure than passwords. A key pair consists of a private key (which you keep on your local computer) and a public key (which you place on the server).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;On your local computer (not the server):&lt;&#x2F;strong&gt;
If you don’t have an SSH key pair yet, generate one. The &lt;code&gt;ed25519&lt;&#x2F;code&gt; algorithm is modern and highly secure.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# This command is run on your local machine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh-keygen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ed25519&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;your_email@example.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Press Enter to accept the default file location and set an optional (but recommended) passphrase for your key.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Copy your public key to the server:&lt;&#x2F;strong&gt;
The &lt;code&gt;ssh-copy-id&lt;&#x2F;code&gt; command is the easiest way to do this. It will automatically add your public key to the correct file on the server.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Replace with your new username and server IP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh-copy-id&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; adminuser@your_server_ip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After this, you should be able to log into your server as &lt;code&gt;adminuser&lt;&#x2F;code&gt; without being asked for a password (you might be asked for your key’s passphrase if you set one).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-configure-and-secure-the-ssh-daemon&quot;&gt;3.2. Configure and Secure the SSH Daemon&lt;&#x2F;h3&gt;
&lt;p&gt;Now we will edit the main SSH configuration file to improve security.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            DO NOT CLOSE YOUR TERMINAL!
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Keep your current SSH session open while performing these steps. If you make a mistake, you can revert the changes. Only close the terminal after you have successfully tested the new login method in a separate terminal window.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Open the configuration file with a text editor:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; vim &#x2F;etc&#x2F;ssh&#x2F;sshd_config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make the following changes to harden the configuration:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Change port (optional, reduces log noise from bots)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Port&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 8496&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Authentication&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PermitRootLogin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PasswordAuthentication&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PubkeyAuthentication&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;MaxAuthTries&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;LoginGraceTime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 30&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Restrict to specific user(s)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;AllowUsers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; adminuser&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Disable unnecessary features&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;X11Forwarding&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;AllowTcpForwarding&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;AllowAgentForwarding&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Restrict key algorithms to modern, secure options&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;PubkeyAcceptedAlgorithms&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ssh-ed25519,sk-ssh-ed25519@openssh.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Key explanations for these options:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;MaxAuthTries 3&lt;&#x2F;strong&gt; — Limits login attempts per connection to 3.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;LoginGraceTime 30&lt;&#x2F;strong&gt; — Disconnects after 30 seconds without successful authentication.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;AllowUsers adminuser&lt;&#x2F;strong&gt; — Only the specified user(s) can log in via SSH.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;X11Forwarding no&lt;&#x2F;strong&gt; — Disables GUI forwarding, reducing attack surface.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;AllowTcp&#x2F;AgentForwarding no&lt;&#x2F;strong&gt; — Prevents SSH tunneling and potential agent exploitation.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;PubkeyAcceptedAlgorithms&lt;&#x2F;strong&gt; — Restricts to Ed25519 and FIDO2&#x2F;Hardware keys (YubiKey).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Save the file and exit the editor.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-3-test-and-restart-ssh&quot;&gt;3.3. Test and Restart SSH&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            CRITICAL: TEST BEFORE RESTART
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Always validate your configuration before restarting the SSH daemon. A syntax error can lead to a permanent lockout.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ALWAYS test configuration before restarting&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sshd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Only if no errors are shown, restart the service:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl restart sshd.service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, &lt;strong&gt;open a new terminal window&lt;&#x2F;strong&gt; and try to connect using the new port and your key.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Use your username, IP, and the new port number&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; adminuser@your_server_ip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p 8496&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If the login is successful, your SSH hardening is complete. You can now safely close the old terminal window.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-4-configure-a-firewall-with-ufw&quot;&gt;Step 4: Configure a Firewall with UFW&lt;&#x2F;h2&gt;
&lt;p&gt;A firewall is essential for controlling network traffic. We will use UFW (Uncomplicated Firewall) because it is user-friendly and effective.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Install UFW&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install ufw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we will set up some basic rules. By default, we will deny all incoming traffic and allow all outgoing traffic. Then we will explicitly allow traffic for the services we need.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Set default policies&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw default deny incoming&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw default allow outgoing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Allow standard web traffic&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow http&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Port 80&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow https&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Port 443&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# IMPORTANT: Allow your new SSH port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# We use &amp;#39;limit&amp;#39; to help protect against brute-force attacks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw limit 8496&#x2F;tcp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Use the port you chose&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, enable the firewall. It will ask for confirmation to proceed.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw enable&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check the status of the firewall at any time&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw status verbose&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            CLOUD FIREWALL
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Cloud providers like Hetzner, DigitalOcean, or AWS offer cloud-level firewalls in their web panel. These filter traffic before it reaches your server. If available, mirror your UFW rules there as an additional layer.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-5-prevent-intrusion-with-fail2ban&quot;&gt;Step 5: Prevent Intrusion with Fail2Ban&lt;&#x2F;h2&gt;
&lt;p&gt;With key-only SSH authentication, brute-force attacks against SSH are already neutralized. So why Fail2Ban? Because your server will likely run more than SSH. Once you deploy a web server, mail server, or other services, Fail2Ban protects those too. It is a general-purpose intrusion prevention tool.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Install Fail2Ban&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install fail2ban&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Fail2Ban’s configuration should be done in a local file, which overrides the default settings without being changed during package updates.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create a local configuration file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cp &#x2F;etc&#x2F;fail2ban&#x2F;jail.conf &#x2F;etc&#x2F;fail2ban&#x2F;jail.local&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, edit the new local file to configure it for our custom SSH port.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; vim &#x2F;etc&#x2F;fail2ban&#x2F;jail.local&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Find the &lt;code&gt;[sshd]&lt;&#x2F;code&gt; section. Most settings can be left as default, but you must update the &lt;code&gt;port&lt;&#x2F;code&gt; to match your custom SSH port and ensure it’s enabled.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[sshd]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;enabled&lt;&#x2F;span&gt;&lt;span&gt;  = true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;port&lt;&#x2F;span&gt;&lt;span&gt;     = 8496&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;maxretry&lt;&#x2F;span&gt;&lt;span&gt; = 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;bantime&lt;&#x2F;span&gt;&lt;span&gt;  = 1h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;findtime&lt;&#x2F;span&gt;&lt;span&gt; = 10m&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save the file and restart Fail2Ban to apply the changes.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl restart fail2ban&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check the status of the SSH jail&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fail2ban-client status sshd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            VERSATILE PROTECTION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Fail2Ban is incredibly powerful. You can configure it to protect many other services, such as web servers (Nginx, Apache) or mail servers, by creating custom jails.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-6-automate-security-updates&quot;&gt;Step 6: Automate Security Updates&lt;&#x2F;h2&gt;
&lt;p&gt;Even with a hardened server, new vulnerabilities are discovered all the time. It is vital to install security updates promptly. The &lt;code&gt;unattended-upgrades&lt;&#x2F;code&gt; package can do this for you automatically.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Install the package&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install unattended-upgrades apt-listchanges&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, run the configuration wizard to enable it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# This will open a simple text-based interface&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dpkg-reconfigure&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -plow&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; unattended-upgrades&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Select &lt;strong&gt;“Yes”&lt;&#x2F;strong&gt; to enable automatic updates. This will create a configuration file that tells the system to automatically install packages from Debian’s security repository.&lt;&#x2F;p&gt;
&lt;p&gt;To further harden this, you can configure email notifications and an automatic reboot policy (essential for kernel updates) in &lt;code&gt;&#x2F;etc&#x2F;apt&#x2F;apt.conf.d&#x2F;50unattended-upgrades&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Email notification (requires a working mail setup like msmtp)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Unattended-Upgrade::Mail &amp;quot;your@email.com&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Automatic reboot policy (e.g., at 04:00 AM)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Unattended-Upgrade::Automatic-Reboot &amp;quot;true&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Unattended-Upgrade::Automatic-Reboot-Time &amp;quot;04:00&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-7-final-system-housekeeping&quot;&gt;Step 7: Final System Housekeeping&lt;&#x2F;h2&gt;
&lt;p&gt;A few final touches will make your server easier to manage.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;1. Set the Timezone:&lt;&#x2F;strong&gt; Correct log timestamps are crucial for troubleshooting.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Set your timezone, e.g., for Berlin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; timedatectl set-timezone Europe&#x2F;Berlin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;2. Install Useful Tools:&lt;&#x2F;strong&gt; These small utilities are incredibly helpful for administration.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install htop ncdu curl git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;htop&lt;&#x2F;code&gt;: An interactive process viewer.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;ncdu&lt;&#x2F;code&gt;: A disk usage analyzer to easily find large files.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;curl&lt;&#x2F;code&gt;: A tool for transferring data with URLs.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;git&lt;&#x2F;code&gt;: Version control system, often needed to download software.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-8-basic-monitoring-and-logging&quot;&gt;Step 8: Basic Monitoring and Logging&lt;&#x2F;h2&gt;
&lt;p&gt;A secure server is one where you &lt;em&gt;notice&lt;&#x2F;em&gt; when something goes wrong.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;8-1-persistent-journal-logging&quot;&gt;8.1. Persistent Journal Logging&lt;&#x2F;h3&gt;
&lt;p&gt;On some Debian installations, journal logs are lost upon reboot. This makes them persistent:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;var&#x2F;log&#x2F;journal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemd-tmpfiles&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --create --prefix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;var&#x2F;log&#x2F;journal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl restart systemd-journald&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;8-2-logwatch-optional&quot;&gt;8.2. Logwatch (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;Logwatch provides a daily summary of SSH attempts, disk usage, and service errors.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install logwatch&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; logwatch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --detail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Med&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --range&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; yesterday&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; stdout&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;8-3-monitoring-disk-space&quot;&gt;8.3. Monitoring Disk Space&lt;&#x2F;h3&gt;
&lt;p&gt;Full disks are a common cause of service failures.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;df&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ncdu &#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-9-backup-strategy&quot;&gt;Step 9: Backup Strategy&lt;&#x2F;h2&gt;
&lt;p&gt;Security = &lt;strong&gt;Prevent&lt;&#x2F;strong&gt; + &lt;strong&gt;Detect&lt;&#x2F;strong&gt; + &lt;strong&gt;Recover&lt;&#x2F;strong&gt;. A server without a backup is not truly secure.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;core-principles&quot;&gt;Core Principles&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Provider Snapshots:&lt;&#x2F;strong&gt; Enable them as your first layer of defense.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Application-Level Backups:&lt;&#x2F;strong&gt; Use tools like &lt;code&gt;borgbackup&lt;&#x2F;code&gt; or &lt;code&gt;restic&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;3-2-1 Rule:&lt;&#x2F;strong&gt; 3 copies, 2 different media, 1 offsite.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Test Restores:&lt;&#x2F;strong&gt; A backup is only as good as its last successful restore.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Example with BorgBackup:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install borgbackup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;borg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; init&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --encryption=repokey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;path&#x2F;to&#x2F;backup&#x2F;repo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Note: Adjust paths like &#x2F;var&#x2F;lib depending on your data volume (e.g., Docker volumes, databases).&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;borg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; create &#x2F;path&#x2F;to&#x2F;backup&#x2F;repo::&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%Y-%m-%d&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc &#x2F;home &#x2F;var&#x2F;lib&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Verify your backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;borg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; list &#x2F;path&#x2F;to&#x2F;backup&#x2F;repo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-10-optional-maximum-security-ssh-via-wireguard&quot;&gt;Step 10 (Optional): Maximum Security — SSH via WireGuard&lt;&#x2F;h2&gt;
&lt;p&gt;For maximum security, do not expose SSH publicly at all. Access your server through a WireGuard VPN tunnel; SSH then listens only on the VPN interface. This eliminates scanning and brute-force attacks entirely.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-1-setup-wireguard-server&quot;&gt;10.1. Setup WireGuard Server&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install wireguard&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create directory with restricted permissions first&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;umask 077&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;wg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; genkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tee&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc&#x2F;wireguard&#x2F;server_private.key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; wg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pubkey&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc&#x2F;wireguard&#x2F;server_public.key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;(Note: The &lt;code&gt;tee&lt;&#x2F;code&gt; command outputs the private key to your terminal. Do not share this output.)&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-2-server-configuration&quot;&gt;10.2. Server Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Create &lt;code&gt;&#x2F;etc&#x2F;wireguard&#x2F;wg0.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[Interface]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Address&lt;&#x2F;span&gt;&lt;span&gt; = 10.0.0.1&#x2F;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;ListenPort&lt;&#x2F;span&gt;&lt;span&gt; = 51820&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;PrivateKey&lt;&#x2F;span&gt;&lt;span&gt; = &amp;lt;contents of server_private.key&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[Peer]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;PublicKey&lt;&#x2F;span&gt;&lt;span&gt; = &amp;lt;client_public_key&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;AllowedIPs&lt;&#x2F;span&gt;&lt;span&gt; = 10.0.0.2&#x2F;32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Enable the service:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl enable wg-quick@wg0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl start wg-quick@wg0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;10-3-restrict-ssh-to-vpn&quot;&gt;10.3. Restrict SSH to VPN&lt;&#x2F;h3&gt;
&lt;p&gt;In &lt;code&gt;&#x2F;etc&#x2F;ssh&#x2F;sshd_config&lt;&#x2F;code&gt;, set:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ListenAddress&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 10.0.0.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Test and restart:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sshd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl restart sshd.service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;10-4-update-firewall&quot;&gt;10.4. Update Firewall&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 51820&#x2F;udp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw delete limit 8496&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            WARNING
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;After this change, SSH is ONLY reachable via WireGuard. Ensure your VPN connection works before closing your session.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;10-5-client-configuration&quot;&gt;10.5. Client Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;To connect to your newly secured server, you will need to configure a WireGuard client on your local machine using the public key from the server and a newly generated client key pair:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# &#x2F;etc&#x2F;wireguard&#x2F;wg0.conf on client&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[Interface]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Address&lt;&#x2F;span&gt;&lt;span&gt; = 10.0.0.2&#x2F;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;PrivateKey&lt;&#x2F;span&gt;&lt;span&gt; = &amp;lt;client_private_key&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[Peer]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;PublicKey&lt;&#x2F;span&gt;&lt;span&gt; = &amp;lt;server_public_key&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Endpoint&lt;&#x2F;span&gt;&lt;span&gt; = your_server_ip:51820&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;AllowedIPs&lt;&#x2F;span&gt;&lt;span&gt; = 10.0.0.1&#x2F;32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Congratulations! You have successfully performed the essential first steps to harden your new Debian server. By creating a sudo user, securing SSH with key authentication, and setting up a firewall and intrusion prevention system, you have built a solid foundation for any application you wish to deploy.&lt;&#x2F;p&gt;
&lt;p&gt;Combined with monitoring, a solid backup strategy, and optionally a VPN-secured access layer, your server is well-prepared for production use. Your server is now significantly more resistant to common automated attacks and hardware failures.&lt;&#x2F;p&gt;
&lt;!-- Retro-Trennlinie Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: retro_divider(style=&quot;dots&quot;) --&gt;
&lt;!-- Styles: dots, double, dashed, solid, shadow --&gt;


&lt;hr size=&quot;2&quot; noshade color=&quot;#666666&quot; style=&quot;margin: 15px 0; border-style: double;&quot;&gt;

&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHAT&amp;#x27;S NEXT?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;With this secure base, you are now ready to install your applications, such as a web server (Nginx&#x2F;Apache), a database, or a Docker environment.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.debian.org&amp;#x2F;doc&amp;#x2F;manuals&amp;#x2F;securing-debian-manual&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL DEBIAN SECURITY MANUAL&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;wiki.debian.org&amp;#x2F;Fail2ban&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🛡️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;DEBIAN WIKI: FAIL2BAN&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack</title>
          <pubDate>Tue, 03 Mar 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/traefik-v3-crowdsec-tutorial/</link>
          <guid>https://criticalbasics.xyz/posts/traefik-v3-crowdsec-tutorial/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/traefik-v3-crowdsec-tutorial/">&lt;p&gt;This guide provides a streamlined approach to deploying a powerful and secure web stack using Traefik as a reverse proxy and CrowdSec for threat protection. We will use Docker Compose to orchestrate the services, creating a setup that is easy to manage, scale, and maintain.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-03-03&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Security Fix:&lt;&#x2F;strong&gt; Added &lt;code&gt;forwardedHeaders.trustedIPs&lt;&#x2F;code&gt; to both entrypoints to prevent X-Forwarded-For spoofing.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2026-03-03&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Component Updates &amp;amp; Syntax Fixes:&lt;&#x2F;strong&gt; Updated Traefik to v3.6, CrowdSec plugin to v1.4.7, and pinned CrowdSec to v1.6. Fixed Traefik v3 &lt;code&gt;HostRegexp&lt;&#x2F;code&gt; syntax and improved healthchecks.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2026-01-26&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Robustness Update:&lt;&#x2F;strong&gt; Added AccessLog filtering to prevent disk exhaustion and improved logrotate instructions with path discovery.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2026-01-15&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Docs Update:&lt;&#x2F;strong&gt; Removed redundant &lt;code&gt;router.tls=true&lt;&#x2F;code&gt; label from the bypass example and added a new section explaining how to route multiple (sub)domains to one service.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-12-10&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Production Hardening:&lt;&#x2F;strong&gt; Added comprehensive log rotation configuration and disk troubleshooting section based on real-world feedback.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-09-18&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Final Review:&lt;&#x2F;strong&gt; Switched to robust httpChallenge, corrected provider in example, added raw API key generation.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-09-17&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Major Refactor:&lt;&#x2F;strong&gt; Switched from legacy bouncer container to modern Traefik Plugin. Moved all variable configs to Docker Labels.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-07-10&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Added Special Use-Case:&lt;&#x2F;strong&gt; Included a clear example of how to deploy a service &lt;em&gt;without&lt;&#x2F;em&gt; CrowdSec protection for specific needs.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-07-09&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Article created based on best practices for a modern Traefik v3 and CrowdSec deployment with Docker Compose.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before you begin, ensure you have the following installed on your server (e.g., Ubuntu 22.04 or Debian 12):&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Docker&lt;&#x2F;strong&gt; and &lt;strong&gt;Docker Compose&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;curl&lt;&#x2F;code&gt;, &lt;code&gt;openssl&lt;&#x2F;code&gt;, and &lt;code&gt;apache2-utils&lt;&#x2F;code&gt; (for password generation)&lt;&#x2F;li&gt;
&lt;li&gt;A domain name pointed to your server’s IP address&lt;&#x2F;li&gt;
&lt;li&gt;Open firewall ports &lt;code&gt;80&lt;&#x2F;code&gt; and &lt;code&gt;443&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;You can install the required utilities with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; curl openssl apache2-utils&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;A well-organized directory structure is key. We will create a central location for our stack’s configuration and data.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the main directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create directories for each service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&#x2F;{dynamic,logs,certs}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; crowdsec&#x2F;{config,data}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Prepare Let&amp;#39;s Encrypt certificates file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; touch traefik&#x2F;certs&#x2F;acme.json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 600&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&#x2F;certs&#x2F;acme.json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This structure keeps everything tidy and separated.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;3-configuration-files&quot;&gt;3. Configuration Files&lt;&#x2F;h2&gt;
&lt;p&gt;Now, let’s create the configuration files for our stack.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-main-configuration-env&quot;&gt;3.1. Main Configuration (&lt;code&gt;.env&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file holds all your environment-specific variables.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- General Settings ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;TZ=Europe&#x2F;Berlin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DOMAIN_NAME=your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Traefik Settings ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;TRAEFIK_DASHBOARD_HOST=traefik.${DOMAIN_NAME}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;LETSENCRYPT_EMAIL=your-email@example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- CrowdSec Settings ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;CROWDSEC_COLLECTIONS=&amp;quot;crowdsecurity&#x2F;traefik crowdsecurity&#x2F;linux&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Credentials ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;CROWDSEC_BOUNCER_API_KEY=PASTE-YOUR-GENERATED-KEY-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            IMPORTANT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Replace &lt;code&gt;your-domain.com&lt;&#x2F;code&gt;, &lt;code&gt;your-email@example.com&lt;&#x2F;code&gt;. The API key will be generated and pasted in a later step.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-2-traefik-static-configuration-traefik-yml&quot;&gt;3.2. Traefik Static Configuration (&lt;code&gt;traefik.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file contains the core Traefik settings that rarely change.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee traefik.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;global:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  checkNewVersion: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  sendAnonymousUsage: false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;api:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  dashboard: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;ping: {}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;entryPoints:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  web:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    address: &amp;quot;:80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    http:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      redirections:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        entryPoint:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;          to: websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;          scheme: https&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    forwardedHeaders:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      insecure: false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      trustedIPs:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;127.0.0.1&#x2F;32&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;10.0.0.0&#x2F;8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;172.16.0.0&#x2F;12&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;192.168.0.0&#x2F;16&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  websecure:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    address: &amp;quot;:443&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    forwardedHeaders:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      insecure: false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      trustedIPs:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;127.0.0.1&#x2F;32&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;10.0.0.0&#x2F;8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;172.16.0.0&#x2F;12&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;192.168.0.0&#x2F;16&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;providers:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  docker:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    endpoint: &amp;quot;unix:&#x2F;&#x2F;&#x2F;var&#x2F;run&#x2F;docker.sock&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    exposedByDefault: false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  file:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    directory: &#x2F;etc&#x2F;traefik&#x2F;dynamic&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    watch: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;experimental:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  plugins:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    crowdsec-bouncer:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      moduleName: github.com&#x2F;maxlerebourg&#x2F;crowdsec-bouncer-traefik-plugin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      version: v1.4.7&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;certificatesResolvers:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  tls_resolver:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    acme:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      storage: &#x2F;certs&#x2F;acme.json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      httpChallenge:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        entryPoint: web&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;log:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  level: INFO&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  filePath: &#x2F;var&#x2F;log&#x2F;traefik&#x2F;traefik.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;accessLog:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  filePath: &#x2F;var&#x2F;log&#x2F;traefik&#x2F;access.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  format: json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  filters:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    statusCodes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;400-599&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  fields:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    headers:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      defaultMode: keep&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-1-forwarded-headers-trusted-ips&quot;&gt;3.2.1. Forwarded Headers (Trusted IPs)&lt;&#x2F;h3&gt;
&lt;p&gt;Traefik acts as a reverse proxy in front of your applications. To ensure your apps see the real client IP (and not the internal Docker gateway IP), Traefik must correctly process the &lt;code&gt;X-Forwarded-For&lt;&#x2F;code&gt; header.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Without this configuration&lt;&#x2F;strong&gt;, any visitor can spoof the &lt;code&gt;X-Forwarded-For&lt;&#x2F;code&gt; header, bypassing IP-based rate limiting, abuse protection, or geo-blocking.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;What do these entries in &lt;code&gt;traefik.yml&lt;&#x2F;code&gt; mean?&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;insecure: false&lt;&#x2F;code&gt; — Traefik does not automatically trust all incoming &lt;code&gt;X-Forwarded-For&lt;&#x2F;code&gt; headers. This is the default, but we set it explicitly for clarity.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;trustedIPs&lt;&#x2F;code&gt; — Traefik only accepts the forwarded header from these source IPs. For all other requests, Traefik overwrites the header with the actual sender IP.&lt;&#x2F;li&gt;
&lt;li&gt;The four ranges cover the loopback interface (127.0.0.1) and all private network ranges (used for internal Docker communication).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            UPSTREAM PROXIES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;If you run a load balancer or CDN in front of Traefik, you must add its IP ranges as well. Examples:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hetzner Load Balancer:&lt;&#x2F;strong&gt; The private IPs of the LB within the same network (e.g., &lt;code&gt;10.0.0.0&#x2F;8&lt;&#x2F;code&gt; already covers this if the LB is in the same private network). Alternatively, explicitly add the public LB IP.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Cloudflare:&lt;&#x2F;strong&gt; Add the official Cloudflare IP ranges. See &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.cloudflare.com&#x2F;ips&#x2F;&quot;&gt;https:&#x2F;&#x2F;www.cloudflare.com&#x2F;ips&#x2F;&lt;&#x2F;a&gt;. Traefik also offers the shorthand &lt;code&gt;cloudflare&lt;&#x2F;code&gt; as a provider for this (undocumented, better to set the ranges explicitly).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;AWS ALB &#x2F; NLB:&lt;&#x2F;strong&gt; The VPC subnet ranges of the load balancer.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Without the correct IPs, your application will see the load balancer’s IP instead of the client’s IP.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            NEVER USE INSECURE: TRUE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The setting &lt;code&gt;insecure: true&lt;&#x2F;code&gt; causes Traefik to accept the &lt;code&gt;X-Forwarded-For&lt;&#x2F;code&gt; header from &lt;strong&gt;any&lt;&#x2F;strong&gt; source — even directly from the internet. This opens the door for IP spoofing and should never be used in production.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            PLUGIN NAMING CONVENTION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The plugin is defined here under the name &lt;code&gt;crowdsec-bouncer&lt;&#x2F;code&gt;. You will often see the official CrowdSec documentation refer to it simply as &lt;code&gt;bouncer&lt;&#x2F;code&gt;. Both work perfectly, as long as you are consistent when referencing it in your Docker labels later on.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-3-traefik-dynamic-configuration-dynamic-middlewares-yml&quot;&gt;3.3. Traefik Dynamic Configuration (&lt;code&gt;dynamic&#x2F;middlewares.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file defines reusable middleware components.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee traefik&#x2F;dynamic&#x2F;middlewares.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;http:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  middlewares:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # 1. General security headers&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    security-headers:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      headers:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        browserXssFilter: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        contentTypeNosniff: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        frameDeny: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        forceSTSHeader: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        stsIncludeSubdomains: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        stsPreload: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        stsSeconds: 31536000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # 2. Basic Auth for the dashboard&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    traefik-dashboard-auth:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      basicAuth:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        usersFile: &amp;quot;&#x2F;etc&#x2F;traefik&#x2F;dynamic&#x2F;.htpasswd&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-4-docker-compose-docker-compose-yml&quot;&gt;3.4. Docker Compose (&lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This is the main file defining our services.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  traefik:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: traefik:v3.6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ports:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;80:80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;443:443&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - --certificatesresolvers.tls_resolver.acme.email=${LETSENCRYPT_EMAIL}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &#x2F;var&#x2F;run&#x2F;docker.sock:&#x2F;var&#x2F;run&#x2F;docker.sock:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;traefik.yml:&#x2F;etc&#x2F;traefik&#x2F;traefik.yml:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;traefik&#x2F;dynamic:&#x2F;etc&#x2F;traefik&#x2F;dynamic:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;traefik&#x2F;certs:&#x2F;certs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;traefik&#x2F;logs:&#x2F;var&#x2F;log&#x2F;traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - TZ=${TZ}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.crowdsec-bouncer.plugin.crowdsec-bouncer.crowdsecMode=stream&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.crowdsec-bouncer.plugin.crowdsec-bouncer.crowdsecLapiHost=crowdsec:8080&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.crowdsec-bouncer.plugin.crowdsec-bouncer.crowdsecLapiKey=${CROWDSEC_BOUNCER_API_KEY}&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.dashboard.rule=Host(`${TRAEFIK_DASHBOARD_HOST}`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.dashboard.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.dashboard.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.dashboard.service=api@internal&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.dashboard.middlewares=traefik-dashboard-auth@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;quot;CMD&amp;quot;, &amp;quot;traefik&amp;quot;, &amp;quot;healthcheck&amp;quot;, &amp;quot;--ping&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      interval: 30s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      timeout: 10s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      retries: 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  crowdsec:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: crowdsecurity&#x2F;crowdsec:latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: crowdsec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &#x2F;var&#x2F;run&#x2F;docker.sock:&#x2F;var&#x2F;run&#x2F;docker.sock:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;crowdsec&#x2F;config:&#x2F;etc&#x2F;crowdsec:z&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;crowdsec&#x2F;data:&#x2F;var&#x2F;lib&#x2F;crowdsec&#x2F;data:z&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;traefik&#x2F;logs:&#x2F;var&#x2F;log&#x2F;traefik:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &#x2F;var&#x2F;log:&#x2F;var&#x2F;log&#x2F;host&#x2F;:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - TZ=${TZ}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - COLLECTIONS=${CROWDSEC_COLLECTIONS}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;quot;CMD&amp;quot;, &amp;quot;cscli&amp;quot;, &amp;quot;version&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      interval: 60s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      timeout: 15s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      retries: 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    name: proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            DOCKER SOCKET SECURITY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Mounting &lt;code&gt;&#x2F;var&#x2F;run&#x2F;docker.sock&lt;&#x2F;code&gt; directly gives the container root-equivalent access to the Docker daemon. For a production-hardened setup, consider using a Docker Socket Proxy (like &lt;code&gt;tecnativa&#x2F;docker-socket-proxy&lt;&#x2F;code&gt;) to restrict Traefik to read-only access for essential API endpoints.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-5-create-dashboard-password&quot;&gt;3.5. Create Dashboard Password&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; htpasswd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&#x2F;dynamic&#x2F;.htpasswd admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-6-crowdsec-acquisition-configuration-crowdsec-config-acquis-yaml&quot;&gt;3.6. CrowdSec Acquisition Configuration (&lt;code&gt;crowdsec&#x2F;config&#x2F;acquis.yaml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee crowdsec&#x2F;config&#x2F;acquis.yaml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;filenames:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  - &#x2F;var&#x2F;log&#x2F;traefik&#x2F;access.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  type: traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;filenames:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  - &#x2F;var&#x2F;log&#x2F;host&#x2F;auth.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  - &#x2F;var&#x2F;log&#x2F;host&#x2F;syslog&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  type: syslog&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;4-launch-and-verify-the-stack&quot;&gt;4. Launch and Verify the Stack&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create the external network:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; network create proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Start the services:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;Upon first launch, Traefik will request a certificate from Let’s Encrypt. This may take a minute.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Generate the Bouncer API Key:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose exec crowdsec cscli bouncers add traefik&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; raw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            LAPI STARTUP TIME
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Upon the very first start, CrowdSec might take a few moments to initialize the Local API (LAPI). If you get a connection error, wait 10-20 seconds and try the command again.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;

Copy the long, alphanumeric string that is output.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Update your &lt;code&gt;.env&lt;&#x2F;code&gt; file:&lt;&#x2F;strong&gt; Paste the copied key as the value for &lt;code&gt;CROWDSEC_BOUNCER_API_KEY&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Restart Traefik to apply the key:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --force-recreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Verify the bouncer connection:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose exec crowdsec cscli bouncers list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;You should see the &lt;code&gt;traefik&lt;&#x2F;code&gt; bouncer listed. You can now access your dashboard at &lt;code&gt;https:&#x2F;&#x2F;traefik.your-domain.com&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;5-adding-services-to-traefik&quot;&gt;5. Adding Services to Traefik&lt;&#x2F;h2&gt;
&lt;p&gt;Here is how to expose other Docker services through Traefik, with and without CrowdSec protection.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-1-scenario-1-service-protected-by-crowdsec-standard&quot;&gt;5.1. Scenario 1: Service Protected by CrowdSec (Standard)&lt;&#x2F;h3&gt;
&lt;p&gt;This is the recommended setup for most public-facing services. We’ll use WordPress as an example. Create a &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; in a separate directory (e.g., &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;wordpress&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;services&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  wordpress&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    image&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; wordpress:latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    restart&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    networks&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    labels&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.wordpress.rule=Host(`blog.your-domain.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.wordpress.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.wordpress.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.wordpress.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.services.wordpress.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  db&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    image&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mariadb:11&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    restart&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    environment&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;      MYSQL_ROOT_PASSWORD&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; change-me&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;      MYSQL_DATABASE&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; wordpress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;      MYSQL_USER&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; wordpress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;      MYSQL_PASSWORD&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; supersecret&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    volumes&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; db_data:&#x2F;var&#x2F;lib&#x2F;mysql&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    networks&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;networks&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  proxy&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    external&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  default&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;volumes&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  db_data&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The key label is &lt;code&gt;traefik.http.routers.wordpress.middlewares=security-headers@file,crowdsec-bouncer@docker&lt;&#x2F;code&gt;, which applies our security headers (from the file provider) and the CrowdSec bouncer (defined on the Traefik service via Docker labels).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-2-scenario-2-service-bypassing-crowdsec-special-case&quot;&gt;5.2. Scenario 2: Service Bypassing CrowdSec (Special Case)&lt;&#x2F;h3&gt;
&lt;p&gt;Sometimes you need to expose a service without CrowdSec’s interference. Common reasons include:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A public API that must not be blocked.&lt;&#x2F;li&gt;
&lt;li&gt;A site heavily reliant on ad network traffic, where false positives could impact revenue.&lt;&#x2F;li&gt;
&lt;li&gt;Internal tools that are already secured by other means.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;To bypass CrowdSec, simply omit the &lt;code&gt;crowdsec-bouncer@docker&lt;&#x2F;code&gt; middleware.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# In the labels for your service (e.g., an API)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;labels&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.my-api.rule=Host(`api.your-domain.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.my-api.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.my-api.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # --- Middlewares (Security ONLY) ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.my-api.middlewares=security-headers@file&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.services.my-api.loadbalancer.server.port=3000&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            MAXIMUM FLEXIBILITY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;By applying middleware on a per-router basis instead of globally on the entrypoint, you gain complete control over which services are protected by CrowdSec and which are not.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;5-3-routing-multiple-sub-domains-to-one-service&quot;&gt;5.3. Routing Multiple (Sub)Domains to One Service&lt;&#x2F;h3&gt;
&lt;p&gt;Sometimes one container should respond to more than one hostname (e.g., &lt;code&gt;example.com&lt;&#x2F;code&gt; and &lt;code&gt;www.example.com&lt;&#x2F;code&gt;, or multiple subdomains pointing to the same app). You have a few common options.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;option-a-multiple-explicit-hosts-in-one-router&quot;&gt;Option A: Multiple Explicit Hosts in One Router&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;labels&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.rule=Host(`example.com`) || Host(`www.example.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.services.app.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;option-b-wildcard-pattern-matching-many-subdomains&quot;&gt;Option B: Wildcard &#x2F; Pattern Matching (Many Subdomains)&lt;&#x2F;h4&gt;
&lt;p&gt;Use this if you want to match &lt;em&gt;many&lt;&#x2F;em&gt; subdomains dynamically.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;labels&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.rule=HostRegexp(`[a-z0-9-]+\.example\.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.services.app.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            WILDCARD CERTIFICATES &amp;amp; LET&amp;#x27;S ENCRYPT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;While &lt;code&gt;HostRegexp&lt;&#x2F;code&gt; routes the traffic dynamically, the &lt;code&gt;httpChallenge&lt;&#x2F;code&gt; configured earlier cannot issue a wildcard certificate (e.g., &lt;code&gt;*.example.com&lt;&#x2F;code&gt;). Let’s Encrypt requires a &lt;strong&gt;DNS challenge&lt;&#x2F;strong&gt; for wildcards. With &lt;code&gt;httpChallenge&lt;&#x2F;code&gt;, Traefik will attempt to request individual certificates for every matched subdomain, which can quickly exhaust Let’s Encrypt rate limits.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h4 id=&quot;option-c-multiple-routers-one-service-different-middleware-per-host&quot;&gt;Option C: Multiple Routers, One Service (Different Middleware per Host)&lt;&#x2F;h4&gt;
&lt;p&gt;This is useful if one hostname should bypass CrowdSec while another one stays protected.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;labels&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-main.rule=Host(`app.example.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-main.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-main.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-main.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-api.rule=Host(`api.example.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-api.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-api.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-api.middlewares=security-headers@file&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.services.app.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-main.service=app&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.app-api.service=app&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;6-maintenance&quot;&gt;6. Maintenance&lt;&#x2F;h2&gt;
&lt;p&gt;To update your stack to the latest container images:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --remove-orphans&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;6-1-log-rotation-critical-for-production&quot;&gt;6.1. Log Rotation (Critical for Production)&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            DON&amp;#x27;T SKIP THIS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This setup generates detailed JSON access logs for CrowdSec analysis. Without proper log rotation, Traefik logs alone can consume &lt;strong&gt;70+ GB&lt;&#x2F;strong&gt; within weeks on a busy server. Docker container logs can add another 40+ GB. Configure rotation &lt;strong&gt;before&lt;&#x2F;strong&gt; going to production.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h4 id=&quot;docker-global-log-rotation&quot;&gt;Docker Global Log Rotation&lt;&#x2F;h4&gt;
&lt;p&gt;Configure Docker to automatically rotate all container logs by editing &lt;code&gt;&#x2F;etc&#x2F;docker&#x2F;daemon.json&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee &#x2F;etc&#x2F;docker&#x2F;daemon.json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  &amp;quot;log-driver&amp;quot;: &amp;quot;json-file&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  &amp;quot;log-opts&amp;quot;: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;max-size&amp;quot;: &amp;quot;10m&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;max-file&amp;quot;: &amp;quot;3&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Apply the changes:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; systemctl restart docker&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; info&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -A3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Logging Driver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            EXISTING CONTAINERS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This setting only applies to newly created containers. Existing containers keep their old logging configuration. Recreate them with &lt;code&gt;docker compose up -d --force-recreate&lt;&#x2F;code&gt; to apply the new limits.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h4 id=&quot;traefik-host-log-rotation&quot;&gt;Traefik Host Log Rotation&lt;&#x2F;h4&gt;
&lt;p&gt;Since Traefik writes logs directly to the host filesystem, use &lt;code&gt;logrotate&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            PATH VERIFICATION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Ensure the path in the config below matches your &lt;strong&gt;host path&lt;&#x2F;strong&gt; where the logs are stored. You can find it by running:
&lt;code&gt;docker inspect traefik --format &#x27;{{range .Mounts}}{{.Source}}{{&quot;\n&quot;}}{{end}}&#x27; | grep logs&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee &#x2F;etc&#x2F;logrotate.d&#x2F;traefik&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&#x2F;traefik&#x2F;logs&#x2F;*.log {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  daily&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  rotate 7&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  compress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  delaycompress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  missingok&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  notifempty&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  copytruncate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  maxsize 50M&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;verify-log-rotation&quot;&gt;Verify Log Rotation&lt;&#x2F;h4&gt;
&lt;p&gt;To ensure your rotation is working correctly and to troubleshoot issues, use these commands:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Debug: show which rules would apply without actually rotating&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; logrotate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc&#x2F;logrotate.d&#x2F;traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Force rotation: execute immediately&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; logrotate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc&#x2F;logrotate.d&#x2F;traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check rotation status: see when logs were last rotated&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cat &#x2F;var&#x2F;lib&#x2F;logrotate&#x2F;status&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;7-troubleshooting-disk-full&quot;&gt;7. Troubleshooting: Disk Full&lt;&#x2F;h2&gt;
&lt;p&gt;If your server runs out of disk space, logs are usually the culprit. Here’s how to diagnose and fix it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;7-1-identify-the-problem&quot;&gt;7.1. Identify the Problem&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Quick overview&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;df&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Find large directories&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;du&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h -d1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;du&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h -d1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;var&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;du&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h -d1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Docker-specific&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;du&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h -d1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;var&#x2F;lib&#x2F;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;du&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h -d1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;var&#x2F;lib&#x2F;docker&#x2F;containers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Find large container logs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;find&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;var&#x2F;lib&#x2F;docker&#x2F;containers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;*-json.log&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; du&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; {}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check journald (usually not the problem)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;journalctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --disk-usage&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;7-2-emergency-cleanup&quot;&gt;7.2. Emergency Cleanup&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            CAUTION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;These commands delete log data permanently. Only proceed if you don’t need the logs for debugging.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;&lt;strong&gt;Truncate Docker container logs:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; find &#x2F;var&#x2F;lib&#x2F;docker&#x2F;containers&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;*-json.log&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; truncate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s 0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; {}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Clear Traefik logs:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose down&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -rf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&#x2F;logs&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After cleanup, &lt;strong&gt;immediately configure log rotation&lt;&#x2F;strong&gt; as described in section 6.1 to prevent recurrence.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You now have a modern, secure, and flexible reverse proxy setup. Traefik handles routing and TLS termination effortlessly, while CrowdSec provides a powerful, community-driven security layer. By managing middlewares on a per-service basis, you can tailor the level of protection to fit the exact needs of each application you deploy.&lt;&#x2F;p&gt;
&lt;p&gt;As a next step, you might want to explore the &lt;strong&gt;AppSec (WAF)&lt;&#x2F;strong&gt; capabilities of the CrowdSec Bouncer plugin, which adds application-level protection against advanced attacks like SQL injection and Cross-Site Scripting directly at the Traefik layer.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;doc.traefik.io&amp;#x2F;traefik&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;TRAEFIK DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.crowdsec.net&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🛡️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;CROWDSEC DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Deploying a Matrix Synapse Server with Docker and Traefik</title>
          <pubDate>Fri, 20 Feb 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/matrix-synapse-server/</link>
          <guid>https://criticalbasics.xyz/posts/matrix-synapse-server/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/matrix-synapse-server/">&lt;p&gt;This guide will walk you through deploying a powerful, federated Matrix Synapse homeserver. We will use the popular &lt;code&gt;matrix-docker-ansible-deploy&lt;&#x2F;code&gt; playbook, which simplifies the setup of Synapse and its various components, including bridges for other chat platforms.&lt;&#x2F;p&gt;
&lt;p&gt;This setup is designed to integrate seamlessly with an existing Traefik v3 reverse proxy and a root-domain &lt;a href=&quot;..&#x2F;nginx_webserver&#x2F;&quot;&gt;Nginx web server&lt;&#x2F;a&gt;, making it a perfect addition to a modern, container-based infrastructure.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-02-20&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Configuration Update:&lt;&#x2F;strong&gt; Updated &lt;code&gt;matrix_coturn_enabled&lt;&#x2F;code&gt; to &lt;code&gt;coturn_enabled&lt;&#x2F;code&gt;, removed Sliding Sync, and added PostgreSQL upgrade instructions.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-09-17&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created, focusing on Traefik v3 integration, Ansible deployment, and enabling various bridges and features like Sliding Sync.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our reverse proxy and security.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;nginx-webserver&#x2F;&quot;&gt;Deploying a Secure Nginx Website with Traefik and Docker Compose&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This step is crucial as it establishes a web server on your root domain and correctly configures the &lt;code&gt;.well-known&#x2F;matrix&lt;&#x2F;code&gt; delegation required for federation.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik and Nginx stacks running as described in the prerequisite guides.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            ROOT DOMAIN REMAINS FREE FOR YOUR WEBSITE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Synapse runs on a dedicated subdomain (e.g., &lt;code&gt;matrix.your-domain.com&lt;&#x2F;code&gt;). The root domain (e.g., &lt;code&gt;your-domain.com&lt;&#x2F;code&gt;) continues to serve your main website via &lt;a href=&quot;..&#x2F;nginx-webserver&#x2F;&quot;&gt;Nginx&lt;&#x2F;a&gt;. The &lt;code&gt;.well-known&lt;&#x2F;code&gt; files on the root domain merely delegate clients and federation to the subdomain, so your homepage remains unaffected.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Architecture (simplified)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  Users &#x2F; Browsers &#x2F; Homeservers&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             ▼&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      your-domain.com  ──&amp;gt;  [Nginx](..&#x2F;nginx_webserver&#x2F;) on root domain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             │                 │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             │                 ├─ Serves your website (&#x2F;, &#x2F;assets, ...)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             │                 └─ Serves .well-known&#x2F;matrix&#x2F;{server,client}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             │                                  │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             │                                  ▼&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;             └────────────────────────── delegates to ──&amp;gt; matrix.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                                       (Synapse via Traefik)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                                            │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                                            ▼&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                               Traefik (websecure, synapse)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                                            │&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                                            ▼&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                                                        Synapse&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git&lt;&#x2F;code&gt;, &lt;code&gt;jq&lt;&#x2F;code&gt;, and &lt;code&gt;pwgen&lt;&#x2F;code&gt; for version control, JSON parsing, and password generation.&lt;&#x2F;li&gt;
&lt;li&gt;Python 3 and &lt;code&gt;pip&lt;&#x2F;code&gt; installed on your server.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Install the required tools:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; install git jq pwgen python3-pip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;First, we’ll create a dedicated directory for the Matrix playbook configuration and files.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-download-the-ansible-playbook&quot;&gt;3. Download the Ansible Playbook&lt;&#x2F;h2&gt;
&lt;p&gt;Next, clone the official &lt;code&gt;matrix-docker-ansible-deploy&lt;&#x2F;code&gt; repository from GitHub into the directory you just created.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git clone https:&#x2F;&#x2F;github.com&#x2F;spantaleev&#x2F;matrix-docker-ansible-deploy.git &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;4-initial-configuration&quot;&gt;4. Initial Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;The playbook is configured using Ansible variables. We’ll start by creating a configuration directory based on your Matrix server’s hostname and copying the example &lt;code&gt;vars.yml&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            HOSTNAME CONVENTION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The playbook expects the server to be available at &lt;code&gt;matrix.your-domain.com&lt;&#x2F;code&gt;. The configuration directory must match this hostname.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Replace &amp;#39;matrix.your-domain.com&amp;#39; with your actual server name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;host_vars&#x2F;matrix.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cp examples&#x2F;vars.yml inventory&#x2F;host_vars&#x2F;matrix.your-domain.com&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-1-generate-secret-keys&quot;&gt;4.1. Generate Secret Keys&lt;&#x2F;h3&gt;
&lt;p&gt;The configuration requires two strong secret keys. You can generate these using &lt;code&gt;pwgen&lt;&#x2F;code&gt; or &lt;code&gt;openssl&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Generate two strong keys and save them for the next step&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pwgen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s 64 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pwgen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s 64 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-2-customize-vars-yml&quot;&gt;4.2. Customize &lt;code&gt;vars.yml&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Now, open the &lt;code&gt;vars.yml&lt;&#x2F;code&gt; file and customize it for your environment. This is the most critical step.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nano inventory&#x2F;host_vars&#x2F;matrix.your-domain.com&#x2F;vars.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Below is a complete configuration based on a feature-rich setup. Adjust the values to match your domain, secrets, and desired features.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# The bare domain name which represents your Matrix identity.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_domain&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_homeserver_implementation&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; synapse&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_homeserver_generic_secret_key&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;PASTE-YOUR-GENERIC-SECRET-KEY-HERE&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Use our own Traefik (externally managed)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_playbook_reverse_proxy_type&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; other-traefik-container&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;traefik_certs_dumper_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;traefik_config_certificatesResolvers_acme_email&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;your-email@example.com&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;postgres_connection_password&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;PASTE-YOUR-POSTGRES-PASSWORD-HERE&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;devture_systemd_docker_base_docker_service_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_playbook_docker_installation_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# We delegate .well-known from the root domain via Nginx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_static_files_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_static_files_container_labels_traefik_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;coturn_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Traefik integration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_playbook_reverse_proxy_container_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_playbook_reverse_proxy_hostname&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_federation_traefik_entrypoint_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; synapse&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Disable Synapse&amp;#39;s internal client-API router (or redirect to a valid entrypoint)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_reverse_proxy_companion_container_labels_internal_client_api_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Core services ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_container_labels_traefik_docker_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_container_labels_traefik_tls_certResolver&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tls_resolver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_container_labels_traefik_middlewares&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;security-headers@file,crowdsec-bouncer@docker&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_client_element_container_labels_traefik_docker_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_client_element_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_client_element_container_labels_traefik_tls_certResolver&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tls_resolver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_client_element_container_labels_traefik_middlewares&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;security-headers@file,crowdsec-bouncer@docker&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_admin&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;@your-username:your-domain.com&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_admin_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_admin_container_http_host_bind_port&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_admin_container_labels_traefik_docker_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_admin_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_admin_container_labels_traefik_tls_certResolver&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tls_resolver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_synapse_admin_container_labels_traefik_middlewares&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;security-headers@file,crowdsec-bouncer@docker&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# E-Mail relay (optional)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_sender_address&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;matrix@your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_relay_use&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_relay_host_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;mail.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_relay_host_port&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 587&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_relay_auth&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_relay_auth_username&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;user@your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;exim_relay_relay_auth_password&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;YOUR-EMAIL-PASSWORD&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_appservice_double_puppet_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Bridges ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# The playbook can install and configure various bridges to connect your Matrix homeserver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# to other chat networks like Telegram, Discord, Signal, etc. When enabling a bridge,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# it is crucial to provide the `homeserver` configuration block to ensure it communicates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# correctly with Synapse via Traefik. For more details on available bridges and their&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# specific configurations, refer to the official documentation.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Telegram – Correct EntryPoints + specify Homeserver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_api_id&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 12345678&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_api_hash&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;your_telegram_api_hash&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_container_labels_public_endpoint_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_container_labels_metrics_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_telegram_configuration_extension_yaml&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  homeserver:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    address: &amp;quot;https:&#x2F;&#x2F;matrix.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    domain: &amp;quot;your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  bridge:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    permissions:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      &amp;#39;{{ matrix_admin }}&amp;#39;: admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Meta Messenger&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_meta_messenger_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_meta_messenger_configuration_extension_yaml&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  homeserver:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    address: &amp;quot;https:&#x2F;&#x2F;matrix.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    domain: &amp;quot;your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  bridge:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    permissions:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      &amp;#39;*&amp;#39;: relay&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      &amp;#39;your-domain.com&amp;#39;: admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      &amp;#39;{{ matrix_admin }}&amp;#39;: admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Discord – Correct Avatar-Proxy &amp;amp; general EntryPoints&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_discord_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_discord_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_discord_container_labels_avatar_proxy_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_mautrix_discord_configuration_extension_yaml&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  homeserver:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    address: &amp;quot;https:&#x2F;&#x2F;matrix.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    domain: &amp;quot;your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Element Call &#x2F; Livekit ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_element_call_enabled&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_element_call_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_element_call_container_labels_traefik_tls_certResolver&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tls_resolver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_element_call_container_labels_traefik_docker_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_livekit_jwt_service_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_livekit_jwt_service_container_labels_traefik_tls_certResolver&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tls_resolver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;matrix_livekit_jwt_service_container_labels_traefik_docker_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;livekit_server_container_labels_traefik_entrypoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; websecure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;livekit_server_container_labels_public_metrics_traefik_tls_certResolver&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tls_resolver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;livekit_server_container_labels_traefik_docker_network&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;5-install-ansible-and-dependencies&quot;&gt;5. Install Ansible and Dependencies&lt;&#x2F;h2&gt;
&lt;p&gt;This playbook uses Ansible to automate the setup. Choose the installation method that fits your distribution policy.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;for-debian-12-system-pip-with-break-system-packages&quot;&gt;For Debian 12 (system pip with –break-system-packages)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Ensure pip is available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; python3-pip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Install Ansible and required Python packages system-wide&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pip3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --break-system-packages&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible docker passlib&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;for-other-linux-distributions-recommended-python-virtual-environment&quot;&gt;For Other Linux Distributions (recommended: Python virtual environment)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create and activate a dedicated virtual environment&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;python3&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; venv ~&#x2F;.venvs&#x2F;matrix-ansible&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;source&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.venvs&#x2F;matrix-ansible&#x2F;bin&#x2F;activate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Upgrade pip and install required packages in the venv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --upgrade&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; install ansible docker passlib&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            VIRTUALENV REMINDER
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;If you use the virtual environment, remember to reactivate it in new shell sessions with:
&lt;code&gt;source ~&#x2F;.venvs&#x2F;matrix-ansible&#x2F;bin&#x2F;activate&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Next, install the Ansible roles required by the playbook:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;make&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; roles&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;6-configure-ansible-hosts&quot;&gt;6. Configure Ansible Hosts&lt;&#x2F;h2&gt;
&lt;p&gt;Now, we need to tell Ansible which server to configure. Since we are running it locally, the setup is simple.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Copy the example hosts file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cp examples&#x2F;hosts inventory&#x2F;hosts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Edit the file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nano inventory&#x2F;hosts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Modify the file to look like this. The &lt;code&gt;ansible_connection=local&lt;&#x2F;code&gt; tells Ansible to run all commands on the machine it’s currently on, instead of connecting to a remote server via SSH. Because of this, &lt;code&gt;ansible_host=127.0.0.1&lt;&#x2F;code&gt; (localhost) is the correct value. Parameters like &lt;code&gt;ansible_ssh_user=root&lt;&#x2F;code&gt; are ignored in this mode, as the playbook runs with the permissions of the user executing it (in our case, &lt;code&gt;root&lt;&#x2F;code&gt; via &lt;code&gt;sudo&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[matrix_servers]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;matrix.your-domain.com &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;ansible_host&lt;&#x2F;span&gt;&lt;span&gt;=127.0.0.1 &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;ansible_connection&lt;&#x2F;span&gt;&lt;span&gt;=local&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;7-adjust-traefik-for-federation&quot;&gt;7. Adjust Traefik for Federation&lt;&#x2F;h2&gt;
&lt;p&gt;For Matrix federation to work, other servers need to connect to yours on port &lt;code&gt;8448&lt;&#x2F;code&gt;. We must expose this port in our main Traefik stack and create a dedicated entrypoint for it.&lt;&#x2F;p&gt;
&lt;p&gt;Go to your Traefik stack’s directory (e.g., &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;7-1-expose-federation-port&quot;&gt;7.1. Expose Federation Port&lt;&#x2F;h3&gt;
&lt;p&gt;Edit your main &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nano docker-compose.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add port &lt;code&gt;8448&lt;&#x2F;code&gt; to the &lt;code&gt;ports&lt;&#x2F;code&gt; section of the &lt;code&gt;traefik&lt;&#x2F;code&gt; service:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;services&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  traefik&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # ... other settings&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    ports&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;80:80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;443:443&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;8448:8448&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Add this line for Matrix federation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # ... rest of the settings&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;7-2-create-federation-and-internal-entrypoints&quot;&gt;7.2. Create Federation and Internal Entrypoints&lt;&#x2F;h3&gt;
&lt;p&gt;Edit your static Traefik configuration (&lt;code&gt;traefik&#x2F;config&#x2F;traefik.yml&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nano traefik&#x2F;config&#x2F;traefik.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add a new &lt;code&gt;synapse&lt;&#x2F;code&gt; entrypoint for federation and a &lt;code&gt;matrix-internal-matrix-client-api&lt;&#x2F;code&gt; entrypoint for internal communication.&lt;&#x2F;p&gt;
&lt;p&gt;For recent playbook versions, it is recommended to also define the internal &lt;code&gt;matrix-internal-matrix-client-api&lt;&#x2F;code&gt; entrypoint on port 8008. This port is &lt;strong&gt;not&lt;&#x2F;strong&gt; published to the host and serves as an internal C2S route for bridges and add-ons, preventing errors in the Traefik dashboard.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;entryPoints&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  web&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    address&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;:80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # ...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  websecure&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    address&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;:443&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  synapse&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # For federation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    address&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;:8448&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  matrix-internal-matrix-client-api&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # For internal C2S communication&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;    address&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;:8008&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;7-3-restart-traefik&quot;&gt;7.3. Restart Traefik&lt;&#x2F;h3&gt;
&lt;p&gt;Apply the changes by restarting your Traefik stack:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;8-run-the-matrix-installation&quot;&gt;8. Run the Matrix Installation&lt;&#x2F;h2&gt;
&lt;p&gt;With all the configuration in place, we can now run the Ansible playbook to set up and install everything.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=setup-all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This command will download all necessary Docker images, generate configuration files, and prepare the services. It may take several minutes.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;9-start-the-matrix-services&quot;&gt;9. Start the Matrix Services&lt;&#x2F;h2&gt;
&lt;p&gt;Once the setup is complete, start all the Matrix containers:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=start&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After a few moments, all the services you enabled should be running. You can verify this with &lt;code&gt;docker ps&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;10-verify-the-installation&quot;&gt;10. Verify the Installation&lt;&#x2F;h2&gt;
&lt;p&gt;After starting the services, it’s crucial to verify that all components are running and communicating correctly.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-1-check-running-containers&quot;&gt;10.1. Check Running Containers&lt;&#x2F;h3&gt;
&lt;p&gt;First, ensure all enabled services are running. The exact names will vary based on your &lt;code&gt;matrix_domain&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --format&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{{.Names}}&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -E&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;synapse|element|sliding|admin&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;10-2-verify-well-known-delegation-cli&quot;&gt;10.2. Verify &lt;code&gt;.well-known&lt;&#x2F;code&gt; Delegation (CLI)&lt;&#x2F;h3&gt;
&lt;p&gt;Check if your Nginx server is correctly serving the delegation files for your root domain.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Replace &amp;#39;your-domain.com&amp;#39; with your actual domain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;your-domain.com&#x2F;.well-known&#x2F;matrix&#x2F;server&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;your-domain.com&#x2F;.well-known&#x2F;matrix&#x2F;client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Both commands should return a clean JSON output pointing to &lt;code&gt;matrix.your-domain.com&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-3-verify-federation-endpoint-cli&quot;&gt;10.3. Verify Federation Endpoint (CLI)&lt;&#x2F;h3&gt;
&lt;p&gt;Test if the Synapse federation port (&lt;code&gt;8448&lt;&#x2F;code&gt;) is correctly exposed through Traefik.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Replace &amp;#39;matrix.your-domain.com&amp;#39; with your actual matrix subdomain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;matrix.your-domain.com:8448&#x2F;_matrix&#x2F;federation&#x2F;v1&#x2F;version&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This should return a JSON object with server information, confirming the federation endpoint is reachable.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-4-verify-crowdsec-bouncer-registration&quot;&gt;10.4. Verify CrowdSec Bouncer Registration&lt;&#x2F;h3&gt;
&lt;p&gt;Check if the CrowdSec bouncer for Traefik has successfully registered with the CrowdSec agent.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose exec crowdsec cscli bouncers list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You should see the Traefik bouncer in the list with a valid status.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-5-web-based-federation-test&quot;&gt;10.5. Web-based Federation Test&lt;&#x2F;h3&gt;
&lt;p&gt;Finally, use the official Federation Tester for a comprehensive check.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Go to: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;federationtester.matrix.org&#x2F;&quot;&gt;https:&#x2F;&#x2F;federationtester.matrix.org&#x2F;&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Enter your server name (e.g., &lt;code&gt;your-domain.com&lt;&#x2F;code&gt;) and run the test.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;If everything is configured correctly, you should see a success message.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;11-create-your-first-user&quot;&gt;11. Create Your First User&lt;&#x2F;h2&gt;
&lt;p&gt;Use the playbook to register your administrator user.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            PASSWORD SECURITY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;To avoid leaving your password in your shell’s history, omit the &lt;code&gt;-e &#x27;password=...&#x27;&lt;&#x2F;code&gt; part. The playbook will then prompt you to enter the password securely.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;... -e &#x27;username=your-username&#x27; -e &#x27;admin=yes&#x27;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=register-user -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;username=your-username&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;admin=yes&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can re-run this command with &lt;code&gt;admin=no&lt;&#x2F;code&gt; to create non-admin users.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;12-log-in-with-element&quot;&gt;12. Log In with Element&lt;&#x2F;h2&gt;
&lt;p&gt;Your homeserver is now ready! You can access the Element web client by navigating to &lt;code&gt;https:&#x2F;&#x2F;matrix.your-domain.com&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Click “Sign In”.&lt;&#x2F;li&gt;
&lt;li&gt;Your homeserver should be pre-filled. If not, edit it to show your server’s address (&lt;code&gt;matrix.your-domain.com&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;Log in with the username and password you just created.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;13-accessing-the-synapse-admin-ui&quot;&gt;13. Accessing the Synapse Admin UI&lt;&#x2F;h2&gt;
&lt;p&gt;Because we set &lt;code&gt;matrix_synapse_admin_enabled: true&lt;&#x2F;code&gt; in our &lt;code&gt;vars.yml&lt;&#x2F;code&gt; configuration, a powerful web-based administration interface for Synapse is automatically deployed. This UI is essential for server maintenance and user management.&lt;&#x2F;p&gt;
&lt;p&gt;You can access it at: &lt;code&gt;https:&#x2F;&#x2F;matrix.your-domain.com&#x2F;synapse-admin&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Log in with your Matrix administrator account. From here, you can:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Manage users (deactivate, make admin, etc.).&lt;&#x2F;li&gt;
&lt;li&gt;View server statistics and metrics.&lt;&#x2F;li&gt;
&lt;li&gt;Explore rooms and manage their settings.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This interface is the primary tool for the day-to-day administration of your homeserver.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;14-maintenance&quot;&gt;14. Maintenance&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;updating-matrix&quot;&gt;Updating Matrix&lt;&#x2F;h3&gt;
&lt;p&gt;To update your Matrix server and its components to the latest version:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Pull the latest changes from the git repository&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# It&amp;#39;s a good practice to review the CHANGELOG.md for breaking changes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# sudo nano CHANGELOG.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Re-run the setup and start tags to apply updates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=setup-all,start&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;upgrading-postgresql&quot;&gt;Upgrading PostgreSQL&lt;&#x2F;h3&gt;
&lt;p&gt;If the playbook notifies you about a new PostgreSQL version being available, you can perform the upgrade with a specific tag.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            BACKUP RECOMMENDED
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Before upgrading the database, ensure you have a recent backup of your data.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=upgrade-postgres&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;stopping-and-uninstalling&quot;&gt;Stopping and Uninstalling&lt;&#x2F;h3&gt;
&lt;p&gt;To &lt;strong&gt;stop&lt;&#x2F;strong&gt; all Matrix services:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=stop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To completely &lt;strong&gt;uninstall and delete all data&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;matrix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ansible-playbook&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inventory&#x2F;hosts setup.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --tags=uninstall&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            DATA LOSS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;uninstall&lt;&#x2F;code&gt; tag is destructive and will remove all user data, chat history, and media. Use with extreme caution.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;15-troubleshooting&quot;&gt;15. Troubleshooting&lt;&#x2F;h2&gt;
&lt;p&gt;Below are common issues and quick checks to resolve them.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            TIP: VERIFY ONE LAYER AT A TIME
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;When in doubt, verify DNS → Traefik → Nginx &lt;code&gt;.well-known&lt;&#x2F;code&gt; → Synapse federation endpoint step by step. Isolate the layer that fails.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;15-1-federation-test-fails&quot;&gt;15.1 Federation test fails&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Ensure port 8448 is exposed by Traefik and the &lt;code&gt;synapse&lt;&#x2F;code&gt; entrypoint exists.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose ps traefik&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; inspect traefik&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.[0].NetworkSettings.Ports[&amp;quot;8448&#x2F;tcp&amp;quot;]&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Test the federation version endpoint directly:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;matrix.your-domain.com:8448&#x2F;_matrix&#x2F;federation&#x2F;v1&#x2F;version&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;15-2-well-known-is-invalid-or-missing&quot;&gt;15.2 .well-known is invalid or missing&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Verify the &lt;code&gt;.well-known&lt;&#x2F;code&gt; delegation from your root domain (served by &lt;a href=&quot;..&#x2F;nginx_webserver&#x2F;&quot;&gt;Nginx server&lt;&#x2F;a&gt;):&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;your-domain.com&#x2F;.well-known&#x2F;matrix&#x2F;server&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;your-domain.com&#x2F;.well-known&#x2F;matrix&#x2F;client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Re-check that the placeholders in &lt;code&gt;conf&#x2F;nginx.conf&lt;&#x2F;code&gt; were replaced via &lt;code&gt;sed&lt;&#x2F;code&gt; and that CORS headers middleware uses camelCase keys in Traefik labels (e.g., &lt;code&gt;accessControlAllowOriginList&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;15-3-traefik-crowdsec-middleware-not-applied&quot;&gt;15.3 Traefik&#x2F;CrowdSec middleware not applied&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Ensure you reference providers correctly:
&lt;ul&gt;
&lt;li&gt;Security headers: &lt;code&gt;security-headers@file&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;CrowdSec bouncer: &lt;code&gt;crowdsec-bouncer@docker&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;15-4-acme-tls-issues&quot;&gt;15.4 ACME&#x2F;TLS issues&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Inspect Traefik logs for ACME errors and DNS problems:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n 200&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; traefik&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tail&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n 200&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Confirm A&#x2F;AAAA records for &lt;code&gt;traefik.your-domain.com&lt;&#x2F;code&gt; and &lt;code&gt;matrix.your-domain.com&lt;&#x2F;code&gt; point to your server and that port 443 is reachable.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Disable CDN Proxy for Initial Certificate:&lt;&#x2F;strong&gt; If you are using a CDN like Cloudflare, ensure the proxy is disabled (set to “DNS Only” or “grey cloud”) for your domains during the first certificate request. The HTTP-01 challenge requires Let’s Encrypt to reach your server directly. You can re-enable the proxy after the certificate is issued.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;15-5-docker-network-not-found&quot;&gt;15.5 Docker network not found&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Make sure the external &lt;code&gt;proxy&lt;&#x2F;code&gt; network exists and is used by all services behind Traefik:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; network ls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; proxy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; network create proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;15-6-permission-problems-in-inventory-host-vars&quot;&gt;15.6 Permission problems in inventory&#x2F;host_vars&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;If editing files is cumbersome, you can align ownership (optional):&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -R&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;:&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$USER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &#x2F;opt&#x2F;containers&#x2F;matrix&#x2F;inventory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;15-7-ansible-venv-not-active&quot;&gt;15.7 Ansible&#x2F;venv not active&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;If you installed Ansible in a virtualenv, reactivate it before running playbooks:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;source&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.venvs&#x2F;matrix-ansible&#x2F;bin&#x2F;activate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;15-8-crowdsec-bouncer-not-registered&quot;&gt;15.8 CrowdSec bouncer not registered&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Check the bouncer status inside the CrowdSec container (run in your Traefik stack directory):&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose exec crowdsec cscli bouncers list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You now have a fully functional, federated Matrix Synapse homeserver integrated with your Traefik proxy and Nginx web server. This powerful setup not only gives you control over your own secure communications but is also extensible with numerous bridges and features, allowing you to create a central hub for all your chat services.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;spantaleev&amp;#x2F;matrix-docker-ansible-deploy&amp;#x2F;blob&amp;#x2F;master&amp;#x2F;docs&amp;#x2F;README.md&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;PLAYBOOK DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;matrix.org&amp;#x2F;docs&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🛡️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;MATRIX DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Git &amp; GitHub for Beginners: Navigating the Version Control Labyrinth</title>
          <pubDate>Sat, 07 Feb 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/git-tutorial-cheatsheet/</link>
          <guid>https://criticalbasics.xyz/posts/git-tutorial-cheatsheet/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/git-tutorial-cheatsheet/">&lt;p&gt;Welcome, intrepid coder, to the world of &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;&quot;&gt;Git&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;&quot;&gt;GitHub&lt;&#x2F;a&gt;! This guide cuts through the noise to give you a solid understanding of version control, focusing on the practical steps and common pitfalls encountered in daily development. We’ll demystify local Git versus online platforms, walk through essential commands, and tackle the ever-present authentication headaches with solutions drawn from real-world scenarios.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-02-07&lt;&#x2F;td&gt;&lt;td&gt;Initial Version: Guide created for beginners with practical tips, authentication troubleshooting, and common workflow patterns.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;1-git-vs-github-a-tale-of-two-systems&quot;&gt;1. Git vs. GitHub: A Tale of Two Systems&lt;&#x2F;h1&gt;
&lt;p&gt;Understanding the distinction between &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;&quot;&gt;Git&lt;&#x2F;a&gt; (the tool) and &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;&quot;&gt;GitHub&lt;&#x2F;a&gt; (the service) is foundational.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;local-git&quot;&gt;Local Git&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;&quot;&gt;Git&lt;&#x2F;a&gt; is a &lt;strong&gt;version control system&lt;&#x2F;strong&gt; that lives on your computer. It meticulously tracks the history of your project as a series of &lt;strong&gt;commits&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Repository (Repo)&lt;&#x2F;strong&gt;: This is your project folder, distinguished by a hidden &lt;code&gt;.git&#x2F;&lt;&#x2F;code&gt; directory.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Commit&lt;&#x2F;strong&gt;: A “snapshot” of your changes at a specific point in time.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Branch&lt;&#x2F;strong&gt;: An independent line of development (e.g., &lt;code&gt;main&lt;&#x2F;code&gt;, &lt;code&gt;feature&#x2F;my-new-thing&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Remote&lt;&#x2F;strong&gt;: A counterpart of your local repository hosted on a server (e.g., &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;&quot;&gt;GitHub&lt;&#x2F;a&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;github-com&quot;&gt;GitHub.com&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;&quot;&gt;GitHub&lt;&#x2F;a&gt; is a &lt;strong&gt;hosting service&lt;&#x2F;strong&gt; built around Git repositories. It offers a suite of tools for collaborative development:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Stores repositories online (publicly or privately).&lt;&#x2F;li&gt;
&lt;li&gt;Facilitates collaboration through Pull Requests, Issues, and Code Reviews.&lt;&#x2F;li&gt;
&lt;li&gt;Provides Continuous Integration&#x2F;Continuous Deployment (CI&#x2F;CD) with &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;actions&quot;&gt;GitHub Actions&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Can host container images and packages (e.g., &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;packages&#x2F;working-with-a-github-packages-registry&#x2F;working-with-the-container-registry&quot;&gt;GitHub Container Registry (GHCR)&lt;&#x2F;a&gt;: &lt;code&gt;ghcr.io&#x2F;...&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            KEY TAKEAWAY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Git can function entirely without GitHub. GitHub &lt;em&gt;enhances&lt;&#x2F;em&gt; Git by providing cloud hosting and robust collaboration features.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;2-open-source-alternatives-to-github&quot;&gt;2. Open-Source Alternatives to GitHub&lt;&#x2F;h1&gt;
&lt;p&gt;If you prefer self-hosting or exploring other platforms, these are excellent alternatives that all speak the same Git language:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;about.gitlab.com&#x2F;&quot;&gt;GitLab CE&#x2F;EE&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: GitLab Community Edition is fully open-source, offering a comprehensive suite of DevOps tools.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;gitea.io&#x2F;&quot;&gt;Gitea&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: A lightweight, self-hostable Git service, popular for its ease of deployment and minimal resource footprint.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;forgejo.org&#x2F;&quot;&gt;Forgejo&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: A community-driven fork of Gitea, focused on open governance.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;sourcehut.org&#x2F;&quot;&gt;SourceHut&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: A minimalist, “Git-first” development platform.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            UNIVERSAL COMMANDS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Regardless of the platform, your local Git commands remain almost identical. This is the power of Git!&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;3-the-typical-workflow-six-key-concepts-visualized&quot;&gt;3. The Typical Workflow: Six Key Concepts &amp;amp; Visualized&lt;&#x2F;h1&gt;
&lt;p&gt;To master Git, grasp these six core areas, and visualize their flow.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Working Tree&lt;&#x2F;strong&gt;: The actual files in your project directory, including any uncommitted changes.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Staging Area &#x2F; Index&lt;&#x2F;strong&gt;: A temporary area where you select which changes will be included in your &lt;em&gt;next&lt;&#x2F;em&gt; commit.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Commit History&lt;&#x2F;strong&gt;: The chronological record of all your project’s commits.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Branch&lt;&#x2F;strong&gt;: The current line of development you are working on.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Remote &lt;code&gt;origin&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: The URL pointing to your online repository (often called &lt;code&gt;origin&lt;&#x2F;code&gt; by default).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Push&#x2F;Pull&lt;&#x2F;strong&gt;: The actions of sending (pushing) or receiving (pulling) changes between your local repository and the remote.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;visualizing-the-workflow&quot;&gt;Visualizing the Workflow&lt;&#x2F;h3&gt;
&lt;p&gt;A simple mental model helps understand the core Git flow:&lt;&#x2F;p&gt;
&lt;!-- ASCII-Art Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: ascii_art() mit ASCII-Kunst als Inhalt --&gt;

&lt;pre style=&quot;font-family: &#x27;Perfect DOS VGA 437&#x27;, monospace; 
            line-height: 1.0; 
            color: #e0e0e0; 
            background-color: #121212; 
            padding: 15px; 
            border: 1px solid #666666; 
            overflow: auto; 
            white-space: pre; 
            font-size: 14px;&quot;&gt;Working Directory (Your files)
        ↓ (`git add`)
Staging Area (Index)
        ↓ (`git commit`)
Local Repository (Commit history)
        ↓ (`git push`)
Remote Repository ([GitHub](https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;), [GitLab](https:&amp;#x2F;&amp;#x2F;about.gitlab.com&amp;#x2F;), etc.)
        ↓ (`git pull`)
(Back to Working Directory for others)&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;4-initial-setup-a-clean-start&quot;&gt;4. Initial Setup: A Clean Start&lt;&#x2F;h1&gt;
&lt;p&gt;Setting up Git correctly from the beginning prevents many headaches.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-1-set-your-git-identity-for-commits&quot;&gt;4.1. Set Your Git Identity (For Commits)&lt;&#x2F;h3&gt;
&lt;p&gt;These details define the &lt;strong&gt;author&lt;&#x2F;strong&gt; of your commits; they are &lt;em&gt;not&lt;&#x2F;em&gt; your login credentials for GitHub. The &lt;code&gt;user.name&lt;&#x2F;code&gt; and &lt;code&gt;user.email&lt;&#x2F;code&gt; you set here are what will appear in the commit history on platforms like GitHub.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.name &amp;quot;Your Name&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.email &amp;quot;your-email@example.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;how-to-check-your-current-git-identity&quot;&gt;How to Check Your Current Git Identity&lt;&#x2F;h4&gt;
&lt;p&gt;To see what &lt;code&gt;user.name&lt;&#x2F;code&gt; and &lt;code&gt;user.email&lt;&#x2F;code&gt; are currently set for your active repository or globally:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;For the current repository:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config user.name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config user.email&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Globally (for all repositories):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.email&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;how-to-change-your-git-identity&quot;&gt;How to Change Your Git Identity&lt;&#x2F;h4&gt;
&lt;p&gt;To change your Git identity:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Globally (recommended for most users, applies to all new repos):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.name &amp;quot;Your New Name&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.email &amp;quot;your-new-email@domain.tld&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;For only the current repository (overrides global settings for this repo):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config user.name &amp;quot;Project Specific Name&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config user.email &amp;quot;project-email@domain.tld&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            EXISTING COMMITS RETAIN THEIR AUTHOR
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Changing these settings only affects &lt;strong&gt;future commits&lt;&#x2F;strong&gt;. Commits you have already made will retain the &lt;code&gt;user.name&lt;&#x2F;code&gt; and &lt;code&gt;user.email&lt;&#x2F;code&gt; that were active at the time of their creation. Rewriting history for already-pushed commits is possible but complex and generally not recommended for beginners.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;4-2-initialize-or-clone-a-repository&quot;&gt;4.2. Initialize or Clone a Repository&lt;&#x2F;h3&gt;
&lt;p&gt;There are two main ways to start:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Clone an existing repository&lt;&#x2F;strong&gt;: This is standard for team projects or contributing to open source.&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Using HTTPS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; clone https:&#x2F;&#x2F;github.com&#x2F;ORG&#x2F;REPO.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Using SSH&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; clone git@github.com:ORG&#x2F;REPO.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Initialize a brand-new project&lt;&#x2F;strong&gt;: If you’re starting a project from scratch on your local machine.&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; my-new-project&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; my-new-project&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; init&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;You can then connect it to a remote repository later once you create one online.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;4-3-check-your-remotes&quot;&gt;4.3. Check Your Remotes&lt;&#x2F;h3&gt;
&lt;p&gt;Confirm the remote repository is correctly configured:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; remote&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;5-essential-commands-your-daily-toolkit&quot;&gt;5. Essential Commands: Your Daily Toolkit&lt;&#x2F;h1&gt;
&lt;p&gt;Here are the most frequently used Git commands and their purposes.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;status-overview&quot;&gt;Status &amp;amp; Overview&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; log&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --oneline --decorate -n 20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; diff&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;stage-files-prepare-for-commit&quot;&gt;Stage Files (Prepare for Commit)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; add .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Or stage specific files:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; add path&#x2F;to&#x2F;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;create-a-commit&quot;&gt;Create a Commit&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; commit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Brief, descriptive message&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;push-pull-explained&quot;&gt;Push &#x2F; Pull Explained&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git push&lt;&#x2F;code&gt;: Sends your local commits to the remote repository.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;git pull&lt;&#x2F;code&gt;: &lt;strong&gt;Fetches&lt;&#x2F;strong&gt; changes from the remote &lt;em&gt;and then&lt;&#x2F;em&gt; &lt;strong&gt;merges&lt;&#x2F;strong&gt; them into your current local branch.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; push&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pull&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # = git fetch + git merge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            AVOID ACCIDENTAL MERGE COMMITS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;For a cleaner history, especially when working on a personal branch, consider using &lt;code&gt;git pull --rebase&lt;&#x2F;code&gt;. This fetches remote changes and then re-applies your local commits &lt;em&gt;on top&lt;&#x2F;em&gt; of them, avoiding an explicit merge commit.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;branching-typical-workflow&quot;&gt;Branching (Typical Workflow)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; checkout&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; feature&#x2F;my-new-feature&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; push&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -u&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; origin feature&#x2F;my-new-feature&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;mini-example-your-first-commit&quot;&gt;Mini-Example: Your First Commit!&lt;&#x2F;h3&gt;
&lt;p&gt;Let’s try a complete cycle:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Create a new directory and initialize Git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; my-first-repo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; my-first-repo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; init&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Create a file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Hello, Git World!&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; index.html&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Check status (it&amp;#39;s untracked)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 4. Stage the file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; add index.html&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 5. Check status again (it&amp;#39;s staged)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 6. Commit the file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; commit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Add initial homepage with Hello World&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 7. Check log (see your commit)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; log&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --oneline&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# At this point, you&amp;#39;d typically connect to a remote and push.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For now, you have a local commit!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;6-ignoring-files-with-gitignore&quot;&gt;6. Ignoring Files with &lt;code&gt;.gitignore&lt;&#x2F;code&gt;&lt;&#x2F;h1&gt;
&lt;p&gt;Not every file belongs in your repository. Temporary files, build artifacts, and sensitive data should be ignored.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-is-node-modules-or-target-in-my-git&quot;&gt;Why is &lt;code&gt;node_modules&lt;&#x2F;code&gt; (or &lt;code&gt;target&#x2F;&lt;&#x2F;code&gt;) in my Git?!&lt;&#x2F;h3&gt;
&lt;p&gt;This is a common beginner question. Files generated by your build system (like &lt;code&gt;node_modules&lt;&#x2F;code&gt; for JavaScript or &lt;code&gt;target&#x2F;&lt;&#x2F;code&gt; for Rust) should &lt;em&gt;not&lt;&#x2F;em&gt; be committed. They bloat your repository and cause unnecessary merge conflicts.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;how-to-use-gitignore&quot;&gt;How to Use &lt;code&gt;.gitignore&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Create a file named &lt;code&gt;.gitignore&lt;&#x2F;code&gt; in the root of your repository and list the files or directories you want Git to ignore.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Example .gitignore content&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Node.js dependencies&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;node_modules&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Logs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt;.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;npm-debug.log*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;yarn-debug.log*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;yarn-error.log*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# OS generated files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;.DS_Store&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;.env&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Build artifacts (e.g., for Rust)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;target&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Your application&amp;#39;s local settings (if applicable)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;config&#x2F;local.yaml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# To create and add to .gitignore:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;node_modules&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .gitignore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;*.log&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .gitignore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; add .gitignore&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; commit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Add .gitignore to exclude common temporary files&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            EFFECTIVE .GITIGNORE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Make sure &lt;code&gt;.gitignore&lt;&#x2F;code&gt; is committed &lt;em&gt;before&lt;&#x2F;em&gt; you add any files that should be ignored. If files are already tracked, adding them to &lt;code&gt;.gitignore&lt;&#x2F;code&gt; won’t untrack them. You’d need &lt;code&gt;git rm --cached &amp;lt;file&amp;gt;&lt;&#x2F;code&gt; first.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;7-crucial-context-accounts-vs-repository-permissions&quot;&gt;7. Crucial Context: Accounts vs. Repository Permissions&lt;&#x2F;h1&gt;
&lt;p&gt;This is where many newcomers (and even seasoned pros) stumble.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;github-account-personal-vs-company-organization-repository&quot;&gt;GitHub Account (Personal) vs. Company&#x2F;Organization Repository&lt;&#x2F;h3&gt;
&lt;p&gt;On GitHub, repositories are often owned by an &lt;strong&gt;Organization&lt;&#x2F;strong&gt; (e.g., &lt;code&gt;DELIGHTFUL-corp&#x2F;my-project&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;You log in with a &lt;strong&gt;GitHub User Account&lt;&#x2F;strong&gt; (which might be your personal one).&lt;&#x2F;li&gt;
&lt;li&gt;This user account needs &lt;strong&gt;permissions&lt;&#x2F;strong&gt; (e.g., &lt;code&gt;WRITE&lt;&#x2F;code&gt;, &lt;code&gt;MAINTAIN&lt;&#x2F;code&gt;, &lt;code&gt;ADMIN&lt;&#x2F;code&gt;) within the Organization’s repository.&lt;&#x2F;li&gt;
&lt;li&gt;Without sufficient permissions, you might be able to read the repository but not push changes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;common-pitfall-the-identity-crisis&quot;&gt;Common Pitfall: The Identity Crisis&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            THE STEALTHY &amp;#x27;REPOSITORY NOT FOUND&amp;#x27; ERROR
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;A classic issue: you’re logged into GitHub in your browser with Account A, but Git on your command line is using cached credentials from Account B. This often results in “repository not found” errors for private repos even when you believe you have access.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;&#x2F;strong&gt; Your &lt;code&gt;git push&lt;&#x2F;code&gt; fails, even though you “know” you have access to the repository. The error message is often misleading (&lt;code&gt;fatal: repository &#x27;https:&#x2F;&#x2F;github.com&#x2F;ORG&#x2F;REPO.git&#x2F;&#x27; not found&lt;&#x2F;code&gt;) rather than an explicit “permission denied.” GitHub frequently returns a &lt;strong&gt;404&lt;&#x2F;strong&gt; (“not found”) for private repositories when permissions are lacking, to avoid leaking the existence of private repos.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;8-authentication-https-vs-ssh-and-why-your-error-happened&quot;&gt;8. Authentication: HTTPS vs. SSH (And Why Your Error Happened)&lt;&#x2F;h1&gt;
&lt;p&gt;Authentication methods can be a source of confusion.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;https-token-credentials&quot;&gt;HTTPS (Token&#x2F;Credentials)&lt;&#x2F;h3&gt;
&lt;p&gt;With HTTPS, Git requires authentication details. While passwords were used in the past, today it’s almost always:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;authentication&#x2F;keeping-your-account-and-data-secure&#x2F;managing-your-personal-access-tokens&quot;&gt;Personal Access Token (PAT)&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;, or&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;cli.github.com&#x2F;&quot;&gt;GitHub CLI&lt;&#x2F;a&gt; (&lt;code&gt;gh&lt;&#x2F;code&gt;)&lt;&#x2F;strong&gt; managing a token for you automatically. The GitHub CLI is an &lt;strong&gt;optional but highly recommended&lt;&#x2F;strong&gt; tool for smoother authentication workflows.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;installing-github-cli&quot;&gt;Installing GitHub CLI&lt;&#x2F;h4&gt;
&lt;p&gt;&lt;strong&gt;Debian&#x2F;Ubuntu:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install gh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Arch Linux:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; github-cli&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Your specific stumbling block was classic:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;gh repo view ... viewerPermission&lt;&#x2F;code&gt; correctly showed &lt;code&gt;ADMIN&lt;&#x2F;code&gt; (meaning permissions were there).&lt;&#x2F;li&gt;
&lt;li&gt;But &lt;code&gt;git ls-remote origin HEAD&lt;&#x2F;code&gt; reported &lt;code&gt;Repository not found&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;This often happens when Git uses &lt;strong&gt;incorrect or cached credentials&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;the-fix-from-your-real-world-case&quot;&gt;The Fix (from your real-world case)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; auth login&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; auth setup-git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This sequence ensures that Git is configured to use the credentials managed by the GitHub CLI for &lt;code&gt;https:&#x2F;&#x2F;github.com&#x2F;...&lt;&#x2F;code&gt; remotes.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;ssh-keys&quot;&gt;SSH (Keys)&lt;&#x2F;h3&gt;
&lt;p&gt;SSH is often more “set it and forget it” once correctly configured:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;You add an &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;authentication&#x2F;connecting-to-github-with-ssh&quot;&gt;SSH public key&lt;&#x2F;a&gt; to your GitHub account.&lt;&#x2F;li&gt;
&lt;li&gt;Your remote URL will look like &lt;code&gt;git@github.com:ORG&#x2F;REPO.git&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;SSH authentication is handled by your SSH agent, not Git’s credential storage. This setup avoids credential helper conflicts, making it robust for many users.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;9-troubleshooting-checklist-when-git-push-acts-up&quot;&gt;9. Troubleshooting Checklist: When &lt;code&gt;git push&lt;&#x2F;code&gt; Acts Up&lt;&#x2F;h1&gt;
&lt;p&gt;If &lt;code&gt;git push&lt;&#x2F;code&gt; fails, go through this checklist.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;9-1-is-the-remote-correct&quot;&gt;9.1. Is the Remote Correct?&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; remote&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;9-2-can-you-even-see-the-repository-authenticating-access&quot;&gt;9.2. Can You Even “See” the Repository? (Authenticating Access)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ls-remote origin HEAD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If this command fails with “repository not found” or “authentication failed,” the issue is almost certainly &lt;strong&gt;authentication, the remote URL, or your permissions&lt;&#x2F;strong&gt;. This is the first diagnostic step for “git push repository not found” problems.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;9-3-which-github-identity-is-active-gh-cli&quot;&gt;9.3. Which GitHub Identity is Active (GH CLI)?&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; auth status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;9-4-what-permissions-do-you-have&quot;&gt;9.4. What Permissions Do You Have?&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; repo view ORG&#x2F;REPO&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; viewerPermission&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;9-5-if-https-credentials-are-stuck-re-link&quot;&gt;9.5. If HTTPS Credentials are Stuck: Re-link&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; auth setup-git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;9-6-clear-cached-credentials-if-necessary&quot;&gt;9.6. Clear Cached Credentials (If Necessary)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;printf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;protocol=https\nhost=github.com\n\n&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; credential reject&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;10-your-minimal-daily-workflow&quot;&gt;10. Your Minimal Daily Workflow&lt;&#x2F;h1&gt;
&lt;p&gt;Once authentication is set up correctly (as it should be now), your daily routine is simple:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Start by pulling any remote changes (optional, but good practice)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Check what you&amp;#39;ve modified&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Stage your changes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; add .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 4. Commit your changes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; commit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Description of your changes&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 5. Push your changes to the remote repository&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; push&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;11-practical-rules-keeping-it-clean-long-term&quot;&gt;11. Practical Rules: Keeping it Clean Long-Term&lt;&#x2F;h1&gt;
&lt;p&gt;Adhere to these rules for a smoother Git experience.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One Identity Per Purpose&lt;&#x2F;strong&gt;:
&lt;ul&gt;
&lt;li&gt;GitHub Account (login) = Access &amp;amp; Permissions.&lt;&#x2F;li&gt;
&lt;li&gt;Git &lt;code&gt;user.name&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;user.email&lt;&#x2F;code&gt; = Commit Author (can be your company identity).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;For Private&#x2F;Org Repos&lt;&#x2F;strong&gt;: Always ensure your GitHub user is explicitly part of the Organization’s team with the necessary permissions.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;When Switching Accounts&lt;&#x2F;strong&gt;: After changing GitHub accounts (e.g., personal to work), always run &lt;code&gt;gh auth status&lt;&#x2F;code&gt; and potentially &lt;code&gt;gh auth setup-git&lt;&#x2F;code&gt; again. This is key to resolving “git authentication failed” issues.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;When it says “Repository not found”&lt;&#x2F;strong&gt;: First, check &lt;code&gt;git ls-remote origin HEAD&lt;&#x2F;code&gt;. If that fails, it’s time to check your credentials and active account. This specific error often means your authentication is failing for “github 404 private repository” scenarios.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;12-managing-multiple-git-identities-e-g-work-vs-personal&quot;&gt;12. Managing Multiple Git Identities (e.g., Work vs. Personal)&lt;&#x2F;h1&gt;
&lt;p&gt;It’s common to work on different projects that require different Git identities (e.g., a work email&#x2F;name for company projects and a personal one for open-source contributions). Git offers flexible ways to manage this.&lt;&#x2F;p&gt;
&lt;p&gt;Git applies configurations in a specific order:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Repository-specific (&lt;code&gt;.git&#x2F;config&lt;&#x2F;code&gt;):&lt;&#x2F;strong&gt; These settings override all others for the current repository.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Global (&lt;code&gt;~&#x2F;.gitconfig&lt;&#x2F;code&gt;):&lt;&#x2F;strong&gt; These settings apply to all repositories that don’t have their own specific configuration.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;System-wide (&lt;code&gt;$(prefix)&#x2F;etc&#x2F;gitconfig&lt;&#x2F;code&gt;):&lt;&#x2F;strong&gt; Least specific, rarely modified directly.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;option-a-simple-set-identity-per-repository&quot;&gt;Option A (Simple): Set Identity Per Repository&lt;&#x2F;h3&gt;
&lt;p&gt;The easiest way to use different identities is to set them directly within each project’s folder. This overrides your global settings only for that specific repository.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Set your default global identity&lt;&#x2F;strong&gt; (e.g., your personal one, or the one you use most often):&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.name &amp;quot;Your Default Name&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --global&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.email &amp;quot;your-default@mail.tld&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Navigate to a specific project folder&lt;&#x2F;strong&gt; (e.g., a work project).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Set the identity for &lt;em&gt;only this repository&lt;&#x2F;em&gt;:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config user.name &amp;quot;Work Name&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config user.email &amp;quot;work@company.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;This creates&#x2F;modifies the &lt;code&gt;.git&#x2F;config&lt;&#x2F;code&gt; file in that repository.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;To verify the local settings:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --local&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --local&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; user.email&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;option-b-advanced-conditional-includes-for-directories&quot;&gt;Option B (Advanced): Conditional Includes for Directories&lt;&#x2F;h3&gt;
&lt;p&gt;If you organize your projects into separate top-level directories (e.g., &lt;code&gt;~&#x2F;work&#x2F;company-projects&#x2F;&lt;&#x2F;code&gt; and &lt;code&gt;~&#x2F;personal-projects&#x2F;&lt;&#x2F;code&gt;), you can use Git’s &lt;code&gt;includeIf&lt;&#x2F;code&gt; directive. This automatically applies different configurations based on the path of the repository.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Define your default global identity&lt;&#x2F;strong&gt; in &lt;code&gt;~&#x2F;.gitconfig&lt;&#x2F;code&gt; (e.g., your personal one):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ~&#x2F;.gitconfig&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[user]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span&gt; = Dude (Personal)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  email&lt;&#x2F;span&gt;&lt;span&gt; = dude.personal@mail.tld&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[includeIf &amp;quot;gitdir:~&#x2F;work&#x2F;delightful&#x2F;&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  path&lt;&#x2F;span&gt;&lt;span&gt; = ~&#x2F;.gitconfig-delightful&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[includeIf &amp;quot;gitdir:~&#x2F;personal-projects&#x2F;&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  path&lt;&#x2F;span&gt;&lt;span&gt; = ~&#x2F;.gitconfig-personal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;Note: The &lt;code&gt;gitdir:&lt;&#x2F;code&gt; path should end with a &lt;code&gt;&#x2F;&lt;&#x2F;code&gt; to indicate a directory. Make sure these paths exist on your system.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create separate configuration files&lt;&#x2F;strong&gt; for each specific context.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;~&#x2F;.gitconfig-delightful&lt;&#x2F;code&gt;:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[user]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span&gt; = DELIGHTFUL Inc.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  email&lt;&#x2F;span&gt;&lt;span&gt; = dude.work@delightful.tld&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;~&#x2F;.gitconfig-personal&lt;&#x2F;code&gt;:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[user]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  name&lt;&#x2F;span&gt;&lt;span&gt; = Dude (Open Source)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  email&lt;&#x2F;span&gt;&lt;span&gt; = dude.opensource@mail.tld&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Now, when you enter a repository within &lt;code&gt;~&#x2F;work&#x2F;delightful&#x2F;&lt;&#x2F;code&gt;, Git will automatically use the &lt;code&gt;DELIGHTFUL Inc.&lt;&#x2F;code&gt; identity. When you’re in &lt;code&gt;~&#x2F;personal-projects&#x2F;&lt;&#x2F;code&gt;, it will use &lt;code&gt;Dude (Open Source)&lt;&#x2F;code&gt;. Any other repository will fall back to the default &lt;code&gt;Dude (Personal)&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;what-if-you-use-multiple-github-accounts-not-just-identities&quot;&gt;What if You Use Multiple GitHub Accounts (not just identities)?&lt;&#x2F;h3&gt;
&lt;p&gt;If you manage entirely separate GitHub accounts (e.g., &lt;code&gt;github.com&#x2F;my-personal-account&lt;&#x2F;code&gt; and &lt;code&gt;github.com&#x2F;my-work-account&lt;&#x2F;code&gt;), you’ll also need to configure &lt;strong&gt;separate SSH keys and SSH host aliases&lt;&#x2F;strong&gt; in your &lt;code&gt;~&#x2F;.ssh&#x2F;config&lt;&#x2F;code&gt; file. This tells Git which SSH key to use when connecting to &lt;code&gt;github.com&lt;&#x2F;code&gt; for specific projects. This setup is more advanced and beyond the scope of this beginner tutorial, but it’s important to be aware of it.&lt;&#x2F;p&gt;
&lt;!-- Retro-Trennlinie Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: retro_divider(style=&quot;dots&quot;) --&gt;
&lt;!-- Styles: dots, double, dashed, solid, shadow --&gt;


&lt;hr size=&quot;2&quot; noshade color=&quot;#666666&quot; style=&quot;margin: 15px 0; border-style: double;&quot;&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You’re now equipped with the knowledge to navigate Git and GitHub with confidence! We’ve covered the fundamentals, delved into the crucial authentication challenges, and provided a clear path to troubleshooting common issues like “git push repository not found.” Understanding how to manage your Git identity, especially across multiple projects, will streamline your workflow significantly. Version control can seem daunting, but with these principles and tools, you’ll be committing and collaborating like a pro in no time.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;git-scm.com&amp;#x2F;doc&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL GIT DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.github.com&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;GITHUB DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Self-hosting Immich with Docker, Traefik, and CrowdSec</title>
          <pubDate>Thu, 15 Jan 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/immich/</link>
          <guid>https://criticalbasics.xyz/posts/immich/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/immich/">&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;immich.app&#x2F;&quot;&gt;Immich&lt;&#x2F;a&gt; is currently the most powerful open-source alternative to Google Photos. It offers high-performance backup, AI-driven face recognition, and a polished mobile app. This guide focuses on a robust deployment using Docker Compose, integrating it into our  &lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;existing Traefik v3 reverse proxy&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt; and securing it with the CrowdSec IPS.&lt;&#x2F;p&gt;
&lt;p&gt;By placing Immich behind Traefik, we benefit from automatic TLS certificates and a central entry point for our mobile devices, while CrowdSec protects our personal memories from brute-force and bot attacks.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-01-15&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Immich v1.12x+, Traefik v3 integration, pgvector, and specific CrowdSec bypass notes for mobile sync.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This deployment assumes you have followed our foundational security stack guide. Immich is resource-intensive, especially during the initial scan of your library.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik stack running as described in the prerequisite guide:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This provides the &lt;code&gt;proxy&lt;&#x2F;code&gt; network and the &lt;code&gt;crowdsec-bouncer&lt;&#x2F;code&gt; middleware.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;&lt;strong&gt;System Recommendations:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;RAM:&lt;&#x2F;strong&gt; Minimum 4GB (8GB+ recommended for AI&#x2F;Machine Learning).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Storage:&lt;&#x2F;strong&gt; A large dedicated disk or mount point for your photo library.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Domain:&lt;&#x2F;strong&gt; A subdomain like &lt;code&gt;photos.your-domain.com&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;Immich requires several volumes for its database, machine learning cache, and the actual photo library.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the main directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;immich&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;immich&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create directories for data persistence&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; volumes&#x2F;db&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;      # Postgres data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; volumes&#x2F;library&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Your actual photos&#x2F;videos&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; volumes&#x2F;model-cache&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # AI models&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-configuration&quot;&gt;3. Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;Immich uses a &lt;code&gt;.env&lt;&#x2F;code&gt; file for core settings and a &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; for service orchestration.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-generate-database-password&quot;&gt;3.1. Generate Database Password&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DB_PASSWORD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -hex 32&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your Immich DB password: &lt;&#x2F;span&gt;&lt;span&gt;$DB_PASSWORD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-environment-variables-env&quot;&gt;3.2. Environment Variables (&lt;code&gt;.env&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;Create the &lt;code&gt;.env&lt;&#x2F;code&gt; file. Replace placeholders with your values.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Database ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DB_PASSWORD=&lt;&#x2F;span&gt;&lt;span&gt;$DB_PASSWORD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DB_USERNAME=immich&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DB_DATABASE_NAME=immich&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- System ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;TZ=Europe&#x2F;Vienna&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;IMMICH_VERSION=release&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Library Location ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Ensure this path has sufficient space (ideally a dedicated disk)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;UPLOAD_LOCATION=.&#x2F;volumes&#x2F;library&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# --- Domain ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DOMAIN_NAME=photos.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-3-docker-compose-docker-compose-yml&quot;&gt;3.3. Docker Compose (&lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  immich-server:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: immich_server&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: ghcr.io&#x2F;immich-app&#x2F;immich-server:${IMMICH_VERSION:-release}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - ${UPLOAD_LOCATION}:&#x2F;usr&#x2F;src&#x2F;app&#x2F;upload&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &#x2F;etc&#x2F;localtime:&#x2F;etc&#x2F;localtime:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    env_file:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .env&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - redis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - database&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - immich-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.immich.rule=Host(`${DOMAIN_NAME}`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.immich.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.immich.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # See Section 4.3 for opting out of CrowdSec if needed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.immich.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.immich.loadbalancer.server.port=2283&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  immich-machine-learning:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: immich_machine_learning&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: ghcr.io&#x2F;immich-app&#x2F;immich-machine-learning:${IMMICH_VERSION:-release}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;volumes&#x2F;model-cache:&#x2F;cache&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    env_file:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .env&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - immich-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  redis:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: immich_redis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: redis:6.2-alpine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - immich-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  database:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: immich_postgres&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: tensorchord&#x2F;pgvecto-rs:pg16-v0.2.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      POSTGRES_PASSWORD: ${DB_PASSWORD}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      POSTGRES_USER: ${DB_USERNAME}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      POSTGRES_DB: ${DB_DATABASE_NAME}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;volumes&#x2F;db:&#x2F;var&#x2F;lib&#x2F;postgresql&#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - immich-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  immich-net:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    driver: bridge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;4-hardware-security-tuning&quot;&gt;4. Hardware &amp;amp; Security Tuning&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;4-1-hardware-acceleration-optional&quot;&gt;4.1. Hardware Acceleration (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;Using an iGPU or GPU speeds up video transcoding and AI processing significantly.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            TRANSCODING &amp;amp; ML
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;To enable Intel QuickSync, add the following to both &lt;code&gt;immich-server&lt;&#x2F;code&gt; (for video) and &lt;code&gt;immich-machine-learning&lt;&#x2F;code&gt; (for AI) in your &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;devices&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;dri:&#x2F;dev&#x2F;dri&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;4-2-mobile-apps-crowdsec&quot;&gt;4.2. Mobile Apps &amp;amp; CrowdSec&lt;&#x2F;h3&gt;
&lt;p&gt;Immich mobile apps (especially on iOS) perform many rapid requests during background synchronization.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            MOBILE SYNC &amp;amp; FALSE POSITIVES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;If you experience “Connection Lost” or sync issues in the mobile app, check your CrowdSec decisions (&lt;code&gt;cscli decisions list&lt;&#x2F;code&gt;). Frequent background requests can sometimes trigger rate-limiting or bot-detection scenarios.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;4-3-running-immich-without-crowdsec-optional&quot;&gt;4.3. Running Immich without CrowdSec (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;If you find that the CrowdSec middleware frequently interferes with your mobile backups, you can choose to bypass it for Immich specifically while keeping your other services protected.&lt;&#x2F;p&gt;
&lt;p&gt;To disable CrowdSec for Immich, update the labels in your &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; by removing &lt;code&gt;crowdsec-bouncer@docker&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# In the immich-server labels section:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;traefik.http.routers.immich.middlewares=security-headers@file&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For more details on why you might want to do this, see:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;#5-2-scenario-2-service-bypassing-crowdsec-special-case&quot;&gt;Scenario 2: Service Bypassing CrowdSec&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;5-maintenance-backup&quot;&gt;5. Maintenance &amp;amp; Backup&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;updating-immich&quot;&gt;Updating Immich&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;immich&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;backup-strategy&quot;&gt;Backup Strategy&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Gezieltes Database Backup:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Export only the &amp;#39;immich&amp;#39; database for a cleaner dump&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; database pg_dump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; immich immich&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; immich_db_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.sql&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You now have a secure, high-performance photo management system. By integrating Immich with Traefik and CrowdSec (or selectively bypassing it for sync reliability), you achieve a “Google Photos” experience while maintaining full control over your private data.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;immich.app&amp;#x2F;docs&amp;#x2F;overview&amp;#x2F;introduction&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL IMMICH DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;immich-app&amp;#x2F;immich&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;IMMICH GITHUB&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>BIOS &amp; Firmware Update on Framework 13 (AMD Ryzen AI 300) under Arch Linux</title>
          <pubDate>Wed, 14 Jan 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/framework-bios-update/</link>
          <guid>https://criticalbasics.xyz/posts/framework-bios-update/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/framework-bios-update/">&lt;p&gt;The Framework Laptop 13 (AMD Ryzen AI 300 Series) is a prime example of hardware designed with Linux in mind. Instead of needing a Windows environment or a separate bootable USB stick, Framework leverages the &lt;strong&gt;Linux Vendor Firmware Service (LVFS)&lt;&#x2F;strong&gt;. This guide outlines the exact, reproducible workflow to keep your system up to date using &lt;code&gt;fwupd&lt;&#x2F;code&gt; on Arch Linux.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-01-14&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Full protocol for Framework 13 (AMD Ryzen AI 300) BIOS updates.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before starting the process, ensure your environment meets these requirements:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hardware:&lt;&#x2F;strong&gt; Framework Laptop 13 (AMD Ryzen AI 300 Series, e.g., AI 9 HX 370).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Power:&lt;&#x2F;strong&gt; Power adapter &lt;strong&gt;must be connected&lt;&#x2F;strong&gt; and charging.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Partitioning:&lt;&#x2F;strong&gt; EFI System Partition (ESP) must be mounted (usually at &lt;code&gt;&#x2F;boot&lt;&#x2F;code&gt; or &lt;code&gt;&#x2F;efi&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            MANDATORY POWER CONNECTION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The BIOS flash will refuse to start if the laptop is running on battery. Ensure your power cable is securely plugged in before proceeding.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-understanding-fwupd-lvfs&quot;&gt;2. Understanding fwupd &amp;amp; LVFS&lt;&#x2F;h2&gt;
&lt;p&gt;Framework officially supports firmware updates via:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;fwupd&lt;&#x2F;strong&gt;: The Firmware Update Daemon that manages the installation.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;LVFS&lt;&#x2F;strong&gt;: The online repository where vendors upload their firmware.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The process uses &lt;strong&gt;UEFI Capsules&lt;&#x2F;strong&gt;. &lt;code&gt;fwupd&lt;&#x2F;code&gt; stages the update on your EFI partition, and the actual “flashing” happens during the next reboot within the UEFI environment, not while Linux is running.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-installation&quot;&gt;3. Installation&lt;&#x2F;h2&gt;
&lt;p&gt;Install the necessary tools on Arch Linux using &lt;code&gt;pacman&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fwupd fwupd-efi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;fwupd.service&lt;&#x2F;code&gt; is a static systemd service. It doesn’t need to be “enabled”; it starts automatically when called. You can verify its status:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;systemctl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; status fwupd.service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-refreshing-firmware-metadata&quot;&gt;4. Refreshing Firmware Metadata&lt;&#x2F;h2&gt;
&lt;p&gt;First, update the local database of available firmware from LVFS:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fwupdmgr refresh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If prompted to enable the LVFS remote, confirm with &lt;strong&gt;Y&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-checking-for-updates&quot;&gt;5. Checking for Updates&lt;&#x2F;h2&gt;
&lt;p&gt;List all available updates for your hardware:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fwupdmgr get-updates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You will likely see several entries, such as:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;System Firmware&lt;&#x2F;strong&gt; (The BIOS&#x2F;UEFI)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fingerprint Sensor Firmware&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;UEFI dbx&lt;&#x2F;strong&gt; (Secure Boot revocation list)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-performing-the-update&quot;&gt;6. Performing the Update&lt;&#x2F;h2&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            SAFETY FIRST
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;During the update:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Do &lt;strong&gt;not&lt;&#x2F;strong&gt; power off the machine.&lt;&#x2F;li&gt;
&lt;li&gt;Do &lt;strong&gt;not&lt;&#x2F;strong&gt; close the lid.&lt;&#x2F;li&gt;
&lt;li&gt;Be patient. The screen may stay black for several minutes.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Start the update process:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; fwupdmgr update&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;what-to-expect&quot;&gt;What to expect:&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Fingerprint Sensor:&lt;&#x2F;strong&gt; This usually updates instantly without a reboot.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;System Firmware (BIOS):&lt;&#x2F;strong&gt; This is the core update. &lt;code&gt;fwupd&lt;&#x2F;code&gt; will schedule it for the next boot.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;UEFI dbx:&lt;&#x2F;strong&gt; Updates the Secure Boot blacklist.
&lt;em&gt;(Note: If you use a custom Secure Boot setup with your own keys, review this step carefully before confirming.)&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-the-reboot-flash-process&quot;&gt;7. The Reboot &amp;amp; Flash Process&lt;&#x2F;h2&gt;
&lt;p&gt;After the command finishes, &lt;code&gt;fwupd&lt;&#x2F;code&gt; will prompt you to restart:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;A&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; reboot is required to complete the update.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;What happens during reboot:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The system enters a special firmware update mode.&lt;&#x2F;li&gt;
&lt;li&gt;The screen might remain black, and fans might spin up loudly.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Do not interrupt this.&lt;&#x2F;strong&gt; There might not be a visible progress bar depending on the specific firmware version.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The system will automatically reboot into Arch Linux once the flash is complete.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;8-verifying-success&quot;&gt;8. Verifying Success&lt;&#x2F;h2&gt;
&lt;p&gt;Once back in your terminal, verify that all devices are on the latest version:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;fwupdmgr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; get-devices&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Alternatively, check the version directly in the BIOS by pressing &lt;strong&gt;F2&lt;&#x2F;strong&gt; during startup. You should see the updated version number (e.g., &lt;code&gt;0.0.3.5&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;Updating firmware on a Framework laptop is a seamless experience that respects the user’s choice of OS:&lt;&#x2F;p&gt;
&lt;p&gt;✅ Full BIOS update support under Linux
✅ No USB-Stick or Windows required
✅ Safe, transactional updates via UEFI Capsules
✅ Officially supported by Framework&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;knowledgebase.frame.work&amp;#x2F;en_us&amp;#x2F;framework-laptop-13-bios-and-driver-releases-amd-ryzen-ai-300-series-r1wqKAs1e&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🔧&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL FRAMEWORK BIOS RELEASES&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;wiki.archlinux.org&amp;#x2F;title&amp;#x2F;Fwupd&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;ARCH WIKI: FWUPD&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;fwupd.org&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🌐&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;FWUPD PROJECT HOME&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Enhancing Ranger with exiftool: Advanced Image Metadata Viewing</title>
          <pubDate>Mon, 12 Jan 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/ranger-exiftool-integration/</link>
          <guid>https://criticalbasics.xyz/posts/ranger-exiftool-integration/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/ranger-exiftool-integration/">&lt;p&gt;For photographers, designers, and anyone working with digital media, having quick access to file metadata is essential. This guide shows you how to integrate the powerful &lt;code&gt;exiftool&lt;&#x2F;code&gt; utility with the ranger file manager, allowing you to view comprehensive metadata for images and other media files without leaving your terminal.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-01-12&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Shortcut Update:&lt;&#x2F;strong&gt; Switched metadata shortcut from &lt;code&gt;ei&lt;&#x2F;code&gt; to &lt;code&gt;ii&lt;&#x2F;code&gt; (inspect&#x2F;media prefix)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-07-18&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Created guide for integrating exiftool with ranger&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, make sure you have the following tools installed:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ranger&lt;&#x2F;strong&gt;: The terminal file manager&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;exiftool&lt;&#x2F;strong&gt;: A powerful utility for reading, writing, and manipulating metadata&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;installation-on-various-distributions&quot;&gt;Installation on Various Distributions&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Debian&#x2F;Ubuntu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install ranger libimage-exiftool-perl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Arch Linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ranger perl-image-exiftool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Fedora&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dnf install ranger perl-Image-ExifTool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-creating-the-custom-exif-info-command&quot;&gt;2. Creating the Custom exif_info Command&lt;&#x2F;h2&gt;
&lt;p&gt;The integration requires adding a custom command to ranger that will use &lt;code&gt;exiftool&lt;&#x2F;code&gt; to display metadata for the selected file.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-1-create-or-edit-commands-py&quot;&gt;2.1. Create or Edit commands.py&lt;&#x2F;h3&gt;
&lt;p&gt;First, navigate to your ranger configuration directory and create or edit the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;touch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;commands.py&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don’t have a &lt;code&gt;commands.py&lt;&#x2F;code&gt; file yet, you can generate a template with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=commands&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;2-2-add-the-exif-info-command&quot;&gt;2.2. Add the exif_info Command&lt;&#x2F;h3&gt;
&lt;p&gt;Open the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file in your favorite text editor and add the following code:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt; ranger.api.commands&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; import&lt;&#x2F;span&gt;&lt;span&gt; Command&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; mimetypes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; os&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; shlex&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; shutil&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; subprocess&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; exif_info&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    :exif_info&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    Shows file metadata using exiftool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisfile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; f:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        filename&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; f.path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; filename&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; or&lt;&#x2F;span&gt;&lt;span&gt; os.path.isdir(filename):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; None&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; shutil.which(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;file&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            try&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; subprocess.check_output(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;file&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;--mime-type&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;-Lb&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, filename],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;                    text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;                    stderr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;subprocess.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;DEVNULL&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                ).strip()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            except&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Exception&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; None&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; mime:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            mime, _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; mimetypes.guess_type(filename)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        is_media&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; False&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; mime:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            is_media&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                mime.startswith((&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;image&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;video&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;audio&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                or&lt;&#x2F;span&gt;&lt;span&gt; mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;application&#x2F;pdf&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; is_media:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; shlex.quote(filename)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.execute_command(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;exiftool &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; | less&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.display_file()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This command will:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Detect whether the selected file is an image, video, audio file, or PDF (using &lt;code&gt;file --mime-type&lt;&#x2F;code&gt; when available, with an extension-based fallback)&lt;&#x2F;li&gt;
&lt;li&gt;Run &lt;code&gt;exiftool&lt;&#x2F;code&gt; on media&#x2F;PDF files and pipe the output to &lt;code&gt;less&lt;&#x2F;code&gt; for easy viewing&lt;&#x2F;li&gt;
&lt;li&gt;Fall back to ranger’s default preview (&lt;code&gt;display_file()&lt;&#x2F;code&gt;) for all other file types&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-creating-a-keyboard-shortcut&quot;&gt;3. Creating a Keyboard Shortcut&lt;&#x2F;h2&gt;
&lt;p&gt;Now that we have our custom command, let’s create a keyboard shortcut to invoke it easily.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-edit-rc-conf&quot;&gt;3.1. Edit rc.conf&lt;&#x2F;h3&gt;
&lt;p&gt;Open your ranger configuration file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don’t have this file yet, you can generate it with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=rc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-add-the-keyboard-mapping&quot;&gt;3.2. Add the Keyboard Mapping&lt;&#x2F;h3&gt;
&lt;p&gt;Add the following line to map the &lt;code&gt;exif_info&lt;&#x2F;code&gt; command to a keyboard shortcut. In this example, we’ll use &lt;code&gt;ii&lt;&#x2F;code&gt; (which stands for “inspect info”):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map ii exif_info&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We use &lt;code&gt;i&lt;&#x2F;code&gt; as a generic &lt;strong&gt;inspect &#x2F; media prefix&lt;&#x2F;strong&gt; to group all image and media-related actions and avoid conflicts with ranger’s built-in &lt;code&gt;o&lt;&#x2F;code&gt; (order) commands.&lt;&#x2F;p&gt;
&lt;p&gt;This shortcut is easy to remember as &lt;code&gt;ii&lt;&#x2F;code&gt; stands for “inspect info” - which is exactly what this command does: it shows you detailed metadata information about your files.&lt;&#x2F;p&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Shortcut&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;ii&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Show detailed metadata for the selected file using exiftool&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-advanced-configuration&quot;&gt;4. Advanced Configuration&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;4-1-using-with-different-file-types&quot;&gt;4.1. Using with Different File Types&lt;&#x2F;h3&gt;
&lt;p&gt;One of the advantages of this implementation is that it targets media-related formats and avoids running exiftool on unrelated file types. The command will automatically use exiftool for:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Common image formats (JPG, PNG, GIF, TIFF, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;RAW camera formats (CR2, NEF, ARW, DNG, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;Video files (MP4, MOV, AVI, MKV, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;Document formats (PDF, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;Audio files (MP3, FLAC, etc.)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For everything else, it will fall back to ranger’s normal file preview.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-2-format-the-output&quot;&gt;4.2. Format the Output&lt;&#x2F;h3&gt;
&lt;p&gt;You can customize how the metadata is displayed by modifying the command that calls &lt;code&gt;exiftool&lt;&#x2F;code&gt;. For example, to show only specific tags:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; shlex.quote(filename)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.fm.execute_command(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;exiftool -DateTimeOriginal -Make -Model -LensModel -ExposureTime -FNumber -ISO &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; | less&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-3-create-a-colorized-output&quot;&gt;4.3. Create a Colorized Output&lt;&#x2F;h3&gt;
&lt;p&gt;For a more visually appealing output, you can use &lt;code&gt;bat&lt;&#x2F;code&gt; instead of &lt;code&gt;less&lt;&#x2F;code&gt; if you have it installed:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; shlex.quote(filename)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.fm.execute_command(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;exiftool &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; | bat --style=plain --color=always | less -R&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-usage&quot;&gt;5. Usage&lt;&#x2F;h2&gt;
&lt;p&gt;Once everything is set up, you can use your new metadata viewing capability:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Open ranger in your terminal&lt;&#x2F;li&gt;
&lt;li&gt;Navigate to an image or media file&lt;&#x2F;li&gt;
&lt;li&gt;Press your configured shortcut (e.g., &lt;code&gt;ii&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Browse through the metadata information&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;q&lt;&#x2F;code&gt; to exit the viewer and return to ranger&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-practical-examples&quot;&gt;6. Practical Examples&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;6-1-photography-workflow&quot;&gt;6.1. Photography Workflow&lt;&#x2F;h3&gt;
&lt;p&gt;For photographers, this integration is particularly useful for quickly checking:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Camera settings (aperture, shutter speed, ISO)&lt;&#x2F;li&gt;
&lt;li&gt;Lens information&lt;&#x2F;li&gt;
&lt;li&gt;Date and time the photo was taken&lt;&#x2F;li&gt;
&lt;li&gt;GPS coordinates (if available)&lt;&#x2F;li&gt;
&lt;li&gt;Copyright information&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;6-2-batch-processing&quot;&gt;6.2. Batch Processing&lt;&#x2F;h3&gt;
&lt;p&gt;You can combine this with other ranger commands to create a powerful workflow. For example, you could:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Use &lt;code&gt;zi&lt;&#x2F;code&gt; (if you have the &lt;a href=&quot;&#x2F;posts&#x2F;ranger-fzf-bat-integration&#x2F;&quot;&gt;fzf integration&lt;&#x2F;a&gt;) to quickly find images&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;ii&lt;&#x2F;code&gt; to check their metadata&lt;&#x2F;li&gt;
&lt;li&gt;Use ranger’s tagging system to organize files based on metadata information&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;6-3-checking-file-integrity&quot;&gt;6.3. Checking File Integrity&lt;&#x2F;h3&gt;
&lt;p&gt;For downloaded files or files received from others, you can quickly check:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Creation and modification dates&lt;&#x2F;li&gt;
&lt;li&gt;Software used to create the file&lt;&#x2F;li&gt;
&lt;li&gt;Embedded comments or descriptions&lt;&#x2F;li&gt;
&lt;li&gt;File integrity information&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-troubleshooting&quot;&gt;7. Troubleshooting&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;7-1-command-not-found&quot;&gt;7.1. Command Not Found&lt;&#x2F;h3&gt;
&lt;p&gt;If you get a “Command not found” error when trying to use the shortcut:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure you’ve saved the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file correctly&lt;&#x2F;li&gt;
&lt;li&gt;Restart ranger to load the new command&lt;&#x2F;li&gt;
&lt;li&gt;Check that &lt;code&gt;exiftool&lt;&#x2F;code&gt; is installed and in your PATH&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;7-2-no-metadata-displayed&quot;&gt;7.2. No Metadata Displayed&lt;&#x2F;h3&gt;
&lt;p&gt;If no metadata is displayed for a file:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The file might not contain any metadata&lt;&#x2F;li&gt;
&lt;li&gt;The file format might not be supported by exiftool&lt;&#x2F;li&gt;
&lt;li&gt;There might be permission issues with the file&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Try running &lt;code&gt;exiftool&lt;&#x2F;code&gt; directly on the file to see if it works outside of ranger:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;exiftool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; path&#x2F;to&#x2F;your&#x2F;file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With this integration, you’ve enhanced ranger’s capabilities for working with digital media files:&lt;&#x2F;p&gt;
&lt;p&gt;✅ Quick access to comprehensive file metadata
✅ Support for a wide range of file formats
✅ Customizable keyboard shortcuts
✅ Seamless integration with your terminal workflow&lt;&#x2F;p&gt;
&lt;p&gt;This setup is particularly valuable for photographers, designers, and anyone who works with digital media files regularly. It combines the file management power of ranger with the detailed metadata analysis capabilities of exiftool.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;exiftool.org&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;EXIFTOOL DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;ranger&amp;#x2F;ranger&amp;#x2F;wiki&amp;#x2F;Custom-Commands&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🔧&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;RANGER CUSTOM COMMANDS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;exiftool.org&amp;#x2F;TagNames&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🏷️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;EXIFTOOL TAG NAMES&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
&lt;h2 id=&quot;related-ranger-guides&quot;&gt;Related Ranger Guides&lt;&#x2F;h2&gt;
&lt;p&gt;Enhance your ranger experience with these additional tutorials:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-fzf-bat-integration&#x2F;&quot;&gt;Ranger and fzf Integration&lt;&#x2F;a&gt; - Add powerful fuzzy search capabilities&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-compression-workflow&#x2F;&quot;&gt;File Compression Workflow&lt;&#x2F;a&gt; - Create and extract archives easily&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-media-preview-configuration&#x2F;&quot;&gt;Advanced Media Preview Configuration&lt;&#x2F;a&gt; - Customize file previews for various formats&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-sxiv-integration&#x2F;&quot;&gt;Ranger and sxiv Integration&lt;&#x2F;a&gt; - Create a seamless image viewing workflow&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>A Modern Image Optimization Workflow in ranger (with Rofi, ImageMagick &amp; WebP)</title>
          <pubDate>Mon, 12 Jan 2026 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/ranger-image-optimization/</link>
          <guid>https://criticalbasics.xyz/posts/ranger-image-optimization/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/ranger-image-optimization/">&lt;p&gt;For many power users, the terminal is not a limitation but a productivity multiplier. Yet image optimization is often one of the last steps still handled by heavyweight GUI tools.&lt;&#x2F;p&gt;
&lt;p&gt;This guide shows you how to build a &lt;strong&gt;fully terminal-based image optimization workflow&lt;&#x2F;strong&gt; around &lt;strong&gt;ranger&lt;&#x2F;strong&gt;, combining ImageMagick, modern image optimizers, and a Rofi-driven preset menu. The result is a fast, reproducible setup that scales from simple social media exports to high-quality WebP graphics — without ever leaving your file manager.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2026-01-12&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Shortcut Update:&lt;&#x2F;strong&gt; Switched optimization shortcut from &lt;code&gt;oi&lt;&#x2F;code&gt; to &lt;code&gt;io&lt;&#x2F;code&gt; (inspect&#x2F;media prefix)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2026-01-09&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Created guide for image optimization workflow with Rofi presets&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide assumes a Linux system with a keyboard-focused workflow. Ensure you have the following tools installed:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ranger&lt;&#x2F;strong&gt;: The terminal file manager&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ImageMagick&lt;&#x2F;strong&gt;: The image processing backend&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;pngquant&lt;&#x2F;strong&gt;: Lossy PNG optimization&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;oxipng&lt;&#x2F;strong&gt;: Lossless PNG optimization&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;rofi&lt;&#x2F;strong&gt;: Interactive preset menu&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;libwebp&lt;&#x2F;strong&gt;: WebP support&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            NOTE ON IMAGEMAGICK VERSIONS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This workflow supports both ImageMagick 6 (&lt;code&gt;convert&lt;&#x2F;code&gt;) and ImageMagick 7 (&lt;code&gt;magick&lt;&#x2F;code&gt;). On modern systems, ImageMagick 7 is preferred for better performance and syntax consistency. The script automatically detects which version is available.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;1-1-installation-examples&quot;&gt;1.1. Installation Examples&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Arch Linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ranger imagemagick pngquant oxipng rofi libwebp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Debian &#x2F; Ubuntu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install ranger imagemagick pngquant oxipng rofi libwebp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-design-goals-processing-strategy&quot;&gt;2. Design Goals &amp;amp; Processing Strategy&lt;&#x2F;h2&gt;
&lt;p&gt;Before diving into the code, it is important to understand the design principles behind this setup:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Non-destructive&lt;&#x2F;strong&gt;: Original images are never modified.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Preset-driven&lt;&#x2F;strong&gt;: No manual tweaking of parameters during daily use.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pixel-safe where required&lt;&#x2F;strong&gt;: Graphics and screenshots are handled differently from photos.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Privacy-aware&lt;&#x2F;strong&gt;: Metadata is stripped by default.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fast access&lt;&#x2F;strong&gt;: One keybinding opens all optimization options.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-1-photos-vs-graphics&quot;&gt;2.1. Photos vs Graphics&lt;&#x2F;h3&gt;
&lt;p&gt;A critical distinction is made between two image categories:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Photos (JPEG&#x2F;PNG)&lt;&#x2F;strong&gt;: Lossy compression is acceptable. Target: small file size for web&#x2F;social platforms.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Graphics &#x2F; UI &#x2F; Screenshots&lt;&#x2F;strong&gt;: Pixel integrity matters. Target: lossless or near-lossless processing.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-implementation-in-commands-py&quot;&gt;3. Implementation in commands.py&lt;&#x2F;h2&gt;
&lt;p&gt;The code below should be added to your ranger configuration. It uses CommandLoader to run heavy processing in the background, keeping the ranger UI responsive.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-edit-commands-py&quot;&gt;3.1. Edit commands.py&lt;&#x2F;h3&gt;
&lt;p&gt;Open your ranger configuration directory:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;commands.py&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-add-the-optimization-logic&quot;&gt;3.2. Add the Optimization Logic&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt; ranger.api.commands&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; import&lt;&#x2F;span&gt;&lt;span&gt; Command&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; os&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; shutil&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; shlex&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; subprocess&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt; ranger.core.loader&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; import&lt;&#x2F;span&gt;&lt;span&gt; CommandLoader&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_base&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot; Backend logic for image optimization &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; optimize&lt;&#x2F;span&gt;&lt;span&gt;(self, target_width, quality, mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;None&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                 keep_meta&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;, webp_lossless&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;, do_colorspace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        cwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisdir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        marked_files&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; cwd.get_selection()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; marked_files:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.notify(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;No files selected!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; bad&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        output_dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; cwd.path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        image_exts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.jpg&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.jpeg&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.png&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.webp&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tif&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tiff&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        images&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; marked_files&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; if&lt;&#x2F;span&gt;&lt;span&gt; f.path.lower().endswith(image_exts)]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; images:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.notify(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;No images found!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; bad&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        magick_bin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;magick&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; if&lt;&#x2F;span&gt;&lt;span&gt; shutil.which(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;magick&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;convert&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; if&lt;&#x2F;span&gt;&lt;span&gt; shutil.which(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;convert&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; None&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; magick_bin:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.notify(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Error: ImageMagick missing!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; bad&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        pngquant_bin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; shutil.which(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;pngquant&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        oxipng_bin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; shutil.which(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;oxipng&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span&gt;.fm.notify(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Starting optimization (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;)...&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        for&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; images:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(f.path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            name, raw_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.splitext(base)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            src_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; raw_ext.lower()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; if&lt;&#x2F;span&gt;&lt;span&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; src_ext&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            final_suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; if&lt;&#x2F;span&gt;&lt;span&gt; suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; else f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;_w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;target_width&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            out_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}{&lt;&#x2F;span&gt;&lt;span&gt;final_suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}{&lt;&#x2F;span&gt;&lt;span&gt;out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            dest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.join(output_dir, out_name)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;            # Avoid overwriting&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            counter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            while&lt;&#x2F;span&gt;&lt;span&gt; os.path.exists(dest):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                out_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}{&lt;&#x2F;span&gt;&lt;span&gt;final_suffix&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;counter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}{&lt;&#x2F;span&gt;&lt;span&gt;out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                dest&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.join(output_dir, out_name)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                counter&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cmd_im&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [magick_bin, f.path,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-auto-orient&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; target_width&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-resize&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;target_width&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;x&amp;gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; do_colorspace:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-colorspace&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;sRGB&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            do_strip_in_im&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; True&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; keep_meta:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                do_strip_in_im&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; False&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            elif&lt;&#x2F;span&gt;&lt;span&gt; out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.png&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; and&lt;&#x2F;span&gt;&lt;span&gt; mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;hq&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; and&lt;&#x2F;span&gt;&lt;span&gt; oxipng_bin:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                do_strip_in_im&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; False&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; do_strip_in_im:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.append(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-strip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.jpg&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.jpeg&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-quality&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; str&lt;&#x2F;span&gt;&lt;span&gt;(quality)])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                if&lt;&#x2F;span&gt;&lt;span&gt; mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-sampling-factor&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;4:2:0&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-interlace&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;Plane&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.append(dest)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.loader.add(CommandLoader(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;cmd_im,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;JPG &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            elif&lt;&#x2F;span&gt;&lt;span&gt; out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.webp&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-define&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;webp:method=6&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                if&lt;&#x2F;span&gt;&lt;span&gt; webp_lossless:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-define&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;webp:lossless=true&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                else&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-quality&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; str&lt;&#x2F;span&gt;&lt;span&gt;(quality)])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    cmd_im.extend([&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-define&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;webp:alpha-quality=90&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.append(dest)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.loader.add(CommandLoader(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;cmd_im,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;WebP: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            elif&lt;&#x2F;span&gt;&lt;span&gt; out_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.png&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.append(dest)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                safe_im_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;.join(shlex.quote(arg)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; cmd_im)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                full_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; safe_im_cmd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;PNG (IM): &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                if&lt;&#x2F;span&gt;&lt;span&gt; mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; and&lt;&#x2F;span&gt;&lt;span&gt; pngquant_bin:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    cmd_pq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [pngquant_bin,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;--force&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;--skip-if-larger&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;--speed&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;3&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;--quality=65-85&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, dest]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    safe_pq_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;.join(shlex.quote(arg)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; cmd_pq)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    full_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;safe_im_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;safe_pq_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;PNG Lossy: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                elif&lt;&#x2F;span&gt;&lt;span&gt; mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;hq&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; and&lt;&#x2F;span&gt;&lt;span&gt; oxipng_bin:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    cmd_oxi&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [oxipng_bin,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-o&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;2&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;--strip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;safe&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, dest]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    safe_oxi_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;.join(shlex.quote(arg)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; cmd_oxi)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    full_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;safe_im_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;safe_oxi_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;PNG HQ: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.loader.add(CommandLoader(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;sh&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-c&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, full_cmd],&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;descr,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            else&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                cmd_im.append(dest)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.loader.add(CommandLoader(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;cmd_im,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Convert: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;base&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; True&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # --- PRESETS ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_web&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1920&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 82&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_web&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_web_xl&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;2560&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 82&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_webXL&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_web_hq&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1920&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 92&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;hq&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_webHQ&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_blog&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1400&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 82&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_blog&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_thumb&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;600&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 75&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_thumb&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_ig_feed&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1080&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 85&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_ig&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_ig_portrait&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1350&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 85&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_ig4x5&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_story&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1080&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 85&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_story&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_linkedin&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1200&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 85&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_li&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_meta_ads&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1200&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 85&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_ads&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_jpeg_email&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1280&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 80&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_email&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.jpg&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_webp_hq&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1920&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 85&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_web&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.webp&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_webp_lossless&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;hq&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_graphic&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.webp&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; webp_lossless&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; do_colorspace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_webp_no_resize&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 82&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;lossy&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_webp&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.webp&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_png_graphic&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;hq&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_graphic&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; force_fmt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.png&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; do_colorspace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; scale_strip_only&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;scale_base&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.optimize(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;hq&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;_stripped&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; keep_meta&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; do_colorspace&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;False&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # --- ROFI MENU ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; image_optimization_menu&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        &amp;quot;&amp;quot;&amp;quot; Rofi Menu for Image Optimization &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            menu_structure&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;--- WEB ---&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;true&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Web Standard (1920px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_web&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Web XL (2560px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_web_xl&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Web HQ (1920px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_web_hq&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Blog (1400px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_blog&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Thumbnail (600px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_thumb&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;--- SOCIAL ---&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;true&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;IG Feed (1080px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_ig_feed&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;IG Portrait (1350px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_ig_portrait&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;IG Story&#x2F;Reel (1080px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_story&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;LinkedIn (1200px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_linkedin&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Meta Ads (1200px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_meta_ads&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;JPEG Email (1280px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_jpeg_email&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;--- MODERN&#x2F;TOOLS ---&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;true&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;WebP HQ (1920px)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_webp_hq&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;WebP Lossless (Grafik)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_webp_lossless&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;WebP Convert (Original Size)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_webp_no_resize&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;PNG Graphic (Original, no sRGB)&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_png_graphic&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Strip Metadata Only&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;scale_strip_only&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if not&lt;&#x2F;span&gt;&lt;span&gt; shutil.which(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;rofi&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.notify(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Rofi missing!&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; bad&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            options_str&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;.join([item[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; item&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; menu_structure])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            try&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; subprocess.Popen(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;rofi&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-dmenu&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-p&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;Optimize&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-i&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;-lines&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; str&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(menu_structure))],&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;                    stdin&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;subprocess.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;PIPE&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;                    stdout&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;subprocess.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;PIPE&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;                    stderr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;subprocess.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;PIPE&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;                    text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                stdout, _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; p.communicate(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;input&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;options_str)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                selection&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; stdout.strip()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                if not&lt;&#x2F;span&gt;&lt;span&gt; selection:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                    return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                for&lt;&#x2F;span&gt;&lt;span&gt; label, cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; menu_structure:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                    if&lt;&#x2F;span&gt;&lt;span&gt; label&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span&gt; selection:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                        if&lt;&#x2F;span&gt;&lt;span&gt; cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;true&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.execute_console(cmd)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                        break&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            except&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; Exception&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; as&lt;&#x2F;span&gt;&lt;span&gt; e:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.notify(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Error: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; bad&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;                return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-creating-keyboard-shortcuts&quot;&gt;4. Creating Keyboard Shortcuts&lt;&#x2F;h2&gt;
&lt;p&gt;Now, let’s map the interactive menu to a shortcut.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-1-edit-rc-conf&quot;&gt;4.1. Edit rc.conf&lt;&#x2F;h3&gt;
&lt;p&gt;Open your rc.conf:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-2-add-the-mapping&quot;&gt;4.2. Add the Mapping&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Image Optimization Menu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map io image_optimization_menu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We use &lt;code&gt;i&lt;&#x2F;code&gt; as a generic &lt;strong&gt;inspect &#x2F; media prefix&lt;&#x2F;strong&gt; to group all image and media-related actions and avoid conflicts with ranger’s built-in &lt;code&gt;o&lt;&#x2F;code&gt; (order) commands.&lt;&#x2F;p&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Shortcut&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;io&lt;&#x2F;td&gt;&lt;td&gt;Open Rofi menu to select image optimization preset&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-preset-overview&quot;&gt;5. Preset Overview&lt;&#x2F;h2&gt;
&lt;p&gt;The workflow provides curated presets for real-world scenarios:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Web Standard (1920px)&lt;&#x2F;strong&gt;: Balanced compression for websites.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Web XL (2560px)&lt;&#x2F;strong&gt;: Extra-wide output for large screens.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Web HQ (1920px)&lt;&#x2F;strong&gt;: Minimal compression for high-quality portfolios.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Blog (1400px)&lt;&#x2F;strong&gt;: Cleaner sizing for article layouts.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Thumbnail (600px)&lt;&#x2F;strong&gt;: Small previews.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Instagram Feed (1080px)&lt;&#x2F;strong&gt;: Optimized for Instagram’s upload limits.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;IG Portrait (1350px)&lt;&#x2F;strong&gt;: 4:5 portrait-friendly sizing.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;IG Story&#x2F;Reel (1080px)&lt;&#x2F;strong&gt;: Vertical-first exports.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;LinkedIn (1200px)&lt;&#x2F;strong&gt;: Social sharing format.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Meta Ads (1200px)&lt;&#x2F;strong&gt;: Ad-friendly sizing.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;JPEG Email (1280px)&lt;&#x2F;strong&gt;: Compatibility-first export.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WebP HQ&lt;&#x2F;strong&gt;: Modern lossy format for superior size-to-quality ratio.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WebP Lossless (Graphic)&lt;&#x2F;strong&gt;: Lossless WebP for pixel-perfect graphics.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;WebP Convert (Original Size)&lt;&#x2F;strong&gt;: Convert without resizing.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;PNG Graphic (Original, no sRGB)&lt;&#x2F;strong&gt;: Preserve pixel values and skip sRGB conversion.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Strip Metadata&lt;&#x2F;strong&gt;: Removes EXIF&#x2F;GPS data without changing pixel values.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            WHY ROFI?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Rofi provides fuzzy search and instant feedback. It fits perfectly into window manager workflows and avoids the need to memorize dozens of separate keybindings.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-practical-use-cases&quot;&gt;6. Practical Use Cases&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;6-1-content-publishing&quot;&gt;6.1. Content Publishing&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to your image folder in ranger.&lt;&#x2F;li&gt;
&lt;li&gt;Mark images with Space.&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;io&lt;&#x2F;code&gt; and select &lt;strong&gt;Web Standard&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Optimized files appear in the same folder as the originals.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;6-2-privacy-stripping&quot;&gt;6.2. Privacy Stripping&lt;&#x2F;h3&gt;
&lt;p&gt;Before sharing photos online, mark them and run &lt;strong&gt;Strip Metadata Only&lt;&#x2F;strong&gt; to ensure no GPS or camera information is leaked.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-troubleshooting&quot;&gt;7. Troubleshooting&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;7-1-images-appear-rotated&quot;&gt;7.1. Images appear rotated&lt;&#x2F;h3&gt;
&lt;p&gt;The script uses &lt;code&gt;-auto-orient&lt;&#x2F;code&gt; before processing. This ensures that the orientation tag is respected even when metadata is stripped.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;7-2-colors-look-different&quot;&gt;7.2. Colors look different&lt;&#x2F;h3&gt;
&lt;p&gt;Web presets normalize images to sRGB. If you need to preserve a specific color profile, use the &lt;strong&gt;Strip Only&lt;&#x2F;strong&gt; or &lt;strong&gt;PNG Graphic&lt;&#x2F;strong&gt; presets which skip colorspace conversion.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;8-summary&quot;&gt;8. Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With this integration, you’ve transformed ranger into a high-performance image processing station:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;✅ Batch processing of multiple images&lt;&#x2F;li&gt;
&lt;li&gt;✅ Searchable Rofi menu for all presets&lt;&#x2F;li&gt;
&lt;li&gt;✅ Background execution via CommandLoader&lt;&#x2F;li&gt;
&lt;li&gt;✅ Support for modern formats like WebP&lt;&#x2F;li&gt;
&lt;li&gt;✅ Optimized for web, social media, and privacy&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This setup combines the simplicity of ranger with the industrial-grade power of ImageMagick, ensuring your images are always perfectly optimized for any platform.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;imagemagick.org&amp;#x2F;script&amp;#x2F;command-line-options.php&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;IMAGEMAGICK CLI DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;shinchiro&amp;#x2F;mpv-scripts&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🔧&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;MORE RANGER TOOLS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;pngquant.org&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🖼️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;PNGQUANT HOME&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;9-related-ranger-guides&quot;&gt;9. Related Ranger Guides&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;ranger-fzf-bat-integration&#x2F;&quot;&gt;Ranger and fzf Integration&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: Search files at lightning speed&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;ranger-exiftool-integration&#x2F;&quot;&gt;Image Metadata Viewing with exiftool&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: View EXIF data before optimizing&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;ranger-compression-workflow&#x2F;&quot;&gt;File Compression Workflow&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: Archive your optimized assets&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;ranger-media-preview-configuration&#x2F;&quot;&gt;Advanced Media Preview Configuration&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: Better previews for WebP files&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>Turning on Samsung M51 without Power Button: The Heimdall Method</title>
          <pubDate>Tue, 09 Dec 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/samsung-m51-heimdall-start/</link>
          <guid>https://criticalbasics.xyz/posts/samsung-m51-heimdall-start/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/samsung-m51-heimdall-start/">&lt;p&gt;When the power button of a Samsung Galaxy smartphone breaks, the device often seems like a lost cause once the battery runs empty or it turns off. A frustrating detail: Without a working power button, the device often shows no charging animation when plugged in, but rather stays on a black screen—it appears “dead” even though the battery is charging.&lt;&#x2F;p&gt;
&lt;p&gt;This guide demonstrates a reliable workaround: We force the device into &lt;strong&gt;Download Mode&lt;&#x2F;strong&gt; using a button combination and use the open-source tool &lt;strong&gt;Heimdall&lt;&#x2F;strong&gt; on Linux to force a reboot.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            COMPATIBILITY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This guide was specifically verified with a &lt;strong&gt;Samsung Galaxy M51&lt;&#x2F;strong&gt;. However, the method works with almost all Samsung devices that have physical volume keys due to the underlying technology:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Galaxy S-Series&lt;&#x2F;strong&gt; (e.g., S7 to S21)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Galaxy A-Series&lt;&#x2F;strong&gt; (e.g., A51, A52, A21s)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Galaxy M-Series&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Galaxy Tab Tablets&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-12-09&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Update &amp;amp; Refinement:&lt;&#x2F;strong&gt; Updated to Heimdall 2.2.2, added troubleshooting section, and clarified distinction between Warning Screen and Download Mode.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-12-08&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created based on successful tests with a Samsung Galaxy M51.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, ensure you have access to a Linux PC. This guide specifically references Arch Linux, but the commands are easily transferable to Debian&#x2F;Ubuntu.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            IMPORTANT: ROOT &amp;amp; BATTERY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;ol&gt;
&lt;li&gt;&lt;strong&gt;No Root on Phone needed:&lt;&#x2F;strong&gt; Your smartphone does &lt;em&gt;not&lt;&#x2F;em&gt; need to be rooted. We only need &lt;code&gt;sudo&lt;&#x2F;code&gt; rights on the &lt;strong&gt;PC&lt;&#x2F;strong&gt; to access the USB interface.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Charge Battery:&lt;&#x2F;strong&gt; Ensure the device has been on the charger for at least 15 minutes, even if the display remained black.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Data Cable:&lt;&#x2F;strong&gt; Use a fully functional USB data cable, not a charge-only cable.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;2-forcing-download-mode&quot;&gt;2. Forcing Download Mode&lt;&#x2F;h2&gt;
&lt;p&gt;Since the power button is non-functional, we utilize a service button combination. This step is performed while the device is powered off.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Disconnect Cable:&lt;&#x2F;strong&gt; Ensure the USB cable is &lt;em&gt;not&lt;&#x2F;em&gt; connected to the smartphone (but is already plugged into the PC).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Hold Buttons:&lt;&#x2F;strong&gt; Press and hold both &lt;strong&gt;Volume Up (Vol+)&lt;&#x2F;strong&gt; and &lt;strong&gt;Volume Down (Vol-)&lt;&#x2F;strong&gt; simultaneously.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Connect:&lt;&#x2F;strong&gt; While holding both buttons, plug the USB cable into the smartphone.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The display should now light up and show a turquoise &lt;strong&gt;Warning Screen&lt;&#x2F;strong&gt; (&lt;code&gt;Warning! A custom OS can cause...&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;&#x2F;strong&gt; This is &lt;em&gt;not&lt;&#x2F;em&gt; Download Mode yet.&lt;&#x2F;p&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;&lt;strong&gt;Confirm:&lt;&#x2F;strong&gt; Now press the &lt;strong&gt;Vol Up&lt;&#x2F;strong&gt; key once. Only now does the device switch to the actual &lt;strong&gt;Download Mode&lt;&#x2F;strong&gt;. The screen will display a large “Downloading…”.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;3-heimdall-setup&quot;&gt;3. Heimdall Setup&lt;&#x2F;h2&gt;
&lt;p&gt;We use the tool &lt;code&gt;heimdall&lt;&#x2F;code&gt;, an open-source alternative to Samsung’s Odin.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-installation&quot;&gt;3.1. Installation&lt;&#x2F;h3&gt;
&lt;p&gt;On Arch Linux, install the package as follows (tested with version 2.2.2):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; heimdall&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;For Debian&#x2F;Ubuntu users, the command is usually &lt;code&gt;sudo apt install heimdall-flash&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-verify-connection&quot;&gt;3.2. Verify Connection&lt;&#x2F;h3&gt;
&lt;p&gt;Check if your PC recognizes the smartphone in Download Mode.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;heimdall&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; detect&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The expected output should be:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Device detected&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;(If an error occurs here, see Section 5 “Troubleshooting”.)&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;4-triggering-the-reboot&quot;&gt;4. Triggering the Reboot&lt;&#x2F;h2&gt;
&lt;p&gt;Now for the crucial step. We send a command to the smartphone that usually cleanly terminates a flashing session.&lt;&#x2F;p&gt;
&lt;p&gt;Run the following command in your terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; heimdall close-pc-screen&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;the-result&quot;&gt;The Result&lt;&#x2F;h3&gt;
&lt;p&gt;You should see a success message in the terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Attempting to close connect to pc screen...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Rebooting device...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Attempt complete&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The smartphone screen will immediately turn black and restart. Since we are no longer in the special maintenance mode, the Android system will boot up normally—without needing the power button.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;5-troubleshooting&quot;&gt;5. Troubleshooting&lt;&#x2F;h2&gt;
&lt;p&gt;If it doesn’t work right away, here are the common pitfalls:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Problem: &lt;code&gt;heimdall detect&lt;&#x2F;code&gt; shows “Failed to detect compatible device”&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Solution A (Cable):&lt;&#x2F;strong&gt; The most common issue is low-quality USB cables. Try a different one, ideally the original Samsung cable.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Solution B (Permissions):&lt;&#x2F;strong&gt; Missing &lt;code&gt;udev&lt;&#x2F;code&gt; rules might be the cause. Try running the command with admin privileges: &lt;code&gt;sudo heimdall detect&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Problem: &lt;code&gt;libusb error&lt;&#x2F;code&gt; or &lt;code&gt;Claiming interface failed&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Solution:&lt;&#x2F;strong&gt; Another process is blocking the USB port. Unplug the cable, wait 5 seconds, and plug it back in. Ensure no other software (like ModemManager) is trying to access the device.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Problem: Device reboots back into Download Mode&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Solution:&lt;&#x2F;strong&gt; In rare cases, one of the volume buttons might be stuck physically. Ensure the keys are not jammed.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;6-technical-background&quot;&gt;6. Technical Background&lt;&#x2F;h2&gt;
&lt;p&gt;Why does this work?&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hardware Design:&lt;&#x2F;strong&gt; Samsung devices have a hardware trigger (&lt;code&gt;Vol+&lt;&#x2F;code&gt; &amp;amp; &lt;code&gt;Vol-&lt;&#x2F;code&gt; + USB Insert) that activates &lt;em&gt;before&lt;&#x2F;em&gt; the main bootloader. This allows technicians to access the device even with corrupted software or broken physical buttons.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;The Protocol:&lt;&#x2F;strong&gt; The command &lt;code&gt;close-pc-screen&lt;&#x2F;code&gt; sends a specific &lt;strong&gt;End-of-Session command&lt;&#x2F;strong&gt; to the bootloader. The bootloader interprets this as “Maintenance successfully finished” and initiates a regular system reboot.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;git.sr.ht&amp;#x2F;~grimler&amp;#x2F;Heimdall&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;HEIMDALL SOURCE CODE&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;wiki.archlinux.org&amp;#x2F;title&amp;#x2F;Android_flashing#Heimdall&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;ARCH WIKI: HEIMDALL&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Deploying Mox Mail Server with Traefik and Docker Compose: A Lightweight Mailcow Alternative</title>
          <pubDate>Wed, 12 Nov 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/mox-e-mail-server/</link>
          <guid>https://criticalbasics.xyz/posts/mox-e-mail-server/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/mox-e-mail-server/">&lt;p&gt;This guide provides a straightforward method for deploying &lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.xmox.nl&#x2F;&quot;&gt;Mox&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;, a modern and resource-efficient mail server, and integrating it into an existing Traefik stack. Mox is an excellent all-in-one alternative to more complex solutions like &lt;strong&gt;&lt;a href=&quot;..&#x2F;mailcow-mailserver&#x2F;&quot;&gt;Mailcow&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;, as it bundles services like SMTP, IMAP, webmail, and spam filtering into a single, easy-to-manage application. By leveraging our &lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik and CrowdSec setup&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;, you can secure its web administration interface right from the start.&lt;&#x2F;p&gt;
&lt;p&gt;Mox aims to simplify self-hosted email, making it accessible for users who want to maintain control over their digital communications without the complexity of configuring multiple services.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-11-12&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created for integrating Mox with the Traefik v3 stack.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This tutorial assumes you have a fully operational Traefik v3 and CrowdSec environment. This setup is essential for routing, TLS, and security.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik stack running as described in the prerequisite guide.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our public-facing reverse proxy and security.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A domain name for your mail server.&lt;&#x2F;li&gt;
&lt;li&gt;The ability to add and modify DNS records (specifically &lt;code&gt;A&lt;&#x2F;code&gt; and &lt;code&gt;MX&lt;&#x2F;code&gt; records) for your domain.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access to your server.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;First, we’ll create a dedicated directory for the Mox configuration and data. This keeps your project isolated and organized.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-configuration&quot;&gt;3. Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;We will now create the necessary environment, Docker Compose, and Dockerfile.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-environment-file-env&quot;&gt;3.1. Environment File (&lt;code&gt;.env&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file will store variables specific to your setup.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;TZ=Europe&#x2F;Berlin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DOMAIN_NAME=your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;MOX_ADMIN_EMAIL=admin@your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Be sure to replace &lt;code&gt;your-domain.com&lt;&#x2F;code&gt; with your actual domain and adjust the timezone if necessary.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-dockerfile-build-from-source&quot;&gt;3.2. Dockerfile (Build from Source)&lt;&#x2F;h3&gt;
&lt;p&gt;To ensure we are running the latest, most secure version directly from the developer, we will build the Mox image ourselves instead of using a community-maintained image.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHY BUILD FROM SOURCE?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Building the image directly from the official GitHub repository guarantees you have the latest stable release with no third-party modifications.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Create the &lt;code&gt;Dockerfile&lt;&#x2F;code&gt; in your &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;mox&lt;&#x2F;code&gt; directory:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee Dockerfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Stage 1: Build the Go binary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;FROM golang:1.22-alpine AS builder&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;RUN apk add --no-cache git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;RUN git clone https:&#x2F;&#x2F;github.com&#x2F;mjl-&#x2F;mox.git &#x2F;src&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;WORKDIR &#x2F;src&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Build a smaller, optimized binary without debug symbols&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;RUN go build -trimpath -ldflags=&amp;quot;-s -w&amp;quot; .&#x2F;cmd&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Stage 2: Create the final, minimal image&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;FROM alpine:latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;RUN apk add --no-cache ca-certificates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;COPY --from=builder &#x2F;src&#x2F;mox&#x2F;mox &#x2F;usr&#x2F;local&#x2F;bin&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Create a dedicated, non-root user for the service&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;RUN adduser -D -h &#x2F;data mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;USER mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;WORKDIR &#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;VOLUME &#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EXPOSE 25 465 587 993 80&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;ENTRYPOINT [&amp;quot;mox&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-3-docker-compose-docker-compose-yml&quot;&gt;3.3. Docker Compose (&lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file defines the Mox service and tells Traefik how to route traffic to it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;version: &amp;quot;3.9&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  mox:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    build: .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - TZ=${TZ}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;data:&#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;quot;CMD&amp;quot;, &amp;quot;mox&amp;quot;, &amp;quot;version&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      interval: 60s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      timeout: 10s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      retries: 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mox.rule=Host(`mail.${DOMAIN_NAME}`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mox.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mox.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.mox.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.mox.loadbalancer.server.scheme=http&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mox.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Configuration Explained:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;build: .&lt;&#x2F;code&gt;: Tells Docker Compose to build an image from the local &lt;code&gt;Dockerfile&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Security:&lt;&#x2F;strong&gt; The container runs as a dedicated, non-privileged user (&lt;code&gt;mox&lt;&#x2F;code&gt;) for enhanced security.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;healthcheck:&lt;&#x2F;code&gt; Periodically checks if the Mox service is running correctly, providing a clear status in &lt;code&gt;docker ps&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;loadbalancer.server.port=80&lt;&#x2F;code&gt; &amp;amp; &lt;code&gt;scheme=http&lt;&#x2F;code&gt;: Traefik handles public HTTPS and communicates with Mox internally via standard HTTP, centralizing TLS management.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;middlewares=...crowdsec-bouncer@docker&lt;&#x2F;code&gt;: Secures the web UI with our CrowdSec bouncer.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;4-dns-configuration&quot;&gt;4. DNS Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;For your mail server to be reachable, you need to configure your domain’s DNS records.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A Record:&lt;&#x2F;strong&gt; Point the subdomain for Mox to your server’s IP address.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mail.your-domain.com.  A  &amp;lt;your_server_ip&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MX Record:&lt;&#x2F;strong&gt; After setup, set an MX record to direct email for your domain to the Mox server.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;your-domain.com.  MX  10 mail.your-domain.com.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            SPF, DKIM, AND DMARC RECORDS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;When you complete the Mox setup wizard, it will display the necessary DNS &lt;code&gt;TXT&lt;&#x2F;code&gt; records for SPF, DKIM, and DMARC. Adding these records to your domain is crucial for ensuring proper mail delivery and building a good sender reputation.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;5-launch-and-set-up-mox&quot;&gt;5. Launch and Set Up Mox&lt;&#x2F;h2&gt;
&lt;p&gt;With the configuration in place, you can now build and start the container.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Build and Start the Service:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From within the &#x2F;opt&#x2F;containers&#x2F;mox directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --build&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;--build&lt;&#x2F;code&gt; flag is important for the first launch and whenever you want to update Mox.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access the Admin Wizard:&lt;&#x2F;strong&gt;
Navigate to your Mox admin interface in a web browser:
&lt;strong&gt;&lt;code&gt;https:&#x2F;&#x2F;mail.your-domain.com&#x2F;admin&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;On your first visit, Mox presents an interactive setup wizard to guide you through the initial configuration.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;6-updating-mox&quot;&gt;6. Updating Mox&lt;&#x2F;h2&gt;
&lt;p&gt;Because we are building the image from the source code, updating is a simple process of rebuilding the image and restarting the container.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Pull the latest source code and rebuild the image&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose build&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --pull --no-cache&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Restart the container with the new image&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --force-recreate --remove-orphans&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The latest Mox version will be automatically pulled from GitHub during the build step.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;7-maintenance-and-backups&quot;&gt;7. Maintenance and Backups&lt;&#x2F;h2&gt;
&lt;p&gt;A key advantage of Mox is its simplicity in maintenance.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;built-in-backups&quot;&gt;Built-in Backups&lt;&#x2F;h3&gt;
&lt;p&gt;Mox includes a command to back up its entire configuration and mail data into a single file.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Execute this command to create a backup inside the container&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -it&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mox mox backup &#x2F;data&#x2F;backup.tgz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can then copy this file out of the container volume for off-site storage.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;volume-backup&quot;&gt;Volume Backup&lt;&#x2F;h3&gt;
&lt;p&gt;For a complete backup strategy, you should also regularly back up the entire &lt;code&gt;.&#x2F;data&lt;&#x2F;code&gt; volume using tools like &lt;code&gt;rsync&lt;&#x2F;code&gt; or &lt;code&gt;restic&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;8-resource-profile&quot;&gt;8. Resource Profile&lt;&#x2F;h2&gt;
&lt;p&gt;Mox is exceptionally efficient, making it a great choice for servers with limited resources.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;RAM:&lt;&#x2F;strong&gt; Typically idles around 200-300 MB and rarely exceeds 500 MB under load.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;CPU:&lt;&#x2F;strong&gt; CPU usage is minimal, usually under 1%.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Performance:&lt;&#x2F;strong&gt; On small VPS systems (1 vCPU &#x2F; 1 GB RAM), Mox remains highly responsive even under a light daily mail load (e.g., 100-200 messages per day).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You have successfully deployed Mox using a secure, best-practice approach. By building the image from the official source and leveraging Traefik for proper TLS termination, you have a modern, resource-efficient, and secure solution for self-hosting your own email. This setup gives you full control over your data with minimal maintenance overhead.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;Note: Mox is under active development by &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mjl-&quot;&gt;Marten van Leeuwen&lt;&#x2F;a&gt;. Check the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mjl-&#x2F;mox&#x2F;releases&quot;&gt;Mox Releases page&lt;&#x2F;a&gt; for the latest changelog before rebuilding your image.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.xmox.nl&amp;#x2F;docs&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;MOX DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;mjl-&amp;#x2F;mox&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;MOX GITHUB REPOSITORY&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Deploying Lemmy with Docker, Traefik, and Nginx</title>
          <pubDate>Thu, 30 Oct 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/lemmy/</link>
          <guid>https://criticalbasics.xyz/posts/lemmy/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/lemmy/">&lt;p&gt;This guide provides a comprehensive walkthrough for deploying a secure and scalable Lemmy instance. We will use the official deployment pattern, which includes an Nginx container as an internal reverse proxy to manage application-specific routing. This entire stack is placed behind our modern Traefik v3 reverse proxy, which handles TLS, security, and public-facing routing.&lt;&#x2F;p&gt;
&lt;p&gt;This “proxy-behind-a-proxy” architecture is highly recommended as it simplifies Traefik’s configuration and makes your Lemmy instance more robust and easier to update, closely following the official deployment standards.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-10-30&lt;&#x2F;td&gt;&lt;td&gt;Fixed mixed-content issues by enabling HTTPS settings and proper proxy headers in Lemmy behind Traefik.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-09-26&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created using the official Nginx internal proxy method for maximum compatibility and update safety, integrated with the Traefik v3 stack.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide builds upon a secure Docker environment. Before you begin, you must have a fully functional Traefik v3 and CrowdSec stack.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik stack running as described in the prerequisite guide.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik_v3_crowdsec_tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our public-facing reverse proxy and security.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A dedicated subdomain for your Lemmy instance (e.g., &lt;code&gt;lemmy.your-domain.com&lt;&#x2F;code&gt;) pointed to your server’s IP address.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;code&gt;openssl&lt;&#x2F;code&gt; utility for generating secrets (&lt;code&gt;sudo apt install openssl&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;First, create a dedicated directory for your Lemmy configuration and data. This structure will hold all necessary config files.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the main directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create directories for persistent data and configs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; volumes&#x2F;pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; volumes&#x2F;postgres&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -R&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 991:991 volumes&#x2F;pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-configuration&quot;&gt;3. Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;We will now create all the necessary configuration files for Nginx, PostgreSQL, Lemmy, and Docker Compose.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-generate-secrets&quot;&gt;3.1. Generate Secrets&lt;&#x2F;h3&gt;
&lt;p&gt;Let’s generate strong, unique secrets for the database, image service, and admin account.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Generate a strong password for the Postgres database&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;POSTGRES_PASSWORD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -hex 32&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your Postgres password is: &lt;&#x2F;span&gt;&lt;span&gt;$POSTGRES_PASSWORD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Generate a strong API key for Pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PICTRS_API_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -hex 32&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your Pictrs API key is: &lt;&#x2F;span&gt;&lt;span&gt;$PICTRS_API_KEY&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Generate a strong password for the Lemmy admin user&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LEMMY_ADMIN_PASSWORD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -hex 32&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your Lemmy Admin password is: &lt;&#x2F;span&gt;&lt;span&gt;$LEMMY_ADMIN_PASSWORD&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            SAVE THESE SECRETS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Copy these generated values into a temporary text file. You will need to paste them into the configuration files in the upcoming steps.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-2-nginx-configuration-config-nginx-conf&quot;&gt;3.2. Nginx Configuration (&lt;code&gt;config&#x2F;nginx.conf&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file contains the internal routing logic that directs traffic to either the Lemmy UI, the backend, or the image store based on the request path and headers.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee config&#x2F;nginx.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;worker_processes 1;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;events {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    worker_connections 1024;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;http {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    upstream lemmy { server &amp;quot;lemmy:8536&amp;quot;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    upstream lemmy-ui { server &amp;quot;lemmy-ui:1234&amp;quot;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    server {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        listen 1236;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        listen 8536;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        server_name lemmy.criticalbasics.xyz;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        server_tokens off;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        gzip on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        gzip_types text&#x2F;css application&#x2F;javascript image&#x2F;svg+xml;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        gzip_vary on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        client_max_body_size 20M;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        add_header X-Frame-Options SAMEORIGIN;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        add_header X-Content-Type-Options nosniff;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        add_header X-XSS-Protection &amp;quot;1; mode=block&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location &#x2F; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            set $proxpass &amp;quot;http:&#x2F;&#x2F;lemmy-ui&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            if ($http_accept = &amp;quot;application&#x2F;activity+json&amp;quot;) { set $proxpass &amp;quot;http:&#x2F;&#x2F;lemmy&amp;quot;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            if ($http_accept = &amp;quot;application&#x2F;ld+json; profile=\&amp;quot;https:&#x2F;&#x2F;www.w3.org&#x2F;ns&#x2F;activitystreams\&amp;quot;&amp;quot;) { set $proxpass &amp;quot;http:&#x2F;&#x2F;lemmy&amp;quot;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            if ($request_method = POST) { set $proxpass &amp;quot;http:&#x2F;&#x2F;lemmy&amp;quot;; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_pass $proxpass;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            rewrite ^(.+)&#x2F;+$ $1 permanent;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Real-IP $remote_addr;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header Host $host;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Forwarded-Ssl on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location ~ ^&#x2F;(api|pictrs|feeds|inbox|outbox|nodeinfo|version|socket\.io|federation|\.well-known) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_pass &amp;quot;http:&#x2F;&#x2F;lemmy&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_http_version 1.1;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header Upgrade $http_upgrade;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header Connection &amp;quot;upgrade&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Real-IP $remote_addr;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header Host $host;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_set_header X-Forwarded-Ssl on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            proxy_redirect off;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-3-postgresql-configuration&quot;&gt;3.3. PostgreSQL Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;For better performance, we’ll provide a custom configuration file for PostgreSQL.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;config-custom-conf-performance-tuning&quot;&gt;&lt;code&gt;config&#x2F;custom.conf&lt;&#x2F;code&gt; (Performance Tuning)&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee config&#x2F;custom.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Generated by https:&#x2F;&#x2F;pgtune.leopard.in.ua&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# DB Version: 16, OS: linux, RAM: 12 GB, CPUs: 16, Storage: ssd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_connections = 200&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;shared_buffers = 3GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;effective_cache_size = 9GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;maintenance_work_mem = 768MB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;checkpoint_completion_target = 0.9&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;wal_buffers = 16MB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;default_statistics_target = 100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;random_page_cost = 1.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;effective_io_concurrency = 200&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;work_mem = 3932kB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;min_wal_size = 1GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_wal_size = 8GB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_worker_processes = 16&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_parallel_workers_per_gather = 4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_parallel_workers = 16&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_parallel_maintenance_workers = 4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;config-pg-hba-conf-authentication-rules&quot;&gt;&lt;code&gt;config&#x2F;pg_hba.conf&lt;&#x2F;code&gt; (Authentication Rules)&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee config&#x2F;pg_hba.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# TYPE  DATABASE        USER            ADDRESS                 METHOD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;local   all             all                                     trust&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;host    all             all             0.0.0.0&#x2F;0               md5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;host    all             all             ::&#x2F;0                    md5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-4-lemmy-configuration-config-lemmy-hjson&quot;&gt;3.4. Lemmy Configuration (&lt;code&gt;config&#x2F;lemmy.hjson&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file controls the Lemmy application itself.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee config&#x2F;lemmy.hjson&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  database: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    user: &amp;quot;lemmy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    password: &amp;quot;PASTE-YOUR-POSTGRES-PASSWORD-HERE&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    host: &amp;quot;postgres&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    port: 5432&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    database: &amp;quot;lemmy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  pictrs: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    url: &amp;quot;http:&#x2F;&#x2F;pictrs:8080&#x2F;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    api_key: &amp;quot;PASTE-YOUR-PICTRS-API-KEY-HERE&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  email: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    smtp_server: &amp;quot;your-mail-server.com:587&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    smtp_login: &amp;quot;lemmy@your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    smtp_password: &amp;quot;PASTE-YOUR-EMAIL-PASSWORD-HERE&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    smtp_from_address: &amp;quot;Lemmy &amp;lt;lemmy@your-domain.com&amp;gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    tls_type: &amp;quot;starttls&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  setup: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    admin_username: &amp;quot;admin&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    admin_password: &amp;quot;PASTE-YOUR-LEMMY-ADMIN-PASSWORD-HERE&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    site_name: &amp;quot;My Lemmy Instance&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    admin_email: &amp;quot;your-admin@example.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  hostname: &amp;quot;lemmy.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  bind: &amp;quot;0.0.0.0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  port: 8536&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  tls_enabled: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-5-docker-compose-docker-compose-yml&quot;&gt;3.5. Docker Compose (&lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file ties all the services together. Notice that only the &lt;code&gt;lemmy-proxy&lt;&#x2F;code&gt; service has Traefik labels and is exposed to the external &lt;code&gt;proxy&lt;&#x2F;code&gt; network.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  lemmy-proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: nginx:stable-alpine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: lemmy-proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;config&#x2F;nginx.conf:&#x2F;etc&#x2F;nginx&#x2F;nginx.conf:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy-ui&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.lemmy.rule=Host(`lemmy.your-domain.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.lemmy.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.lemmy.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.lemmy.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.lemmy.loadbalancer.server.port=8536&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.docker.network=proxy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  lemmy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: dessalines&#x2F;lemmy:0.19.3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    hostname: lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - RUST_LOG=warn,lemmy_server=info&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;config&#x2F;lemmy.hjson:&#x2F;config&#x2F;config.hjson:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - postgres&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  lemmy-ui:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: dessalines&#x2F;lemmy-ui:0.19.3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: lemmy-ui&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    hostname: lemmy-ui&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - LEMMY_UI_LEMMY_EXTERNAL_HOST=lemmy.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - LEMMY_UI_HTTPS=true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  pictrs:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: asonix&#x2F;pictrs:0.5.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    hostname: pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - PICTRS__API_KEY=PASTE-YOUR-PICTRS-API-KEY-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - RUST_LOG=info&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    user: 991:991&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;volumes&#x2F;pictrs:&#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  postgres:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: postgres:16-alpine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    hostname: postgres&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: postgres&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - POSTGRES_USER=lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - POSTGRES_PASSWORD=PASTE-YOUR-POSTGRES-PASSWORD-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - POSTGRES_DB=lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;volumes&#x2F;postgres:&#x2F;var&#x2F;lib&#x2F;postgresql&#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;config&#x2F;custom.conf:&#x2F;etc&#x2F;postgresql&#x2F;postgresql.conf:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;config&#x2F;pg_hba.conf:&#x2F;var&#x2F;lib&#x2F;postgresql&#x2F;data&#x2F;pg_hba.conf:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - lemmy-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  lemmy-net:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    driver: bridge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-6-update-configuration-with-your-values&quot;&gt;3.6. Update Configuration with Your Values&lt;&#x2F;h3&gt;
&lt;p&gt;Carefully replace all placeholders in the files you just created.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Domain Name:&lt;&#x2F;strong&gt; In &lt;code&gt;config&#x2F;nginx.conf&lt;&#x2F;code&gt;, &lt;code&gt;config&#x2F;lemmy.hjson&lt;&#x2F;code&gt;, and &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;, replace all instances of &lt;code&gt;lemmy.your-domain.com&lt;&#x2F;code&gt; with your actual domain.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Secrets:&lt;&#x2F;strong&gt; In &lt;code&gt;config&#x2F;lemmy.hjson&lt;&#x2F;code&gt; and &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;, paste the secrets you generated in step 3.1. Ensure the Postgres password and Pictrs API key are identical where required.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Email Settings:&lt;&#x2F;strong&gt; In &lt;code&gt;config&#x2F;lemmy.hjson&lt;&#x2F;code&gt;, update the &lt;code&gt;email&lt;&#x2F;code&gt; section with your SMTP server details.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;4-launch-the-stack&quot;&gt;4. Launch the Stack&lt;&#x2F;h2&gt;
&lt;p&gt;With all configuration files in place, you can start your Lemmy instance.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From within the &#x2F;opt&#x2F;containers&#x2F;lemmy directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The first launch will take a few minutes as Docker downloads all the necessary images. You can monitor the progress with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Press &lt;code&gt;CTRL+C&lt;&#x2F;code&gt; to exit the logs view once the services are stable.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;5-verify-the-installation&quot;&gt;5. Verify the Installation&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check Running Containers:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --format&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;{{.Names}}&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You should see &lt;code&gt;lemmy-proxy&lt;&#x2F;code&gt;, &lt;code&gt;lemmy&lt;&#x2F;code&gt;, &lt;code&gt;lemmy-ui&lt;&#x2F;code&gt;, &lt;code&gt;pictrs&lt;&#x2F;code&gt;, and &lt;code&gt;postgres&lt;&#x2F;code&gt; running.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Access Your Site:&lt;&#x2F;strong&gt;
Open a web browser and navigate to &lt;code&gt;https:&#x2F;&#x2F;lemmy.your-domain.com&lt;&#x2F;code&gt;. You should see the Lemmy welcome page.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Log In as Admin:&lt;&#x2F;strong&gt;
Log in using the admin username (&lt;code&gt;admin&lt;&#x2F;code&gt;) and the strong password you generated for it. You can now begin administering your instance.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;6-maintenance&quot;&gt;6. Maintenance&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;updating-lemmy&quot;&gt;Updating Lemmy&lt;&#x2F;h3&gt;
&lt;p&gt;Updating is now safer. You typically only need to update the image tags in &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; for &lt;code&gt;lemmy&lt;&#x2F;code&gt;, &lt;code&gt;lemmy-ui&lt;&#x2F;code&gt;, and &lt;code&gt;pictrs&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;lemmy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Pull the new images defined in your compose file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Restart the stack with the new images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --remove-orphans&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            CHECK RELEASE NOTES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Always consult the official Lemmy release notes before updating for any special instructions or potential changes to configuration files like &lt;code&gt;nginx.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;backing-up&quot;&gt;Backing Up&lt;&#x2F;h3&gt;
&lt;p&gt;A complete backup consists of the database and the uploaded images.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From your &#x2F;opt&#x2F;containers&#x2F;lemmy directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Stop services to ensure data consistency&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose stop lemmy lemmy-ui lemmy-proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Back up the database&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; postgres pg_dump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; lemmy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; lemmy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; gzip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; lemmy_db_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.sql.gz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Back up the images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -czvf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pictrs_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.tar.gz volumes&#x2F;pictrs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 4. Restart services&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose start&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You have now deployed a production-ready Lemmy instance using a robust and maintainable architecture. By combining the power of Traefik for edge routing and security with the official Nginx proxy for internal application logic, your instance is scalable, secure, and easy to manage for years to come.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;join-lemmy.org&amp;#x2F;docs&amp;#x2F;en&amp;#x2F;administration&amp;#x2F;from_scratch.html&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL LEMMY DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;LemmyNet&amp;#x2F;lemmy-docker&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL DOCKER REPO&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Deploying Mastodon with Docker and a Modern Traefik Stack</title>
          <pubDate>Thu, 30 Oct 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/mastodon/</link>
          <guid>https://criticalbasics.xyz/posts/mastodon/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/mastodon/">&lt;p&gt;This guide provides a step-by-step walkthrough for deploying a production-ready Mastodon instance. We will use the official Mastodon Docker images and configure them to run securely behind our modern Traefik v3 reverse proxy, which handles TLS, security headers, and threat protection via CrowdSec.&lt;&#x2F;p&gt;
&lt;p&gt;This setup ensures a robust, scalable, and secure social media platform that you control.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-10-30&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created, adapting the official Mastodon Docker setup for a modern Traefik v3 and CrowdSec security stack.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide builds upon a secure and pre-existing Docker environment. Before you begin, you must have a fully functional Traefik v3 and CrowdSec stack.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik stack running as described in the prerequisite guide.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our public-facing reverse proxy and security.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A dedicated domain for your Mastodon instance (e.g., &lt;code&gt;mastodon.your-domain.com&lt;&#x2F;code&gt;) pointed to your server’s IP address.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;li&gt;A functional email (SMTP) server for sending transactional emails.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;First, create a dedicated directory for your Mastodon configuration and data. This structure will hold all necessary files and persistent data.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the main directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mastodon&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mastodon&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create directories for persistent data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; postgres redis public&#x2F;system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Mastodon runs as user 991. We need to set the correct permissions.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chown&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -R&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 991:991 public&#x2F;system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-configuration&quot;&gt;3. Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;Configuring Mastodon involves generating a configuration file using an interactive wizard and then creating our Docker Compose file to orchestrate the services.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-docker-compose-docker-compose-yml&quot;&gt;3.1. Docker Compose (&lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;First, create the &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; file. We create this file &lt;em&gt;before&lt;&#x2F;em&gt; running the setup wizard so that Docker knows which image to use.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  db:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: postgres:14-alpine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    shm_size: 256mb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - mastodon-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;#39;CMD&amp;#39;, &amp;#39;pg_isready&amp;#39;, &amp;#39;-U&amp;#39;, &amp;#39;postgres&amp;#39;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;postgres:&#x2F;var&#x2F;lib&#x2F;postgresql&#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;#39;POSTGRES_HOST_AUTH_METHOD=trust&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  redis:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: redis:7-alpine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - mastodon-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;#39;CMD&amp;#39;, &amp;#39;redis-cli&amp;#39;, &amp;#39;ping&amp;#39;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;redis:&#x2F;data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  web:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: ghcr.io&#x2F;mastodon&#x2F;mastodon:v4.4.8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: mastodon-web&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    env_file: .env.production&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command: bash -c &amp;quot;rm -f &#x2F;mastodon&#x2F;tmp&#x2F;pids&#x2F;server.pid; bundle exec rails s -p 3000&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - mastodon-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;#39;CMD-SHELL&amp;#39;, &amp;#39;wget -q --spider --proxy=off localhost:3000&#x2F;health || exit 1&amp;#39;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - db&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - redis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    user: 991:991&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;public&#x2F;system:&#x2F;mastodon&#x2F;public&#x2F;system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-web.rule=Host(`${MASTODON_HOST}`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-web.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-web.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-web.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.mastodon-web.loadbalancer.server.port=3000&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.docker.network=proxy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  streaming:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: ghcr.io&#x2F;mastodon&#x2F;mastodon:v4.4.8 # Note: Since v4.3.0, streaming is part of the main image&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: mastodon-streaming&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    env_file: .env.production&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command: node .&#x2F;streaming&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - mastodon-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;#39;CMD-SHELL&amp;#39;, &amp;#39;wget -q --spider --proxy=off localhost:4000&#x2F;api&#x2F;v1&#x2F;streaming&#x2F;health || exit 1&amp;#39;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - db&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - redis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-streaming.rule=Host(`${MASTODON_HOST}`) &amp;amp;&amp;amp; PathPrefix(`&#x2F;api&#x2F;v1&#x2F;streaming`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-streaming.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-streaming.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.mastodon-streaming.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.mastodon-streaming.loadbalancer.server.port=4000&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.docker.network=proxy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  sidekiq:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: ghcr.io&#x2F;mastodon&#x2F;mastodon:v4.4.8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: mastodon-sidekiq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    env_file: .env.production&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command: bundle exec sidekiq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - db&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - redis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - mastodon-net&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;public&#x2F;system:&#x2F;mastodon&#x2F;public&#x2F;system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;#39;CMD-SHELL&amp;#39;, &amp;quot;ps aux | grep &amp;#39;[s]idekiq&amp;#39; || false&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    user: 991:991&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  mastodon-net:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    driver: bridge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            A NOTE ON DATABASE SECURITY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;POSTGRES_HOST_AUTH_METHOD=trust&lt;&#x2F;code&gt; setting is convenient and generally safe within an isolated Docker network where no ports are exposed to the outside world. It allows other containers within the same &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; to connect without a password. For production environments with stricter security requirements, you should configure proper password-based authentication.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            TRAEFIK LABELS EXPLAINED
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;labels&lt;&#x2F;code&gt; section is crucial. It tells our Traefik proxy how to handle requests for Mastodon.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;tls.certresolver=tls_resolver&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: This uses the Let’s Encrypt resolver we defined in our main Traefik stack.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;middlewares=security-headers@file,crowdsec-bouncer@docker&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: This is the key integration. It applies our predefined security headers and protects the instance with the CrowdSec bouncer, blocking malicious IPs.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-2-environment-file-env&quot;&gt;3.2. Environment File (&lt;code&gt;.env&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;Create a simple &lt;code&gt;.env&lt;&#x2F;code&gt; file to store your domain name. The &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; will use this.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;MASTODON_HOST=mastodon.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            IMPORTANT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Replace &lt;code&gt;mastodon.your-domain.com&lt;&#x2F;code&gt; with your actual domain. This file is separate from the main Mastodon configuration (&lt;code&gt;.env.production&lt;&#x2F;code&gt;) that we will generate next.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-3-mastodon-setup-wizard&quot;&gt;3.3. Mastodon Setup Wizard&lt;&#x2F;h3&gt;
&lt;p&gt;Mastodon provides an interactive setup wizard to generate its main configuration file (&lt;code&gt;.env.production&lt;&#x2F;code&gt;). Let’s run it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# This command runs the setup task in a temporary container&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; web bundle exec rake mastodon:setup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The wizard will ask you a series of questions. Here are some recommendations:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Domain name&lt;&#x2F;strong&gt;: Enter the same domain you used in your &lt;code&gt;.env&lt;&#x2F;code&gt; file (e.g., &lt;code&gt;mastodon.your-domain.com&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Single user mode?&lt;&#x2F;strong&gt;: &lt;code&gt;n&lt;&#x2F;code&gt; (unless you want a private, single-person instance).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Are you using Docker?&lt;&#x2F;strong&gt;: &lt;code&gt;y&lt;&#x2F;code&gt;. This will correctly set the database and Redis hostnames.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Database host&lt;&#x2F;strong&gt;: It should default to &lt;code&gt;db&lt;&#x2F;code&gt;. Press Enter.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Redis host&lt;&#x2F;strong&gt;: It should default to &lt;code&gt;redis&lt;&#x2F;code&gt;. Press Enter.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;SMTP settings&lt;&#x2F;strong&gt;: Provide the details for your email server. Mastodon needs this to send confirmation emails.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Save configuration?&lt;&#x2F;strong&gt;: &lt;code&gt;y&lt;&#x2F;code&gt;. This will create the &lt;code&gt;.env.production&lt;&#x2F;code&gt; file.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;4-launch-the-stack&quot;&gt;4. Launch the Stack&lt;&#x2F;h2&gt;
&lt;p&gt;Now that all configuration is in place, you can start your Mastodon instance.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-1-initial-database-migration&quot;&gt;4.1. Initial Database Migration&lt;&#x2F;h3&gt;
&lt;p&gt;Before the first full launch, we need to prepare the database.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Run the database migration in a temporary container&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; web rails db:migrate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-2-start-all-services&quot;&gt;4.2. Start All Services&lt;&#x2F;h3&gt;
&lt;p&gt;With the database ready, bring the entire stack online.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The first launch will take a few minutes as Docker downloads the images. You can monitor the progress with &lt;code&gt;sudo docker compose logs -f&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;5-post-installation-steps&quot;&gt;5. Post-Installation Steps&lt;&#x2F;h2&gt;
&lt;p&gt;Your instance is running, but you need to create an admin account.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Use this command to create an admin user interactively&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; web tootctl accounts create YOUR_USERNAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  --email&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR_EMAIL@example.com&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --confirmed --role&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Admin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Replace &lt;code&gt;YOUR_USERNAME&lt;&#x2F;code&gt; and &lt;code&gt;YOUR_EMAIL@example.com&lt;&#x2F;code&gt; with your desired credentials. You will be prompted to set a password.&lt;&#x2F;p&gt;
&lt;p&gt;You can now navigate to &lt;code&gt;https:&#x2F;&#x2F;mastodon.your-domain.com&lt;&#x2F;code&gt; and log in with your new admin account.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;6-maintenance&quot;&gt;6. Maintenance&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;updating-mastodon&quot;&gt;Updating Mastodon&lt;&#x2F;h3&gt;
&lt;p&gt;Updating is a straightforward process. First, check the official Mastodon release notes for any special instructions.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mastodon&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Update the image tags in your docker-compose.yml to the new version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Pull the new images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose pull&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Stop the services before migrating the database&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose down&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Run database migrations required by the new version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; web rails db:migrate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Start the stack again&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --remove-orphans&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;backing-up&quot;&gt;Backing Up&lt;&#x2F;h3&gt;
&lt;p&gt;A complete backup consists of the database, user-uploaded files, and Redis data.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mastodon&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. Back up the database&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; db pg_dump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -U&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; postgres&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mastodon_production&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; gzip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mastodon_db_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.sql.gz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Back up user-uploaded files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -czvf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mastodon_files_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.tar.gz public&#x2F;system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Back up Redis data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -czvf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mastodon_redis_backup_&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +%F&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.tar.gz redis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You have successfully deployed a production-ready Mastodon instance. By leveraging Docker for containerization and integrating with a modern Traefik and CrowdSec stack, your instance is not only scalable and easy to manage but also benefits from robust, centralized security and TLS management.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.joinmastodon.org&amp;#x2F;admin&amp;#x2F;install&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL MASTODON DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;mastodon&amp;#x2F;mastodon&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL GITHUB REPO&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Deploying Mailcow with Docker and Traefik for a Full E-Mail Stack</title>
          <pubDate>Fri, 03 Oct 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/mailcow-mailserver/</link>
          <guid>https://criticalbasics.xyz/posts/mailcow-mailserver/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/mailcow-mailserver/">&lt;p&gt;Mailcow is a powerful and flexible open-source mail server suite that allows you to manage your email communications securely and efficiently. With Mailcow, you can create multiple email domains and accounts, manage users, and leverage features like spam filtering and encryption, giving you full control over your email infrastructure. This guide will show you how to set up Mailcow using Docker Compose behind an existing Traefik reverse proxy.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-10-03&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Major Revision:&lt;&#x2F;strong&gt; Corrected &lt;code&gt;certdumper&lt;&#x2F;code&gt; command, simplified Traefik labels, and fixed critical &lt;code&gt;mailcow.conf&lt;&#x2F;code&gt; networking settings to resolve 404 errors. Enhanced troubleshooting for network conflicts.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-09-18&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; First version of this guide was created.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide assumes you have a fully functional server environment with the following components already set up:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our reverse proxy, security, and certificate management.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Docker and Docker Compose&lt;&#x2F;strong&gt;: Must be installed on your server.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Required Tools&lt;&#x2F;strong&gt;: You will need &lt;code&gt;git&lt;&#x2F;code&gt; and &lt;code&gt;jq&lt;&#x2F;code&gt;. Install them with:&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;First, create a dedicated directory for your Mailcow installation.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            PATH CONSISTENCY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This guide uses &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;mailcow&#x2F;&lt;&#x2F;code&gt; as the primary directory for the Mailcow stack. The Traefik stack is assumed to be in &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&#x2F;&lt;&#x2F;code&gt;, consistent with our &lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 tutorial&lt;&#x2F;a&gt;. If your paths differ, be sure to adjust them in all configuration files and commands throughout this guide.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mailcow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-clone-the-mailcow-repository&quot;&gt;3. Clone the Mailcow Repository&lt;&#x2F;h2&gt;
&lt;p&gt;Clone the latest version of the Mailcow Dockerized project from GitHub into the directory you just created.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git clone https:&#x2F;&#x2F;github.com&#x2F;mailcow&#x2F;mailcow-dockerized &#x2F;opt&#x2F;containers&#x2F;mailcow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;4-generate-the-configuration-file&quot;&gt;4. Generate the Configuration File&lt;&#x2F;h2&gt;
&lt;p&gt;Navigate into the new directory and run the configuration generation script.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mailcow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;.&#x2F;generate_config.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You will be prompted for the following information:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mail server hostname (FQDN):&lt;&#x2F;strong&gt; Enter the fully qualified domain name for your mail server, for example, &lt;code&gt;mail.your-domain.com&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Timezone:&lt;&#x2F;strong&gt; Press Enter to accept the default or provide your own.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Available Branches:&lt;&#x2F;strong&gt; Press &lt;code&gt;1&lt;&#x2F;code&gt; to select the master branch.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;5-configure-for-traefik-integration&quot;&gt;5. Configure for Traefik Integration&lt;&#x2F;h2&gt;
&lt;p&gt;To make Mailcow work with our external Traefik instance, we need to create an override file and modify the main configuration.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-1-create-docker-compose-override-yml&quot;&gt;5.1. Create &lt;code&gt;docker-compose.override.yml&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;This file contains all our customizations, telling Mailcow to use the external &lt;code&gt;proxy&lt;&#x2F;code&gt; network and defining labels for Traefik to route traffic correctly. It also sets up a &lt;code&gt;certdumper&lt;&#x2F;code&gt; service, which is crucial for sharing Traefik’s Let’s Encrypt certificates with Mailcow’s services (Postfix and Dovecot).&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            HOW THE CERTDUMPER WORKS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;certdumper&lt;&#x2F;code&gt; is essential. It extracts certificates from Traefik’s &lt;code&gt;acme.json&lt;&#x2F;code&gt; and saves them as &lt;code&gt;.pem&lt;&#x2F;code&gt; files that Postfix and Dovecot can read. The command &lt;code&gt; --restart-containers mailcowdockerized-postfix-mailcow-1,...&lt;&#x2F;code&gt; is critical; it restarts the mail services by their full Docker container name after a certificate is updated, ensuring the new certificate is loaded immediately.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Create the file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee &#x2F;opt&#x2F;containers&#x2F;mailcow&#x2F;docker-compose.override.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    name: proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  certdumper:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: ghcr.io&#x2F;kereis&#x2F;traefik-certs-dumper:latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    network_mode: none&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # Correct command to restart containers by their full name. Mailcow&amp;#39;s project name is &amp;quot;mailcowdockerized&amp;quot;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command: --restart-containers mailcowdockerized-postfix-mailcow-1,mailcowdockerized-dovecot-mailcow-1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Adjust this path to match YOUR Traefik stack&amp;#39;s certificate location&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &#x2F;opt&#x2F;containers&#x2F;traefik-stack&#x2F;traefik&#x2F;certs:&#x2F;traefik:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &#x2F;var&#x2F;run&#x2F;docker.sock:&#x2F;var&#x2F;run&#x2F;docker.sock:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;data&#x2F;assets&#x2F;ssl:&#x2F;output:rw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    environment:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      DOMAIN: ${MAILCOW_HOSTNAME}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Adjust this to match YOUR Traefik acme file name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      ACME_FILE_PATH: &amp;quot;&#x2F;traefik&#x2F;acme.json&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    healthcheck:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      test: [&amp;quot;CMD&amp;quot;, &amp;quot;&#x2F;usr&#x2F;bin&#x2F;healthcheck&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      interval: 30s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      timeout: 10s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      retries: 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  nginx-mailcow:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # We use !reset to completely remove the default port bindings set by Mailcow.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ports: !reset&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.docker.network=proxy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # HTTPS Router (Secure)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # The HTTP to HTTPS redirect is handled globally by our Traefik setup, so we only need the secure router.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx-mailcow-secure.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx-mailcow-secure.rule=Host(`mail.your-domain.com`) || Host(`autodiscover.your-domain.com`) || Host(`autoconfig.your-domain.com`) || Host(`mta-sts.your-domain.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx-mailcow-secure.tls=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx-mailcow-secure.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx-mailcow-secure.service=nginx-mailcow&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx-mailcow-secure.middlewares=security-headers@file,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Service Definition: Point to Mailcow&amp;#39;s internal Nginx port.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # This must be 80, as we are NOT changing the internal ports in mailcow.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.nginx-mailcow.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            CROWDSEC BOUNCER SCOPE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;crowdsec-bouncer@docker&lt;&#x2F;code&gt; middleware only protects the HTTP&#x2F;HTTPS endpoints routed through Traefik (like the Mailcow UI and SOGo). It does &lt;strong&gt;not&lt;&#x2F;strong&gt; protect mail services like SMTP, IMAP, or POP3, as their traffic does not pass through the Traefik router. To harden these mail protocols, you need to configure CrowdSec to parse their log files (e.g., using the &lt;code&gt;crowdsecurity&#x2F;postfix&lt;&#x2F;code&gt; and &lt;code&gt;crowdsecurity&#x2F;dovecot&lt;&#x2F;code&gt; collections on the host).&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            IMPORTANT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;You must replace &lt;code&gt;your-domain.com&lt;&#x2F;code&gt; with your actual domain name. You can do this manually or with the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s&#x2F;your-domain.com&#x2F;your-actual-domain.com&#x2F;g&amp;quot; docker-compose.override.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;5-2-adjust-mailcow-conf&quot;&gt;5.2. Adjust &lt;code&gt;mailcow.conf&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;Next, edit the main configuration file. There are only &lt;strong&gt;two changes&lt;&#x2F;strong&gt; needed here.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nano &#x2F;opt&#x2F;containers&#x2F;mailcow&#x2F;mailcow.conf```&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;--&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;--&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Verwendung: infobox(&lt;&#x2F;span&gt;&lt;span&gt;type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;info&amp;quot;,&lt;&#x2F;span&gt;&lt;span&gt; title&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Titel&amp;quot;) mit Inhalt der Box&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;--&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Types: info, warning, tip, note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;table&lt;&#x2F;span&gt;&lt;span&gt; class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;retro-infobox&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; width&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;100%&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; cellspacing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;0&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; cellpadding&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;10&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; border&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;1&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; bgcolor=&amp;quot;#eeeeee&amp;quot; style=&amp;quot;color: #000000; font-weight: bold;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            ℹ️&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            CRITICAL:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; DO NOT CHANGE PORTS OR BINDINGS!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; bgcolor=&amp;quot;#000000&amp;quot; style=&amp;quot;color: #ffffff;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;Do&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;not&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;strong&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; change&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;HTTP_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;HTTPS_PORT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;HTTP_BIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;, or&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;HTTPS_BIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;. Leaving them at their default values is crucial. Changing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;HTTP_BIND&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;127.0.0.1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;code&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; will prevent Traefik from reaching the Mailcow web UI, resulting in a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;404 Not Found error&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;strong&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;. The internal ports do not conflict with Traefik because they are inside the Docker network, not on the host.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;table&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;1.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  **&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;Disable Mailcow&amp;#39;s Let&amp;#39;s Encrypt:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;**&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Traefik is responsible for all certificate management. This is the most important change.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ```&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Find this line:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SKIP_LETS_ENCRYPT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;n&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Change it to:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SKIP_LETS_ENCRYPT&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ```&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;2.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  **&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;Add SAN for Internal TLS:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;**&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; This helps internal services correctly recognize the hostname on the certificate provided by the `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;certdumper&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ```&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Find this line (it may be commented out):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # ADDITIONAL_SAN=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Change it to:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ADDITIONAL_SAN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;${MAILCOW_HOSTNAME}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ```&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Save&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; and close the file. No other changes are needed in this file.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;### 5.3. Activate MTA-STS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;MTA-STS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; (Mail Transfer Agent-Strict Transport Security) is a security standard that helps prevent man-in-the-middle attacks by ensuring emails are transmitted over secure TLS connections.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;--&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;--&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Verwendung: infobox(&lt;&#x2F;span&gt;&lt;span&gt;type&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;info&amp;quot;,&lt;&#x2F;span&gt;&lt;span&gt; title&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Titel&amp;quot;) mit Inhalt der Box&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;--&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Types: info, warning, tip, note&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;table&lt;&#x2F;span&gt;&lt;span&gt; class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;retro-infobox&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; width&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;100%&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; cellspacing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;0&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; cellpadding&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;10&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; border&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;1&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; bgcolor=&amp;quot;#ccffcc&amp;quot; style=&amp;quot;color: #000000; font-weight: bold;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            💡&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            EASIER&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ALTERNATIVE: USE THE MAILCOW UI&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; bgcolor=&amp;quot;#000000&amp;quot; style=&amp;quot;color: #ffffff;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;Instead of creating the policy file by hand, you can navigate to&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;System -&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; Configuration&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; -&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; MTA-STS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;strong&amp;gt; in the Mailcow UI after setup. The UI provides a generator that creates the correct policy and DNS records for you, which is less error-prone. The manual method below is still valid if you prefer it.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;td&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&#x2F;tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;table&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;If&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; you choose the manual route, create the required directory:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;```&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mailcow&#x2F;data&#x2F;web&#x2F;.well-known&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, create the policy file with a simple &lt;code&gt;enforce&lt;&#x2F;code&gt; policy. This file will be served by Mailcow’s web server.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee &#x2F;opt&#x2F;containers&#x2F;mailcow&#x2F;data&#x2F;web&#x2F;.well-known&#x2F;mta-sts.txt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;version: STSv1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;mode: enforce&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;max_age: 15552000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;mx: mail.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            IMPORTANT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;You must replace &lt;code&gt;your-domain.com&lt;&#x2F;code&gt; with your actual domain name in the file above. You can do this with the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s&#x2F;your-domain.com&#x2F;your-actual-domain.com&#x2F;g&amp;quot; &#x2F;opt&#x2F;containers&#x2F;mailcow&#x2F;data&#x2F;web&#x2F;.well-known&#x2F;mta-sts.txt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;6-launch-mailcow&quot;&gt;6. Launch Mailcow&lt;&#x2F;h2&gt;
&lt;p&gt;You can now start the Mailcow stack.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mailcow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            TROUBLESHOOTING TIPS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pool Overlaps&lt;&#x2F;strong&gt;: If you see an error like &lt;code&gt;Pool overlaps with other one on this address space&lt;&#x2F;code&gt;, another Docker network is using Mailcow’s default IP range. You can fix this permanently by editing &lt;code&gt;mailcow.conf&lt;&#x2F;code&gt; and setting &lt;code&gt;IPV4_NETWORK&lt;&#x2F;code&gt; to an unused subnet prefix (e.g., &lt;code&gt;IPV4_NETWORK=172.25.1&lt;&#x2F;code&gt;). Mailcow will correctly append &lt;code&gt;.0&#x2F;24&lt;&#x2F;code&gt; to create the network.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;RAM Usage&lt;&#x2F;strong&gt;: On a VPS with limited memory, you can disable resource-intensive services by setting &lt;code&gt;SKIP_FTS=y&lt;&#x2F;code&gt; (disables full-text search in Solr) or &lt;code&gt;SKIP_CLAMD=y&lt;&#x2F;code&gt; (disables the ClamAV antivirus engine) in &lt;code&gt;mailcow.conf&lt;&#x2F;code&gt;. This reduces security and functionality, so use it with caution.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;IPv6 Issues&lt;&#x2F;strong&gt;: Some Mailcow versions had startup issues when &lt;code&gt;ENABLE_IPV6=y&lt;&#x2F;code&gt; was set. If you face problems, check the official Mailcow blog for release notes and patches.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;7-dns-configuration&quot;&gt;7. DNS Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;Correct DNS setup is critical for a mail server to function.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;7-1-reverse-dns-ptr-record&quot;&gt;7.1. Reverse DNS (PTR Record)&lt;&#x2F;h3&gt;
&lt;p&gt;Your server’s Reverse DNS (PTR) record for both IPv4 and IPv6 must match the hostname you configured in &lt;code&gt;mailcow.conf&lt;&#x2F;code&gt; (&lt;code&gt;mail.your-domain.com&lt;&#x2F;code&gt;). This is usually set in your server provider’s control panel and is essential for not being marked as spam, especially by major providers like Gmail.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;7-2-dns-records&quot;&gt;7.2. DNS Records&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            USING CLOUDFLARE?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;If you are using Cloudflare for your DNS, all mail-related records (including &lt;code&gt;mail&lt;&#x2F;code&gt;, &lt;code&gt;imap&lt;&#x2F;code&gt;, &lt;code&gt;smtp&lt;&#x2F;code&gt;, &lt;code&gt;autodiscover&lt;&#x2F;code&gt;, &lt;code&gt;autoconfig&lt;&#x2F;code&gt;, and &lt;code&gt;mta-sts&lt;&#x2F;code&gt;) &lt;strong&gt;must&lt;&#x2F;strong&gt; be set to “DNS only” (grey cloud). Cloudflare’s proxy (orange cloud) only supports web protocols like HTTP&#x2F;HTTPS and will break mail services. For more details, see the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;developers.cloudflare.com&#x2F;dns&#x2F;manage-dns-records&#x2F;proxied-dns-records&#x2F;#supported-ports&quot;&gt;official Cloudflare documentation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;In your domain’s DNS management panel, add the following records. We start with a non-restrictive DMARC policy (&lt;code&gt;p=none&lt;&#x2F;code&gt;) to prevent legitimate emails from being rejected during the initial setup.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            GMAIL &amp;amp; YAHOO SENDER REQUIREMENTS (2024)
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;As of 2024, major providers like Gmail and Yahoo enforce stricter sender policies:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;All Senders&lt;&#x2F;strong&gt;: Must have either SPF or DKIM configured.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Bulk Senders&lt;&#x2F;strong&gt; (5,000+ emails&#x2F;day): Must have SPF, DKIM, &lt;strong&gt;and&lt;&#x2F;strong&gt; a DMARC policy. They also require one-click unsubscribe links and must maintain a low spam complaint rate.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Failing to meet these requirements will result in your emails being rejected. For more details, see the official announcements from &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;blog.google&#x2F;products&#x2F;gmail&#x2F;gmail-security-authentication-spam-protection&#x2F;&quot;&gt;Google&lt;&#x2F;a&gt; and &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;blog.postmaster.yahooinc.com&#x2F;post&#x2F;730172167494483968&#x2F;more-secure-less-spam&quot;&gt;Yahoo&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            DMARC STAGED ROLLOUT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Starting with &lt;code&gt;p=none&lt;&#x2F;code&gt; is the safest approach. This allows you to monitor email traffic via the reports sent to your &lt;code&gt;rua&lt;&#x2F;code&gt; address without affecting mail delivery.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Monitor&lt;&#x2F;strong&gt;: Keep &lt;code&gt;p=none&lt;&#x2F;code&gt; for a few weeks and analyze the reports to ensure all legitimate sending sources are correctly authenticated with SPF and DKIM.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Quarantine&lt;&#x2F;strong&gt;: Once you are confident, switch to &lt;code&gt;p=quarantine&lt;&#x2F;code&gt;. This tells receiving servers to treat failing emails with suspicion (e.g., by sending them to the spam folder).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Reject&lt;&#x2F;strong&gt;: After another monitoring period, you can move to the final policy, &lt;code&gt;p=reject&lt;&#x2F;code&gt;, which instructs receivers to block emails that fail DMARC checks.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Name&lt;&#x2F;th&gt;&lt;th&gt;Type&lt;&#x2F;th&gt;&lt;th&gt;Value&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;mail&lt;&#x2F;td&gt;&lt;td&gt;A&lt;&#x2F;td&gt;&lt;td&gt;your-server-ip&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;mail&lt;&#x2F;td&gt;&lt;td&gt;AAAA&lt;&#x2F;td&gt;&lt;td&gt;your-server-ipv6&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;autodiscover&lt;&#x2F;td&gt;&lt;td&gt;CNAME&lt;&#x2F;td&gt;&lt;td&gt;mail.your-domain.com.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;autoconfig&lt;&#x2F;td&gt;&lt;td&gt;CNAME&lt;&#x2F;td&gt;&lt;td&gt;mail.your-domain.com.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;imap&lt;&#x2F;td&gt;&lt;td&gt;CNAME&lt;&#x2F;td&gt;&lt;td&gt;mail.your-domain.com.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;pop3&lt;&#x2F;td&gt;&lt;td&gt;CNAME&lt;&#x2F;td&gt;&lt;td&gt;mail.your-domain.com.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;smtp&lt;&#x2F;td&gt;&lt;td&gt;CNAME&lt;&#x2F;td&gt;&lt;td&gt;mail.your-domain.com.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;@&lt;&#x2F;td&gt;&lt;td&gt;MX 10&lt;&#x2F;td&gt;&lt;td&gt;mail.your-domain.com.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;SPF&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;@&lt;&#x2F;td&gt;&lt;td&gt;TXT&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;v=spf1 mx a -all&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            SPF FINE-TUNING
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;v=spf1 mx a -all&lt;&#x2F;code&gt; record is a safe default. The &lt;code&gt;a&lt;&#x2F;code&gt; part authorizes the server’s main IP address (from the &lt;code&gt;A&lt;&#x2F;code&gt; record) to send mail. If you only send mail from Mailcow, you can make this slightly stricter by using &lt;code&gt;v=spf1 mx -all&lt;&#x2F;code&gt;, which only authorizes servers listed in your &lt;code&gt;MX&lt;&#x2F;code&gt; records.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;

| &lt;strong&gt;DMARC&lt;&#x2F;strong&gt;            |       |                                              |
| _dmarc               | TXT   | &lt;code&gt;v=DMARC1; p=none; rua=mailto:admin@your-domain.com&lt;&#x2F;code&gt; |
| &lt;strong&gt;MTA-STS&lt;&#x2F;strong&gt;          |       |                                              |
| mta-sts              | A     | your-server-ip                               |
| mta-sts              | AAAA  | your-server-ipv6                             |
| _mta-sts             | TXT   | &lt;code&gt;v=STSv1; id=2025091801&lt;&#x2F;code&gt;                      |
| _smtp._tls           | TXT   | &lt;code&gt;v=TLSRPTv1; rua=mailto:admin@your-domain.com&lt;&#x2F;code&gt; |
| &lt;strong&gt;Service Records&lt;&#x2F;strong&gt;  |       |                                              |
| _autodiscover._tcp   | SRV   | &lt;code&gt;0 1 443 mail.your-domain.com.&lt;&#x2F;code&gt;              |
| _caldavs._tcp        | SRV   | &lt;code&gt;0 1 443 mail.your-domain.com.&lt;&#x2F;code&gt;              |
| _caldavs._tcp        | TXT   | &lt;code&gt;&quot;path=&#x2F;SOGo&#x2F;dav&#x2F;&quot;&lt;&#x2F;code&gt;                        |
| _carddavs._tcp       | SRV   | &lt;code&gt;0 1 443 mail.your-domain.com.&lt;&#x2F;code&gt;              |
| _carddavs._tcp       | TXT   | &lt;code&gt;&quot;path=&#x2F;SOGo&#x2F;dav&#x2F;&quot;&lt;&#x2F;code&gt;                        |
| _imaps._tcp          | SRV   | &lt;code&gt;0 1 993 mail.your-domain.com.&lt;&#x2F;code&gt;              |
| _pop3s._tcp          | SRV   | &lt;code&gt;0 1 995 mail.your-domain.com.&lt;&#x2F;code&gt;              |
| _submission._tcp     | SRV   | &lt;code&gt;0 1 587 mail.your-domain.com.&lt;&#x2F;code&gt;              |
| _smtps._tcp          | SRV   | &lt;code&gt;0 1 465 mail.your-domain.com.&lt;&#x2F;code&gt;              |&lt;&#x2F;p&gt;
&lt;p&gt;A DKIM record will be added later after it’s generated by Mailcow.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            UNUSED SRV RECORDS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This guide only lists SRV records for encrypted services (IMAPS, POP3S, etc.). If you decide not to offer certain services (e.g., POP3), you should also omit their corresponding SRV records to prevent clients from attempting to connect to them.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            DNS RECORD NOTES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A vs. CNAME for &lt;code&gt;mta-sts&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: We use &lt;code&gt;A&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;AAAA&lt;&#x2F;code&gt; records for &lt;code&gt;mta-sts&lt;&#x2F;code&gt; pointing directly to the server’s IP. While a &lt;code&gt;CNAME&lt;&#x2F;code&gt; pointing to &lt;code&gt;mail.your-domain.com&lt;&#x2F;code&gt; is also valid, using &lt;code&gt;A&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;AAAA&lt;&#x2F;code&gt; records avoids potential edge cases with some DNS resolvers.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Trailing Dots&lt;&#x2F;strong&gt;: Note the trailing dot (&lt;code&gt;.&lt;&#x2F;code&gt;) at the end of hostnames in &lt;code&gt;MX&lt;&#x2F;code&gt; and &lt;code&gt;SRV&lt;&#x2F;code&gt; records (e.g., &lt;code&gt;mail.your-domain.com.&lt;&#x2F;code&gt;). This signifies that the name is fully qualified. Some DNS providers add this automatically, while others require you to add it manually.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;8-firewall-configuration&quot;&gt;8. Firewall Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;Your firewall must allow traffic on several ports for email services to be reachable.&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Port&lt;&#x2F;th&gt;&lt;th&gt;Service&lt;&#x2F;th&gt;&lt;th&gt;Protocol&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;25&lt;&#x2F;td&gt;&lt;td&gt;SMTP&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;587&lt;&#x2F;td&gt;&lt;td&gt;Submission&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;465&lt;&#x2F;td&gt;&lt;td&gt;SMTPS&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;143&lt;&#x2F;td&gt;&lt;td&gt;IMAP&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;993&lt;&#x2F;td&gt;&lt;td&gt;IMAPS&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;110&lt;&#x2F;td&gt;&lt;td&gt;POP3&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;995&lt;&#x2F;td&gt;&lt;td&gt;POP3S&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;4190&lt;&#x2F;td&gt;&lt;td&gt;ManageSieve&lt;&#x2F;td&gt;&lt;td&gt;TCP&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            PROTOCOL HYGIENE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;For better security, consider disabling protocols you don’t need. For example, if all your clients use IMAP, you can keep the POP3 ports (110, 995) closed. It is also best practice to enforce encrypted connections, favoring Submission (587) and IMAPS (993) over their unencrypted counterparts.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            RESERVED INTERNAL PORTS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Mailcow uses several ports internally (e.g., 8081, 9081, 65510). Avoid using these for your own services on the Docker host to prevent conflicts.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Use &lt;code&gt;ufw&lt;&#x2F;code&gt; to open these ports:&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            DOCKER BYPASSES UFW RULES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;By default, Docker manipulates &lt;code&gt;iptables&lt;&#x2F;code&gt; directly and &lt;strong&gt;bypasses UFW rules&lt;&#x2F;strong&gt;, meaning your container ports might be exposed even if &lt;code&gt;ufw&lt;&#x2F;code&gt; is configured to block them. There are two effective ways to mitigate this:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Bind Services to Localhost (Recommended)&lt;&#x2F;strong&gt;: As we did in &lt;code&gt;mailcow.conf&lt;&#x2F;code&gt; with &lt;code&gt;HTTP_BIND&lt;&#x2F;code&gt;, binding services to &lt;code&gt;127.0.0.1&lt;&#x2F;code&gt; ensures they are never exposed externally by Docker. This is the most secure approach.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Modify UFW’s Configuration&lt;&#x2F;strong&gt;: For services that must be exposed, you can edit &lt;code&gt;&#x2F;etc&#x2F;ufw&#x2F;after.rules&lt;&#x2F;code&gt; to correctly manage traffic from Docker’s network. This is more complex but necessary for direct external access. For more details, see the official &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.docker.com&#x2F;network&#x2F;packet-filtering-firewalls&#x2F;&quot;&gt;Docker documentation on packet filtering&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 25&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 587&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 465&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 143&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 993&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 110&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 995&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 4190&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw status&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;9-initial-mailcow-setup&quot;&gt;9. Initial Mailcow Setup&lt;&#x2F;h2&gt;
&lt;p&gt;Navigate to your Mailcow UI at &lt;code&gt;https:&#x2F;&#x2F;mail.your-domain.com&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Default Username:&lt;&#x2F;strong&gt; &lt;code&gt;admin&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Default Password:&lt;&#x2F;strong&gt; &lt;code&gt;moohoo&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;First, change the administrator password under &lt;strong&gt;System -&amp;gt; Configuration -&amp;gt; Edit&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;9-1-add-your-domain&quot;&gt;9.1. Add Your Domain&lt;&#x2F;h3&gt;
&lt;p&gt;Go to &lt;strong&gt;Email -&amp;gt; Configuration&lt;&#x2F;strong&gt; and click &lt;strong&gt;“Add domain”&lt;&#x2F;strong&gt;. Enter your main domain (e.g., &lt;code&gt;your-domain.com&lt;&#x2F;code&gt;, not &lt;code&gt;mail.your-domain.com&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;9-2-generate-dkim-key&quot;&gt;9.2. Generate DKIM Key&lt;&#x2F;h3&gt;
&lt;p&gt;A DKIM key is essential for email authentication.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to &lt;strong&gt;System -&amp;gt; Configuration&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the &lt;strong&gt;Options -&amp;gt; ARC&#x2F;DKIM keys&lt;&#x2F;strong&gt; tab.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;A 2048-bit key should already be generated for your domain. Copy the public key text from the text box.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Go back to your DNS provider and add a new TXT record:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name:&lt;&#x2F;strong&gt; &lt;code&gt;dkim._domainkey&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Value:&lt;&#x2F;strong&gt; Paste the entire copied key, including the &lt;code&gt;v=DKIM1;k=rsa;p=...&lt;&#x2F;code&gt; part.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            LONG DKIM RECORDS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Some DNS providers have a 255-character limit for a single TXT record string. If your 2048-bit DKIM key is longer, you may need to split it into multiple quoted strings. Many providers handle this automatically, but if you encounter issues, check your provider’s documentation on how to format long TXT records.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;10-testing-and-verification&quot;&gt;10. Testing and Verification&lt;&#x2F;h2&gt;
&lt;p&gt;After waiting for DNS propagation, thoroughly test your setup.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;10-1-internal-dns-and-certificate-check&quot;&gt;10.1. Internal DNS and Certificate Check&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mailcow DNS Check&lt;&#x2F;strong&gt;: In the Mailcow UI, go to &lt;strong&gt;Email -&amp;gt; Configuration -&amp;gt; DNS&lt;&#x2F;strong&gt; next to your domain for an internal check of your records.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Verify Certificates&lt;&#x2F;strong&gt;: Ensure that the certificates from Traefik have been correctly passed to Mailcow’s services. Run these commands, replacing &lt;code&gt;mail.your-domain.com&lt;&#x2F;code&gt; with your mail server’s FQDN:&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check SMTP certificate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Q&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; s_client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -starttls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; smtp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -crlf -connect&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mail.your-domain.com:587&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check IMAP certificate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Q&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; s_client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -starttls&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; imap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -crlf -connect&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mail.your-domain.com:143&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;In the output, look for a certificate chain issued by a trusted authority. For Let’s Encrypt, the chain typically starts with &lt;code&gt;ISRG Root X1&lt;&#x2F;code&gt;. The key is to confirm it is &lt;strong&gt;not&lt;&#x2F;strong&gt; a self-signed certificate. If you see a self-signed certificate (where the issuer matches the subject), it indicates a problem with the &lt;code&gt;certdumper&lt;&#x2F;code&gt; service or its path mappings. In that case, check the certdumper logs:&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;mailcow&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose logs certdumper&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;10-2-external-testing-tools&quot;&gt;10.2. External Testing Tools&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;mail-tester.com&lt;&#x2F;strong&gt;: Send an email to the address provided on their site to get a score out of 10.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;mxtoolbox.com&lt;&#x2F;strong&gt;: Provides various checks for your mail server.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;checktls.com&#x2F;TestReceiver&lt;&#x2F;strong&gt;: Use this to specifically verify your MTA-STS configuration.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;11-create-mailboxes-and-log-in&quot;&gt;11. Create Mailboxes and Log In&lt;&#x2F;h2&gt;
&lt;p&gt;Under &lt;strong&gt;Email -&amp;gt; Mailboxes&lt;&#x2F;strong&gt;, you can add new users. Once a user is created, the primary way to access the webmail interface (SOGo) is by clicking &lt;strong&gt;Apps -&amp;gt; Webmail&lt;&#x2F;strong&gt; from within the Mailcow UI. While you can also try going directly to &lt;code&gt;https:&#x2F;&#x2F;mail.your-domain.com&#x2F;SOGo&#x2F;&lt;&#x2F;code&gt;, be aware that recent Mailcow versions may redirect unauthenticated access back to the main login page.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;12-conclusion&quot;&gt;12. Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You have now successfully deployed a full-featured Mailcow e-mail server. By leveraging Docker for containerization and Traefik for reverse proxying and certificate management, you have a secure, robust, and maintainable mail solution. This setup provides you with complete control over your email, enhanced security through features like MTA-STS, and the flexibility to manage multiple domains and users with ease.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;13-further-reading&quot;&gt;13. Further Reading&lt;&#x2F;h2&gt;
&lt;p&gt;For more detailed information, refer to the official Mailcow documentation:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reverse Proxy Overview:&lt;&#x2F;strong&gt; &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.mailcow.email&#x2F;post_installation&#x2F;reverse-proxy&#x2F;r_p&#x2F;&quot;&gt;docs.mailcow.email&#x2F;post_installation&#x2F;reverse-proxy&#x2F;r_p&#x2F;&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;IP Bindings:&lt;&#x2F;strong&gt; &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.mailcow.email&#x2F;&quot;&gt;docs.mailcow.email&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;MTA-STS Setup:&lt;&#x2F;strong&gt; &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.mailcow.email&#x2F;&quot;&gt;docs.mailcow.email&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.mail-tester.com&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🛡️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;TEST YOUR EMAIL SCORE&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
</description>
      </item>
      <item>
          <title>Deploying the Nextcloud Talk High-Performance Backend with Docker</title>
          <pubDate>Sun, 21 Sep 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/nextcloud-talk-high-performance-backend/</link>
          <guid>https://criticalbasics.xyz/posts/nextcloud-talk-high-performance-backend/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/nextcloud-talk-high-performance-backend/">&lt;p&gt;This guide will walk you through deploying the official Nextcloud Talk High-Performance Backend (HPBE). This backend, which includes a signaling server (Spreed), a STUN&#x2F;TURN server (Coturn), and a WebRTC MCU (Janus), significantly improves the performance and reliability of video calls, especially for multiple participants.&lt;&#x2F;p&gt;
&lt;p&gt;This setup is designed to integrate seamlessly with an existing Traefik v3 reverse proxy, making it a powerful addition to your self-hosted infrastructure.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-09-21&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Guide created, focusing on Docker Compose deployment and Traefik v3 integration.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide is part of a series and builds upon a secure Docker environment. Before you begin, you must have a fully functional Traefik v3 and CrowdSec stack.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            HARD REQUIREMENT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The following steps will not work correctly without the Traefik stack running as described in the prerequisite guide.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our reverse proxy and security.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Docker and Docker Compose installed on your server.&lt;&#x2F;li&gt;
&lt;li&gt;A dedicated subdomain for the signaling server (e.g., &lt;code&gt;signaling.your-domain.com&lt;&#x2F;code&gt;) pointed to your server’s IP address.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;li&gt;The &lt;code&gt;git&lt;&#x2F;code&gt; utility installed (&lt;code&gt;sudo apt install git&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;Firewall ports &lt;code&gt;80&lt;&#x2F;code&gt;, &lt;code&gt;443&lt;&#x2F;code&gt;, &lt;code&gt;3478&#x2F;tcp&lt;&#x2F;code&gt;, &lt;code&gt;3478&#x2F;udp&lt;&#x2F;code&gt; open. The ports &lt;code&gt;3478&lt;&#x2F;code&gt; are required by the Coturn (TURN) server.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;1-1-firewall-configuration-ufw-example&quot;&gt;1.1. Firewall Configuration (UFW Example)&lt;&#x2F;h3&gt;
&lt;p&gt;If you are using &lt;code&gt;ufw&lt;&#x2F;code&gt; (Uncomplicated Firewall), you can open the required ports with the following commands:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 3478&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 3478&#x2F;udp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Example with media range 20000–20100 (choose any suitable range)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 20000:20100&#x2F;udp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;   # match your Janus media range&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Only if you enable TURNS (section 3.4):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 5349&#x2F;tcp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;         # required for TURNS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# sudo ufw allow 5349&#x2F;udp       # optional; enable only if you need UDP on 5349&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note: Choose a media port range that is allowed by your provider&#x2F;network. The exact same range must be configured in both &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; (Janus service &lt;code&gt;ports&lt;&#x2F;code&gt;) and &lt;code&gt;janus&#x2F;janus.jcfg&lt;&#x2F;code&gt; (media min&#x2F;max).&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            SECURITY NOTE &amp;amp; CROWDSEC INTEGRATION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The TURN ports (&lt;code&gt;3478&lt;&#x2F;code&gt;) are exposed directly and are not protected by the Traefik CrowdSec Bouncer. Securing them should be done at the host level.&lt;&#x2F;p&gt;
&lt;p&gt;For advanced protection against abuse (e.g., brute-force attacks on the TURN server), you can feed Coturn’s logs into CrowdSec. This is achieved by configuring Docker’s logging driver for the &lt;code&gt;coturn&lt;&#x2F;code&gt; service and telling CrowdSec where to find these logs.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure CrowdSec to read Docker logs:&lt;&#x2F;strong&gt;
Open the acquisition file from the prerequisite guide and append the following YAML document. This tells CrowdSec to read the logs for the container named &lt;code&gt;coturn&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;File to edit: &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&#x2F;crowdsec&#x2F;config&#x2F;acquis.yaml&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;source&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;container_name_regexp&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ^coturn$&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;labels&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;  type&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; coturn&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Restart CrowdSec:&lt;&#x2F;strong&gt;
For the new acquisition configuration to take effect, restart the CrowdSec container in your Traefik stack.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Navigate to your Traefik stack directory and restart only CrowdSec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;traefik-stack&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose restart crowdsec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;CrowdSec will now automatically parse the logs for the &lt;code&gt;coturn&lt;&#x2F;code&gt; container. The &lt;code&gt;coturn&lt;&#x2F;code&gt; service in &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; should also be configured with a logging driver to enable log rotation.&lt;&#x2F;p&gt;
&lt;p&gt;If you use the CrowdSec Firewall Bouncer (iptables&#x2F;nftables), ensure the Janus media UDP range (e.g., &lt;code&gt;20000–20100&#x2F;udp&lt;&#x2F;code&gt;), Coturn relay range (&lt;code&gt;30000–30100&#x2F;udp&lt;&#x2F;code&gt;), and TURN ports (&lt;code&gt;3478&#x2F;tcp&lt;&#x2F;code&gt;, &lt;code&gt;3478&#x2F;udp&lt;&#x2F;code&gt; and, if enabled, &lt;code&gt;5349&#x2F;tcp&lt;&#x2F;code&gt; [required], &lt;code&gt;5349&#x2F;udp&lt;&#x2F;code&gt; [optional]) are explicitly allowed and not blocked by bouncer rules.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;1-2-resource-planning&quot;&gt;1.2. Resource Planning&lt;&#x2F;h3&gt;
&lt;p&gt;The High-Performance Backend, especially the Janus MCU, can be resource-intensive during video calls. For a small group of users (e.g., 3-5 concurrent participants in a call), plan for at least &lt;strong&gt;1-2 dedicated CPU cores and 2-4 GB of RAM&lt;&#x2F;strong&gt; for the HPBE stack. For larger deployments, monitor your resource usage and scale accordingly. To keep an eye on performance, regularly check resource usage with tools like &lt;code&gt;htop&lt;&#x2F;code&gt;, &lt;code&gt;docker stats&lt;&#x2F;code&gt;, or a more comprehensive monitoring stack like Prometheus and Grafana.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;2-directory-structure-and-download&quot;&gt;2. Directory Structure and Download&lt;&#x2F;h2&gt;
&lt;p&gt;First, we will clone the official repository, which contains all the necessary Docker configurations.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Navigate to your main containers directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Clone the repository&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git clone https:&#x2F;&#x2F;github.com&#x2F;strukturag&#x2F;nextcloud-spreed-signaling.git nextcloud-hpbe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Enter the new directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nextcloud-hpbe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-configuration-files&quot;&gt;3. Configuration Files&lt;&#x2F;h2&gt;
&lt;p&gt;This setup uses two main configuration files: &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; for defining the services and &lt;code&gt;server.conf&lt;&#x2F;code&gt; for the signaling server itself. All configuration values will be hardcoded directly into these files for simplicity and clarity.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-docker-compose-file-docker-compose-yml&quot;&gt;3.1. Docker Compose File (&lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;Create the &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; file. This version uses a hardcoded configuration and is optimized for Traefik v3.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  spreedbackend:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    build:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      context: .&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      dockerfile: docker&#x2F;server&#x2F;Dockerfile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      platforms:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        - &amp;quot;linux&#x2F;amd64&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: spreedbackend&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    depends_on:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - nats&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - janus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - coturn&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;server.conf:&#x2F;config&#x2F;server.conf:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.docker.network=proxy&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Router for certificate acquisition (Host-only rule)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe-cert.rule=Host(`signaling.your-domain.com`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe-cert.entrypoints=web,websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe-cert.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe-cert.priority=1&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Router for the actual service (Host + Path rule)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe.rule=Host(`signaling.your-domain.com`) &amp;amp;&amp;amp; PathPrefix(`&#x2F;standalone-signaling`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe.tls=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe.priority=100&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Middlewares: Set X-Forwarded-Proto and strip the path prefix&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.hpbe-headers.headers.customRequestHeaders.X-Forwarded-Proto=https&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.hpbe-strip.stripprefix.prefixes=&#x2F;standalone-signaling&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.hpbe.middlewares=hpbe-headers@docker,hpbe-strip@docker,crowdsec-bouncer@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Internal service port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.hpbe.loadbalancer.server.port=8080&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  nats:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: nats:2.10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: nats&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command: [&amp;quot;-c&amp;quot;, &amp;quot;&#x2F;config&#x2F;gnatsd.conf&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - type: bind&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        source: .&#x2F;gnatsd.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        target: &#x2F;config&#x2F;gnatsd.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        read_only: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  janus:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # Build Janus from source using the provided Dockerfile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    build: docker&#x2F;janus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: janus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command: [&amp;quot;janus&amp;quot;, &amp;quot;--full-trickle&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ports:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;20000-20100:20000-20100&#x2F;udp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Optional only if you enabled ice_tcp=true (see section 3.3)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # - &amp;quot;20000-20100:20000-20100&#x2F;tcp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;janus&#x2F;janus.jcfg:&#x2F;usr&#x2F;local&#x2F;etc&#x2F;janus&#x2F;janus.jcfg:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  coturn:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: coturn&#x2F;coturn:4.6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: coturn&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    logging:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      driver: &amp;quot;json-file&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      options:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        max-size: &amp;quot;10m&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        max-file: &amp;quot;3&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    command:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--realm&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;signaling.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--static-auth-secret&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;PASTE-A-STRONG-RANDOM-32-CHAR-HEX-SECRET-HERE&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--no-stdout-log&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--log-file&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;stdout&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--stale-nonce=600&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--use-auth-secret&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Using shared-secret auth only; lt-cred-mech omitted to avoid mixed-auth warning&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--fingerprint&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--no-software-attribute&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--no-multicast-peers&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--min-port&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;30000&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--max-port&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;30100&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--cert&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;&#x2F;certs&#x2F;fullchain.pem&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--pkey&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;&#x2F;certs&#x2F;privkey.pem&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;--tls-listening-port&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;5349&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ports:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;3478:3478&#x2F;tcp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;3478:3478&#x2F;udp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;5349:5349&#x2F;tcp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;5349:5349&#x2F;udp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;30000-30100:30000-30100&#x2F;udp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;certs:&#x2F;certs:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note: Before launching, create &lt;code&gt;janus&#x2F;janus.jcfg&lt;&#x2F;code&gt; as described in section 3.3 (set &lt;code&gt;nat_1_1_mapping&lt;&#x2F;code&gt; and the &lt;code&gt;min_port&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;max_port&lt;&#x2F;code&gt; media port range).&lt;&#x2F;p&gt;
&lt;p&gt;Note: On hosts with a direct public IP, you typically do not need to set Coturn’s &lt;code&gt;--listening-ip&lt;&#x2F;code&gt;, &lt;code&gt;--relay-ip&lt;&#x2F;code&gt;, or &lt;code&gt;--external-ip&lt;&#x2F;code&gt;. Relying on defaults avoids common binding errors (e.g., “Cannot assign requested address”, errno=99). Only set &lt;code&gt;--external-ip PUBLIC_IP&#x2F;PRIVATE_HOST_IP&lt;&#x2F;code&gt; (and optionally &lt;code&gt;--listening-ip&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;--relay-ip&lt;&#x2F;code&gt; to the private host IP) if your host is behind NAT.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-signaling-server-config-server-conf&quot;&gt;3.2. Signaling Server Config (&lt;code&gt;server.conf&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;This file configures the core logic of the HPBE. Create &lt;code&gt;server.conf&lt;&#x2F;code&gt;, paste the template below, and replace the placeholder values with your own secrets and URLs.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee server.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[http]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;listen = 0.0.0.0:8080&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[app]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;debug = false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[sessions]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Use &amp;#39;openssl rand -base64 16&amp;#39; to generate these&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;hashkey = PASTE-A-RANDOM-BASE64-KEY-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;blockkey = PASTE-A-RANDOM-BASE64-KEY-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[backend]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;backends = backend-1 #, backend-2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;allowall = false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;timeout = 10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;connectionsperhost = 8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[backend-1]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;url = https:&#x2F;&#x2F;cloud.your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Use &amp;#39;openssl rand -hex 16&amp;#39; to generate this&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;secret = PASTE-A-RANDOM-HEX-SECRET-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# To add a second backend, add it to the &amp;#39;backends&amp;#39; list and create a new section&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# [backend-2]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# url = https:&#x2F;&#x2F;another-cloud.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# secret = PASTE-ANOTHER-RANDOM-HEX-SECRET-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[nats]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;url = nats:&#x2F;&#x2F;nats:4222&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[mcu]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;type = janus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;url = ws:&#x2F;&#x2F;janus:8188&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[turn]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# Use &amp;#39;openssl rand -base64 16&amp;#39; to generate this&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;apikey = PASTE-A-RANDOM-BASE64-KEY-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;# This secret MUST be identical to the &amp;#39;--static-auth-secret&amp;#39; in docker-compose.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;secret = PASTE-THE-SAME-STRONG-SECRET-AS-IN-DOCKER-COMPOSE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;servers = turn:signaling.your-domain.com:3478?transport=udp,turn:signaling.your-domain.com:3478?transport=tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            SYNCHRONIZE TURN SECRET
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;secret&lt;&#x2F;code&gt; in the &lt;code&gt;[turn]&lt;&#x2F;code&gt; section of this file &lt;strong&gt;must&lt;&#x2F;strong&gt; be identical to the &lt;code&gt;--static-auth-secret&lt;&#x2F;code&gt; value used in the &lt;code&gt;coturn&lt;&#x2F;code&gt; service in your &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;Ensure the file has the correct permissions: &lt;code&gt;sudo chmod 644 server.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-2-1-replace-placeholders-and-generate-secrets&quot;&gt;3.2.1 Replace placeholders and generate secrets&lt;&#x2F;h3&gt;
&lt;p&gt;Before launching, perform these steps so your setup works on your domain and with strong secrets.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Replace the domain placeholder&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;We use &lt;code&gt;signaling.your-domain.com&lt;&#x2F;code&gt; as a placeholder. Replace it with your real domain in both files:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;nextcloud-hpbe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;s&#x2F;signaling\.your-domain\.com&#x2F;signaling.example.com&#x2F;g&amp;#39; docker-compose.yml server.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Replace &lt;code&gt;signaling.example.com&lt;&#x2F;code&gt; with your actual TURN&#x2F;signaling domain.&lt;&#x2F;p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Generate the required secrets with openssl&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;ul&gt;
&lt;li&gt;Sessions keys (base64) for &lt;code&gt;server.conf&lt;&#x2F;code&gt; &lt;code&gt;[sessions]&lt;&#x2F;code&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -base64 16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # paste as sessions.hashkey&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -base64 16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # paste as sessions.blockkey&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;Backend shared secret (hex) for each Nextcloud in &lt;code&gt;server.conf&lt;&#x2F;code&gt; &lt;code&gt;[backend-*]&lt;&#x2F;code&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -hex 16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;     # paste as backend-1.secret (and for backend-2, backend-3, ...)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;TURN API key (base64) for &lt;code&gt;server.conf&lt;&#x2F;code&gt; &lt;code&gt;[turn] apikey&lt;&#x2F;code&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -base64 16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # paste as turn.apikey&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;TURN static secret (hex) used in BOTH places:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;server.conf&lt;&#x2F;code&gt; &lt;code&gt;[turn] secret&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;docker-compose &lt;code&gt;coturn&lt;&#x2F;code&gt; command &lt;code&gt;--static-auth-secret&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rand&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -hex 16&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;     # paste into both places, values must be identical&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Open firewall ports (host level)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 3478&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 3478&#x2F;udp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 20000:20100&#x2F;udp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;   # Janus media range&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 30000:30100&#x2F;udp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;   # Coturn relay range&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# The main docker-compose includes TURNS by default:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 5349&#x2F;tcp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;         # required for TURNS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# sudo ufw allow 5349&#x2F;udp       # optional; some clients might use it&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-2-example-multiple-nextcloud-backends&quot;&gt;3.2.2 Example: Multiple Nextcloud backends&lt;&#x2F;h3&gt;
&lt;p&gt;If you operate more than one Nextcloud that should use the same signaling backend, model your &lt;code&gt;[backend]&lt;&#x2F;code&gt; section like this. Replace the example domains and secrets with your own.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[backend]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;backends&lt;&#x2F;span&gt;&lt;span&gt; = backend-1, backend-2, backend-3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;allowall&lt;&#x2F;span&gt;&lt;span&gt; = false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;timeout&lt;&#x2F;span&gt;&lt;span&gt; = 10&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;connectionsperhost&lt;&#x2F;span&gt;&lt;span&gt; = 8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[backend-1]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;url&lt;&#x2F;span&gt;&lt;span&gt; = https:&#x2F;&#x2F;cloud1.example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;secret&lt;&#x2F;span&gt;&lt;span&gt; = PASTE-A-RANDOM-HEX-SECRET-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[backend-2]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;url&lt;&#x2F;span&gt;&lt;span&gt; = https:&#x2F;&#x2F;cloud2.example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;secret&lt;&#x2F;span&gt;&lt;span&gt; = PASTE-A-RANDOM-HEX-SECRET-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[backend-3]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;url&lt;&#x2F;span&gt;&lt;span&gt; = https:&#x2F;&#x2F;cloud3.example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;secret&lt;&#x2F;span&gt;&lt;span&gt; = PASTE-A-RANDOM-HEX-SECRET-HERE&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note: The &lt;code&gt;secret&lt;&#x2F;code&gt; for each backend must match the “Shared secret” you configure in that specific Nextcloud under Admin -&amp;gt; Talk.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;3-2-3-optional-bind-the-http-listener-to-the-service-name&quot;&gt;3.2.3 Optional: Bind the HTTP listener to the service name&lt;&#x2F;h4&gt;
&lt;p&gt;By default this guide uses &lt;code&gt;listen = 0.0.0.0:8080&lt;&#x2F;code&gt; in &lt;code&gt;[http]&lt;&#x2F;code&gt;, which is simple and works well behind Traefik. If you prefer to bind strictly to the Docker service name, you can set:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[http]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;listen&lt;&#x2F;span&gt;&lt;span&gt; = spreedbackend:8080&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Both are valid in a single Docker network; choose the variant that fits your operational preference.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-3-janus-nat-and-media-ports-required-for-working-audio-video&quot;&gt;3.3. Janus NAT and Media Ports (required for working audio&#x2F;video)&lt;&#x2F;h3&gt;
&lt;p&gt;WebRTC media flows (DTLS&#x2F;SRTP) are carried on a dynamic UDP port range on the Janus SFU. If these ports are not reachable from the internet, calls will not establish and you will see errors like “publisher not sending yet” or repeated “requestoffer: context deadline exceeded” in the signaling logs.&lt;&#x2F;p&gt;
&lt;p&gt;Do the following:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Create a minimal Janus config that sets public IP mapping and a fixed media port range&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Create &lt;code&gt;.&#x2F;janus&#x2F;janus.jcfg&lt;&#x2F;code&gt; with the following content. Replace &lt;code&gt;PUBLIC.IP.OR.DNS&lt;&#x2F;code&gt; with your server’s public address or a DNS name that resolves to it (no CDN&#x2F;Orange-Cloud in front):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Minimal but complete Janus config for operation behind Docker&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# with a fixed UDP port range and correct 1:1 NAT mapping.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;general: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  configs_folder&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&#x2F;usr&#x2F;local&#x2F;etc&#x2F;janus&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Keep logging at &amp;quot;info&amp;quot; (default), set &amp;quot;debug = true&amp;quot; if needed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;at: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Important: public IP or DNS of the host that clients should see&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  nat_1_1_mapping&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;signaling.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # SRFLX candidates (optional, but doesn&amp;#39;t hurt)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  stun_server&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;signaling.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  stun_port&lt;&#x2F;span&gt;&lt;span&gt;   = 3478&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # ICE Lite is fine for SFU operation and reduces complexity&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  ice_lite&lt;&#x2F;span&gt;&lt;span&gt; = true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;media: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Fixed, small port range: must match docker-compose (ports:)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  min_port&lt;&#x2F;span&gt;&lt;span&gt; = 20000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  max_port&lt;&#x2F;span&gt;&lt;span&gt; = 20100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Prefer UDP (TCP disabled as it&amp;#39;s often problematic&#x2F;unnecessary)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  ice_tcp&lt;&#x2F;span&gt;&lt;span&gt; = false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # (Optional) Enforce RTCP-MUX – common default, can help&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  rtcp_mux&lt;&#x2F;span&gt;&lt;span&gt; = true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Websockets (HPBE communicates internally via ws:&#x2F;&#x2F;janus:8188)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Defaults are fine, no extra port publishing needed as it&amp;#39;s in the same Docker network.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;websockets: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  ws&lt;&#x2F;span&gt;&lt;span&gt; = true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  ws_port&lt;&#x2F;span&gt;&lt;span&gt; = 8188&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  ws_interface&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;0.0.0.0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# REST &amp;amp; Admin disabled by default – not needed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;admin: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  admin_http&lt;&#x2F;span&gt;&lt;span&gt; = false&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  admin_secret&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;changeit&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Ensure your main docker-compose includes the Janus media ports and config mount&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;In section 3.1, the &lt;code&gt;janus&lt;&#x2F;code&gt; service already contains the required &lt;code&gt;ports&lt;&#x2F;code&gt; and &lt;code&gt;volumes&lt;&#x2F;code&gt; lines. Verify that your configuration matches:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ports: &quot;20000-20100:20000-20100&#x2F;udp&quot;&lt;&#x2F;code&gt; (optional TCP only if &lt;code&gt;ice_tcp=true&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;volumes: .&#x2F;janus&#x2F;janus.jcfg:&#x2F;usr&#x2F;local&#x2F;etc&#x2F;janus&#x2F;janus.jcfg:ro&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Open the firewall for the media range (host level)&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 20000:20100&#x2F;udp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Adjust to the exact range you configured in janus.jcfg and docker-compose&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Only if you enabled ice_tcp=true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# sudo ufw allow 20000:20100&#x2F;tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            CAPACITY PLANNING FOR MEDIA PORTS
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;With RTCP-MUX&#x2F;BUNDLE (Janus default), each active PeerConnection typically uses about one UDP port on the server.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Plan roughly 1 port per active participant (conservatively 2 if features like separate screen-share&#x2F;recording open additional PeerConnections).&lt;&#x2F;li&gt;
&lt;li&gt;Examples (illustrative):
&lt;ul&gt;
&lt;li&gt;Range 40000–40050 (51 ports) → about 25–50 concurrent PeerConnections (small groups).&lt;&#x2F;li&gt;
&lt;li&gt;Range 40000–40199 (200 ports) → more headroom for spikes and larger meetings.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Always match your firewall (UFW) and CrowdSec rules to the same UDP range you configured in &lt;code&gt;janus.jcfg&lt;&#x2F;code&gt; and in the &lt;code&gt;janus&lt;&#x2F;code&gt; service &lt;code&gt;ports&lt;&#x2F;code&gt;. The above examples use 40000-based ranges; choose the range you actually configured (e.g., 20000–20100).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Apply the changes&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;ul&gt;
&lt;li&gt;If you have not launched the stack yet, skip this step. The changes will take effect when you start the stack in section 4.&lt;&#x2F;li&gt;
&lt;li&gt;If Janus is already running, apply the updated config now:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --force-recreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; janus&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;5&quot;&gt;
&lt;li&gt;Verify during a call attempt&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;ul&gt;
&lt;li&gt;In Firefox &lt;code&gt;about:webrtc&lt;&#x2F;code&gt; or Chrome &lt;code&gt;chrome:&#x2F;&#x2F;webrtc-internals&lt;&#x2F;code&gt; check that the remote ICE candidates from Janus show your public IP with ports in &lt;code&gt;20000–20100&lt;&#x2F;code&gt; and that the ICE state becomes &lt;code&gt;connected&#x2F;completed&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;On the server, you should see traffic on those ports while a call is setting up:&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tcpdump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -ni&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; any udp port&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 3478&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tcpdump&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -ni&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; any udp portrange 20000-20100&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you exclusively rely on shared-secret auth for TURN, you can still keep section 3.4 (TURNS) as-is; TURN helps with client NAT traversal but cannot replace opening Janus’ own media ports.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-4-enable-turn-over-tls-5349&quot;&gt;3.4. Enable TURN over TLS (5349)&lt;&#x2F;h3&gt;
&lt;p&gt;Enabling &lt;code&gt;turns:&lt;&#x2F;code&gt; adds TLS encryption to TURN traffic on port &lt;code&gt;5349&lt;&#x2F;code&gt;. This often helps in restrictive networks and hides credentials from passive observers.&lt;&#x2F;p&gt;
&lt;p&gt;Steps:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Create the certs directory and export PEMs from Traefik’s ACME store&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Since this guide builds on the prerequisite &lt;a href=&quot;..&#x2F;traefik-v3-crowdsec-tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec tutorial&lt;&#x2F;a&gt;, your certificates are stored in Traefik’s ACME database at &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&#x2F;traefik&#x2F;certs&#x2F;acme.json&lt;&#x2F;code&gt;. Export the certificate and key for your TURN domain into &lt;code&gt;.&#x2F;certs&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;nextcloud-hpbe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Domain used for TURN&#x2F;TURNS (anonymized placeholder)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TURN_DOMAIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;signaling.your-domain.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ACME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&#x2F;opt&#x2F;containers&#x2F;traefik-stack&#x2F;traefik&#x2F;certs&#x2F;acme.json&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Ensure tools are available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt-get update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt-get install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create output directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .&#x2F;certs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# (Directory permissions are set in step 1.1 below)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Extract certificate and key for the TURN domain from acme.json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r --arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; d &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$TURN_DOMAIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  .. | objects&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  | select(has(&amp;quot;domain&amp;quot;) and (.domain.main==$d or ((.domain.sans &#x2F;&#x2F; []) | index($d))))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  | .certificate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ACME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; base64&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .&#x2F;certs&#x2F;fullchain.pem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; jq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r --arg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; d &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$TURN_DOMAIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  .. | objects&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  | select(has(&amp;quot;domain&amp;quot;) and (.domain.main==$d or ((.domain.sans &#x2F;&#x2F; []) | index($d))))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  | .key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$ACME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; base64&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .&#x2F;certs&#x2F;privkey.pem&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note: The certificate must match the TURN realm&#x2F;domain you advertise (e.g., &lt;code&gt;signaling.your-domain.com&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;1.1 Set Certificate and Directory Permissions&lt;&#x2F;p&gt;
&lt;p&gt;Coturn does not run as root inside the container, but as the &lt;code&gt;nobody:nogroup&lt;&#x2F;code&gt; user. Without the correct permissions on both the directory and the files, Coturn cannot read the certificates and the &lt;code&gt;turns:&lt;&#x2F;code&gt; connection will fail (often shown as red in Nextcloud Talk).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# In your project directory (e.g., &#x2F;opt&#x2F;containers&#x2F;nextcloud-hpbe)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Detect the group ID used by Coturn inside the container (commonly 65534 for &amp;#39;nogroup&amp;#39;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose exec&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -T&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; coturn sh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;id -g&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;\r&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Ensure the certs directory is accessible to that group&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chgrp &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$GID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; .&#x2F;certs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 750&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .&#x2F;certs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Set group ownership and restrictive permissions on the files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chgrp &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$GID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; .&#x2F;certs&#x2F;privkey.pem .&#x2F;certs&#x2F;fullchain.pem&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 640&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .&#x2F;certs&#x2F;privkey.pem&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 644&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; .&#x2F;certs&#x2F;fullchain.pem&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Restart Coturn to load the updated certificates&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d --force-recreate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; coturn&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note: If your image uses the default &lt;code&gt;nobody:nogroup&lt;&#x2F;code&gt;, you may alternatively use &lt;code&gt;sudo chgrp nogroup ...&lt;&#x2F;code&gt; instead of the detected GID.&lt;&#x2F;p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;TLS is already configured in the main &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; in this guide. After creating&#x2F;exporting the certificates in step 1, simply recreate Coturn so it picks up the TLS files.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Note: If you exclusively use shared-secret auth (&lt;code&gt;--use-auth-secret&lt;&#x2F;code&gt; with &lt;code&gt;--static-auth-secret&lt;&#x2F;code&gt;), you can omit &lt;code&gt;--lt-cred-mech&lt;&#x2F;code&gt; to avoid a warning.&lt;&#x2F;p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Update your &lt;code&gt;server.conf&lt;&#x2F;code&gt; &lt;code&gt;servers&lt;&#x2F;code&gt; list to include the &lt;code&gt;turns:&lt;&#x2F;code&gt; endpoint:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[turn]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;servers&lt;&#x2F;span&gt;&lt;span&gt; = turn:signaling.your-domain.com:3478?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;transport&lt;&#x2F;span&gt;&lt;span&gt;=udp,turn:signaling.your-domain.com:3478?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;transport&lt;&#x2F;span&gt;&lt;span&gt;=tcp,turns:signaling.your-domain.com:5349?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;transport&lt;&#x2F;span&gt;&lt;span&gt;=tcp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Open the firewall for port &lt;code&gt;5349&lt;&#x2F;code&gt;:&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ufw allow 5349&#x2F;tcp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;         # required for TURNS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# sudo ufw allow 5349&#x2F;udp       # optional; enable only if you need UDP on 5349&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;4-launch-the-stack&quot;&gt;4. Launch the Stack&lt;&#x2F;h2&gt;
&lt;p&gt;With the configuration complete, you can now build and start the services.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From within the &#x2F;opt&#x2F;containers&#x2F;nextcloud-hpbe directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --build -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;--build&lt;&#x2F;code&gt; flag is important because it builds the Janus and the &lt;code&gt;spreedbackend&lt;&#x2F;code&gt; images from their Dockerfiles. The Janus build, in particular, can take several minutes.&lt;&#x2F;p&gt;
&lt;p&gt;You can monitor the logs to ensure everything starts correctly:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-1-verify-turn-turns-endpoints&quot;&gt;4.1 Verify TURN&#x2F;TURNS endpoints&lt;&#x2F;h3&gt;
&lt;p&gt;If &lt;code&gt;nc&lt;&#x2F;code&gt; is not installed, install it first:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt-get update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt-get install&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -y&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; netcat-openbsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Run these quick checks from a client or your server to verify connectivity:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1) Check TCP reachability (expect &amp;quot;succeeded&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -vz&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; signaling.your-domain.com&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 3478&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -vz&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; signaling.your-domain.com&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 5349&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # only if TURNS enabled&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2) Verify TLS on 5349 (should show certificate details; only if TURNS is enabled)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; s_client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -connect&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; signaling.your-domain.com:5349&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -servername&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; signaling.your-domain.com&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -brief&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3) Check Coturn runtime logs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; coturn&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you have &lt;code&gt;turnutils_uclient&lt;&#x2F;code&gt; available (from the coturn package), you can perform an end-to-end TURN allocation test as an advanced check.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;5-configure-nextcloud&quot;&gt;5. Configure Nextcloud&lt;&#x2F;h2&gt;
&lt;p&gt;The final step is to tell your Nextcloud instance to use the new High-Performance Backend.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Log in to Nextcloud as an administrator.&lt;&#x2F;li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Administration Settings&lt;&#x2F;strong&gt; -&amp;gt; &lt;strong&gt;Talk&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Scroll down to the “Signaling server” section.&lt;&#x2F;li&gt;
&lt;li&gt;Check “Enable custom signaling server”.&lt;&#x2F;li&gt;
&lt;li&gt;In the “Signaling server URL” field, enter the full path to your HPBE: &lt;code&gt;https:&#x2F;&#x2F;signaling.your-domain.com&#x2F;standalone-signaling&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;In the “Shared secret” field, paste the corresponding shared secret for this specific Nextcloud instance (e.g., the value of &lt;code&gt;NEXTCLOUD_1_SHARED_SECRET&lt;&#x2F;code&gt; for your first instance).&lt;&#x2F;li&gt;
&lt;li&gt;Click “Save changes”.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Nextcloud will verify the connection. If everything is correct, you’re all set!&lt;&#x2F;p&gt;
&lt;h3 id=&quot;clarifying-secret-mappings&quot;&gt;Clarifying Secret Mappings&lt;&#x2F;h3&gt;
&lt;p&gt;To ensure all components communicate securely, it’s crucial to map the secrets correctly. Here is a quick reference:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;code&gt;server.conf&lt;&#x2F;code&gt; Section &amp;amp; Key&lt;&#x2F;th&gt;&lt;th&gt;Maps to…&lt;&#x2F;th&gt;&lt;th&gt;Purpose&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;[backend]&lt;&#x2F;code&gt; -&amp;gt; &lt;code&gt;secret&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Nextcloud Admin -&amp;gt; Talk -&amp;gt; &lt;strong&gt;Shared secret&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Authenticates Nextcloud with the signaling server.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;[turn]&lt;&#x2F;code&gt; -&amp;gt; &lt;code&gt;apikey&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Used by the signaling server to generate time-limited TURN credentials for clients. Janus does not use this key in this setup.&lt;&#x2F;td&gt;&lt;td&gt;Allows signaling server to get TURN credentials.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;[turn]&lt;&#x2F;code&gt; -&amp;gt; &lt;code&gt;secret&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;coturn&lt;&#x2F;code&gt; service -&amp;gt; &lt;code&gt;--static-auth-secret&lt;&#x2F;code&gt; command argument&lt;&#x2F;td&gt;&lt;td&gt;Authenticates TURN users (generated by signaling).&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;h2 id=&quot;6-troubleshooting-monitoring&quot;&gt;6. Troubleshooting &amp;amp; Monitoring&lt;&#x2F;h2&gt;
&lt;p&gt;If you encounter issues, here are a few steps to diagnose the problem:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify the Signaling Server is Reachable&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You should get a &lt;code&gt;200 OK&lt;&#x2F;code&gt; response from the &lt;code&gt;&#x2F;welcome&lt;&#x2F;code&gt; endpoint. This confirms that Traefik is routing requests correctly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;signaling.your-domain.com&#x2F;standalone-signaling&#x2F;api&#x2F;v1&#x2F;welcome&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check the Container Logs&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The logs are the best source for identifying errors. Pay close attention to messages about secrets, WebSocket connections, or backend timeouts.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# From within the &#x2F;opt&#x2F;containers&#x2F;nextcloud-hpbe directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose logs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Common Errors &amp;amp; Fixes&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ERROR: the sessions block key must be...&lt;&#x2F;code&gt; or &lt;code&gt;hash key should be...&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: This error occurs when the keys in &lt;code&gt;server.conf&lt;&#x2F;code&gt; are missing or have the wrong format. Use &lt;code&gt;openssl rand -base64 16&lt;&#x2F;code&gt; to generate new keys and paste them into the &lt;code&gt;[sessions]&lt;&#x2F;code&gt; section.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;TURN Secret Mismatch&lt;&#x2F;strong&gt;: If calls fail to connect, verify that the &lt;code&gt;secret&lt;&#x2F;code&gt; in the &lt;code&gt;[turn]&lt;&#x2F;code&gt; section of &lt;code&gt;server.conf&lt;&#x2F;code&gt; is &lt;strong&gt;exactly&lt;&#x2F;strong&gt; the same as the &lt;code&gt;--static-auth-secret&lt;&#x2F;code&gt; in the &lt;code&gt;coturn&lt;&#x2F;code&gt; command in &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;“failed to establish signaling connection”&lt;&#x2F;strong&gt;: This is a classic error.
&lt;ul&gt;
&lt;li&gt;Check that the URL in Nextcloud is exactly &lt;code&gt;https:&#x2F;&#x2F;...&#x2F;standalone-signaling&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Ensure your Traefik labels are correct (especially the &lt;code&gt;PathPrefix&lt;&#x2F;code&gt; and &lt;code&gt;stripPrefix&lt;&#x2F;code&gt; rules).&lt;&#x2F;li&gt;
&lt;li&gt;Verify that the &lt;code&gt;Shared secret&lt;&#x2F;code&gt; in Nextcloud matches the one in &lt;code&gt;server.conf&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Media range not reachable: If ICE repeatedly fails or you see “publisher not sending yet”, ensure your chosen Janus media port range is open end-to-end (firewall&#x2F;CrowdSec), and that the exact same range is configured in both &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; (Janus &lt;code&gt;ports&lt;&#x2F;code&gt;) and &lt;code&gt;janus&#x2F;janus.jcfg&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Calls work for 2 people but fail with 3+&lt;&#x2F;strong&gt;: This often points to a problem with Janus (the MCU) or Coturn (the TURN server). Check their logs specifically.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;No video&#x2F;audio from external networks&lt;&#x2F;strong&gt;: This is a typical TURN server issue. Ensure ports &lt;code&gt;3478&lt;&#x2F;code&gt; (TCP&#x2F;UDP) are open on your firewall and correctly forwarded to the Coturn container.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;turn:&lt;&#x2F;code&gt; works, but &lt;code&gt;turns:&lt;&#x2F;code&gt; fails (is red in Nextcloud)&lt;&#x2F;strong&gt;: This is almost always a certificate permission issue. Coturn cannot read the TLS certificate or key. Verify that Coturn can access the files with &lt;code&gt;docker compose exec coturn ls -l &#x2F;certs&lt;&#x2F;code&gt;. If you see permission errors, re-run the permission-setting steps in section 3.4. You can also test externally with: &lt;code&gt;openssl s_client -connect signal.example.com:5349 -servername signal.example.com&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;6-1-diagnose-ice-rtp-issues-quickly&quot;&gt;6.1 Diagnose ICE&#x2F;RTP issues quickly&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Check remote candidates in the browser&lt;&#x2F;strong&gt;: Use &lt;code&gt;about:webrtc&lt;&#x2F;code&gt; (Firefox) or &lt;code&gt;chrome:&#x2F;&#x2F;webrtc-internals&lt;&#x2F;code&gt; (Chrome). You should see server-reflexive (srflx) and relayed (relay) candidates, and remote candidates from Janus on the public IP in the configured media range.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Look for ICE state&lt;&#x2F;strong&gt;: &lt;code&gt;iceConnectionState&lt;&#x2F;code&gt; should reach &lt;code&gt;connected&#x2F;completed&lt;&#x2F;code&gt;. If it stays in &lt;code&gt;checking&#x2F;failed&lt;&#x2F;code&gt;, open ports or NAT&#x2F;public IP mapping are missing.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Server-side packet capture&lt;&#x2F;strong&gt;: While attempting a call, run &lt;code&gt;sudo tcpdump -ni any udp portrange 20000-20100&lt;&#x2F;code&gt; to confirm media packets hit the host.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;TURN sanity&lt;&#x2F;strong&gt;: Use the Trickle ICE demo with your TURN URIs to confirm you get &lt;code&gt;relay&lt;&#x2F;code&gt; candidates; verify your Coturn &lt;code&gt;realm&lt;&#x2F;code&gt; and static secret match the values in &lt;code&gt;server.conf&lt;&#x2F;code&gt; and &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;7-maintenance-and-updates&quot;&gt;7. Maintenance and Updates&lt;&#x2F;h2&gt;
&lt;p&gt;Updating the High-Performance Backend involves fetching the latest version while preserving your custom configurations. The recommended method is to back up your current installation, clone the new version, and restore your configuration files. This avoids potential conflicts from a direct &lt;code&gt;git pull&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;step-1-stop-and-back-up-the-current-installation&quot;&gt;Step 1: Stop and Back Up the Current Installation&lt;&#x2F;h3&gt;
&lt;p&gt;First, stop the running services and create a backup of your entire &lt;code&gt;nextcloud-hpbe&lt;&#x2F;code&gt; directory.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Navigate to the parent directory of your HPBE installation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Stop the services using the existing docker-compose file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nextcloud-hpbe&#x2F;docker-compose.yml down&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create a backup by renaming the directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mv nextcloud-hpbe nextcloud-hpbe_BACKUP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;step-2-clone-the-new-version&quot;&gt;Step 2: Clone the New Version&lt;&#x2F;h3&gt;
&lt;p&gt;Clone the latest version of the repository into a clean directory with the original name.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Stay in &#x2F;opt&#x2F;containers&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git clone https:&#x2F;&#x2F;github.com&#x2F;strukturag&#x2F;nextcloud-spreed-signaling.git nextcloud-hpbe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;step-3-restore-your-configuration&quot;&gt;Step 3: Restore Your Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Copy your essential configuration files from the backup into the new directory. This ensures your secrets, domains, and other settings are preserved.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Copy your docker-compose.yml and server.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cp nextcloud-hpbe_BACKUP&#x2F;docker-compose.yml nextcloud-hpbe&#x2F;docker-compose.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; cp nextcloud-hpbe_BACKUP&#x2F;server.conf nextcloud-hpbe&#x2F;server.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;step-4-launch-the-updated-stack&quot;&gt;Step 4: Launch the Updated Stack&lt;&#x2F;h3&gt;
&lt;p&gt;Finally, navigate into the new directory and start the services. The &lt;code&gt;--build&lt;&#x2F;code&gt; flag will create new images if required, and &lt;code&gt;--remove-orphans&lt;&#x2F;code&gt; cleans up any old, unused containers.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Navigate into the new HPBE directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nextcloud-hpbe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Build and start the updated services&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; docker compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --build -d --remove-orphans&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After a few moments, your updated High-Performance Backend will be running. You can optionally remove the backup directory (&lt;code&gt;sudo rm -rf &#x2F;opt&#x2F;containers&#x2F;nextcloud-hpbe_BACKUP&lt;&#x2F;code&gt;) once you have confirmed everything is working correctly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Congratulations! You have successfully deployed a Nextcloud Talk High-Performance Backend. Your users will now experience more stable and performant video calls, especially in group settings. This powerful, containerized setup integrates perfectly with a modern Traefik proxy, providing a scalable and secure solution for your communication needs.&lt;&#x2F;p&gt;
&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;strukturag&amp;#x2F;nextcloud-spreed-signaling&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OFFICIAL HPBE REPOSITORY&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
</description>
      </item>
      <item>
          <title>Deploying a Secure Nginx Website with Traefik and Docker Compose</title>
          <pubDate>Wed, 17 Sep 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/nginx-webserver/</link>
          <guid>https://criticalbasics.xyz/posts/nginx-webserver/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/nginx-webserver/">&lt;p&gt;This tutorial explains how to deploy a simple and secure Nginx web server using Docker Compose. This setup is designed to run behind an existing Traefik reverse proxy, providing a robust and easily manageable solution for hosting a static website.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-09-17&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Article created to demonstrate a secure Nginx deployment behind a Traefik v3 stack.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;This guide builds directly upon a previously established secure Docker environment. Before you begin, you must have a fully functional Traefik v3 and CrowdSec stack.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            CRUCIAL PREREQUISITE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This tutorial is part of a series and assumes you have a fully functional Docker environment with Traefik running. You must have already completed the setup described in our previous tutorial:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;..&#x2F;traefik_v3_crowdsec_tutorial&#x2F;&quot;&gt;Traefik v3 and CrowdSec with Docker Compose: A Modern Security Stack&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;: This is the foundation for our reverse proxy and security.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;If you haven’t already created the external network for Traefik, do so now:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; network create proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;You will also need:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Docker and Docker Compose installed on your server.&lt;&#x2F;li&gt;
&lt;li&gt;A domain name pointed to your server’s IP address.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sudo&lt;&#x2F;code&gt; or root access.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;2-directory-structure&quot;&gt;2. Directory Structure&lt;&#x2F;h2&gt;
&lt;p&gt;To keep our project organized, we’ll create a dedicated directory for the Nginx service. All subsequent file paths in this guide are relative to this base directory.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the main directory for your Nginx site&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;nginx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;nginx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create subdirectories for configuration and website files&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir conf html&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This structure separates your Nginx configuration from your actual website content.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;3-configuration-files&quot;&gt;3. Configuration Files&lt;&#x2F;h2&gt;
&lt;p&gt;Next, we will create the necessary configuration files for Nginx and Docker Compose.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-environment-file-env&quot;&gt;3.1. Environment File (&lt;code&gt;.env&lt;&#x2F;code&gt;)&lt;&#x2F;h3&gt;
&lt;p&gt;First, create a &lt;code&gt;.env&lt;&#x2F;code&gt; file to store your domain name. This makes the configuration cleaner and easier to update.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;DOMAIN_NAME=your-domain.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            IMPORTANT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Replace &lt;code&gt;your-domain.com&lt;&#x2F;code&gt; with your actual domain name.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-2-docker-compose-file&quot;&gt;3.2. Docker Compose File&lt;&#x2F;h3&gt;
&lt;p&gt;Now, create the &lt;code&gt;docker-compose.yml&lt;&#x2F;code&gt; file. It will read the &lt;code&gt;DOMAIN_NAME&lt;&#x2F;code&gt; variable from your &lt;code&gt;.env&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee docker-compose.yml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;services:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  nginx:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image: nginx:1.27.1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    container_name: nginx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    restart: unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    volumes:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;html:&#x2F;usr&#x2F;share&#x2F;nginx&#x2F;html:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;conf&#x2F;nginx.conf:&#x2F;etc&#x2F;nginx&#x2F;nginx.conf:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - .&#x2F;conf&#x2F;mime.types:&#x2F;etc&#x2F;nginx&#x2F;mime.types:ro&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    labels:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.enable=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # --- Routing ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx.rule=Host(`${DOMAIN_NAME}`) || Host(`www.${DOMAIN_NAME}`)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx.entrypoints=websecure&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx.tls=true&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx.tls.certresolver=tls_resolver&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # --- Middlewares ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # 1. CORS headers for Matrix federation (defined on-the-fly)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.nginx-cors.headers.accessControlAllowMethods=GET,OPTIONS,PUT,POST&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.nginx-cors.headers.accessControlAllowHeaders=*&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.middlewares.nginx-cors.headers.accessControlAllowOriginList=*&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # 2. Assignment of all middlewares&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.routers.nginx.middlewares=security-headers@file,crowdsec-bouncer@docker,nginx-cors@docker&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # --- Service Definition ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - &amp;quot;traefik.http.services.nginx.loadbalancer.server.port=80&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      - proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;networks:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  proxy:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    external: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Key Points from this file:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;labels&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: These are instructions for Traefik. We define routing, TLS, and a chain of middlewares.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;middlewares&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: We apply three middlewares: &lt;code&gt;security-headers&lt;&#x2F;code&gt; (from a file), &lt;code&gt;crowdsec-bouncer&lt;&#x2F;code&gt; (from the Traefik service’s own labels), and &lt;code&gt;nginx-cors&lt;&#x2F;code&gt;. The &lt;code&gt;nginx-cors&lt;&#x2F;code&gt; middleware is defined on-the-fly here and is &lt;strong&gt;critical for Matrix federation&lt;&#x2F;strong&gt;, as it allows other servers to access the &lt;code&gt;.well-known&lt;&#x2F;code&gt; delegation files. For a standard website without Matrix integration, this middleware and its assignment can be omitted.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;volumes&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: We mount our local &lt;code&gt;html&lt;&#x2F;code&gt; and &lt;code&gt;conf&lt;&#x2F;code&gt; directories into the container as read-only (&lt;code&gt;ro&lt;&#x2F;code&gt;) for better security.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;networks&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: The service is attached to the external &lt;code&gt;proxy&lt;&#x2F;code&gt; network, allowing it to communicate with the Traefik container.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-3-nginx-configuration&quot;&gt;3.3. Nginx Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Next, create the main Nginx configuration file at &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;nginx&#x2F;conf&#x2F;nginx.conf&lt;&#x2F;code&gt;. This file controls the behavior of the web server and is optimized for serving a static site with Gzip compression.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee conf&#x2F;nginx.conf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;worker_processes  2;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;user              www-data;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;events {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    use           epoll;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    worker_connections  128;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;http {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    include       &#x2F;etc&#x2F;nginx&#x2F;mime.types;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    default_type  application&#x2F;octet-stream;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # --- Basic Settings ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    sendfile        on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    tcp_nopush      on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    tcp_nodelay     on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    keepalive_timeout  65;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    types_hash_max_size 2048;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # --- Gzip Settings ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_disable &amp;quot;msie6&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_vary on;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_proxied any;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_comp_level 6;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_buffers 16 8k;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_http_version 1.1;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    gzip_types text&#x2F;plain text&#x2F;css application&#x2F;json application&#x2F;javascript text&#x2F;xml application&#x2F;xml application&#x2F;xml+rss text&#x2F;javascript;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # --- Main Server Block ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    server {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        listen 80;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        server_name _;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        root &#x2F;usr&#x2F;share&#x2F;nginx&#x2F;html;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        index index.html;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location &#x2F; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            try_files $uri $uri&#x2F; =404;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        # --- Future-Proofing for Matrix Synapse ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location &#x2F;.well-known&#x2F;matrix&#x2F;server {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            return 200 &amp;#39;{&amp;quot;m.server&amp;quot;: &amp;quot;matrix.YOUR_DOMAIN_COM_PLACEHOLDER:443&amp;quot;}&amp;#39;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            add_header &amp;quot;Content-Type&amp;quot; &amp;quot;application&#x2F;json&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location &#x2F;.well-known&#x2F;matrix&#x2F;client {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             return 200 &amp;#39;{&amp;quot;m.homeserver&amp;quot;: {&amp;quot;base_url&amp;quot;: &amp;quot;https:&#x2F;&#x2F;matrix.YOUR_DOMAIN_COM_PLACEHOLDER&amp;quot;}, &amp;quot;m.identity_server&amp;quot;: {&amp;quot;base_url&amp;quot;: &amp;quot;https:&#x2F;&#x2F;vector.im&amp;quot;}}&amp;#39;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             add_header &amp;quot;Content-Type&amp;quot; &amp;quot;application&#x2F;json; charset=utf-8&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;             add_header &amp;quot;Access-Control-Allow-Origin&amp;quot; &amp;quot;*&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        # --- Error Pages ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        error_page 404 &#x2F;404.html;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location = &#x2F;404.html {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            internal;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        error_page 500 502 503 504 &#x2F;50x.html;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        location = &#x2F;50x.html {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;            internal;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, read the .env file and use sed to replace the placeholders:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;export&lt;&#x2F;span&gt;&lt;span&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;^#&amp;#39; .env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; xargs&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;s&#x2F;YOUR_DOMAIN_COM_PLACEHOLDER&#x2F;${&lt;&#x2F;span&gt;&lt;span&gt;DOMAIN_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&#x2F;g&amp;quot; conf&#x2F;nginx.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            PREPARING FOR MATRIX SYNAPSE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The &lt;code&gt;location &#x2F;.well-known&#x2F;matrix&lt;&#x2F;code&gt; blocks are included as a forward-thinking measure. They are required for setting up a federated &lt;strong&gt;&lt;a href=&quot;..&#x2F;matrix_synapse_server&#x2F;&quot;&gt;Matrix Synapse server&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt; on your domain. By including them now, you won’t need to reconfigure this Nginx service when you decide to deploy Matrix later. These directives tell Matrix clients and other servers where to find your chat homeserver.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;3-4-mime-types&quot;&gt;3.4. Mime Types&lt;&#x2F;h3&gt;
&lt;p&gt;Create a &lt;code&gt;mime.types&lt;&#x2F;code&gt; file at &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;nginx&#x2F;conf&#x2F;mime.types&lt;&#x2F;code&gt;. This file ensures that Nginx sends the correct &lt;code&gt;Content-Type&lt;&#x2F;code&gt; header for various file formats, which is particularly important for web fonts and modern web assets.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee conf&#x2F;mime.types&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;types {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    text&#x2F;html                                        html htm shtml;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    text&#x2F;css                                         css;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    text&#x2F;xml                                         xml;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image&#x2F;gif                                        gif;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image&#x2F;jpeg                                       jpeg jpg;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    application&#x2F;javascript                           js;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    application&#x2F;atom+xml                             atom;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    application&#x2F;rss+xml                              rss;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # Fonts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    application&#x2F;vnd.ms-fontobject                    eot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    font&#x2F;truetype                                    ttf;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    font&#x2F;opentype                                    otf;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    font&#x2F;woff                                        woff;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    font&#x2F;woff2                                       woff2;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image&#x2F;svg+xml                                    svg svgz;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image&#x2F;png                                        png;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    image&#x2F;x-icon                                     ico;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-5-website-content&quot;&gt;3.5. Website Content&lt;&#x2F;h3&gt;
&lt;p&gt;Before launching the server, place your website files into the &lt;code&gt;&#x2F;opt&#x2F;containers&#x2F;nginx&#x2F;html&lt;&#x2F;code&gt; directory. For a quick test, create a simple &lt;code&gt;index.html&lt;&#x2F;code&gt; file within it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create a simple index.html for testing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee html&#x2F;index.html&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;head&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;title&amp;gt;Welcome to My Nginx Site&amp;lt;&#x2F;title&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;style&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        body { font-family: sans-serif; background-color: #f0f0f0; text-align: center; padding: 50px; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        h1 { color: #333; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;&#x2F;style&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;head&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;body&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;h1&amp;gt;Success!&amp;lt;&#x2F;h1&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;p&amp;gt;Your Nginx website is running securely behind Traefik.&amp;lt;&#x2F;p&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;body&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create custom error pages&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee html&#x2F;404.html&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;head&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;title&amp;gt;404 Not Found&amp;lt;&#x2F;title&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;head&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;body&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;h1&amp;gt;404 - Page Not Found&amp;lt;&#x2F;h1&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;p&amp;gt;The page you are looking for does not exist.&amp;lt;&#x2F;p&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;body&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; tee html&#x2F;50x.html&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;EOF&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;head&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;title&amp;gt;Server Error&amp;lt;&#x2F;title&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;head&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;body&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;h1&amp;gt;50x - Server Error&amp;lt;&#x2F;h1&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;lt;p&amp;gt;An internal server error occurred.&amp;lt;&#x2F;p&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;body&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;lt;&#x2F;html&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;5-launch-and-verify&quot;&gt;5. Launch and Verify&lt;&#x2F;h2&gt;
&lt;p&gt;With all the files in place, you can start your Nginx container. Use &lt;code&gt;docker compose&lt;&#x2F;code&gt; for consistency with the main Traefik stack.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Navigate to your project directory if you aren&amp;#39;t already there&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;opt&#x2F;containers&#x2F;nginx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Start the service in the background&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; compose up&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can check the status of your new container with &lt;code&gt;docker compose ps&lt;&#x2F;code&gt;. It should show a state of &lt;code&gt;Up&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Now, open a web browser and navigate to &lt;code&gt;https:&#x2F;&#x2F;your-domain.com&lt;&#x2F;code&gt;. You should see the “Success!” message from your &lt;code&gt;index.html&lt;&#x2F;code&gt; file, served over a secure HTTPS connection managed by Traefik.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;6-conclusion&quot;&gt;6. Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;You have successfully deployed a secure, containerized Nginx web server behind your Traefik and CrowdSec stack. This setup not only serves your static content efficiently but also benefits from centralized TLS management, security headers, and threat protection. Furthermore, it is already prepared for future expansion, such as the addition of a &lt;strong&gt;&lt;a href=&quot;..&#x2F;matrix_synapse_server&#x2F;&quot;&gt;Matrix Synapse server&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Secure Server-to-Server File Transfers with rsync and tmux</title>
          <pubDate>Fri, 08 Aug 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/server-file-transfer-rsync-tmux/</link>
          <guid>https://criticalbasics.xyz/posts/server-file-transfer-rsync-tmux/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/server-file-transfer-rsync-tmux/">&lt;p&gt;This guide provides a definitive, “terminal-first” approach to transferring large amounts of data directly between two remote servers. By combining the power of &lt;code&gt;rsync&lt;&#x2F;code&gt; for data synchronization, &lt;code&gt;tmux&lt;&#x2F;code&gt; for session persistence, and a securely configured SSH deploy key for authentication, you can create a “fire-and-forget” transfer process that is robust, efficient, and secure.&lt;&#x2F;p&gt;
&lt;p&gt;This method avoids routing traffic through your local machine, saving you bandwidth and making the process immune to local network disconnects.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-08-08&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Article created.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-the-goal-direct-robust-server-to-server-transfers&quot;&gt;1. The Goal: Direct, Robust Server-to-Server Transfers&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, it’s essential to understand the data flow we are building.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            UNDERSTANDING THE ARCHITECTURE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The goal is to initiate a transfer that runs entirely on &lt;strong&gt;Server1&lt;&#x2F;strong&gt;, pulling data from itself and pushing it directly to &lt;strong&gt;Server2&lt;&#x2F;strong&gt;. Your local computer is only used to set up the infrastructure and start the process; it can be disconnected immediately afterward.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Data Flow:&lt;&#x2F;strong&gt; &lt;code&gt;Server1 (Source)  ---(Data Transfer)---&amp;gt;  Server2 (Destination)&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;2-prerequisites&quot;&gt;2. Prerequisites&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;You have &lt;strong&gt;key-based SSH access&lt;&#x2F;strong&gt; from your &lt;strong&gt;local computer&lt;&#x2F;strong&gt; to two Linux servers, &lt;code&gt;Server1&lt;&#x2F;code&gt; and &lt;code&gt;Server2&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Password authentication on your servers is (correctly) disabled.&lt;&#x2F;li&gt;
&lt;li&gt;You have &lt;code&gt;sudo&lt;&#x2F;code&gt; or &lt;code&gt;root&lt;&#x2F;code&gt; privileges on &lt;code&gt;Server1&lt;&#x2F;code&gt; to install software.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;local-ssh-configuration-for-your-convenience&quot;&gt;Local SSH Configuration (For Your Convenience)&lt;&#x2F;h3&gt;
&lt;p&gt;Define aliases for your servers in your &lt;strong&gt;local computer’s&lt;&#x2F;strong&gt; &lt;code&gt;~&#x2F;.ssh&#x2F;config&lt;&#x2F;code&gt; file. This only makes it easier for &lt;em&gt;you&lt;&#x2F;em&gt; to connect; it does not affect the servers themselves.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# In ~&#x2F;.ssh&#x2F;config on your LOCAL machine&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Host Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    HostName cloud.server1.xyz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    User your_user&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Host Server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    HostName cloud.server2.xyz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    User root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Port 2222 &lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Use your actual port&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-the-core-method-building-the-key-infrastructure&quot;&gt;3. The Core Method: Building the Key Infrastructure&lt;&#x2F;h2&gt;
&lt;p&gt;This is the most critical part of the tutorial. We will:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Create a deploy key on &lt;code&gt;Server1&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Configure the SSH client &lt;strong&gt;on &lt;code&gt;Server1&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; so it knows how to find &lt;code&gt;Server2&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Use our local PC as a trusted intermediary to securely install and restrict the key on &lt;code&gt;Server2&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-1-on-server1-create-the-deploy-key&quot;&gt;3.1. On Server1: Create the Deploy Key&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On your local machine, connect to Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Now, on Server1, generate a new, passwordless SSH key pair&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# When prompted for a passphrase, press Enter twice to leave it empty.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh-keygen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ed25519&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.ssh&#x2F;id_deploy_to_server2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;rsync deploy key for server2&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-on-server1-configure-its-ssh-client&quot;&gt;3.2. On Server1: Configure its SSH Client&lt;&#x2F;h3&gt;
&lt;p&gt;We must teach &lt;code&gt;Server1&lt;&#x2F;code&gt; how to connect to &lt;code&gt;Server2&lt;&#x2F;code&gt;. We do this by creating a &lt;code&gt;config&lt;&#x2F;code&gt; file in its &lt;code&gt;.ssh&lt;&#x2F;code&gt; directory.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On Server1, create and open the config file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nano&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.ssh&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add the following configuration. &lt;strong&gt;Replace the values&lt;&#x2F;strong&gt; with the actual connection details for &lt;code&gt;Server2&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Host Server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    HostName cloud.server2.xyz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    User root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Port 2222&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    IdentityFile ~&#x2F;.ssh&#x2F;id_deploy_to_server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IdentityFile&lt;&#x2F;code&gt;: This line is key. It tells &lt;code&gt;Server1&lt;&#x2F;code&gt;’s SSH client: “When connecting to the host aliased as ‘Server2’, &lt;strong&gt;always&lt;&#x2F;strong&gt; use this specific private key.”&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Save the file (&lt;code&gt;Ctrl+X&lt;&#x2F;code&gt;, then &lt;code&gt;Y&lt;&#x2F;code&gt;, then &lt;code&gt;Enter&lt;&#x2F;code&gt;) and set the correct permissions:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 600&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.ssh&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-3-on-server1-copy-the-public-key-for-transfer&quot;&gt;3.3. On Server1: Copy the Public Key for Transfer&lt;&#x2F;h3&gt;
&lt;p&gt;Display the public key so you can copy it to your clipboard.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.ssh&#x2F;id_deploy_to_server2.pub&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Action:&lt;&#x2F;strong&gt; Mark and copy the entire output (the line starting &lt;code&gt;ssh-ed25519 AAAA...&lt;&#x2F;code&gt;). Then, log out from &lt;code&gt;Server1&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-4-from-your-local-pc-install-and-restrict-the-key-on-server2&quot;&gt;3.4. From Your Local PC: Install and Restrict the Key on Server2&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 1. On your local PC, append the key to Server2&amp;#39;s authorized_keys.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#    Replace &amp;#39;PASTE_KEY_FROM_CLIPBOARD_HERE&amp;#39; with the key you just copied.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Server2 &amp;quot;echo &amp;#39;PASTE_KEY_FROM_CLIPBOARD_HERE&amp;#39; &amp;gt;&amp;gt; ~&#x2F;.ssh&#x2F;authorized_keys&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 2. Now, SSH to Server2 to restrict the key.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# 3. Once on Server2, open the file for editing.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nano&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.ssh&#x2F;authorized_keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In the editor, find the key you just added at the bottom of the file. Navigate to the &lt;strong&gt;very beginning&lt;&#x2F;strong&gt; of that line and prepend the &lt;code&gt;command&lt;&#x2F;code&gt; restriction.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh-ed25519 AAAA... rsync deploy key for server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;After (replace &lt;code&gt;&#x2F;path&#x2F;to&#x2F;destination&#x2F;&lt;&#x2F;code&gt; with your actual path!):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;command=&amp;quot;rsync --server -vlogDtpre.iL --partial . &#x2F;path&#x2F;to&#x2F;destination&#x2F;&amp;quot;,no-port-forwarding,no-x11-forwarding,no-agent-forwarding,no-pty ssh-ed25519 AAAA... rsync deploy key for server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save the file and exit the editor (&lt;code&gt;Ctrl+X&lt;&#x2F;code&gt;, then &lt;code&gt;Y&lt;&#x2F;code&gt;, then &lt;code&gt;Enter&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-test-the-connection-and-launch-the-transfer&quot;&gt;4. Test the Connection and Launch the Transfer&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;4-1-test-the-inter-server-connection&quot;&gt;4.1. Test the Inter-Server Connection&lt;&#x2F;h3&gt;
&lt;p&gt;This test now verifies that the new configuration on &lt;code&gt;Server1&lt;&#x2F;code&gt; is working correctly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On your local PC&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Now, on Server1, this command will work because of the new ~&#x2F;.ssh&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ssh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; Server2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            SUCCESS LOOKS LIKE A FAILURE!
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The terminal may appear to hang and show a message like &lt;code&gt;PTY allocation request failed on channel 0&lt;&#x2F;code&gt;. This is the &lt;strong&gt;expected and correct behavior!&lt;&#x2F;strong&gt; It proves that the server has successfully rejected your request for an interactive shell due to our security rule.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Press &lt;code&gt;Ctrl+C&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; to return to the prompt. Your test was successful.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;4-2-launch-the-uninterruptible-transfer&quot;&gt;4.2. Launch the Uninterruptible Transfer&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On Server1, install tmux if you haven&amp;#39;t already&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install tmux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Start a new tmux session&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tmux&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; syncJob&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Inside the tmux session, execute the now-simplified rsync command.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# No -e option is needed because Server1&amp;#39;s SSH client is now configured!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;rsync&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -avh --info=progress2 --partial \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  &#x2F;path&#x2F;to&#x2F;source&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  Server2:&#x2F;path&#x2F;to&#x2F;destination&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-3-detach-and-disconnect&quot;&gt;4.3. Detach and Disconnect&lt;&#x2F;h3&gt;
&lt;p&gt;The process is now running. Detach from the &lt;code&gt;tmux&lt;&#x2F;code&gt; session and log out.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;Ctrl+b&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, then &lt;strong&gt;&lt;code&gt;d&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On Server1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;exit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-managing-the-rsync-session&quot;&gt;5. Managing the &lt;code&gt;rsync&lt;&#x2F;code&gt; Session&lt;&#x2F;h2&gt;
&lt;p&gt;You can check on, re-attach, or terminate your transfer at any time.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;To check the progress:&lt;&#x2F;strong&gt; &lt;code&gt;ssh Server1&lt;&#x2F;code&gt; and then &lt;code&gt;tmux attach -t syncJob&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;To kill the session:&lt;&#x2F;strong&gt; &lt;code&gt;ssh Server1&lt;&#x2F;code&gt; and then &lt;code&gt;tmux kill-session -t syncJob&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-quick-troubleshooting&quot;&gt;6. Quick Troubleshooting&lt;&#x2F;h2&gt;

  



  





&lt;div class=&quot;styled-table-container&quot;&gt;
  &lt;table id=&quot;custom-table&quot; &gt;
    
      &lt;colgroup&gt;
        
          &lt;col width=&quot;40%&quot;&gt;
        
          &lt;col width=&quot;60%&quot;&gt;
        
      &lt;&#x2F;colgroup&gt;
    

    &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem&lt;&#x2F;th&gt;&lt;th&gt;Solution&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;“Could not resolve hostname Server2”&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;The &lt;code&gt;~&#x2F;.ssh&#x2F;config&lt;&#x2F;code&gt; file on &lt;strong&gt;Server1&lt;&#x2F;strong&gt; is missing, has incorrect permissions (should be 600), or the &lt;code&gt;Host Server2&lt;&#x2F;code&gt; entry is misspelled.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;“Permission denied (publickey).”&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;The &lt;code&gt;IdentityFile&lt;&#x2F;code&gt; path in &lt;code&gt;Server1&lt;&#x2F;code&gt;’s &lt;code&gt;~&#x2F;.ssh&#x2F;config&lt;&#x2F;code&gt; might be wrong. Or, the public key was not correctly added to &lt;code&gt;Server2&lt;&#x2F;code&gt;’s &lt;code&gt;authorized_keys&lt;&#x2F;code&gt;.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;&lt;code&gt;ssh Server2&lt;&#x2F;code&gt; test works, but &lt;code&gt;rsync&lt;&#x2F;code&gt; fails&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Check the &lt;code&gt;User&lt;&#x2F;code&gt; in &lt;code&gt;Server1&lt;&#x2F;code&gt;’s &lt;code&gt;~&#x2F;.ssh&#x2F;config&lt;&#x2F;code&gt;. Does that user have permission to write to the destination directory on &lt;code&gt;Server2&lt;&#x2F;code&gt;? Also, check the path in the &lt;code&gt;command=&lt;&#x2F;code&gt; restriction.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Files are copied into a nested directory&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;You likely omitted the trailing slash (&lt;code&gt;&#x2F;&lt;&#x2F;code&gt;) on your source path. &lt;code&gt;&#x2F;path&#x2F;to&#x2F;source&lt;&#x2F;code&gt; copies the directory itself, while &lt;code&gt;&#x2F;path&#x2F;to&#x2F;source&#x2F;&lt;&#x2F;code&gt; copies its contents.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;

  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-conclusion&quot;&gt;7. Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;By following this definitive guide, you have built a powerful and professionally architected data transfer system. The key was configuring the client (&lt;code&gt;Server1&lt;&#x2F;code&gt;) to know how to reach the target (&lt;code&gt;Server2&lt;&#x2F;code&gt;), a fundamental concept for any automated inter-server task. This setup is ideal for large backups, data migrations, and any scenario where a direct, robust, server-to-server connection is required.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.samba.org&amp;#x2F;ftp&amp;#x2F;rsync&amp;#x2F;rsync.html&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;RSYNC DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;tmux&amp;#x2F;tmux&amp;#x2F;wiki&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🛡️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;TMUX WIKI &amp;amp; DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>A Smart, mimeapps.list-Aware File Opener for Neomutt</title>
          <pubDate>Mon, 04 Aug 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/neomutt-file-opener/</link>
          <guid>https://criticalbasics.xyz/posts/neomutt-file-opener/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/neomutt-file-opener/">&lt;p&gt;Tired of being locked into a single default program for your email attachments in &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;LukeSmithxyz&#x2F;mutt-wizard&quot;&gt;Neomutt&lt;&#x2F;a&gt;? This tutorial will guide you through creating an intelligent file-open-chooser that dynamically reads your system’s &lt;code&gt;mimeapps.list&lt;&#x2F;code&gt; configuration. With a single keypress, you can select from all associated applications to open any attachment, bringing the flexibility of a file manager like Ranger directly into your email client.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-08-04&lt;&#x2F;td&gt;&lt;td&gt;Initial version of the tutorial published.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-1&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, ensure your system has the necessary software and configuration in place.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-1-required-software&quot;&gt;1.1. Required Software&lt;&#x2F;h3&gt;
&lt;p&gt;This script relies on a few common command-line utilities.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Arch Linux Installation&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; neomutt rofi file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Optional: dmenu as a fallback for rofi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dmenu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;1-2-existing-configuration&quot;&gt;1.2. Existing Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;You should already have:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A working Neomutt setup (e.g., one configured with &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;LukeSmithxyz&#x2F;mutt-wizard&quot;&gt;&lt;code&gt;mutt-wizard&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;A populated &lt;code&gt;~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;code&gt; file with your preferred application associations.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-2&quot;&gt;2. The Core Script: &lt;code&gt;file-open-chooser&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;This script is the heart of our new functionality. It identifies an attachment’s file type, finds all associated programs from your &lt;code&gt;mimeapps.list&lt;&#x2F;code&gt;, and presents them in a selection menu.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            BEYOND NEOMUTT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;While we focus on Neomutt here, this script is a full-featured, system-wide file opener. It reads your mimeapps.list and works in any context where files can be piped via stdin - terminal, other mail clients, RSS readers, or custom scripts.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;step-1-create-the-script-s-directory-and-file&quot;&gt;Step 1: Create the Script’s Directory and File&lt;&#x2F;h3&gt;
&lt;p&gt;To keep your scripts organized, we will create a dedicated folder and the script file within it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the subdirectory for our project&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;Scripts&#x2F;file-open-chooser&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create the script file itself&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;touch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;Scripts&#x2F;file-open-chooser&#x2F;file-open-chooser.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, open the file &lt;code&gt;~&#x2F;Scripts&#x2F;file-open-chooser&#x2F;file-open-chooser.sh&lt;&#x2F;code&gt; and paste the entire content below into it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#!&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set -euo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pipefail&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Create a temporary file to hold the attachment content piped from Neomutt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mktemp&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Determine the MIME type of the temporary file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --mime-type -b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Function to extract available programs from mimeapps.list ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;get_programs_for_mime&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    local&lt;&#x2F;span&gt;&lt;span&gt; mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Read from both [Default Applications] and [Added Associations] sections&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default Applications&amp;quot; &amp;quot;Added Associations&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -q&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^\[&lt;&#x2F;span&gt;&lt;span&gt;$section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;\]&amp;quot; ~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;            # Use awk to find and print programs for the given MIME type&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            apps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;awk&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; section=&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$section&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mime=&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                &#x2F;^\[.*\]&#x2F; { current_section = $0; gsub(&#x2F;[\[\]]&#x2F;, &amp;quot;&amp;quot;, current_section) }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                current_section == section &amp;amp;&amp;amp; $0 ~ &amp;quot;^&amp;quot; mime &amp;quot;=&amp;quot; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                    sub(&amp;quot;^&amp;quot; mime &amp;quot;=&amp;quot;, &amp;quot;&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                    gsub(&#x2F;;&#x2F;, &amp;quot;\n&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                    print&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                }&amp;#39; ~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$apps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$apps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Always include a &amp;quot;Default&amp;quot; option to use the system&amp;#39;s xdg-open&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Function to convert a .desktop file name to a human-readable application name ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;desktop_to_name&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    local&lt;&#x2F;span&gt;&lt;span&gt; desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    local&lt;&#x2F;span&gt;&lt;span&gt; desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Search for the .desktop file in standard system locations&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.local&#x2F;share&#x2F;applications &#x2F;usr&#x2F;share&#x2F;applications &#x2F;usr&#x2F;local&#x2F;share&#x2F;applications&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            break&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Extract the &amp;#39;Name=&amp;#39; field from the .desktop file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;^Name=&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;=&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f2-&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;$desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Fallback to the filename if Name is not found&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Main Logic ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Collect a unique, sorted list of programs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;get_programs_for_mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -u&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Build the display list with readable names&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;while&lt;&#x2F;span&gt;&lt;span&gt; IFS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; read -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; program&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$program&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$display_programs$program&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;\n&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        readable_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;desktop_to_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$program&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$display_programs$readable_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; (&lt;&#x2F;span&gt;&lt;span&gt;$program&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;)\n&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done &amp;lt;&amp;lt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Show the selection menu using rofi, dmenu, or a terminal prompt as fallback&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Initialize variable&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; rofi&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; rofi&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -dmenu -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Open &lt;&#x2F;span&gt;&lt;span&gt;$mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; with:&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;elif&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; command -v&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dmenu&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; dmenu&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Open &lt;&#x2F;span&gt;&lt;span&gt;$mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; with:&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Choose program to open &lt;&#x2F;span&gt;&lt;span&gt;$mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; file:&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; nl&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    read -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Enter choice number: &amp;quot; num&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$display_programs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;num&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}p&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Exit if the user cancelled the selection (e.g., by pressing Esc in rofi)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -z&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Execute the chosen program&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Default&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    setsid&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; xdg-open &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Extract the .desktop filename from the selection (e.g., from &amp;quot;Okular (org.kde.okular.desktop)&amp;quot;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;s&#x2F;.*(\(.*\))&#x2F;\1&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ] &amp;amp;&amp;amp; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; !=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Use gtk-launch for .desktop files, as it&amp;#39;s the proper way to launch them&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        setsid&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; gtk-launch &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Fallback to xdg-open if something went wrong&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        setsid&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; xdg-open &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&amp;amp;1&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Clean up the temporary file after a delay to give the program time to open it&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sleep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 60&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tempfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;) &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;step-2-make-the-script-executable&quot;&gt;Step 2: Make the Script Executable&lt;&#x2F;h3&gt;
&lt;p&gt;Your shell needs permission to run the script file.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x ~&#x2F;Scripts&#x2F;file-open-chooser&#x2F;file-open-chooser.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-3&quot;&gt;3. Neomutt Integration&lt;&#x2F;h2&gt;
&lt;p&gt;Now, let’s teach Neomutt our new trick. We will bind the &lt;code&gt;o&lt;&#x2F;code&gt; key (for “open”) in the attachment view to execute our script directly.&lt;&#x2F;p&gt;
&lt;p&gt;Add the following line to your Neomutt configuration file (e.g., &lt;code&gt;~&#x2F;.config&#x2F;mutt&#x2F;muttrc&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add a macro to the attachment menu (key &amp;#39;o&amp;#39;) to pipe the&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# attachment to our script by calling it with its full path.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;macro attach o &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;lt;pipe-entry&amp;gt;bash $HOME&#x2F;Scripts&#x2F;file-open-chooser&#x2F;file-open-chooser.sh&amp;lt;enter&amp;gt;&amp;quot; &amp;quot;Choose program to open attachment&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHY &amp;#x27;BASH $HOME&amp;#x2F;...&amp;#x27;?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;By explicitly calling &lt;code&gt;bash&lt;&#x2F;code&gt;, we ensure the script is executed with the Bash interpreter. Using &lt;code&gt;$HOME&lt;&#x2F;code&gt; instead of &lt;code&gt;~&lt;&#x2F;code&gt; is a good practice inside configurations, as it’s more robustly expanded in different contexts.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-4&quot;&gt;4. Usage in Neomutt&lt;&#x2F;h2&gt;
&lt;p&gt;Your new workflow is simple and efficient:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to an email with an attachment.&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;v&lt;&#x2F;code&gt; to open the attachment view.&lt;&#x2F;li&gt;
&lt;li&gt;Use the arrow keys to select the desired attachment.&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;o&lt;&#x2F;code&gt; (our new macro).&lt;&#x2F;li&gt;
&lt;li&gt;A Rofi (or dmenu) window will appear, listing all compatible programs.&lt;&#x2F;li&gt;
&lt;li&gt;Select a program, and the file will open.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Example Workflows:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;PDF Attachment&lt;&#x2F;strong&gt; → &lt;code&gt;o&lt;&#x2F;code&gt; → Choose between Okular, Zathura, Evince…&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Image Attachment&lt;&#x2F;strong&gt; → &lt;code&gt;o&lt;&#x2F;code&gt; → Choose between Viewnior, GIMP, Inkscape…&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Video Attachment&lt;&#x2F;strong&gt; → &lt;code&gt;o&lt;&#x2F;code&gt; → Choose between MPV, VLC…&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-5&quot;&gt;5. Customization&lt;&#x2F;h2&gt;
&lt;p&gt;To add a new program to the list for a specific file type, simply edit your &lt;code&gt;~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;code&gt; file. The changes are picked up by the script immediately, with no need to restart anything!&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Example &lt;code&gt;[Added Associations]&lt;&#x2F;code&gt; section:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[Added Associations]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;application&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pdf&lt;&#x2F;span&gt;&lt;span&gt;=org.kde.okular.desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;;org.pwmt.zathura.desktop;org.gnome.Evince.desktop;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;image&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;jpeg&lt;&#x2F;span&gt;&lt;span&gt;=viewnior.desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;;gimp.desktop;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;another-useful-keybinding&quot;&gt;Another Useful Keybinding&lt;&#x2F;h3&gt;
&lt;p&gt;You can still define a separate shortcut to &lt;em&gt;always&lt;&#x2F;em&gt; use the default system application without seeing the menu.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add this to your muttrc. &amp;#39;O&amp;#39; (Shift+o) will open with the default handler.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;macro attach O &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;lt;pipe-entry&amp;gt;xdg-open&amp;lt;enter&amp;gt;&amp;quot; &amp;quot;Open with default application&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-6&quot;&gt;6. Troubleshooting&lt;&#x2F;h2&gt;
&lt;p&gt;If things don’t work as expected, here are some common issues and their solutions.&lt;&#x2F;p&gt;

  



  





&lt;div class=&quot;styled-table-container&quot;&gt;
  &lt;table id=&quot;custom-table&quot; &gt;
    
      &lt;colgroup&gt;
        
          &lt;col width=&quot;40%&quot;&gt;
        
          &lt;col width=&quot;60%&quot;&gt;
        
      &lt;&#x2F;colgroup&gt;
    

    &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem&lt;&#x2F;th&gt;&lt;th&gt;Solution&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Permission denied error&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;The script is likely not executable. Run &lt;code&gt;chmod +x ~&#x2F;Scripts&#x2F;file-open-chooser&#x2F;file-open-chooser.sh&lt;&#x2F;code&gt; again to be sure.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;File not found error&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Double-check the path in your Neomutt macro. Make sure it exactly matches the location of your script. Verify with &lt;code&gt;ls -l ~&#x2F;Scripts&#x2F;file-open-chooser&#x2F;file-open-chooser.sh&lt;&#x2F;code&gt;.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Rofi&#x2F;dmenu does not start&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Test &lt;code&gt;rofi&lt;&#x2F;code&gt; directly by running &lt;code&gt;rofi -show run&lt;&#x2F;code&gt;. If it fails, check for error messages. Ensure it’s installed. The script should fall back to a terminal prompt if &lt;code&gt;rofi&lt;&#x2F;code&gt; is missing.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Incorrect or no programs listed&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Test the MIME type detection with &lt;code&gt;file --mime-type -b &#x2F;path&#x2F;to&#x2F;some&#x2F;file.pdf&lt;&#x2F;code&gt;. Check your &lt;code&gt;~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;code&gt; to ensure the associations for that MIME type are correct.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;

  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-conclusion&quot;&gt;7. Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;By implementing this file-open-chooser, you’ve significantly enhanced Neomutt’s capabilities. Your setup now:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;✅ Leverages your existing &lt;code&gt;mimeapps.list&lt;&#x2F;code&gt; configuration without duplication.&lt;&#x2F;li&gt;
&lt;li&gt;✅ Works universally with any file type.&lt;&#x2F;li&gt;
&lt;li&gt;✅ Provides flexible application choices with a single keypress.&lt;&#x2F;li&gt;
&lt;li&gt;✅ Integrates elegantly with modern tools like Rofi.&lt;&#x2F;li&gt;
&lt;li&gt;✅ Is robust, with fallbacks for different system configurations.&lt;&#x2F;li&gt;
&lt;li&gt;✅ Is easy to set up with a direct, simple configuration.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;You now have the same power and flexibility to open files in your email client as you do in your file manager.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;neomutt.org&amp;#x2F;guide&amp;#x2F;advanced-usage#using-external-programs&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;NEOMUTT DOCS: EXTERNAL PROGRAMS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;davatorium&amp;#x2F;rofi&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🚀&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;ROFI ON GITHUB&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Guide: NVIDIA Legacy Drivers &amp; Multi-Monitor Setup on a ThinkPad W520 (Arch Linux)</title>
          <pubDate>Wed, 30 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/thinkpad-w520-nvidia-multi-monitor/</link>
          <guid>https://criticalbasics.xyz/posts/thinkpad-w520-nvidia-multi-monitor/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/thinkpad-w520-nvidia-multi-monitor/">&lt;p&gt;This tutorial walks you through the process of setting up a &lt;strong&gt;ThinkPad W520&lt;&#x2F;strong&gt; to run exclusively on its discrete NVIDIA GPU. This is essential for using external monitors connected via the docking station and achieving a stable, high-performance desktop environment on Arch Linux with the i3 window manager.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            THE GOAL
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;The primary objective is to enable the NVIDIA Quadro 1000M&#x2F;2000M GPU in “Discrete Graphics” mode, install the required legacy &lt;code&gt;nvidia-390xx&lt;&#x2F;code&gt; driver, and configure the system for a stable multi-monitor experience without the freezes commonly caused by compositors like &lt;code&gt;picom&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-29&lt;&#x2F;td&gt;&lt;td&gt;Initial version of the guide created.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-correct-bios-configuration&quot;&gt;1. Correct BIOS Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;First, we need to instruct the system to use only the NVIDIA GPU, bypassing the integrated Intel graphics.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;strong&gt;F1&lt;&#x2F;strong&gt; during startup to enter the BIOS setup utility.&lt;&#x2F;li&gt;
&lt;li&gt;Navigate to the &lt;code&gt;Config&lt;&#x2F;code&gt; → &lt;code&gt;Display&lt;&#x2F;code&gt; menu.&lt;&#x2F;li&gt;
&lt;li&gt;Set the &lt;strong&gt;Graphics Device&lt;&#x2F;strong&gt; option to &lt;strong&gt;Discrete Graphics&lt;&#x2F;strong&gt;. Do not use “Optimus” or “Integrated Graphics.”&lt;&#x2F;li&gt;
&lt;li&gt;If the option exists, disable &lt;code&gt;OS Detection for Optimus&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Save your changes and exit the BIOS. The system will now reboot.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            WHY DISCRETE GRAPHICS?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;On the ThinkPad W520, the physical display outputs (DisplayPort, DVI) on the laptop and its docking station are wired directly to the NVIDIA GPU. They will not function if the system is running on integrated graphics.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-installing-the-nvidia-legacy-driver&quot;&gt;2. Installing the NVIDIA Legacy Driver&lt;&#x2F;h2&gt;
&lt;p&gt;The NVIDIA Quadro 1000M&#x2F;2000M GPU found in the W520 belongs to the “Fermi” architecture. Mainline NVIDIA drivers no longer support it, so we must install the &lt;code&gt;nvidia-390xx&lt;&#x2F;code&gt; legacy driver from the Arch User Repository (AUR).&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-1-install-an-aur-helper-yay&quot;&gt;2.1. Install an AUR Helper (yay)&lt;&#x2F;h3&gt;
&lt;p&gt;If you don’t already have an AUR helper, &lt;code&gt;yay&lt;&#x2F;code&gt; is a popular choice.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S --needed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; git base-devel&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; clone https:&#x2F;&#x2F;aur.archlinux.org&#x2F;yay.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; yay&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;makepkg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -si&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;2-2-install-the-nvidia-390xx-driver-from-the-aur&quot;&gt;2.2. Install the NVIDIA 390xx Driver from the AUR&lt;&#x2F;h3&gt;
&lt;p&gt;Now, use your AUR helper to install the driver and its utilities.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;yay&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nvidia-390xx-dkms nvidia-390xx-utils&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;-dkms&lt;&#x2F;code&gt; package ensures that the NVIDIA kernel module is automatically rebuilt every time your Linux kernel is updated, which prevents breakage.&lt;&#x2F;li&gt;
&lt;li&gt;During the installation, if prompted, allow the installer to blacklist the open-source &lt;code&gt;nouveau&lt;&#x2F;code&gt; driver, as it conflicts with the proprietary NVIDIA driver.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;2-3-ensure-kernel-headers-are-present&quot;&gt;2.3. Ensure Kernel Headers are Present&lt;&#x2F;h3&gt;
&lt;p&gt;DKMS requires kernel headers to build modules. Install them if they are not already on your system.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; linux-headers&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After installation, you can run &lt;code&gt;sudo dkms autoinstall&lt;&#x2F;code&gt; to manually rebuild the module if needed.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-4-reboot-and-verify&quot;&gt;2.4. Reboot and Verify&lt;&#x2F;h3&gt;
&lt;p&gt;A reboot is necessary to load the new kernel module.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; reboot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After rebooting, check if the NVIDIA GPU is active and the driver is loaded correctly by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nvidia-smi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If this command displays your GPU details and driver version, the installation was successful.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-minimal-xorg-configuration&quot;&gt;3. Minimal Xorg Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;To ensure the X server starts correctly, we will create a minimal configuration file.&lt;&#x2F;p&gt;
&lt;p&gt;Create the directory if it doesn’t exist:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;etc&#x2F;X11&#x2F;xorg.conf.d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create and edit the configuration file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; nano &#x2F;etc&#x2F;X11&#x2F;xorg.conf.d&#x2F;20-nvidia.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add the following content to the file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Section &amp;quot;Device&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Identifier &amp;quot;NVIDIA Card&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Driver &amp;quot;nvidia&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Option &amp;quot;AllowEmptyInitialConfiguration&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;EndSection&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reboot your system one more time. After this, Xorg should correctly detect all connected displays (both the internal laptop screen and any external monitors) and run them at their native resolutions.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-taming-the-compositor-picom&quot;&gt;4. Taming the Compositor (picom)&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;code&gt;nvidia-390xx&lt;&#x2F;code&gt; driver can have stability issues with modern compositors like &lt;code&gt;picom&lt;&#x2F;code&gt;, often causing applications like &lt;code&gt;rofi&lt;&#x2F;code&gt; or terminal emulators to freeze the entire desktop. Here are two solutions.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-1-the-stable-solution-configure-picom&quot;&gt;4.1. The Stable Solution: Configure picom&lt;&#x2F;h3&gt;
&lt;p&gt;You can make &lt;code&gt;picom&lt;&#x2F;code&gt; more stable by changing its rendering backend.&lt;&#x2F;p&gt;
&lt;p&gt;Open your &lt;code&gt;picom&lt;&#x2F;code&gt; configuration file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nano&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;picom&#x2F;picom.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Find and set the following lines:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;backend = &amp;quot;xrender&amp;quot;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vsync = false;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;xrender&lt;&#x2F;code&gt; backend uses CPU-based rendering. While it may be slightly less performant than the GPU-based GLX backend, it is significantly more stable with this legacy driver.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-2-the-rock-solid-alternative-disable-picom&quot;&gt;4.2. The Rock-Solid Alternative: Disable picom&lt;&#x2F;h3&gt;
&lt;p&gt;If you don’t need transparency or other compositor effects, the most stable option is to disable &lt;code&gt;picom&lt;&#x2F;code&gt; entirely.&lt;&#x2F;p&gt;
&lt;p&gt;First, stop any running instance:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;killall&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; picom&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, prevent it from starting automatically by commenting out or deleting the relevant line in your i3 config (&lt;code&gt;~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# exec --no-startup-id picom&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            ACHIEVING TEAR-FREE VIDEO WITHOUT A COMPOSITOR
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;You can still get a tear-free experience by enabling the “Force Full Composition Pipeline” option in the NVIDIA settings.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;nvidia-settings&lt;&#x2F;code&gt; from the terminal.&lt;&#x2F;li&gt;
&lt;li&gt;Navigate to &lt;em&gt;X Server Display Configuration&lt;&#x2F;em&gt; → &lt;em&gt;Advanced&lt;&#x2F;em&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Check the box for &lt;strong&gt;Force Full Composition Pipeline&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply&lt;&#x2F;strong&gt;, and then save the configuration by running &lt;code&gt;sudo nvidia-settings --write-config&lt;&#x2F;code&gt;. This will make the setting persistent across reboots.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-multi-monitor-autostart-in-i3&quot;&gt;5. Multi-Monitor Autostart in i3&lt;&#x2F;h2&gt;
&lt;p&gt;To have i3 automatically arrange your monitors every time it starts, create a simple shell script.&lt;&#x2F;p&gt;
&lt;p&gt;First, create a directory for your layout scripts:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.screenlayout&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create the script:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nano&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.screenlayout&#x2F;monitors.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add your &lt;code&gt;xrandr&lt;&#x2F;code&gt; command to the script. Use the &lt;code&gt;xrandr&lt;&#x2F;code&gt; command with no arguments to find the names of your connected outputs (e.g., &lt;code&gt;eDP-1&lt;&#x2F;code&gt;, &lt;code&gt;DP-1&lt;&#x2F;code&gt;, &lt;code&gt;DP-5&lt;&#x2F;code&gt;, etc.).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#!&#x2F;bin&#x2F;bash&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;xrandr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; eDP-1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --primary --mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 1920x1080&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --pos 0x0 --rotate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; normal&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;       --output&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; DP-1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --mode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; 1920x1080&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --right-of&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; eDP-1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --rotate&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; normal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make the script executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x ~&#x2F;.screenlayout&#x2F;monitors.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Finally, add this script to your i3 config to execute it on startup:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# In ~&#x2F;.config&#x2F;i3&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;exec --no-startup-id ~&#x2F;.screenlayout&#x2F;monitors.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;you-re-all-set&quot;&gt;You’re All Set!&lt;&#x2F;h2&gt;
&lt;p&gt;Congratulations! You should now have a fully functional and stable setup.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Your ThinkPad W520 is running on its powerful NVIDIA GPU.&lt;&#x2F;li&gt;
&lt;li&gt;External monitors connected via the dock are recognized and working.&lt;&#x2F;li&gt;
&lt;li&gt;Desktop freezes caused by the compositor have been resolved.&lt;&#x2F;li&gt;
&lt;li&gt;Your i3 session automatically configures your monitor layout on startup.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>Efficient File Compression in Ranger File Manager</title>
          <pubDate>Fri, 18 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/ranger-compression-workflow/</link>
          <guid>https://criticalbasics.xyz/posts/ranger-compression-workflow/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/ranger-compression-workflow/">&lt;p&gt;Terminal file managers like ranger offer powerful ways to manage your files efficiently. This guide shows you how to enhance ranger with custom commands for compressing files into various archive formats directly from the file manager interface. This is part of a series of guides on extending ranger’s functionality.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-18&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Created guide for compression workflow in ranger&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, make sure you have the following tools installed:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ranger&lt;&#x2F;strong&gt;: The terminal file manager&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;atool&lt;&#x2F;strong&gt;: A script for managing file archives of various types&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Archive utilities&lt;&#x2F;strong&gt;: While atool is a wrapper, you’ll need the actual compression tools installed:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;zip&lt;&#x2F;strong&gt;, &lt;strong&gt;unzip&lt;&#x2F;strong&gt;: For .zip archives&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;tar&lt;&#x2F;strong&gt;: For .tar, .tar.gz, .tar.bz2 archives&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;p7zip-full&lt;&#x2F;strong&gt; (Debian&#x2F;Ubuntu) or &lt;strong&gt;p7zip&lt;&#x2F;strong&gt; (Arch&#x2F;Fedora): For .7z archives&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;rar&lt;&#x2F;strong&gt;, &lt;strong&gt;unrar&lt;&#x2F;strong&gt;: For .rar archives&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;installation-on-various-distributions&quot;&gt;Installation on Various Distributions&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Debian&#x2F;Ubuntu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install ranger atool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Arch Linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ranger atool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Fedora&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dnf install ranger atool&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;atool&lt;&#x2F;code&gt; package provides commands like &lt;code&gt;apack&lt;&#x2F;code&gt; (for creating archives) and &lt;code&gt;aunpack&lt;&#x2F;code&gt; (for extracting archives), which we’ll use in our custom ranger commands.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-creating-the-custom-compress-command&quot;&gt;2. Creating the Custom compress Command&lt;&#x2F;h2&gt;
&lt;p&gt;The integration requires adding a custom command to ranger that will use &lt;code&gt;apack&lt;&#x2F;code&gt; to compress selected files into an archive.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-1-create-or-edit-commands-py&quot;&gt;2.1. Create or Edit commands.py&lt;&#x2F;h3&gt;
&lt;p&gt;First, navigate to your ranger configuration directory and create or edit the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;touch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;commands.py&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don’t have a &lt;code&gt;commands.py&lt;&#x2F;code&gt; file yet, you can generate a template with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=commands&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;2-2-add-the-compress-command&quot;&gt;2.2. Add the compress Command&lt;&#x2F;h3&gt;
&lt;p&gt;Open the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file in your favorite text editor and add the following code:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; os&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt; ranger.core.loader&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; import&lt;&#x2F;span&gt;&lt;span&gt; CommandLoader&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; compress&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        &amp;quot;&amp;quot;&amp;quot; Compress marked files to current directory &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        cwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisdir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        marked_files&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; cwd.get_selection()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; marked_files:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; refresh&lt;&#x2F;span&gt;&lt;span&gt;(_):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.fm.get_directory(original_path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cwd.load_content()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        original_path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; cwd.path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        parts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.line.split()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        au_flags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; parts[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;:]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Compressing to: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(parts[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;])&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        obj&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; CommandLoader(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;apack&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; au_flags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                [os.path.relpath(f.path, cwd.path)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; marked_files],&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;descr,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        obj.signal_bind(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;after&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, refresh)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span&gt;.fm.loader.add(obj)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tab&lt;&#x2F;span&gt;&lt;span&gt;(self, tabnum):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        &amp;quot;&amp;quot;&amp;quot; Complete with current folder name &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        extension&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.zip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tar.gz&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.rar&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.7z&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;compress &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisdir.path)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; extension]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This command will:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Take the marked files in ranger&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;apack&lt;&#x2F;code&gt; to compress them into an archive&lt;&#x2F;li&gt;
&lt;li&gt;Refresh the directory view after compression&lt;&#x2F;li&gt;
&lt;li&gt;Provide tab completion for common archive formats&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-adding-an-extract-command-optional&quot;&gt;3. Adding an Extract Command (Optional)&lt;&#x2F;h2&gt;
&lt;p&gt;For a complete compression workflow, you might also want to add an extraction command. Add this to your &lt;code&gt;commands.py&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; extract_here&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;        &amp;quot;&amp;quot;&amp;quot; Extract selected files to current directory &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        cwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisdir&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        marked_files&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; cwd.get_selection()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if not&lt;&#x2F;span&gt;&lt;span&gt; marked_files:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; refresh&lt;&#x2F;span&gt;&lt;span&gt;(_):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.fm.get_directory(original_path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            cwd.load_content()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        original_path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; cwd.path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        au_flags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-X&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, cwd.path]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Extract to current directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        au_flags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; self&lt;&#x2F;span&gt;&lt;span&gt;.line.split()[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;:]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        au_flags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;-e&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span&gt;.fm.copy_buffer.clear()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span&gt;.fm.cut_buffer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; False&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; len&lt;&#x2F;span&gt;&lt;span&gt;(marked_files)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;extracting: &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(marked_files[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;].path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;extracting &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; files&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;.format(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;len&lt;&#x2F;span&gt;&lt;span&gt;(marked_files))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        obj&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; CommandLoader(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;args&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;aunpack&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; au_flags&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                [f.path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; marked_files],&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; descr&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;descr,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; read&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        obj.signal_bind(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;after&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, refresh)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        self&lt;&#x2F;span&gt;&lt;span&gt;.fm.loader.add(obj)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-creating-keyboard-shortcuts&quot;&gt;4. Creating Keyboard Shortcuts&lt;&#x2F;h2&gt;
&lt;p&gt;Now that we have our custom commands, let’s create keyboard shortcuts to invoke them easily.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-1-edit-rc-conf&quot;&gt;4.1. Edit rc.conf&lt;&#x2F;h3&gt;
&lt;p&gt;Open your ranger configuration file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don’t have this file yet, you can generate it with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=rc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-2-add-the-keyboard-mappings&quot;&gt;4.2. Add the Keyboard Mappings&lt;&#x2F;h3&gt;
&lt;p&gt;Add the following lines to map the commands to keyboard shortcuts:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Compression and extraction&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map cc console compress%space&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map cx extract_here&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;With these shortcuts:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cc&lt;&#x2F;code&gt; will start the compress command and wait for you to specify the archive name&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;cx&lt;&#x2F;code&gt; will extract the selected archive in the current directory&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Shortcut&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;cc&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Compress selected files into an archive&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;cx&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Extract selected archive in the current directory&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-advanced-configuration&quot;&gt;5. Advanced Configuration&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;5-1-customize-archive-formats&quot;&gt;5.1. Customize Archive Formats&lt;&#x2F;h3&gt;
&lt;p&gt;You can modify the list of supported archive extensions in the &lt;code&gt;tab&lt;&#x2F;code&gt; method of the &lt;code&gt;compress&lt;&#x2F;code&gt; command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tab&lt;&#x2F;span&gt;&lt;span&gt;(self, tabnum):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot; Complete with current folder name &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    extension&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.zip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tar.gz&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tar.bz2&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tar.xz&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.rar&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.7z&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    return&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;compress &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisdir.path)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; extension]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add or remove archive formats based on your needs and installed utilities.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-2-add-compression-options&quot;&gt;5.2. Add Compression Options&lt;&#x2F;h3&gt;
&lt;p&gt;You can enhance the &lt;code&gt;compress&lt;&#x2F;code&gt; command to support additional options like compression level:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; tab&lt;&#x2F;span&gt;&lt;span&gt;(self, tabnum):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot; Complete with current folder name and compression options &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    extension&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.zip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.tar.gz&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.rar&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.7z&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    base_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.fm.thisdir.path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Basic archive names&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    options&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;compress &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; base_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; extension]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Add options with compression levels for zip&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; tabnum&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        options&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;compress &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; base_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.zip -mx=9&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Maximum compression&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        options&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +=&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;compress &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span&gt; base_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; +&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.zip -mx=1&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Fastest compression&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    return&lt;&#x2F;span&gt;&lt;span&gt; options&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-3-exclude-certain-files&quot;&gt;5.3. Exclude Certain Files&lt;&#x2F;h3&gt;
&lt;p&gt;You might want to exclude certain files from compression (like temporary files or already compressed files). You can modify the &lt;code&gt;execute&lt;&#x2F;code&gt; method to filter the marked files:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;marked_files&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; cwd.get_selection()&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; if not&lt;&#x2F;span&gt;&lt;span&gt; f.path.endswith((&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.zip&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.rar&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;.7z&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;))]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-usage&quot;&gt;6. Usage&lt;&#x2F;h2&gt;
&lt;p&gt;Once everything is set up, you can use your new compression workflow:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;6-1-creating-archives&quot;&gt;6.1. Creating Archives&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Open ranger in your terminal&lt;&#x2F;li&gt;
&lt;li&gt;Navigate to the directory containing files you want to compress&lt;&#x2F;li&gt;
&lt;li&gt;Select files using the &lt;code&gt;space&lt;&#x2F;code&gt; key (or select a single file with the cursor)&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;cc&lt;&#x2F;code&gt; to start the compress command&lt;&#x2F;li&gt;
&lt;li&gt;Type the archive name or press &lt;code&gt;Tab&lt;&#x2F;code&gt; to auto-complete with suggested formats&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;Enter&lt;&#x2F;code&gt; to create the archive&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;6-2-extracting-archives&quot;&gt;6.2. Extracting Archives&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to an archive file or select it&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;cx&lt;&#x2F;code&gt; to extract its contents to the current directory&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-practical-examples&quot;&gt;7. Practical Examples&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;7-1-backup-workflow&quot;&gt;7.1. Backup Workflow&lt;&#x2F;h3&gt;
&lt;p&gt;Create quick backups of important directories:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to a project folder&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;cc&lt;&#x2F;code&gt; then &lt;code&gt;Tab&lt;&#x2F;code&gt; to get suggestions&lt;&#x2F;li&gt;
&lt;li&gt;Select &lt;code&gt;.tar.gz&lt;&#x2F;code&gt; format for good compression&lt;&#x2F;li&gt;
&lt;li&gt;Add a date to the filename: &lt;code&gt;project-backup-2025-07-18.tar.gz&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;7-2-sharing-files&quot;&gt;7.2. Sharing Files&lt;&#x2F;h3&gt;
&lt;p&gt;Compress files for sharing:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Select multiple files with &lt;code&gt;space&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;cc&lt;&#x2F;code&gt; and create a &lt;code&gt;.zip&lt;&#x2F;code&gt; file (most compatible format)&lt;&#x2F;li&gt;
&lt;li&gt;The archive is ready to be emailed or transferred&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;7-3-working-with-different-archive-types&quot;&gt;7.3. Working with Different Archive Types&lt;&#x2F;h3&gt;
&lt;p&gt;The workflow supports various archive formats:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.zip&lt;&#x2F;code&gt; - Good compatibility across platforms&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;.tar.gz&lt;&#x2F;code&gt; - Better compression, common on Linux&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;.7z&lt;&#x2F;code&gt; - Best compression ratio&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;.rar&lt;&#x2F;code&gt; - Good for split archives&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;8-troubleshooting&quot;&gt;8. Troubleshooting&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;8-1-command-not-found&quot;&gt;8.1. Command Not Found&lt;&#x2F;h3&gt;
&lt;p&gt;If you get a “Command not found” error when trying to use the shortcut:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure you’ve saved the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file correctly&lt;&#x2F;li&gt;
&lt;li&gt;Restart ranger to load the new command&lt;&#x2F;li&gt;
&lt;li&gt;Check that &lt;code&gt;atool&lt;&#x2F;code&gt; is installed and in your PATH&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;8-2-compression-fails&quot;&gt;8.2. Compression Fails&lt;&#x2F;h3&gt;
&lt;p&gt;If compression fails:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Check if you have the appropriate compression tools installed&lt;&#x2F;li&gt;
&lt;li&gt;Verify that you have write permissions in the current directory&lt;&#x2F;li&gt;
&lt;li&gt;Make sure you have enough disk space&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Try running &lt;code&gt;apack&lt;&#x2F;code&gt; directly to see if it works outside of ranger:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;apack&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; archive.zip file1 file2 file3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;8-3-file-not-found-errors&quot;&gt;8.3. File Not Found Errors&lt;&#x2F;h3&gt;
&lt;p&gt;If you get “file not found” errors:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure you’re not trying to compress files with special characters in their names&lt;&#x2F;li&gt;
&lt;li&gt;Check if the paths are correct&lt;&#x2F;li&gt;
&lt;li&gt;Try using relative paths instead of absolute paths&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With this compression workflow integration, you’ve enhanced ranger’s capabilities for working with archives:&lt;&#x2F;p&gt;
&lt;p&gt;✅ Quick compression of files with just a few keystrokes
✅ Support for multiple archive formats
✅ Tab completion for common archive types
✅ Easy extraction of archives
✅ Seamless integration with your terminal workflow&lt;&#x2F;p&gt;
&lt;p&gt;This setup is particularly valuable for system administrators, developers, and anyone who frequently needs to create or extract archives. It combines the file management power of ranger with the versatility of atool for handling various archive formats.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.nongnu.org&amp;#x2F;atool&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;ATOOL DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;ranger&amp;#x2F;ranger&amp;#x2F;wiki&amp;#x2F;Custom-Commands&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🔧&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;RANGER CUSTOM COMMANDS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;wiki.archlinux.org&amp;#x2F;title&amp;#x2F;Ranger#Archives&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📦&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;ARCH WIKI: RANGER ARCHIVES&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;related-ranger-guides&quot;&gt;Related Ranger Guides&lt;&#x2F;h2&gt;
&lt;p&gt;Enhance your ranger experience with these additional tutorials:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-fzf-bat-integration&#x2F;&quot;&gt;Ranger and fzf Integration&lt;&#x2F;a&gt; - Add powerful fuzzy search capabilities&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-exiftool-integration&#x2F;&quot;&gt;Image Metadata Viewing with exiftool&lt;&#x2F;a&gt; - View detailed metadata for images and media files&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-media-preview-configuration&#x2F;&quot;&gt;Advanced Media Preview Configuration&lt;&#x2F;a&gt; - Customize file previews for various formats&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;&#x2F;posts&#x2F;ranger-sxiv-integration&#x2F;&quot;&gt;Ranger and sxiv Integration&lt;&#x2F;a&gt; - Create a seamless image viewing workflow&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
      <item>
          <title>Enhancing Ranger with fzf and bat: A Powerful File Search Integration</title>
          <pubDate>Fri, 18 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/ranger-fzf-bat-integration/</link>
          <guid>https://criticalbasics.xyz/posts/ranger-fzf-bat-integration/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/ranger-fzf-bat-integration/">&lt;p&gt;The ranger file manager is already a powerful tool for navigating your filesystem, but with the addition of &lt;code&gt;fzf&lt;&#x2F;code&gt; (fuzzy finder) and &lt;code&gt;bat&lt;&#x2F;code&gt; (syntax highlighter), you can supercharge your file searching capabilities. This guide will show you how to integrate these tools for a seamless and visually appealing search experience.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-18&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Created guide for integrating fzf and bat with ranger&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-prerequisites&quot;&gt;1. Prerequisites&lt;&#x2F;h2&gt;
&lt;p&gt;Before we begin, ensure you have the following tools installed on your system:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ranger&lt;&#x2F;strong&gt;: The terminal file manager&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;fzf&lt;&#x2F;strong&gt;: Command-line fuzzy finder&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;bat&lt;&#x2F;strong&gt;: A cat clone with syntax highlighting&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;installation-on-various-distributions&quot;&gt;Installation on Various Distributions&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Debian&#x2F;Ubuntu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install ranger fzf bat&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Arch Linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ranger fzf bat&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Fedora&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dnf install ranger fzf bat&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;&#x2F;strong&gt;: On some distributions, &lt;code&gt;bat&lt;&#x2F;code&gt; might be packaged as &lt;code&gt;batcat&lt;&#x2F;code&gt;. You can create an alias in your shell configuration file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; bat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;batcat&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-creating-the-custom-fzf-select-command&quot;&gt;2. Creating the Custom fzf_select Command&lt;&#x2F;h2&gt;
&lt;p&gt;The integration requires adding a custom command to ranger. This command will use &lt;code&gt;fzf&lt;&#x2F;code&gt; for searching and &lt;code&gt;bat&lt;&#x2F;code&gt; for file previews.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-1-create-or-edit-commands-py&quot;&gt;2.1. Create or Edit commands.py&lt;&#x2F;h3&gt;
&lt;p&gt;First, navigate to your ranger configuration directory and create or edit the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;touch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;commands.py&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don’t have a &lt;code&gt;commands.py&lt;&#x2F;code&gt; file yet, you can generate a template with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=commands&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;2-2-add-the-fzf-select-command&quot;&gt;2.2. Add the fzf_select Command&lt;&#x2F;h3&gt;
&lt;p&gt;Open the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file in your favorite text editor and add the following code:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt; ranger.api.commands&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; import&lt;&#x2F;span&gt;&lt;span&gt; Command&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; os&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; subprocess&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; fzf_select&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;Command&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    :fzf_select&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    Find a file or directory using fzf with preview using bat, excluding certain directories unless currently in them.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    &amp;quot;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    def&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; execute&lt;&#x2F;span&gt;&lt;span&gt;(self):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        exclude_dirs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;Remote&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;USBmount&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;NFSshares&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;Games_ROMS&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # List of directories to exclude&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        current_dir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.getcwd()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        base_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.basename(current_dir)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Check if the current directory is in the list of directories to exclude&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; base_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; exclude_dirs:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            find_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;find . -type f -o -type d&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;            # Construct the find command with exclusion criteria&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            exclude_opts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39; &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;.join(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;-path &amp;#39;.&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39; -prune -o&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; for&lt;&#x2F;span&gt;&lt;span&gt; d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span&gt; exclude_dirs)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            find_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;find . &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\\&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;( &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;exclude_opts&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; -false &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\\&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;) -o &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\\&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;( -type f -o -type d &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\\&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;) -print&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;find_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; | fzf --preview &amp;#39;[[ -f &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{{}}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ]] &amp;amp;&amp;amp; bat --style=numbers --color=always &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{{}}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; || echo &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{{}}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; is a directory&amp;#39; --preview-window=right:70%:wrap --exact&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        fzf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; subprocess.Popen(command,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; stdout&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;subprocess.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;PIPE&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; shell&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;True&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt; cwd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;current_dir)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        selected, _&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; fzf.communicate()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; fzf.returncode&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            selected&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; selected.strip()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            selected_path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; os.path.abspath(selected)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; os.path.isdir(selected_path):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;                # Change to the directory if it&amp;#39;s a directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.cd(selected_path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;            else&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;                # Open the file if it&amp;#39;s a file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                self&lt;&#x2F;span&gt;&lt;span&gt;.fm.select_file(selected_path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;            # Explicitly refresh the ranger window&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            self&lt;&#x2F;span&gt;&lt;span&gt;.fm.ui.redraw_window()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This command will:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Exclude specific directories from the search (unless you’re already in one of them)&lt;&#x2F;li&gt;
&lt;li&gt;Use &lt;code&gt;bat&lt;&#x2F;code&gt; for file previews and show a simple message for directories&lt;&#x2F;li&gt;
&lt;li&gt;Execute &lt;code&gt;fzf&lt;&#x2F;code&gt; with the appropriate options&lt;&#x2F;li&gt;
&lt;li&gt;Navigate to the selected file or directory&lt;&#x2F;li&gt;
&lt;li&gt;Explicitly refresh the ranger window after selection&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-creating-a-keyboard-shortcut&quot;&gt;3. Creating a Keyboard Shortcut&lt;&#x2F;h2&gt;
&lt;p&gt;Now that we have our custom command, let’s create a keyboard shortcut to invoke it easily.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-edit-rc-conf&quot;&gt;3.1. Edit rc.conf&lt;&#x2F;h3&gt;
&lt;p&gt;Open your ranger configuration file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you don’t have this file yet, you can generate it with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=rc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;3-2-add-the-keyboard-mapping&quot;&gt;3.2. Add the Keyboard Mapping&lt;&#x2F;h3&gt;
&lt;p&gt;Add the following line to map the &lt;code&gt;fzf_select&lt;&#x2F;code&gt; command to a keyboard shortcut. In this example, we’ll use &lt;code&gt;zi&lt;&#x2F;code&gt; (which stands for “zoom in”):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map zi fzf_select&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This shortcut is easy to remember as &lt;code&gt;zi&lt;&#x2F;code&gt; stands for “zoom in” - which is exactly what this command does: it zooms into your file structure to quickly find what you’re looking for.&lt;&#x2F;p&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Shortcut&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;zi&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;td&gt;Start fuzzy search with fzf and bat preview (“zoom in” to your files)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-advanced-configuration&quot;&gt;4. Advanced Configuration&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;4-1-customize-directory-exclusions&quot;&gt;4.1. Customize Directory Exclusions&lt;&#x2F;h3&gt;
&lt;p&gt;You can modify the list of directories to exclude from the search by changing the &lt;code&gt;exclude_dirs&lt;&#x2F;code&gt; list in the &lt;code&gt;fzf_select&lt;&#x2F;code&gt; command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;exclude_dirs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;Remote&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;USBmount&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;NFSshares&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;Games_ROMS&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;VirtualMachines&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Add or remove directories as needed&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-2-show-hidden-files&quot;&gt;4.2. Show Hidden Files&lt;&#x2F;h3&gt;
&lt;p&gt;If you want to include hidden files in your search, modify the &lt;code&gt;find_command&lt;&#x2F;code&gt; variable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;find_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;find . -type f -o -type d -name &amp;#39;.*&amp;#39; -o -type f -o -type d&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-3-customize-preview-options&quot;&gt;4.3. Customize Preview Options&lt;&#x2F;h3&gt;
&lt;p&gt;You can customize how &lt;code&gt;bat&lt;&#x2F;code&gt; displays file previews by modifying the preview part of the command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; = f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span&gt;find_command&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; | fzf --preview &amp;#39;[[ -f &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{{}}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ]] &amp;amp;&amp;amp; bat --style=full --color=always --line-range :150 &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{{}}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; || echo &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;{{}}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; is a directory&amp;#39; --preview-window=right:60%:wrap --exact&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This example:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Uses the “full” style for bat (includes line numbers, Git modifications, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;Shows up to 150 lines in the preview&lt;&#x2F;li&gt;
&lt;li&gt;Sets the preview window width to 60% of the terminal&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-usage&quot;&gt;5. Usage&lt;&#x2F;h2&gt;
&lt;p&gt;Once everything is set up, you can use your new fuzzy search capability:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Open ranger in your terminal&lt;&#x2F;li&gt;
&lt;li&gt;Press your configured shortcut (e.g., &lt;code&gt;zi&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Type to search for files&lt;&#x2F;li&gt;
&lt;li&gt;Use arrow keys to navigate through results&lt;&#x2F;li&gt;
&lt;li&gt;Press Enter to select a file or directory&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-troubleshooting&quot;&gt;6. Troubleshooting&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;6-1-command-not-found&quot;&gt;6.1. Command Not Found&lt;&#x2F;h3&gt;
&lt;p&gt;If you get a “Command not found” error when trying to use the shortcut:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure you’ve saved the &lt;code&gt;commands.py&lt;&#x2F;code&gt; file correctly&lt;&#x2F;li&gt;
&lt;li&gt;Restart ranger to load the new command&lt;&#x2F;li&gt;
&lt;li&gt;Check that &lt;code&gt;fzf&lt;&#x2F;code&gt; and &lt;code&gt;bat&lt;&#x2F;code&gt; are installed and in your PATH&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;6-2-preview-not-working&quot;&gt;6.2. Preview Not Working&lt;&#x2F;h3&gt;
&lt;p&gt;If file previews aren’t displaying:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Verify that &lt;code&gt;bat&lt;&#x2F;code&gt; is installed correctly&lt;&#x2F;li&gt;
&lt;li&gt;Try using &lt;code&gt;batcat&lt;&#x2F;code&gt; instead of &lt;code&gt;bat&lt;&#x2F;code&gt; if you’re on Debian&#x2F;Ubuntu&lt;&#x2F;li&gt;
&lt;li&gt;Check if your terminal supports the preview feature&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With this integration, you’ve significantly enhanced ranger’s search capabilities:&lt;&#x2F;p&gt;
&lt;p&gt;✅ Lightning-fast file searching with fuzzy matching
✅ Beautiful syntax-highlighted previews
✅ Seamless navigation to selected files
✅ Customizable interface and behavior&lt;&#x2F;p&gt;
&lt;p&gt;This setup combines the best of three powerful tools: ranger’s file management, fzf’s search capabilities, and bat’s beautiful syntax highlighting.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;ranger&amp;#x2F;ranger&amp;#x2F;wiki&amp;#x2F;Custom-Commands&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;RANGER CUSTOM COMMANDS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;junegunn&amp;#x2F;fzf&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🔍&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;FZF DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;sharkdp&amp;#x2F;bat&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🦇&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;BAT DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Advanced Media Preview Configuration in Ranger</title>
          <pubDate>Fri, 18 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/ranger-media-preview-configuration/</link>
          <guid>https://criticalbasics.xyz/posts/ranger-media-preview-configuration/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/ranger-media-preview-configuration/">&lt;p&gt;One of ranger’s most powerful features is its ability to preview various file types directly in the terminal. This guide shows you how to customize the preview system to support a wide range of media files with optimal display settings.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-18&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Created guide for customizing media previews in ranger&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-understanding-ranger-s-preview-system&quot;&gt;1. Understanding Ranger’s Preview System&lt;&#x2F;h2&gt;
&lt;p&gt;Ranger uses a script called &lt;code&gt;scope.sh&lt;&#x2F;code&gt; to generate previews for different file types. This script determines how to handle each file based on its MIME type or extension, then calls the appropriate external tools to generate a preview.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-1-the-preview-process&quot;&gt;1.1. The Preview Process&lt;&#x2F;h3&gt;
&lt;p&gt;When you select a file in ranger:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Ranger calls the &lt;code&gt;scope.sh&lt;&#x2F;code&gt; script&lt;&#x2F;li&gt;
&lt;li&gt;The script identifies the file type&lt;&#x2F;li&gt;
&lt;li&gt;It selects an appropriate preview method&lt;&#x2F;li&gt;
&lt;li&gt;The preview is displayed in the preview pane&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;1-2-default-configuration&quot;&gt;1.2. Default Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;By default, ranger comes with a sample &lt;code&gt;scope.sh&lt;&#x2F;code&gt; file, but it’s not automatically installed. You need to copy it to your configuration directory and customize it for your needs.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-setting-up-the-preview-script&quot;&gt;2. Setting Up the Preview Script&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;2-1-copy-the-default-scope-sh&quot;&gt;2.1. Copy the Default scope.sh&lt;&#x2F;h3&gt;
&lt;p&gt;First, create your ranger configuration directory if it doesn’t exist:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, copy the default &lt;code&gt;scope.sh&lt;&#x2F;code&gt; script:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --copy-config=scope&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will create &lt;code&gt;~&#x2F;.config&#x2F;ranger&#x2F;scope.sh&lt;&#x2F;code&gt; with the default configuration.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-2-make-the-script-executable&quot;&gt;2.2. Make the Script Executable&lt;&#x2F;h3&gt;
&lt;p&gt;Ensure the script is executable:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x ~&#x2F;.config&#x2F;ranger&#x2F;scope.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-installing-preview-dependencies&quot;&gt;3. Installing Preview Dependencies&lt;&#x2F;h2&gt;
&lt;p&gt;To get the most out of ranger’s preview capabilities, you’ll need to install various tools for different file types:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Debian&#x2F;Ubuntu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt update&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apt install highlight atool lynx mediainfo poppler-utils&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ffmpegthumbnailer imagemagick transmission-cli odt2txt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    python3-pygments catdoc docx2txt fontforge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Arch Linux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; highlight atool lynx mediainfo poppler ffmpegthumbnailer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    imagemagick transmission-cli python-pygments catdoc fontforge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Fedora&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; dnf install highlight atool lynx mediainfo poppler-utils ffmpegthumbnailer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    ImageMagick transmission python3-pygments catdoc fontforge&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Optional: Install xlsx2csv for spreadsheet previews&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; install xlsx2csv&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-customizing-the-preview-script&quot;&gt;4. Customizing the Preview Script&lt;&#x2F;h2&gt;
&lt;p&gt;Now let’s customize the &lt;code&gt;scope.sh&lt;&#x2F;code&gt; script to enhance the preview capabilities. Open the file in your favorite text editor:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;ranger&#x2F;scope.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-1-image-preview-configuration&quot;&gt;4.1. Image Preview Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Find the section that handles images and customize it:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;case&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Image previews&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #DBEDFF;&quot;&gt;    image&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;        # Use preview size of 1920px for large images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        local&lt;&#x2F;span&gt;&lt;span&gt; geometry&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;1920x1080&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        if&lt;&#x2F;span&gt;&lt;span&gt; [[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;mimetype&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;image&#x2F;svg+xml&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            convert&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            exiftool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -b -PreviewImage -w&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;            # If exiftool failed, try standard conversion&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;            convert&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}[0]&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -resize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;geometry&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-2-video-preview-with-ffmpegthumbnailer&quot;&gt;4.2. Video Preview with FFmpegthumbnailer&lt;&#x2F;h3&gt;
&lt;p&gt;Enhance the video preview section:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;video&#x2F;*&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Video preview using ffmpegthumbnailer&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    ffmpegthumbnailer&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -i&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -s 0 -q 10&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-3-pdf-preview-configuration&quot;&gt;4.3. PDF Preview Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Improve PDF preview with higher resolution:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;pdf&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Higher quality PDF preview (first page)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    pdftoppm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f 1 -l 1 -scale-to 1024 -singlefile -jpeg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;%&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-4-office-documents-preview&quot;&gt;4.4. Office Documents Preview&lt;&#x2F;h3&gt;
&lt;p&gt;Add better support for office documents:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Office documents&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;vnd.openxmlformats-officedocument.wordprocessingml.document&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;vnd.oasis.opendocument.text&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Convert to plain text&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    docx2txt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot; -&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    odt2txt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;vnd.openxmlformats-officedocument.spreadsheetml.sheet&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;vnd.oasis.opendocument.spreadsheet&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Convert to CSV&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    xlsx2csv&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-5-archive-content-preview&quot;&gt;4.5. Archive Content Preview&lt;&#x2F;h3&gt;
&lt;p&gt;Enhance archive preview:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Archives&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;zip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-rar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-7z-compressed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-bzip2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-gzip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-xz&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # List archive contents&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    atool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --list --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    bsdtar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --list --file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;4-6-syntax-highlighting-for-code&quot;&gt;4.6. Syntax Highlighting for Code&lt;&#x2F;h3&gt;
&lt;p&gt;Improve code syntax highlighting:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Syntax highlighting for code&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;text&#x2F;*&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Try to use pygmentize for syntax highlighting&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    env&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; COLORTERM=8bit bat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --color=always --style=plain&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    pygmentize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; terminal&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -O&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; style=monokai&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -g&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Fallback to cat if pygmentize is not available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    cat&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-advanced-customizations&quot;&gt;5. Advanced Customizations&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;5-1-custom-preview-size&quot;&gt;5.1. Custom Preview Size&lt;&#x2F;h3&gt;
&lt;p&gt;You can adjust the preview size by modifying your &lt;code&gt;rc.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add to ~&#x2F;.config&#x2F;ranger&#x2F;rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_images&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_images_method kitty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # or use: w3m, iterm2, terminology, urxvt, sixel&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_max_size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 10485760&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Don&amp;#39;t preview files larger than 10MB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-2-font-preview&quot;&gt;5.2. Font Preview&lt;&#x2F;h3&gt;
&lt;p&gt;Add font preview capability:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add to scope.sh under the case statement&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Note: This requires FontForge to be installed for the fontimage command&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;font&#x2F;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;font*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;|&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;x-font*&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    preview_png&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&#x2F;tmp&#x2F;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;basename&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;%&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;).png&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; fontimage&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;preview_png&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --pixelsize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;120&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --fontname \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --pixelsize&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;80&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  ABCDEFGHIJKLMNOPQRSTUVWXYZ  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  abcdefghijklmnopqrstuvwxyz  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  0123456789.:,;(*!?&amp;#39;)  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;                 --text&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;  The quick brown fox jumps over the lazy dog.  &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;                 &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        convert&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;preview_png&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;IMAGE_CACHE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;preview_png&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    else&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;        exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-3-audio-file-preview&quot;&gt;5.3. Audio File Preview&lt;&#x2F;h3&gt;
&lt;p&gt;Add audio file metadata preview:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add to scope.sh under the case statement&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;audio&#x2F;*&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Show audio metadata&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    mediainfo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    exiftool&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;FILE_PATH&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; exit 5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    exit 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-configuring-image-preview-methods&quot;&gt;6. Configuring Image Preview Methods&lt;&#x2F;h2&gt;
&lt;p&gt;Ranger supports several methods for displaying image previews in the terminal. You’ll need to configure both &lt;code&gt;scope.sh&lt;&#x2F;code&gt; and &lt;code&gt;rc.conf&lt;&#x2F;code&gt; to use them properly.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;6-1-available-preview-methods&quot;&gt;6.1. Available Preview Methods&lt;&#x2F;h3&gt;
&lt;p&gt;Add this to your &lt;code&gt;rc.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Choose one of these methods:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_images&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_images_method kitty&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Options: kitty, ueberzug, w3m, iterm2, terminology, urxvt, sixel&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Different methods work with different terminals:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;kitty&lt;&#x2F;strong&gt;: For the kitty terminal&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;ueberzug&lt;&#x2F;strong&gt;: Works with most terminals (requires python-ueberzug)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;w3m&lt;&#x2F;strong&gt;: Works with most terminals that support w3m&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;iterm2&lt;&#x2F;strong&gt;: For iTerm2 on macOS&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;terminology&lt;&#x2F;strong&gt;: For the Terminology terminal&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;urxvt&lt;&#x2F;strong&gt;: For urxvt with pixbuf support&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;sixel&lt;&#x2F;strong&gt;: For terminals with sixel support&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;6-2-installing-ueberzugpp-recommended&quot;&gt;6.2. Installing UeberzugPP (Recommended)&lt;&#x2F;h3&gt;
&lt;p&gt;For the best image preview experience across different terminals, install UeberzugPP. Note that the original Ueberzug project is no longer maintained, and UeberzugPP is the modern replacement with Wayland support:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For Arch Linux (via AUR)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;yay&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ueberzugpp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For other distributions (compile from source)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; clone https:&#x2F;&#x2F;github.com&#x2F;jstkdng&#x2F;ueberzugpp.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ueberzugpp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; build&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; build&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;cmake&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -DCMAKE_BUILD_TYPE=Release&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ..&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;make&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; make install&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Alternative: Install via pip (if available)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;pip&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; install ueberzugpp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then set in &lt;code&gt;rc.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_images&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_images_method ueberzug&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Note: Even though we’re using UeberzugPP, the method name in ranger’s configuration remains &lt;code&gt;ueberzug&lt;&#x2F;code&gt; for compatibility.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-testing-your-configuration&quot;&gt;7. Testing Your Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;After making changes to &lt;code&gt;scope.sh&lt;&#x2F;code&gt;, restart ranger and test the preview functionality:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to different file types&lt;&#x2F;li&gt;
&lt;li&gt;Check if the previews are displayed correctly&lt;&#x2F;li&gt;
&lt;li&gt;Adjust the configuration as needed&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;7-1-debugging-preview-issues&quot;&gt;7.1. Debugging Preview Issues&lt;&#x2F;h3&gt;
&lt;p&gt;If previews aren’t working as expected:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run ranger with the &lt;code&gt;--debug&lt;&#x2F;code&gt; flag:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --debug&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Check the output for errors related to the preview script&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Make sure all required dependencies are installed&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Verify that &lt;code&gt;scope.sh&lt;&#x2F;code&gt; is executable&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;8-practical-examples&quot;&gt;8. Practical Examples&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;8-1-image-gallery-browsing&quot;&gt;8.1. Image Gallery Browsing&lt;&#x2F;h3&gt;
&lt;p&gt;With proper image preview configuration, you can use ranger as an image browser:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to a directory with images&lt;&#x2F;li&gt;
&lt;li&gt;Use arrow keys to browse through images&lt;&#x2F;li&gt;
&lt;li&gt;See high-quality previews directly in the terminal&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;8-2-code-review&quot;&gt;8.2. Code Review&lt;&#x2F;h3&gt;
&lt;p&gt;With syntax highlighting enabled:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to source code files&lt;&#x2F;li&gt;
&lt;li&gt;See syntax-highlighted code in the preview pane&lt;&#x2F;li&gt;
&lt;li&gt;Quickly scan through multiple files&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;8-3-document-management&quot;&gt;8.3. Document Management&lt;&#x2F;h3&gt;
&lt;p&gt;With document preview support:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Browse through PDF documents&lt;&#x2F;li&gt;
&lt;li&gt;See previews of the first page&lt;&#x2F;li&gt;
&lt;li&gt;View plain text content of office documents&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;9-troubleshooting&quot;&gt;9. Troubleshooting&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;9-1-missing-dependencies&quot;&gt;9.1. Missing Dependencies&lt;&#x2F;h3&gt;
&lt;p&gt;If certain file types don’t preview correctly, you might be missing dependencies:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Check if a command is available&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;which&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ffmpegthumbnailer&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;which&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; convert&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;which&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pdftoppm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Install any missing tools using your package manager.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;9-2-terminal-compatibility&quot;&gt;9.2. Terminal Compatibility&lt;&#x2F;h3&gt;
&lt;p&gt;Not all terminals support all preview methods:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;If images don’t display, try a different &lt;code&gt;preview_images_method&lt;&#x2F;code&gt; in &lt;code&gt;rc.conf&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;For kitty terminal, make sure you’re using the kitty method&lt;&#x2F;li&gt;
&lt;li&gt;For other terminals, try ueberzug or w3m&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;9-3-large-files&quot;&gt;9.3. Large Files&lt;&#x2F;h3&gt;
&lt;p&gt;If ranger becomes slow when previewing large files:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add to rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; preview_max_size&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 5242880&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # Don&amp;#39;t preview files larger than 5MB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With these customizations to ranger’s preview system, you’ve enhanced your terminal file manager with rich media preview capabilities:&lt;&#x2F;p&gt;
&lt;p&gt;✅ High-quality image previews
✅ Video thumbnails
✅ PDF document previews
✅ Office document text extraction
✅ Syntax highlighting for code
✅ Archive content listing
✅ Font previews&lt;&#x2F;p&gt;
&lt;p&gt;This setup transforms ranger from a simple file manager into a powerful media browser that lets you quickly preview and navigate through various file types without leaving your terminal.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;ranger&amp;#x2F;ranger&amp;#x2F;wiki&amp;#x2F;Image-Previews&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🖼️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;RANGER IMAGE PREVIEWS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;ranger&amp;#x2F;ranger&amp;#x2F;wiki&amp;#x2F;Custom-Commands&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🔧&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;RANGER CUSTOM COMMANDS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;seebye&amp;#x2F;ueberzug&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;UEBERZUG DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>The Ultimate Guide to Email Encryption with OpenPGP</title>
          <pubDate>Tue, 15 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/e-mail-encryption-with-openpgp/</link>
          <guid>https://criticalbasics.xyz/posts/e-mail-encryption-with-openpgp/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/e-mail-encryption-with-openpgp/">&lt;p&gt;This guide provides a comprehensive, “terminal-first” approach to setting up robust end-to-end email encryption. By creating your cryptographic keys directly with GnuPG, you build a universal and secure foundation. We will then show you how to integrate this setup seamlessly with both Thunderbird, a user-friendly graphical client, and Neomutt, a powerful terminal-based client.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-15&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Major Restructure (Terminal-First):&lt;&#x2F;strong&gt; The entire guide was rewritten to prioritize key creation in the terminal (&lt;code&gt;gpg&lt;&#x2F;code&gt;), making it more robust, universal, and secure. This resolves platform-specific client issues.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-07-15&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Initial Version:&lt;&#x2F;strong&gt; Article created.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-pre-flight-check-your-system-s-foundation&quot;&gt;1. Pre-Flight Check – Your System’s Foundation&lt;&#x2F;h2&gt;
&lt;p&gt;Before we create any keys, we must ensure your system is correctly configured.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1-1-install-gnupg&quot;&gt;1.1. Install GnuPG&lt;&#x2F;h3&gt;
&lt;p&gt;This is the core encryption engine.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Debian&#x2F;Ubuntu:&lt;&#x2F;strong&gt; &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install gnupg&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Arch Linux:&lt;&#x2F;strong&gt; &lt;code&gt;sudo pacman -Syu gnupg&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;part-1-2&quot;&gt;1.2. Install and Configure &lt;code&gt;pinentry&lt;&#x2F;code&gt;&lt;&#x2F;h3&gt;
&lt;p&gt;When a program needs your key’s passphrase, GPG uses a helper application called &lt;code&gt;pinentry&lt;&#x2F;code&gt; to display a secure prompt. You must choose the right one for your environment.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Choose and Install the Right &lt;code&gt;pinentry&lt;&#x2F;code&gt; for Your Environment&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For standard Desktop Environments (GNOME, KDE, XFCE, etc.):&lt;&#x2F;strong&gt;
A graphical pop-up is the default. Install the appropriate package:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GNOME:&lt;&#x2F;strong&gt; &lt;code&gt;sudo apt install pinentry-gnome3&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;KDE Plasma:&lt;&#x2F;strong&gt; &lt;code&gt;sudo apt install pinentry-qt&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Arch Linux (most desktops):&lt;&#x2F;strong&gt; &lt;code&gt;sudo pacman -S pinentry&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For Tiling Window Managers (i3wm, sway, etc.) or Terminal-Enthusiasts (Recommended):&lt;&#x2F;strong&gt;
A graphical &lt;code&gt;pinentry&lt;&#x2F;code&gt; can “grab” focus and freeze your desktop. The terminal-based &lt;code&gt;pinentry-curses&lt;&#x2F;code&gt; is a much better solution as it runs directly in your terminal, allowing you to switch windows normally.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Debian&#x2F;Ubuntu:&lt;&#x2F;strong&gt; &lt;code&gt;sudo apt install pinentry-curses&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Arch Linux:&lt;&#x2F;strong&gt; &lt;code&gt;pinentry&lt;&#x2F;code&gt; is already included in the &lt;code&gt;pinentry&lt;&#x2F;code&gt; package.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Tell the GPG Agent Which Program to Use&lt;&#x2F;strong&gt;
We will now edit the GPG Agent configuration file.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the file with a terminal editor:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;nano&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.gnupg&#x2F;gpg-agent.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inside the &lt;code&gt;nano&lt;&#x2F;code&gt; editor,&lt;&#x2F;strong&gt; add &lt;strong&gt;ONE&lt;&#x2F;strong&gt; of the following lines, depending on your choice in Step 1. Ensure the other line is deleted or commented out with a &lt;code&gt;#&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For a terminal-based prompt (i3wm, sway - HIGHLY RECOMMENDED for this setup)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pinentry-program &#x2F;usr&#x2F;bin&#x2F;pinentry-curses&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# For a graphical prompt (GNOME, KDE, etc.)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# pinentry-program &#x2F;usr&#x2F;bin&#x2F;pinentry-gnome3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;default-cache-ttl 600&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;max-cache-ttl 7200&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;em&gt;Note: Verify the correct path with &lt;code&gt;which pinentry-gnome3&lt;&#x2F;code&gt; or &lt;code&gt;which pinentry-curses&lt;&#x2F;code&gt; if needed.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Save the file and exit &lt;code&gt;nano&lt;&#x2F;code&gt; (&lt;code&gt;Ctrl+X&lt;&#x2F;code&gt;, then &lt;code&gt;Y&lt;&#x2F;code&gt;, then &lt;code&gt;Enter&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Reload the agent to apply the new configuration:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg-connect-agent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; reloadagent &#x2F;bye&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-2&quot;&gt;2. Creating Your Master Key in the Terminal&lt;&#x2F;h2&gt;
&lt;p&gt;We will now create your OpenPGP key using the recommended interactive process.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Start the key generation process:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --full-generate-key&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Follow the prompts.&lt;&#x2F;strong&gt; The recommended choices are secure and robust:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Key Type:&lt;&#x2F;strong&gt; Select &lt;strong&gt;&lt;code&gt;(1) RSA and RSA&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Key Size:&lt;&#x2F;strong&gt; Enter &lt;strong&gt;&lt;code&gt;4096&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; bits.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Expiration Date:&lt;&#x2F;strong&gt; Enter &lt;strong&gt;&lt;code&gt;2y&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; (for 2 years). Keys should expire. This is a critical safety net that limits potential damage if a key is ever lost. Don’t worry, you can easily extend the validity before it expires, as shown in Part 3.5.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Confirm&lt;&#x2F;strong&gt; that the expiration date is correct by typing &lt;strong&gt;&lt;code&gt;y&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Provide Your User ID:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Real name:&lt;&#x2F;strong&gt; Enter your full name.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Email address:&lt;&#x2F;strong&gt; Enter the email address for this key.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Comment:&lt;&#x2F;strong&gt; You can leave this blank.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Confirm&lt;&#x2F;strong&gt; your details by typing &lt;strong&gt;&lt;code&gt;O&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; (for Okay).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set Your Passphrase:&lt;&#x2F;strong&gt;
A secure prompt will now appear (thanks to &lt;code&gt;pinentry&lt;&#x2F;code&gt;!). This will be the master password for your new private key.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            PASSPHRASE QUALITY IS CRITICAL
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;A weak passphrase makes your encrypted data vulnerable. Consider using a method like &lt;strong&gt;Diceware&lt;&#x2F;strong&gt; to generate a sequence of random words. If you lose this passphrase, you lose access to all data encrypted with this key permanently.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Congratulations, you have successfully created a secure, command-line-native OpenPGP key!&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-3&quot;&gt;3. Essential Security Practices (Don’t Skip This!)&lt;&#x2F;h2&gt;
&lt;p&gt;Immediately after creation, you must secure your new key for long-term use.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-1-identifying-your-key-the-key-id&quot;&gt;3.1. Identifying Your Key: The Key-ID&lt;&#x2F;h3&gt;
&lt;p&gt;From this point forward, we will use your key’s unique &lt;strong&gt;Key-ID&lt;&#x2F;strong&gt; to refer to it. This avoids any confusion if you ever have multiple keys for the same email address.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Find Your Key-ID:&lt;&#x2F;strong&gt; Run the following command.&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --list-secret-keys --keyid-format&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; LONG&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Identify the ID:&lt;&#x2F;strong&gt; In the output &lt;code&gt;sec rsa4096&#x2F;YOUR-KEY-ID ...&lt;&#x2F;code&gt;, the &lt;code&gt;YOUR-KEY-ID&lt;&#x2F;code&gt; is the long string of characters you will use in all subsequent commands.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-2-backup-your-private-key&quot;&gt;3.2. Backup Your Private Key&lt;&#x2F;h3&gt;
&lt;p&gt;A backup is not a backup until it’s tested. Use your newly found Key-ID here.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create the Backup:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;umask 077&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --export-secret-keys --armor&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR-KEY-ID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; private-key-backup.asc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Verify the Backup:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --dry-run --import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; private-key-backup.asc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;If this command runs without errors, your backup is valid. Now, store the &lt;code&gt;.asc&lt;&#x2F;code&gt; file in one or more &lt;strong&gt;extremely secure, offline locations&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-3-create-a-revocation-certificate&quot;&gt;3.3. Create a Revocation Certificate&lt;&#x2F;h3&gt;
&lt;p&gt;This is your emergency button. Use your Key-ID to specify which key to revoke.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;umask 077&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --gen-revoke --armor&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR-KEY-ID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; revocation-cert.asc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Store this file as securely as your private key backup.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-4-verify-keys-and-build-your-web-of-trust-the-core-of-pgp-s-security&quot;&gt;3.4. Verify Keys and Build Your Web of Trust: The Core of PGP’s Security&lt;&#x2F;h3&gt;
&lt;p&gt;This section is conceptually the most important part of the entire guide. It explains how you can be sure a public key truly belongs to the person it claims to.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;what-is-the-fingerprint&quot;&gt;What is the Fingerprint?&lt;&#x2F;h4&gt;
&lt;p&gt;When you run the command &lt;code&gt;gpg --fingerprint YOUR-KEY-ID&lt;&#x2F;code&gt;, you get an output like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ gpg --fingerprint 8A738464A2144E4C&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pub   rsa4096 2025-07-29 [SC] [expires: 2027-07-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      4A9E 9A72 85F5 F569 C17C  299B 8A73 8464 A214 4E4C&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uid        [ultimate] Delightful Dude &amp;lt;delightfuldude@criticalbasics.xyz&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sub   rsa4096 2025-07-29 [E] [expires: 2027-07-29]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;strong&gt;Fingerprint&lt;&#x2F;strong&gt; is the long line of 40 hexadecimal characters (often displayed in 10 blocks of 4 characters). It is like a human fingerprint: absolutely unique to this specific key. This is your key’s “ID card.”&lt;&#x2F;p&gt;
&lt;h4 id=&quot;the-verification-process-a-practical-example&quot;&gt;The Verification Process: A Practical Example&lt;&#x2F;h4&gt;
&lt;p&gt;Imagine you want to communicate securely with your friend, Anna.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: You acquire Anna’s public key.&lt;&#x2F;strong&gt;
Anna has published her key on her website (Method 4.1) or a keyserver (Method 4.2). You import it.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Example: You import Anna&amp;#39;s key from her website&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -sL&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; https:&#x2F;&#x2F;anna.example.com&#x2F;public.asc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --import&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Step 2: You check the key’s status.&lt;&#x2F;strong&gt;
Now, you view the fingerprint of Anna’s key in your keyring.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --fingerprint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; anna@example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output will contain a line that looks like this:
&lt;code&gt;uid [ unknown ] Anna Miller &amp;lt;anna@example.com&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;[ unknown ]&lt;&#x2F;code&gt; part is critical. It means: “I have this key, but I have absolutely no idea if it really belongs to Anna or to an attacker impersonating her.”&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 3: The actual verification (the human part).&lt;&#x2F;strong&gt;
To be sure, you must compare the fingerprint with Anna over a &lt;strong&gt;different, trusted channel&lt;&#x2F;strong&gt;. This is the most important step to prevent man-in-the-middle attacks.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;You meet Anna in person.&lt;&#x2F;li&gt;
&lt;li&gt;You call Anna or have a video call (with someone whose voice or face you recognize).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;During the conversation, the following happens:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You say:&lt;&#x2F;strong&gt; “Anna, I’m going to read you the fingerprint I have for your key. Does it start with 1234 ABCD…?”&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Anna says:&lt;&#x2F;strong&gt; “Yes, that’s correct. And does yours start with 0FDA EF41…?”&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;You say:&lt;&#x2F;strong&gt; “Yes, it does.”&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Now you both have certainty that you possess each other’s authentic key.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 4: Sign the key (digitally record your trust).&lt;&#x2F;strong&gt;
After verifying the key, you tell your GnuPG that you trust it. You do this by signing the foreign key with your own private key.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --sign-key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; anna@example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;GPG will show you Anna’s fingerprint again and ask if you are really sure. Confirm with &lt;code&gt;y&lt;&#x2F;code&gt;. You will need to enter your passphrase to authorize the signature with your private key.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 5: Check the result.&lt;&#x2F;strong&gt;
Run the fingerprint command again:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --fingerprint&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; anna@example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The output has now changed:
&lt;code&gt;uid [ full ] Anna Miller &amp;lt;anna@example.com&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;[ full ]&lt;&#x2F;code&gt; is your personal note: “I have personally verified this key. It’s authentic. I trust it completely.”&lt;&#x2F;p&gt;
&lt;p&gt;Through this process, you build your personal &lt;strong&gt;“Web of Trust”&lt;&#x2F;strong&gt;. If you trust Anna’s key, and Anna in turn trusts Bob’s key, you have a reason to lend some level of trust to Bob’s key as well.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;3-5-extending-your-key-s-validity-key-renewal&quot;&gt;3.5. Extending Your Key’s Validity (Key Renewal)&lt;&#x2F;h3&gt;
&lt;p&gt;An expiring key is a feature, not a problem. You do &lt;strong&gt;NOT&lt;&#x2F;strong&gt; need to start over. You can easily extend its life before it expires.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Start the Key-Editing Process:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --edit-key&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR-KEY-ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Extend the Expiration Date:&lt;&#x2F;strong&gt;
Inside the GPG prompt, type &lt;code&gt;expire&lt;&#x2F;code&gt;, enter a new duration (e.g., &lt;code&gt;2y&lt;&#x2F;code&gt;), and confirm.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Save Your Changes:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpg&amp;gt; save&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Distribute Your Updated Key:&lt;&#x2F;strong&gt;
You must re-publish your updated public key.&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --keyserver&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; hkps:&#x2F;&#x2F;keys.openpgp.org&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --send-keys&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR-KEY-ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;Also, send a newly signed email with your updated public key attached to your most important contacts.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-4&quot;&gt;4. Making Your Key Discoverable (Optional)&lt;&#x2F;h2&gt;
&lt;p&gt;A public key that only exists on your computer is like a phone number you never give out. For others to send you encrypted mail easily, you should distribute your public key.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-1-method-1-the-gold-standard-your-personal-website&quot;&gt;4.1. Method 1: The Gold Standard - Your Personal Website&lt;&#x2F;h3&gt;
&lt;p&gt;This is the most secure and authoritative method. You establish a “source of truth” that you control, avoiding issues with public servers.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Export your public key:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --export --armor&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR-KEY-ID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; public.asc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Upload the &lt;code&gt;public.asc&lt;&#x2F;code&gt; file to your website,&lt;&#x2F;strong&gt; for example, to &lt;code&gt;https:&#x2F;&#x2F;your-website.com&#x2F;public.asc&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;4-2-method-2-the-convenient-way-public-keyservers&quot;&gt;4.2. Method 2: The Convenient Way - Public Keyservers&lt;&#x2F;h3&gt;
&lt;p&gt;This method is more convenient but involves a trade-off with privacy.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Security Risk: NO.&lt;&#x2F;strong&gt; You only upload your &lt;strong&gt;public&lt;&#x2F;strong&gt; key.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Privacy Risk: YES.&lt;&#x2F;strong&gt; This publicly associates your email with PGP usage.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;The Solution: Use a Modern, Privacy-Respecting Keyserver.&lt;&#x2F;strong&gt;
This is why we exclusively recommend &lt;code&gt;keys.openpgp.org&lt;&#x2F;code&gt;. It requires your consent via email verification to publish your key.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Send Your Key to the Server:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --keyserver&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; hkps:&#x2F;&#x2F;keys.openpgp.org&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --send-keys&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; YOUR-KEY-ID&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Check Your Email:&lt;&#x2F;strong&gt; The keyserver will send you a verification email. You &lt;strong&gt;must click the link&lt;&#x2F;strong&gt; to finalize the publication.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-going-public-your-contact-page-and-email-signature&quot;&gt;5. Going Public: Your Contact Page and Email Signature&lt;&#x2F;h2&gt;
&lt;p&gt;Now that you have ways to distribute your key, you need to tell people about them.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;5-1-on-your-website-s-contact-page&quot;&gt;5.1. On Your Website’s Contact Page&lt;&#x2F;h3&gt;
&lt;p&gt;Add a section like this to your contact page. It provides clear instructions for everyone.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Digital Contact &amp;amp; Verification&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;h3&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;E-Mail:&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; your.name@example.com&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;OpenPGP Key:&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; For encrypted communication, you can get my public key here:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; href&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&#x2F;public.asc&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; download&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Download Public Key&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;a&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Or import via command line:&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;br&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;curl -sL https:&#x2F;&#x2F;your-website.com&#x2F;public.asc | gpg --import&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;li&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;ul&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Fingerprint for Verification:&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;strong&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;br&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;YOUR FINGERPRINT IN 4-DIGIT BLOCKS&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;code&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;em&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Policy: All legitimate emails from me will be digitally signed with this key.&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;em&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;5-2-in-your-email-signature&quot;&gt;5.2. In Your Email Signature&lt;&#x2F;h3&gt;
&lt;p&gt;A compact, professional signature in every email reinforces trust and makes verification easy.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-- &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Your Name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Website &amp;amp; PGP Key: https:&#x2F;&#x2F;your-website.com&#x2F;contact&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GPG Fingerprint: YOUR FINGERPRINT IN 4-DIGIT BLOCKS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This signature doesn’t overload the email but provides everything a recipient needs to verify your identity and find your key.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;part-6&quot;&gt;6. Integration with Thunderbird&lt;&#x2F;h2&gt;
&lt;p&gt;Once your key is created via the terminal, you need to tell Thunderbird to use it for your email account.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;In Thunderbird, open the &lt;strong&gt;Account Settings&lt;&#x2F;strong&gt; (via the “Hamburger” menu or &lt;code&gt;Tools&lt;&#x2F;code&gt; -&amp;gt; &lt;code&gt;Account Settings&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;In the left-hand sidebar, select the email account you want to secure (e.g., &lt;code&gt;delightfuldude@criticalbasics.xyz&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;Click on the &lt;strong&gt;End-To-End Encryption&lt;&#x2F;strong&gt; sub-menu for that account.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Now, you have two possible scenarios:&lt;&#x2F;p&gt;
&lt;h4 id=&quot;scenario-a-thunderbird-automatically-finds-your-key&quot;&gt;Scenario A: Thunderbird Automatically Finds Your Key&lt;&#x2F;h4&gt;
&lt;p&gt;If you’re lucky, Thunderbird has already detected the key you created in the terminal. You will see it listed and can select it directly from the dropdown menu to associate it with your account. If so, you’re done!&lt;&#x2F;p&gt;
&lt;h4 id=&quot;scenario-b-the-key-is-not-listed-manual-import&quot;&gt;Scenario B: The Key is Not Listed (Manual Import)&lt;&#x2F;h4&gt;
&lt;p&gt;More often, Thunderbird doesn’t immediately find externally created keys. If your key is not in the list, you must import it manually.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;In the same settings window, click the &lt;strong&gt;OpenPGP Key Manager…&lt;&#x2F;strong&gt; button.&lt;&#x2F;li&gt;
&lt;li&gt;A new “OpenPGP Key Manager” window will open. In its menu, go to &lt;strong&gt;File&lt;&#x2F;strong&gt; -&amp;gt; &lt;strong&gt;Import Secret Key(s) From File…&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;A file dialog will open. Navigate to and select the &lt;code&gt;private.asc&lt;&#x2F;code&gt; file you exported in &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;e-mail-encryption-with-openpgp&#x2F;#part-4&quot;&gt;&lt;strong&gt;Part 4&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;You will be prompted for the passphrase you created for your key. Enter it to complete the import.&lt;&#x2F;li&gt;
&lt;li&gt;After a successful import, your new key will appear in the Key Manager list. You can now close this window.&lt;&#x2F;li&gt;
&lt;li&gt;Back in the &lt;strong&gt;Account Settings&lt;&#x2F;strong&gt;, your newly imported key should now be available in the dropdown menu. Select it to finalize the setup.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            FURTHER HELP
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;For more detailed questions or troubleshooting, Mozilla provides an extensive FAQ page that is highly recommended:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;support.mozilla.org&#x2F;en-US&#x2F;kb&#x2F;openpgp-thunderbird-howto-and-faq&quot;&gt;Official Thunderbird Help: OpenPGP HOWTO and FAQ&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-integration-with-neomutt&quot;&gt;7. Integration with Neomutt&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;7-1-neomutt-configuration&quot;&gt;7.1. Neomutt Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Add these settings to &lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;muttrc&lt;&#x2F;code&gt;, using your unique Key-ID.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- GPG&#x2F;PGP Settings for Neomutt ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_verify_sig&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_good_sign&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;✅ Good OpenPGP signature from&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_autosign&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_replyencrypt&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_replysign&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Für neuere Neomutt-Versionen:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_replysign_encrypted&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Für ältere Neomutt-Versionen (falls obige Option einen Fehler verursacht):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# set crypt_replysign = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Use the Key-ID followed by an exclamation mark!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# This tells GPG to use *exactly* this key.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_sign_as&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;YOUR-KEY-ID!&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_timeout&lt;&#x2F;span&gt;&lt;span&gt; = 300&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_show_unusable&lt;&#x2F;span&gt;&lt;span&gt; = no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;8-advanced-topic-handling-multiple-accounts&quot;&gt;8. Advanced Topic: Handling Multiple Accounts&lt;&#x2F;h2&gt;
&lt;p&gt;For maximum security, use &lt;strong&gt;separate OpenPGP keys for each email account&lt;&#x2F;strong&gt;. This provides strong separation between your digital identities. This section covers the setup for Thunderbird and two common approaches for Neomutt.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Create Keys:&lt;&#x2F;strong&gt; For each identity (e.g., private, work), &lt;strong&gt;repeat the process in &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;e-mail-encryption-with-openpgp&#x2F;#part-2&quot;&gt;Part 2&lt;&#x2F;a&gt;&lt;&#x2F;strong&gt; to generate a new, dedicated key. Make sure to use the correct name and email address for each.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;8-1-thunderbird-integration&quot;&gt;8.1. Thunderbird Integration&lt;&#x2F;h3&gt;
&lt;p&gt;For each account you have set up in Thunderbird, follow &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;e-mail-encryption-with-openpgp&#x2F;#part-6&quot;&gt;&lt;strong&gt;Part 6&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt; to assign the correct existing key to the corresponding email address. Thunderbird handles the mapping automatically.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;8-2-neomutt-integration-two-approaches&quot;&gt;8.2. Neomutt Integration: Two Approaches&lt;&#x2F;h3&gt;
&lt;p&gt;For Neomutt, you can either switch accounts automatically based on the folder you are in, or manually via keyboard shortcuts.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;method-a-automatic-switching-with-folder-hooks&quot;&gt;Method A: Automatic Switching with Folder-Hooks&lt;&#x2F;h4&gt;
&lt;p&gt;This method uses &lt;code&gt;folder-hook&lt;&#x2F;code&gt; to automatically load the correct account configuration (including the PGP key) when you enter a specific mailbox.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Create the Directory Structure&lt;&#x2F;strong&gt;
First, organize your account configurations in a dedicated directory.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;neomutt&#x2F;accounts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Configure the Main &lt;code&gt;muttrc&lt;&#x2F;code&gt; for Hooks&lt;&#x2F;strong&gt;
Your main &lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;muttrc&lt;&#x2F;code&gt; will now act as a loader. Add the PGP defaults (if not already present) and the hooks.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- PGP Defaults (add to your main muttrc) ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_timeout&lt;&#x2F;span&gt;&lt;span&gt; = 300&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_verify_sig&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_good_sign&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;✅ Good OpenPGP signature from&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_show_unusable&lt;&#x2F;span&gt;&lt;span&gt; = no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Für neuere Neomutt-Versionen:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_replysign_encrypted&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Für ältere Neomutt-Versionen (falls obige Option einen Fehler verursacht):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# set crypt_replysign = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Account Hooks ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Load a specific config file when you enter a folder.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Replace the imap paths with your actual server paths.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;folder-hook &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;imaps:&#x2F;&#x2F;private@mail.com&#x2F;&amp;#39; &amp;#39;source ~&#x2F;.config&#x2F;neomutt&#x2F;accounts&#x2F;private.muttrc&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;folder-hook &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;imaps:&#x2F;&#x2F;work@company.com&#x2F;&amp;#39;   &amp;#39;source ~&#x2F;.config&#x2F;neomutt&#x2F;accounts&#x2F;work.muttrc&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Load a default account when Neomutt starts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;source ~&#x2F;.config&#x2F;neomutt&#x2F;accounts&#x2F;private.muttrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Create Per-Account Configuration Files&lt;&#x2F;strong&gt;
Create a separate file for each account inside &lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;accounts&#x2F;&lt;&#x2F;code&gt;. This is where you set the PGP key for each identity.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Example: &lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;accounts&#x2F;private.muttrc&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# --- Account: Private ---&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;private@mail.com&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;realname&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Your Name (Private)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_sign_as&lt;&#x2F;span&gt;&lt;span&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;YOUR-PRIVATE-KEY-ID!&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; # Get ID from Part 3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_autosign&lt;&#x2F;span&gt;&lt;span&gt; = yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ... your private imap_user, imap_pass, smtp_url, etc. go here&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;method-b-manual-switching-for-mutt-wizard-users&quot;&gt;Method B: Manual Switching (for &lt;code&gt;mutt-wizard&lt;&#x2F;code&gt; users)&lt;&#x2F;h4&gt;
&lt;p&gt;Many users rely on the popular &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;LukeSmithxyz&#x2F;mutt-wizard&quot;&gt;&lt;code&gt;mutt-wizard&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; script, which favors manual account switching via macros. If your &lt;code&gt;muttrc&lt;&#x2F;code&gt; contains lines like &lt;code&gt;macro index,pager i1 &#x27;source ...&#x27;&lt;&#x2F;code&gt;, this method is for you.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Locate Your Account Files&lt;&#x2F;strong&gt;
&lt;code&gt;mutt-wizard&lt;&#x2F;code&gt; creates a separate configuration file for each of your accounts, typically located in &lt;code&gt;~&#x2F;.config&#x2F;mutt&#x2F;accounts&#x2F;&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Add &lt;code&gt;pgp_sign_as&lt;&#x2F;code&gt; to Each Account File&lt;&#x2F;strong&gt;
For each account, edit its corresponding file and add the &lt;code&gt;pgp_sign_as&lt;&#x2F;code&gt; line to tell Neomutt which PGP key to use.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Get the &lt;strong&gt;Key-ID&lt;&#x2F;strong&gt; for the key you want to use with this account (as described in &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;e-mail-encryption-with-openpgp&#x2F;#part-3&quot;&gt;Part 3&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Open the account’s configuration file (e.g., &lt;code&gt;~&#x2F;.config&#x2F;mutt&#x2F;accounts&#x2F;delightfuldude@criticalbasics.xyz.muttrc&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Add the following line, replacing &lt;code&gt;YOUR-KEY-ID!&lt;&#x2F;code&gt; with the actual ID:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Inside e.g., ~&#x2F;.config&#x2F;mutt&#x2F;accounts&#x2F;delightfuldude@criticalbasics.xyz.muttrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ... existing settings like &amp;#39;set from&amp;#39;, &amp;#39;set realname&amp;#39;, etc.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Add this line to set the default PGP signing key for this account&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pgp_sign_as&lt;&#x2F;span&gt;&lt;span&gt; = YOUR-CRITICALBASICS-KEY-ID!&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;Result:&lt;&#x2F;strong&gt;
Now, when you use your keyboard macros (e.g., &lt;code&gt;i1&lt;&#x2F;code&gt;, &lt;code&gt;i2&lt;&#x2F;code&gt;) to switch accounts, Neomutt will load the correct email settings and automatically select the right PGP key for signing. Your existing workflow remains unchanged but is now PGP-aware.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;9-transferring-your-configuration-between-computers&quot;&gt;9. Transferring Your Configuration Between Computers&lt;&#x2F;h2&gt;
&lt;p&gt;One of the most common questions is: “How can I use my OpenPGP setup on multiple computers without repeating this entire tutorial?” The good news is that you can transfer your configuration between computers quite easily.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;9-1-what-files-to-transfer&quot;&gt;9.1. What Files to Transfer&lt;&#x2F;h3&gt;
&lt;p&gt;The most important directory is &lt;code&gt;~&#x2F;.gnupg&#x2F;&lt;&#x2F;code&gt;, which contains:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Your private and public keys&lt;&#x2F;li&gt;
&lt;li&gt;GPG Agent configuration&lt;&#x2F;li&gt;
&lt;li&gt;Trust database (Web of Trust)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Additionally, depending on your email client:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Thunderbird&lt;&#x2F;strong&gt;: Thunderbird accesses the GnuPG keyring directly, so transferring the &lt;code&gt;.gnupg&lt;&#x2F;code&gt; directory is sufficient.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Neomutt&lt;&#x2F;strong&gt;: You’ll also need to copy your configuration files:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;muttrc&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;~&#x2F;.config&#x2F;neomutt&#x2F;accounts&#x2F;&lt;&#x2F;code&gt; (if you have multiple accounts)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;9-2-transfer-process&quot;&gt;9.2. Transfer Process&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Secure Transfer&lt;&#x2F;strong&gt;: Use a secure channel for transferring these files (encrypted USB drive, encrypted file transfer).&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Copy the Directory&lt;&#x2F;strong&gt;: Copy the entire &lt;code&gt;.gnupg&lt;&#x2F;code&gt; directory to the same location on the target computer.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On the source computer, create a secure backup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -czf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; gnupg-backup.tar.gz&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~ .gnupg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Transfer securely to the target computer and extract&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# On the target computer:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;tar&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -xzf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; gnupg-backup.tar.gz&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -C&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Fix Permissions&lt;&#x2F;strong&gt;: After transferring, ensure proper permissions:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 700&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.gnupg&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 600&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.gnupg&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;*&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Adjust Pinentry Configuration&lt;&#x2F;strong&gt;: If the target system has a different desktop environment, you may need to modify the &lt;code&gt;pinentry-program&lt;&#x2F;code&gt; path in &lt;code&gt;~&#x2F;.gnupg&#x2F;gpg-agent.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Reload GPG Agent&lt;&#x2F;strong&gt;: After transferring, reload the GPG agent:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg-connect-agent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; reloadagent &#x2F;bye&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify the Setup&lt;&#x2F;strong&gt;: Test that your keys are available:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;gpg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --list-secret-keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;By following these steps, you can efficiently use your OpenPGP setup across multiple computers without repeating the entire configuration process.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;10-quick-troubleshooting&quot;&gt;10. Quick Troubleshooting&lt;&#x2F;h2&gt;

  



  





&lt;div class=&quot;styled-table-container&quot;&gt;
  &lt;table id=&quot;custom-table&quot; &gt;
    
      &lt;colgroup&gt;
        
          &lt;col width=&quot;40%&quot;&gt;
        
          &lt;col width=&quot;60%&quot;&gt;
        
      &lt;&#x2F;colgroup&gt;
    

    &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Problem&lt;&#x2F;th&gt;&lt;th&gt;Solution&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;“gpg: signing failed: Ambiguous specification”&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;You have multiple keys for one email. Use the unique &lt;strong&gt;Key-ID&lt;&#x2F;strong&gt; instead of the email address in your configuration (e.g., &lt;code&gt;pgp_sign_as&lt;&#x2F;code&gt; in Neomutt).&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;No password prompt appears&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Your &lt;code&gt;pinentry&lt;&#x2F;code&gt; program is missing or misconfigured. Go back to &lt;a href=&quot;#part-1-2&quot;&gt;&lt;strong&gt;Part 1.2&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt; and ensure it is installed and configured correctly.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;GPG Agent Issues&lt;&#x2F;strong&gt; (Passphrase not requested)&lt;&#x2F;td&gt;&lt;td&gt;The GPG agent might have a stale cache. Force a reload with: &lt;code&gt;gpg-connect-agent reloadagent &#x2F;bye&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;“Key not found” error&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;You don’t have the recipient’s public key. Ask them for it or search a keyserver.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;“gpg: signing failed: No secret key”&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;Your key might be expired, or GPG cannot find the correct secret key. Check &lt;code&gt;gpg --list-secret-keys&lt;&#x2F;code&gt; to ensure it’s present and valid.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Message shows “untrusted signature”&lt;&#x2F;strong&gt;&lt;&#x2F;td&gt;&lt;td&gt;You have the sender’s public key, but you haven’t marked it as trusted. Verify the fingerprint and then sign it.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;

  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;11-conclusion&quot;&gt;11. Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;By starting with a solid foundation—creating your keys directly in the terminal—you have built a robust and universal encryption setup. This method not only avoids platform-specific pitfalls but also equips you with a deeper understanding of how PGP works. By performing essential maintenance like backups, establishing a clear public identity, and renewing your keys, you ensure your digital identity remains secure and trustworthy for the long term.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.openpgp.org&amp;#x2F;docs&amp;#x2F;&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📚&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;OPENPGP DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;

&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;gnupg.org&amp;#x2F;documentation&amp;#x2F;index.html&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;🛡️&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;GNUPG DOCUMENTATION&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Tutorial: Integrating ranger and sxiv with Advanced Features</title>
          <pubDate>Sun, 06 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/ranger-sxiv-integration/</link>
          <guid>https://criticalbasics.xyz/posts/ranger-sxiv-integration/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/ranger-sxiv-integration/">&lt;p&gt;This tutorial combines all the necessary steps to seamlessly integrate &lt;strong&gt;sxiv&lt;&#x2F;strong&gt; and &lt;strong&gt;ranger&lt;&#x2F;strong&gt;, including:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Launching a gallery view from ranger&lt;&#x2F;li&gt;
&lt;li&gt;Configuring keybindings in ranger&lt;&#x2F;li&gt;
&lt;li&gt;Creating an interactive “Open with…” menu in sxiv&lt;&#x2F;li&gt;
&lt;li&gt;Opening ranger from within sxiv&lt;&#x2F;li&gt;
&lt;li&gt;Navigating and using shortcuts in sxiv&lt;&#x2F;li&gt;
&lt;li&gt;Increasing thumbnail sizes by recompiling sxiv&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Arch Linux&lt;&#x2F;strong&gt; (or a similar distro; this guide refers to &lt;code&gt;pacman&lt;&#x2F;code&gt; and the AUR)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;sxiv&lt;&#x2F;code&gt; and &lt;code&gt;ranger&lt;&#x2F;code&gt; installed&lt;&#x2F;li&gt;
&lt;li&gt;A terminal emulator (e.g., &lt;code&gt;xterm&lt;&#x2F;code&gt;, &lt;code&gt;urxvt&lt;&#x2F;code&gt;, &lt;code&gt;alacritty&lt;&#x2F;code&gt;, &lt;code&gt;kitty&lt;&#x2F;code&gt;)&lt;&#x2F;li&gt;
&lt;li&gt;Standard command-line tools (&lt;code&gt;file&lt;&#x2F;code&gt;, &lt;code&gt;grep&lt;&#x2F;code&gt;, &lt;code&gt;sed&lt;&#x2F;code&gt;, etc.)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;gtk-launch&lt;&#x2F;code&gt; (usually available via &lt;code&gt;xdg-utils&lt;&#x2F;code&gt; or a similar package)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-set-up-the-ranger-keybinding-launch-gallery&quot;&gt;1. Set Up the ranger Keybinding (Launch Gallery)&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open your ranger configuration file: &lt;code&gt;~&#x2F;.config&#x2F;ranger&#x2F;rc.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Add a line to open sxiv in &lt;strong&gt;thumbnail mode&lt;&#x2F;strong&gt; recursively using a key combination. For example, &lt;code&gt;gG&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Open sxiv in thumbnail mode (-t) recursively (-r) in the current directory (%d)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map gG shell sxiv -tr %d &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-t&lt;&#x2F;code&gt; enables &lt;strong&gt;thumbnail mode&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-r&lt;&#x2F;code&gt; searches subdirectories recursively.&lt;&#x2F;li&gt;
&lt;li&gt;The trailing &lt;code&gt;&amp;amp;&lt;&#x2F;code&gt; ensures that ranger &lt;strong&gt;does not&lt;&#x2F;strong&gt; wait for sxiv to close.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Save the file and reload the configuration in ranger with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;:reload_config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;or simply restart ranger.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-navigating-in-sxiv&quot;&gt;2. Navigating in sxiv&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open Gallery View:&lt;&#x2F;strong&gt;
Use &lt;code&gt;sxiv -tr &#x2F;path&#x2F;to&#x2F;your&#x2F;folder&lt;&#x2F;code&gt; to start directly in thumbnail mode.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open a Single Image:&lt;&#x2F;strong&gt;
Highlight an image in the gallery and press &lt;code&gt;Enter&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Switch Between Images (Single-Image Mode):&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;n&lt;&#x2F;code&gt; or &lt;code&gt;Space&lt;&#x2F;code&gt;: Next image&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;p&lt;&#x2F;code&gt; or &lt;code&gt;Backspace&lt;&#x2F;code&gt;: Previous image&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;]&lt;&#x2F;code&gt;: 10 images forward&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[&lt;&#x2F;code&gt;: 10 images backward&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;g&lt;&#x2F;code&gt;: First image, &lt;code&gt;G&lt;&#x2F;code&gt;: Last image&lt;&#x2F;li&gt;
&lt;li&gt;Right mouse click: Next image, Left mouse click: Previous image&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Zoom in the Gallery:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;+&lt;&#x2F;code&gt;: Zoom in&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;-&lt;&#x2F;code&gt;: Zoom out&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;blockquote&gt;
&lt;p&gt;To increase the maximum zoom level, you need to recompile sxiv (see Section 4).&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-interactive-open-with-and-ranger-integration-in-sxiv&quot;&gt;3. Interactive “Open with…” and Ranger Integration in sxiv&lt;&#x2F;h2&gt;
&lt;p&gt;We will create a &lt;strong&gt;key-handler script&lt;&#x2F;strong&gt; that allows the following:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;Ctrl-x r&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Opens ranger in a new terminal, selecting the current file.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;Ctrl-x o&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; (or any other key): Displays an interactive menu of all suitable applications and opens the image with the selected one.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;3-1-create-the-script&quot;&gt;3.1. Create the Script&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create the directory:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.config&#x2F;sxiv&#x2F;exec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Create the file &lt;code&gt;~&#x2F;.config&#x2F;sxiv&#x2F;exec&#x2F;key-handler&lt;&#x2F;code&gt; and paste the following content &lt;strong&gt;in its entirety&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#!&#x2F;usr&#x2F;bin&#x2F;env sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# ~&#x2F;.config&#x2F;sxiv&#x2F;exec&#x2F;key-handler&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Interactive script for sxiv:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# - Ctrl-x r → opens ranger in a new terminal with the current file selected&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# - Ctrl-x o (and others) → opens an &amp;quot;Open with…&amp;quot; menu to choose an application&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Robust handling of spaces, logging, and i3-compatible terminals&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Logfile for debugging and tracking&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;tmp&#x2F;sxiv-open.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;=== key-handler started $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;date&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;) ===&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Terminal emulator used to open the selection menu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Possible options: xterm, urxvt, alacritty, kitty …&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TERMWIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;${TERMWIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;:-&lt;&#x2F;span&gt;&lt;span&gt;urxvt}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;TERMWIN set to: &lt;&#x2F;span&gt;&lt;span&gt;$TERMWIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# $1 contains the key pressed after Ctrl-x&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;$1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Command argument: &lt;&#x2F;span&gt;&lt;span&gt;$cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Remove the prefix argument; all image paths follow via stdin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;shift&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Process each file individually (handles paths with spaces)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;while&lt;&#x2F;span&gt;&lt;span&gt; IFS&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; read -r&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; img&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Processing file: &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # === Ranger Integration (Ctrl-x r) ===&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;r&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Ranger Integration: Opening ranger in terminal for &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    # Ranger needs a terminal, so launch it via a terminal emulator&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$TERMWIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ranger&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --selectfile=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    continue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # === Default Open-with… Menu (Ctrl-x o or other keys) ===&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 1) Determine the MIME type of the file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --mime-type -b&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; MIME-Type: &lt;&#x2F;span&gt;&lt;span&gt;$mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 2) Find matching .desktop files for this MIME type&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  mapfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; apps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;lt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -Rl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;MimeType=.*&lt;&#x2F;span&gt;&lt;span&gt;$mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      &#x2F;usr&#x2F;share&#x2F;applications ~&#x2F;.local&#x2F;share&#x2F;applications&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; 2&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; xargs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -r -n1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; basename&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sort&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -u&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  if&lt;&#x2F;span&gt;&lt;span&gt; [ ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;#&lt;&#x2F;span&gt;&lt;span&gt;apps[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;@&lt;&#x2F;span&gt;&lt;span&gt;]}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -eq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;    echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; No matching applications found for MIME &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$mime&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    continue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; Found applications: ${&lt;&#x2F;span&gt;&lt;span&gt;apps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;]}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 3) Create temporary files for the list and the choice&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  list_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mktemp&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  tmp_choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mktemp&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  printf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;%s\n&amp;quot; &amp;quot;${&lt;&#x2F;span&gt;&lt;span&gt;apps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;@&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;]}&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$list_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; List file: &lt;&#x2F;span&gt;&lt;span&gt;$list_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; Choice file: &lt;&#x2F;span&gt;&lt;span&gt;$tmp_choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 4) Open the terminal selection menu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$TERMWIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; bash&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -lc&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    PS3=&amp;quot;Open with: &amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    # Read all entries into an array&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    IFS=$&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;\n&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39; read -rd &amp;quot;&amp;quot; -r -a options &amp;lt; &amp;quot;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$list_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    select opt in &amp;quot;${options[@]}&amp;quot;; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      # Write the choice to the temp file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      echo &amp;quot;$opt&amp;quot; &amp;gt; &amp;quot;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp_choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;      break&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;  &amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 5) Read the choice and clean up&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp_choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;  rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$list_file&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$tmp_choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; Selected: &lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -n&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; || continue&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 6) Find the full .desktop file path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  for&lt;&#x2F;span&gt;&lt;span&gt; d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;usr&#x2F;share&#x2F;applications ~&#x2F;.local&#x2F;share&#x2F;applications&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; ];&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$d&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;$choice&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;      break&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; Desktop entry: &lt;&#x2F;span&gt;&lt;span&gt;$desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 7) Read the Exec line and remove placeholders&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  exec_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;$(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;grep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -m1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;^Exec=&amp;#39; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$desktop&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;             |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cut&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -d= -f2- \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;             |&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; sed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -E&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;s&#x2F; %[fFuUdDnNickvm]&#x2F;&#x2F;g&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; Exec command: &lt;&#x2F;span&gt;&lt;span&gt;$exec_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  # 8) Execute the program with the image path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  eval&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$exec_cmd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; \&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;\&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;amp;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot; Application started for &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;$img&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# End of log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;=== key-handler finished ===&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;$LOG&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Make the script executable&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;chmod&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; +x ~&#x2F;.config&#x2F;sxiv&#x2F;exec&#x2F;key-handler&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;TERMWIN&lt;&#x2F;code&gt; variable (optional)&lt;&#x2F;strong&gt;:
If you want to use a terminal other than &lt;code&gt;urxvt&lt;&#x2F;code&gt;, like &lt;code&gt;alacritty&lt;&#x2F;code&gt;, add this to your &lt;code&gt;~&#x2F;.bashrc&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;~&#x2F;.profile&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;export&lt;&#x2F;span&gt;&lt;span&gt; TERMWIN&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;alacritty&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-thumbnail-sizes-optional-recompiling-sxiv&quot;&gt;4. Thumbnail Sizes (Optional: Recompiling sxiv)&lt;&#x2F;h2&gt;
&lt;p&gt;By default, the available thumbnail sizes in sxiv are limited to &lt;code&gt;{ 32, 64, 96, 128, 160 }&lt;&#x2F;code&gt; px. If 160px is too small, you can increase them as follows:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Get the sources from the AUR&lt;&#x2F;strong&gt; (example using &lt;code&gt;sxiv-git&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; clone https:&#x2F;&#x2F;aur.archlinux.org&#x2F;sxiv-git.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;cd&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; sxiv-git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Generate &lt;code&gt;config.h&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;make&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; config.h&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Adjust Thumbnail Sizes&lt;&#x2F;strong&gt;:
Open the &lt;code&gt;config.h&lt;&#x2F;code&gt; file and find the &lt;code&gt;_THUMBS_CONFIG&lt;&#x2F;code&gt; section.
Change the block to something like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;#ifdef&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; _THUMBS_CONFIG&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&#x2F;* thumbnail sizes in pixels (width == height): *&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;static const int&lt;&#x2F;span&gt;&lt;span&gt; thumb_sizes&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;[] =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 32&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 64&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 96&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 128&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 160&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 256&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 320&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 400&lt;&#x2F;span&gt;&lt;span&gt; };&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&#x2F;* default thumbnail size on startup (index in thumb_sizes[]): *&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;static const int&lt;&#x2F;span&gt;&lt;span&gt; THUMB_SIZE &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 5&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &#x2F;&#x2F; starts at 256 px&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;#endif&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compile and install&lt;&#x2F;strong&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;make&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; make install&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use the New Thumbnail Sizes&lt;&#x2F;strong&gt;:
In sxiv, sizes up to &lt;strong&gt;400px&lt;&#x2F;strong&gt; are now available. Use &lt;code&gt;+&lt;&#x2F;code&gt; to increase and &lt;code&gt;-&lt;&#x2F;code&gt; to decrease the size.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-summary-of-keybindings&quot;&gt;5. Summary of Keybindings&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;5-1-ranger-shortcuts&quot;&gt;5.1 Ranger Shortcuts&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Start sxiv gallery in current directory&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;gG&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h3 id=&quot;5-2-sxiv-gallery-mode-shortcuts&quot;&gt;5.2 sxiv Gallery Mode Shortcuts&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Open single-image view&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;Enter&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Mark an image (for multi-selection)&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;m&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Zoom in&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;+&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Zoom out&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;-&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;“Open with…” menu (interactive)&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;Ctrl-x o&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Open ranger in a new terminal with file selected&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;Ctrl-x r&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h3 id=&quot;5-3-sxiv-single-image-mode-shortcuts&quot;&gt;5.3 sxiv Single-Image Mode Shortcuts&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Next image&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;n&lt;&#x2F;code&gt; or &lt;code&gt;Space&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Previous image&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;p&lt;&#x2F;code&gt; or &lt;code&gt;Backspace&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;10 images forward&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;]&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;10 images backward&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;[&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;First image&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;g&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Last image&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;G&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Play&#x2F;stop GIF animation&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;Ctrl-Space&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-debugging-logs&quot;&gt;6. Debugging &amp;amp; Logs&lt;&#x2F;h2&gt;
&lt;p&gt;All actions from the &lt;code&gt;key-handler&lt;&#x2F;code&gt; script are logged to &lt;code&gt;&#x2F;tmp&#x2F;sxiv-open.log&lt;&#x2F;code&gt;. There you can see:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The key that was used (&lt;code&gt;ctrl-x r&lt;&#x2F;code&gt; or &lt;code&gt;ctrl-x o&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;The detected &lt;strong&gt;MIME type&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;The found &lt;code&gt;.desktop&lt;&#x2F;code&gt; entries.&lt;&#x2F;li&gt;
&lt;li&gt;The chosen application and the executed command.&lt;&#x2F;li&gt;
&lt;li&gt;The ranger call.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;=== key-handler started Mon Apr 28 18:01:20 CEST 2025 ===&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;TERMWIN set to: xterm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Command argument: o&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Processing file: &amp;#39;&#x2F;home&#x2F;...&#x2F;Example.png&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; MIME-Type: image&#x2F;png&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Found applications: gimp.desktop firefox.desktop ...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;List file: &#x2F;tmp&#x2F;tmp.XXXXXX&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Choice file: &#x2F;tmp&#x2F;tmp.YYYYYY&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Selected: gimp.desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Desktop entry: &#x2F;usr&#x2F;share&#x2F;applications&#x2F;gimp.desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Exec command: gimp-3.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Application started for &amp;#39;&#x2F;home&#x2F;...&#x2F;Example.png&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;=== key-handler finished ===&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If something goes wrong, you can check the log:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;less&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &#x2F;tmp&#x2F;sxiv-open.log&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</description>
      </item>
      <item>
          <title>Vim Tip: How to Insert the Current Time with a Shortcut</title>
          <pubDate>Thu, 03 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/vim-time-insert/</link>
          <guid>https://criticalbasics.xyz/posts/vim-time-insert/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/vim-time-insert/">&lt;p&gt;When keeping a journal, logging meetings, or documenting events, an accurate timestamp is invaluable. However, manually typing the time is cumbersome and interrupts your writing flow.&lt;&#x2F;p&gt;
&lt;p&gt;In this short guide, you’ll learn how to use a single, clever line in your &lt;code&gt;.vimrc&lt;&#x2F;code&gt; to create a shortcut that lets you insert the current time instantly and effortlessly at any position.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;the-solution-a-shortcut-for-insert-mode&quot;&gt;The Solution: A Shortcut for Insert Mode&lt;&#x2F;h2&gt;
&lt;p&gt;This method is ideal when you’re in the middle of writing and want to insert a timestamp directly into the text, for example:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;14:32 – Call from the project manager&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;To do this, simply add the following line to your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Insert the current time (HH:MM) in insert mode with &amp;lt;leader&amp;gt;t&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;inoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;t &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;C-R&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;%H:%M&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;how-it-works&quot;&gt;How It Works&lt;&#x2F;h3&gt;
&lt;p&gt;This single line is a perfect example of Vim’s power:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;inoremap &amp;lt;leader&amp;gt;t&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Defines a key mapping (by default &lt;code&gt;\t&lt;&#x2F;code&gt;) exclusively for &lt;strong&gt;insert mode&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;C-R&amp;gt;=&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: This is the magic part. In insert mode, &lt;code&gt;Ctrl-R&lt;&#x2F;code&gt; normally inserts the content of a register. When you add an equals sign (&lt;code&gt;=&lt;&#x2F;code&gt;), Vim opens a mini-command line and evaluates the following expression.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;strftime(&#x27;%H:%M&#x27;)&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: This is a built-in Vim function that returns the current time, formatted. &lt;code&gt;%H&lt;&#x2F;code&gt; stands for the hour (24h) and &lt;code&gt;%M&lt;&#x2F;code&gt; for the minute.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;CR&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Confirms the function, inserts its result (the time) at the cursor’s position, and seamlessly returns you to insert mode.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;How to use it:&lt;&#x2F;strong&gt; The next time you’re typing in a note, just press &lt;code&gt;\&lt;&#x2F;code&gt; followed by &lt;code&gt;t&lt;&#x2F;code&gt;, and the current timestamp will appear instantly in the text.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;customize-it-to-your-needs&quot;&gt;Customize It to Your Needs&lt;&#x2F;h2&gt;
&lt;p&gt;The best part of this method is its flexibility. You can customize the timestamp format however you like by changing the string inside the &lt;code&gt;strftime()&lt;&#x2F;code&gt; function.&lt;&#x2F;p&gt;
&lt;p&gt;Here are a few popular alternatives for your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; -- EXAMPLE 1: Time with seconds --&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;inoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;ts&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;C-R&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;%H:%M:%S&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; -- EXAMPLE 2: Full date and time (ISO standard) --&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;inoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;dt &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;C-R&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;%Y-%m-%d %H:%M&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; -- EXAMPLE 3: US Date Format --&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;inoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;us &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;C-R&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;%m&#x2F;%d&#x2F;%Y %I:%M %p&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;bonus-inserting-a-timestamp-in-normal-mode&quot;&gt;Bonus: Inserting a Timestamp in Normal Mode&lt;&#x2F;h2&gt;
&lt;p&gt;Sometimes you might want to insert a timestamp on its own new line. For that, a normal mode shortcut is better suited.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Insert the current time on a new line below the current one&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;T :put &lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;strftime&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;%H:%M&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;With this mapping, you can press &lt;code&gt;\T&lt;&#x2F;code&gt; in normal mode, and the time will be placed cleanly on the next line.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With this simple trick, you’ve further optimized your workflow:&lt;&#x2F;p&gt;
&lt;p&gt;✅ You can insert timestamps instantly with a keystroke, without interrupting your flow.
✅ The format is fully customizable to your needs.
✅ The solution is lean, fast, and uses built-in Vim features without any extra plugins.&lt;&#x2F;p&gt;
&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;vimhelp.org&amp;#x2F;eval.txt.html#strftime()&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📂&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;EXPLORE ALL STRFTIME() OPTIONS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;hr &#x2F;&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHAT&amp;#x27;S NEXT?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Now that you’ve mastered timestamps, discover how to perfect links, navigation, and task management in our &lt;a href=&quot;&#x2F;posts&#x2F;vimwiki-workflow-mastered&quot;&gt;Vimwiki Workflow Guide&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
</description>
      </item>
      <item>
          <title>A Guide to Zathura: The Minimalist PDF Viewer</title>
          <pubDate>Thu, 03 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/zathura-pdf-viewer/</link>
          <guid>https://criticalbasics.xyz/posts/zathura-pdf-viewer/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/zathura-pdf-viewer/">&lt;p&gt;This tutorial will guide you through installing, configuring, and using &lt;strong&gt;Zathura&lt;&#x2F;strong&gt; with the &lt;strong&gt;MuPDF backend&lt;&#x2F;strong&gt; on Arch Linux, specifically tailored for an &lt;strong&gt;i3wm&lt;&#x2F;strong&gt; environment. It covers installation, configuration, printing, and a comprehensive overview of the most important shortcuts.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;1-introduction&quot;&gt;1. Introduction&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;Zathura&lt;&#x2F;strong&gt; is a lightweight yet powerful PDF viewer that features a minimalist user interface, making it an excellent fit for lightweight window managers like &lt;strong&gt;i3wm&lt;&#x2F;strong&gt;. By using plugin backends like &lt;strong&gt;MuPDF&lt;&#x2F;strong&gt; or &lt;strong&gt;Poppler&lt;&#x2F;strong&gt;, you can maintain a minimal setup without sacrificing essential features such as search, bookmarks, or printing.&lt;&#x2F;p&gt;
&lt;p&gt;Advantages of Zathura:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Very few dependencies&lt;&#x2F;strong&gt; (only Girara&#x2F;GTK, and a backend like MuPDF or Poppler)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Keyboard-centric control&lt;&#x2F;strong&gt; (ideal for i3wm)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Extensible via plugins&lt;&#x2F;strong&gt; (e.g., for Synctex or annotations)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Highly configurable&lt;&#x2F;strong&gt; through a simple text file&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;2-installation&quot;&gt;2. Installation&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install Zathura &amp;amp; the MuPDF Backend&lt;&#x2F;strong&gt;
Open a terminal and execute the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; zathura zathura-pdf-mupdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Launch Zathura&lt;&#x2F;strong&gt;
After installation, you can open a PDF file like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;zathura&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; document.pdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;3-setting-zathura-as-the-default-pdf-viewer&quot;&gt;3. Setting Zathura as the Default PDF Viewer&lt;&#x2F;h2&gt;
&lt;p&gt;If you were previously using a different viewer like &lt;strong&gt;Evince&lt;&#x2F;strong&gt; (e.g., in &lt;code&gt;mimeapps.list&lt;&#x2F;code&gt;), your configuration might look like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;application&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pdf&lt;&#x2F;span&gt;&lt;span&gt;=org.gnome.Evince.desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To make Zathura the new default for PDF files, you need to add or edit the following line in your &lt;code&gt;~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;code&gt; (or &lt;code&gt;~&#x2F;.local&#x2F;share&#x2F;applications&#x2F;mimeapps.list&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;[Default Applications]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;application&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;pdf&lt;&#x2F;span&gt;&lt;span&gt;=org.pwmt.zathura.desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This sets Zathura as the default application for the &lt;code&gt;application&#x2F;pdf&lt;&#x2F;code&gt; MIME type.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;4-configuring-zathura&quot;&gt;4. Configuring Zathura&lt;&#x2F;h2&gt;
&lt;p&gt;Zathura reads its configuration from &lt;code&gt;~&#x2F;.config&#x2F;zathura&#x2F;zathurarc&lt;&#x2F;code&gt;. Here is an example of a minimal configuration:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# ~&#x2F;.config&#x2F;zathura&#x2F;zathurarc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# 1. Set the default backend to MuPDF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set pdf-mupdf true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# 2. Adjust page to fit width on open&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set adjust-open &amp;quot;fit-width&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# 3. Set default zoom level (100%)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set zoom 1.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# 4. Remap keys (optional)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map &amp;lt;C-f&amp;gt; search-forward&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;map &amp;lt;C-b&amp;gt; search-backward&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# 5. Set bookmark file path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;set bookmark-path &amp;quot;~&#x2F;.config&#x2F;zathura&#x2F;bookmarks&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;explanation-of-key-options&quot;&gt;Explanation of Key Options&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;set pdf-mupdf true&lt;&#x2F;code&gt;: Specifies that Zathura should use the MuPDF backend instead of Poppler.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;set adjust-open &quot;fit-width&quot;&lt;&#x2F;code&gt;: Automatically fits the page to the window’s width when opening a document.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;set zoom 1.0&lt;&#x2F;code&gt;: Sets the default zoom level to 100%.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;map &amp;lt;C-f&amp;gt; search-forward&lt;&#x2F;code&gt;: Remaps &lt;code&gt;Ctrl+f&lt;&#x2F;code&gt; for searching forward.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;map &amp;lt;C-b&amp;gt; search-backward&lt;&#x2F;code&gt;: Remaps &lt;code&gt;Ctrl+b&lt;&#x2F;code&gt; for searching backward.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;set bookmark-path &quot;...&quot;&lt;&#x2F;code&gt;: Defines the directory where bookmark files are stored.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;5-printing-functionality&quot;&gt;5. Printing Functionality&lt;&#x2F;h2&gt;
&lt;p&gt;Zathura supports printing directly via GTK. To print a PDF:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Open the PDF in Zathura:&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;zathura&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; document.pdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;In the viewer, simply press &lt;code&gt;P&lt;&#x2F;code&gt; or enter the command:&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:print&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;The standard &lt;strong&gt;GTK print dialog&lt;&#x2F;strong&gt; will open, allowing you to select a printer, page range, scaling, and other options.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Internally, GTK generates a temporary PDF (using Cairo) and sends it to &lt;strong&gt;CUPS&lt;&#x2F;strong&gt;, so no additional plugins are usually necessary.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;&#x2F;strong&gt; If you prefer to print directly from the shell, you can always use:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;lp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; document.pdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This works independently of your chosen PDF viewer.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;6-overview-of-essential-keyboard-shortcuts&quot;&gt;6. Overview of Essential Keyboard Shortcuts&lt;&#x2F;h2&gt;
&lt;p&gt;Zathura is heavily designed for keyboard control. Below are the most useful shortcuts organized by category.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;6-1-navigation&quot;&gt;6.1 Navigation&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Next Page&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;j&lt;&#x2F;code&gt; or &lt;code&gt;↓&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Previous Page&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;k&lt;&#x2F;code&gt; or &lt;code&gt;↑&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;First Page&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;gg&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Last Page&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;G&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Go to Specific Page&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;:page &amp;lt;number&amp;gt;&lt;&#x2F;code&gt; (e.g., &lt;code&gt;:page 10&lt;&#x2F;code&gt;)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h3 id=&quot;6-2-zoom-view&quot;&gt;6.2 Zoom &amp;amp; View&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Zoom In&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zi&lt;&#x2F;code&gt; or &lt;code&gt;+&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Zoom Out&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zo&lt;&#x2F;code&gt; or &lt;code&gt;-&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Original Size&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zr&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Fit to Width&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zb&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Fit to Height&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;zh&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Toggle Fullscreen&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;f&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h3 id=&quot;6-3-search-bookmarks&quot;&gt;6.3 Search &amp;amp; Bookmarks&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Search Forward&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;&#x2F;&lt;&#x2F;code&gt; followed by search term&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Search Backward&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;?&lt;&#x2F;code&gt; followed by search term&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Next Search Result&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;n&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Previous Search Result&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;N&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Add Bookmark&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;m&lt;&#x2F;code&gt; (then choose a letter)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Open Bookmark List&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;:bookmarks&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Jump to Bookmark&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;`&lt;&#x2F;code&gt; followed by the letter&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h3 id=&quot;6-4-document-operations&quot;&gt;6.4 Document Operations&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Print&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;P&lt;&#x2F;code&gt; or &lt;code&gt;:print&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Reload Document&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;R&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Open Console (Command line in viewer)&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;:&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h3 id=&quot;6-5-general-commands&quot;&gt;6.5 General Commands&lt;&#x2F;h3&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Command&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Show Help&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;H&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Reload Configuration&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;:config-reload&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Quit&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;q&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;&#x2F;strong&gt; Many of these commands can be remapped in &lt;code&gt;~&#x2F;.config&#x2F;zathura&#x2F;zathurarc&lt;&#x2F;code&gt;. See Section 4 for examples.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;7-summary&quot;&gt;7. Summary&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Installation:&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;sudo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; pacman&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -S&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; zathura zathura-pdf-mupdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;```&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;   **&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;Set as Default PDF Viewer:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;**&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;In&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; `&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;~&#x2F;.config&#x2F;mimeapps.list&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;`&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;```&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;ini&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[Default Applications]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;application&#x2F;pdf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;=org.pwmt.zathura.desktop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Configuration:&lt;&#x2F;strong&gt; Via &lt;code&gt;~&#x2F;.config&#x2F;zathura&#x2F;zathurarc&lt;&#x2F;code&gt; (see example file).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Usage:&lt;&#x2F;strong&gt; Keyboard-centric, with quick access to search, zoom, bookmarks, and printing (&lt;code&gt;P&lt;&#x2F;code&gt; &#x2F; &lt;code&gt;:print&lt;&#x2F;code&gt;).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Printing:&lt;&#x2F;strong&gt; Opens the GTK print dialog, using CUPS via Cairo.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Zathura is ideal for users who want a lean, fast-starting PDF viewer with essential features, without the heavy dependencies of large desktop environments like GNOME or KDE.&lt;&#x2F;p&gt;
&lt;p&gt;Enjoy reading with Zathura on i3wm&lt;&#x2F;p&gt;
</description>
      </item>
      <item>
          <title>Dual Journaling with Vimwiki: How to Separate Personal and Business Notes</title>
          <pubDate>Wed, 02 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/vimwiki-dual-journaling/</link>
          <guid>https://criticalbasics.xyz/posts/vimwiki-dual-journaling/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/vimwiki-dual-journaling/">&lt;p&gt;In the &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;vimwiki-journaling-tutorial&#x2F;&quot;&gt;previous post&lt;&#x2F;a&gt;, we built a powerful journaling system using Vimwiki. It’s a fantastic setup, but as you use it more, a common problem emerges: professional meeting notes mix with personal reflections, and work to-dos get tangled with weekend plans.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-02&lt;&#x2F;td&gt;&lt;td&gt;&lt;strong&gt;Created a direct workflow for general notes:&lt;&#x2F;strong&gt; Added a new custom function (&lt;code&gt;CreateGeneralNote&lt;&#x2F;code&gt;) and corresponding shortcuts (&lt;code&gt;\nb&lt;&#x2F;code&gt;, &lt;code&gt;\np&lt;&#x2F;code&gt;) to directly create topic-based notes with a filename prompt, addressing a major workflow flaw.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-20&lt;&#x2F;td&gt;&lt;td&gt;Major Revision: Clarified Wiki vs. Journal distinction, improved naming consistency for directories, and created more intuitive shortcuts.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-19&lt;&#x2F;td&gt;&lt;td&gt;Initial version of the article.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;p&gt;This guide will show you how to build a &lt;strong&gt;dual-wiki system&lt;&#x2F;strong&gt; to cleanly separate your personal and business notes. We will cover how to create both daily &lt;strong&gt;Journal Entries&lt;&#x2F;strong&gt; and topic-based &lt;strong&gt;General Notes&lt;&#x2F;strong&gt; in their correct contexts.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-1-understanding-the-structure&quot;&gt;Step 1: Understanding the Structure&lt;&#x2F;h2&gt;
&lt;p&gt;Before we configure anything, let’s understand the hierarchy we are building. A &lt;strong&gt;Wiki&lt;&#x2F;strong&gt; is the main container for a context (e.g., “Business”). Within that wiki, there are two types of notes:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;General Notes:&lt;&#x2F;strong&gt; Topic-based pages like “Project Alpha Ideas” or “Meeting Checklists”. They live in the root of the wiki.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Journal Entries:&lt;&#x2F;strong&gt; Date-based, daily logs. They live in the &lt;code&gt;diary&#x2F;&lt;&#x2F;code&gt; subdirectory.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This is the structure we will create:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;~&#x2F;Nextcloud&#x2F;Notes&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;├── wiki-business&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   ├── diary&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   │   └── 2025-07-04.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   ├── Project Alpha.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   └── index.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│   └── template-business-journal.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;│&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;└── wiki-personal&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ├── diary&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    │   └── 2025-07-04.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ├── Holiday Plans.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    └── index.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    └── template-personal-journal.md&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This clean separation is the key to an organized system.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-2-update-your-vimwiki-configuration&quot;&gt;Step 2: Update Your Vimwiki Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;First, configure your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt; to define the two wikis. Using &lt;code&gt;expand(&#x27;~&#x27;)&lt;&#x2F;code&gt; makes the configuration robust.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Vimwiki Configuration for multiple wikis&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_list&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;path&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;expand&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;~&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki-business&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;diary_template&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;template-business-journal.md&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;syntax&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;markdown&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;ext&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.md&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span&gt; },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;path&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;expand&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;~&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki-personal&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;diary_template&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;template-personal-journal.md&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;syntax&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;markdown&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;ext&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.md&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;\&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Optional: Set a default wiki (1=first, 2=second).&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_start_wiki&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 2&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; &amp;quot; Make the personal wiki the default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; These settings apply to all wikis in the list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_markdown_link_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_auto_diary_index&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, create the necessary directories in your terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki-business&#x2F;diary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki-personal&#x2F;diary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-3-create-context-specific-journal-templates&quot;&gt;Step 3: Create Context-Specific Journal Templates&lt;&#x2F;h2&gt;
&lt;p&gt;Create a unique template for each journal. Each template file must be placed in the &lt;strong&gt;root directory of its corresponding wiki&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;business-journal-template&quot;&gt;Business Journal Template&lt;&#x2F;h4&gt;
&lt;p&gt;Create the file &lt;code&gt;~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki-business&#x2F;template-business-journal.md&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;# %Y-%m-%d — Business Journal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 🎯 Today&amp;#39;s Top 3 Priorities&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [ ] &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [ ] &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [ ] &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;personal-journal-template&quot;&gt;Personal Journal Template&lt;&#x2F;h4&gt;
&lt;p&gt;Create the file &lt;code&gt;~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki-personal&#x2F;template-personal-journal.md&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;# %Y-%m-%d — Personal Journal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 🙏 Gratitude&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 💡 Ideas &amp;amp; Thoughts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;step-4-the-core-solution-custom-vim-functions&quot;&gt;Step 4: The Core Solution: Custom Vim Functions&lt;&#x2F;h2&gt;
&lt;p&gt;A standard Vimwiki installation has two limitations for our workflow:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;:VimwikiMakeDiaryNote&lt;&#x2F;code&gt; does not automatically apply templates.&lt;&#x2F;li&gt;
&lt;li&gt;There is no direct command to create a new, named topic note.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;We will solve both issues with two dedicated functions in our &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;in-your-vimrc&quot;&gt;In Your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;&lt;&#x2F;h4&gt;
&lt;p&gt;Add these two functions and their corresponding shortcuts to your Vim configuration.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; ----- FUNCTION 1: FOR DAILY JOURNAL ENTRIES -----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;function!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; OpenJournalWithTemplate&lt;&#x2F;span&gt;&lt;span&gt;(wiki_index)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Switch to the correct wiki context&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  execute&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;VimwikiTabIndex &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span&gt;a:wiki_index&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Create or open today&amp;#39;s diary note&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  VimwikiMakeDiaryNote&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; CRITICAL: Force Vim to update its state before we check the file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  redraw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Check if the file is new and empty&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; line&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;$&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; &amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;getline&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; ==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; l:wiki_config&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_list[a:wiki_index&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; - &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; l:template_path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; l:wiki_config.path&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span&gt;l:wiki_config.diary_template&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &amp;quot; If the template file exists, read its content into our new file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; filereadable&lt;&#x2F;span&gt;&lt;span&gt;(l:template_path)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;      execute&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;0read &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span&gt;l:template_path&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      1delete&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; &amp;quot; Delete the initial empty line&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;      normal!&lt;&#x2F;span&gt;&lt;span&gt; gg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; &amp;quot; Go to the top&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    endif&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  endif&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;endfunction&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; ----- FUNCTION 2: FOR GENERAL TOPIC NOTES -----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;function!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; CreateGeneralNote&lt;&#x2F;span&gt;&lt;span&gt;(wiki_index)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Switch to the correct wiki context&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;  execute&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;VimwikiTabIndex &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span&gt;a:wiki_index&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Open the index page of that wiki&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  VimwikiIndex&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Prompt the user for the name of the new note&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  let&lt;&#x2F;span&gt;&lt;span&gt; l:note_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; input&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;Enter name for new note: &amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Proceed only if a name was entered&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  if !&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;empty&lt;&#x2F;span&gt;&lt;span&gt;(l:note_name)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &amp;quot; Go to the end of the index file and add a new link&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; append&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;line&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;$&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;* [[&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span&gt;l:note_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; . &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;]]&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &amp;quot; Move the cursor to the newly created line&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; cursor&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;line&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;$&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &amp;quot; &amp;#39;Press Enter&amp;#39; on the link to create and open the new file&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    VimwikiFollowLink&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  endif&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;endfunction&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; ----- KEYBOARD SHORTCUTS -----&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; For Journals (e.g., \jb for Journal-Business)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;jb :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; OpenJournalWithTemplate&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;jp :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; OpenJournalWithTemplate&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; For General Notes (e.g., \nb for Note-Business)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;nb :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; CreateGeneralNote&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;leader&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;np :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; CreateGeneralNote&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;)&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;CR&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h4 id=&quot;in-your-shell-bashrc-or-zshrc&quot;&gt;In Your Shell (&lt;code&gt;.bashrc&lt;&#x2F;code&gt; or &lt;code&gt;.zshrc&lt;&#x2F;code&gt;)&lt;&#x2F;h4&gt;
&lt;p&gt;Create a full set of aliases in your shell configuration to call these functions directly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Aliases for Journal Entries&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; journalb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;vim -c &amp;quot;call OpenJournalWithTemplate(1)&amp;quot;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; journalp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;vim -c &amp;quot;call OpenJournalWithTemplate(2)&amp;quot;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Aliases for General Topic Notes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; noteb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;vim -c &amp;quot;call CreateGeneralNote(1)&amp;quot;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; notep&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;vim -c &amp;quot;call CreateGeneralNote(2)&amp;quot;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;# Optional: Shorter aliases&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; jb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;journalb&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; jp&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;journalp&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; nb&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;noteb&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; np&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;notep&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reload your shell (&lt;code&gt;source ~&#x2F;.bashrc&lt;&#x2F;code&gt; or &lt;code&gt;source ~&#x2F;.zshrc&lt;&#x2F;code&gt;) to activate them.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-5-how-to-use-your-dual-system&quot;&gt;Step 5: How to Use Your Dual System&lt;&#x2F;h2&gt;
&lt;p&gt;Your workflow is now clean, logical, and direct for both use cases.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;workflow-1-create-a-daily-journal-entry&quot;&gt;Workflow 1: Create a Daily Journal Entry&lt;&#x2F;h3&gt;
&lt;p&gt;Use this for date-based, chronological logs.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;From inside Vim:&lt;&#x2F;strong&gt; Press &lt;code&gt;\jb&lt;&#x2F;code&gt; (Business) or &lt;code&gt;\jp&lt;&#x2F;code&gt; (Personal).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;From your terminal:&lt;&#x2F;strong&gt; Run &lt;code&gt;journalb&lt;&#x2F;code&gt; or &lt;code&gt;jb&lt;&#x2F;code&gt; (Business) &#x2F; &lt;code&gt;journalp&lt;&#x2F;code&gt; or &lt;code&gt;jp&lt;&#x2F;code&gt; (Personal).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Result:&lt;&#x2F;strong&gt; Today’s journal file is created in the &lt;code&gt;diary&#x2F;&lt;&#x2F;code&gt; folder, and the correct template is applied.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;workflow-2-create-a-general-topic-note&quot;&gt;Workflow 2: Create a General Topic Note&lt;&#x2F;h3&gt;
&lt;p&gt;Use this for any non-daily, topic-based note like a project plan, a checklist, or meeting notes.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;From inside Vim:&lt;&#x2F;strong&gt; Press &lt;code&gt;\nb&lt;&#x2F;code&gt; (Business) or &lt;code&gt;\np&lt;&#x2F;code&gt; (Personal).&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;From your terminal:&lt;&#x2F;strong&gt; Run &lt;code&gt;noteb&lt;&#x2F;code&gt; or &lt;code&gt;nb&lt;&#x2F;code&gt; (Business) &#x2F; &lt;code&gt;notep&lt;&#x2F;code&gt; or &lt;code&gt;np&lt;&#x2F;code&gt; (Personal).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Result:&lt;&#x2F;strong&gt; You will be prompted in Vim to &lt;strong&gt;enter a name for the new note&lt;&#x2F;strong&gt;. After you type a name and press Enter, the new file is created in the root of the correct wiki, and a link to it is automatically added to your &lt;code&gt;index.md&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-6-linking-between-wikis&quot;&gt;Step 6: Linking Between Wikis&lt;&#x2F;h2&gt;
&lt;p&gt;The concept of linking between wikis is now much clearer. Imagine you’re in your &lt;strong&gt;personal journal&lt;&#x2F;strong&gt; and have an idea for a business project.&lt;&#x2F;p&gt;
&lt;p&gt;In your personal journal file, you can write:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 💡 Ideas &amp;amp; Thoughts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; I just had an idea for work, I&amp;#39;ll start a new note for it in my business wiki.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; To create it, I can just write the link here and press Enter: [[wiki1:My New Business Idea]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;wiki1:&lt;&#x2F;code&gt; tells Vimwiki to use the first wiki in your list (your business-wiki).&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;When you press &lt;code&gt;Enter&lt;&#x2F;code&gt;, Vimwiki creates the file &lt;code&gt;My New Business Idea.md&lt;&#x2F;code&gt; in the root of your &lt;code&gt;wiki-business&#x2F;&lt;&#x2F;code&gt; and opens it.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;By creating two dedicated functions, you have built a powerful, intuitive, and robust system:&lt;&#x2F;p&gt;
&lt;p&gt;✅ A clean separation between your &lt;strong&gt;wiki-business&lt;&#x2F;strong&gt; and &lt;strong&gt;wiki-personal&lt;&#x2F;strong&gt;.
✅ A clear, direct workflow for creating both daily &lt;strong&gt;Journals&lt;&#x2F;strong&gt; and topic-based &lt;strong&gt;General Notes&lt;&#x2F;strong&gt;.
✅ Custom &lt;strong&gt;journal templates&lt;&#x2F;strong&gt; that are correctly and automatically applied.
✅ Lightning-fast, unambiguous shortcuts (&lt;code&gt;jb&lt;&#x2F;code&gt;, &lt;code&gt;jp&lt;&#x2F;code&gt;, &lt;code&gt;nb&lt;&#x2F;code&gt;, &lt;code&gt;np&lt;&#x2F;code&gt;) for both Vim and your shell.
✅ The power to intelligently link between worlds when needed.&lt;&#x2F;p&gt;
&lt;p&gt;This setup transforms a simple note-taking tool into a comprehensive life management system.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;vimwiki&#x2F;vimwiki&quot;&gt;Explore Vimwiki Further&lt;&#x2F;a&gt; 📂&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHAT&amp;#x27;S NEXT?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Now that your wikis are separated and working reliably, we can explore advanced task management. In a future post, we’ll look at how to aggregate tasks from both journals into a single, unified dashboard.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
</description>
      </item>
      <item>
          <title>Mastering the Vimwiki Workflow: A Guide to Links, Navigation, and Tasks</title>
          <pubDate>Wed, 02 Jul 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/vimwiki-workflow/</link>
          <guid>https://criticalbasics.xyz/posts/vimwiki-workflow/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/vimwiki-workflow/">&lt;p&gt;In previous guides, we built a robust foundation for our note-taking and journaling system with Vimwiki. But the best configuration is useless without a fluid, daily workflow. So, how exactly do you work with it now?&lt;&#x2F;p&gt;
&lt;p&gt;This guide is your daily companion. You will learn the core concepts of Vimwiki that will elevate your productivity to a new level—from the magic of linking and lightning-fast navigation to integrated task management.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;the-heart-of-your-wiki-the-index-md&quot;&gt;The Heart of Your Wiki: The &lt;code&gt;index.md&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Each of your Vim wikis has a central homepage: the &lt;code&gt;index.md&lt;&#x2F;code&gt; file located in the root directory. Think of it as your personal dashboard or table of contents for that wiki.&lt;&#x2F;p&gt;
&lt;p&gt;From here, you should link to all of your important, topic-based notes.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How to open the index page:&lt;&#x2F;strong&gt; From anywhere in Vim, press &lt;code&gt;&amp;lt;leader&amp;gt;ww&lt;&#x2F;code&gt; (usually &lt;code&gt;\ww&lt;&#x2F;code&gt;) to instantly jump to the index page of the current wiki.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A well-maintained index might look like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;# Business Wiki Index&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## Projects&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt; [[Project Alpha]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt; [[Q4 Strategy Planning]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## Processes &amp;amp; Checklists&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt; [[Meeting Checklist]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt; [[New Employee Onboarding]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## References&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span&gt; [[Important Contacts]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;the-magic-of-linking&quot;&gt;The Magic of Linking&lt;&#x2F;h2&gt;
&lt;p&gt;Creating notes and linking ideas is the core of Vimwiki. The process is brilliantly simple.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Write a Link:&lt;&#x2F;strong&gt; Anywhere in a wiki file, write the name of a new or existing note in double square brackets.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;I had an idea for [[Project Alpha]].&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Follow the Link:&lt;&#x2F;strong&gt; Move your cursor over the link and press &lt;code&gt;Enter&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;strong&gt;What happens?&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;If the file &lt;code&gt;Project Alpha.md&lt;&#x2F;code&gt; already exists, Vimwiki opens it.&lt;&#x2F;li&gt;
&lt;li&gt;If the file &lt;strong&gt;does not&lt;&#x2F;strong&gt; exist, Vimwiki automatically creates it for you and opens the new, empty file.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This means you never have to worry about manually creating files. You simply write down your thoughts, link concepts, and let Vimwiki build the structure in the background.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Pro-Tip:&lt;&#x2F;strong&gt; You can also create subdirectories by using a forward slash: &lt;code&gt;[[projects&#x2F;New Project]]&lt;&#x2F;code&gt; will create the file &lt;code&gt;New Project.md&lt;&#x2F;code&gt; inside the &lt;code&gt;projects&#x2F;&lt;&#x2F;code&gt; folder.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;effortless-navigation-how-to-jump-back-and-forth&quot;&gt;Effortless Navigation: How to Jump Back and Forth&lt;&#x2F;h2&gt;
&lt;p&gt;Switching between notes quickly is crucial. Vimwiki primarily uses Vim’s brilliant, built-in commands for this.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Jump back to the previous note:&lt;&#x2F;strong&gt; Press &lt;code&gt;Ctrl-O&lt;&#x2F;code&gt;. This is the most important navigation command. It takes you right back to where you came from after following a link.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Jump forward again:&lt;&#x2F;strong&gt; Press &lt;code&gt;Ctrl-I&lt;&#x2F;code&gt; to reverse the jump.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Go back to the index page:&lt;&#x2F;strong&gt; &lt;code&gt;&amp;lt;leader&amp;gt;ww&lt;&#x2F;code&gt; is your “home button,” always taking you back to the main index of the current wiki.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Go back to today’s journal:&lt;&#x2F;strong&gt; &lt;code&gt;&amp;lt;leader&amp;gt;w&amp;lt;leader&amp;gt;w&lt;&#x2F;code&gt; (or your custom mappings like &lt;code&gt;\jb&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;\jp&lt;&#x2F;code&gt;) will instantly take you to your daily journal entry.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;more-than-just-notes-practical-task-management&quot;&gt;More Than Just Notes: Practical Task Management&lt;&#x2F;h2&gt;
&lt;p&gt;Vimwiki has fantastic built-in support for to-do lists. Anytime you create a checklist in Markdown format, you can change its status directly in Vim.&lt;&#x2F;p&gt;
&lt;p&gt;Write a list like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [ ] Open task&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [ ] Another task that needs to be done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Now, move your cursor onto one of these lines and press &lt;strong&gt;&lt;code&gt;g&amp;lt;Space&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; (that’s &lt;code&gt;g&lt;&#x2F;code&gt; followed by the spacebar).&lt;&#x2F;p&gt;
&lt;p&gt;Vimwiki will cycle through the task’s status:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[ ]&lt;&#x2F;code&gt; → Open&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[.]&lt;&#x2F;code&gt; → Started &#x2F; In Progress (optional)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[X]&lt;&#x2F;code&gt; → Completed&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[-]&lt;&#x2F;code&gt; → Canceled &#x2F; Irrelevant&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This is an incredibly fast and satisfying way to manage tasks without ever leaving Vim.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;important-tips-and-tricks-for-daily-use&quot;&gt;Important Tips and Tricks for Daily Use&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rename Files (and update all links!):&lt;&#x2F;strong&gt; Move your cursor onto a link to a file and run &lt;code&gt;:VimwikiRenameLink&lt;&#x2F;code&gt;. Enter the new name, and Vimwiki will not only rename the file but also &lt;strong&gt;automatically update all other files&lt;&#x2F;strong&gt; that link to that note.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Format Tables:&lt;&#x2F;strong&gt; Create a simple table using pipes (&lt;code&gt;|&lt;&#x2F;code&gt;):&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Column 1 | Column 2 |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|---|---|&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| a | b |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| longer text | c |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;Then, with your cursor inside the table, run the command &lt;code&gt;:VimwikiTable&lt;&#x2F;code&gt;. Vimwiki will format it perfectly for you.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Find Anything:&lt;&#x2F;strong&gt; Use &lt;code&gt;:VimwikiSearch [keyword]&lt;&#x2F;code&gt; to search your entire current wiki. The results are displayed in a handy quickfix list that you can navigate through quickly.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;You now have the tools to not just own Vimwiki, but to truly master it:&lt;&#x2F;p&gt;
&lt;p&gt;✅ You use the &lt;strong&gt;&lt;code&gt;index.md&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; as your central dashboard.
✅ You seamlessly create and connect notes with the &lt;strong&gt;&lt;code&gt;[[Link]]&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; syntax.
✅ You navigate at lightning speed with &lt;strong&gt;&lt;code&gt;Ctrl-O&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; and &lt;strong&gt;&lt;code&gt;&amp;lt;leader&amp;gt;ww&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;.
✅ You manage tasks directly in your notes with &lt;strong&gt;&lt;code&gt;g&amp;lt;Space&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;This fluid workflow transforms Vimwiki from a simple note-taking tool into a powerful “second brain.”&lt;&#x2F;p&gt;
&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;vimwiki&amp;#x2F;vimwiki&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📂&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;EXPLORE VIMWIKI ON GITHUB&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;hr &#x2F;&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            WHAT&amp;#x27;S NEXT?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Now that you’ve mastered the basic workflow, you’re ready for the ultimate organizational boost. In the next article, you’ll learn how to cleanly separate private and business notes with our &lt;a href=&quot;&#x2F;posts&#x2F;vimwiki-dual-journaling&quot;&gt;dual-journaling system&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
</description>
      </item>
      <item>
          <title>Getting Started with Vim Plugins: A Beginner&#x27;s Guide to vim-plug</title>
          <pubDate>Thu, 26 Jun 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/vim-setup-vim-plug/</link>
          <guid>https://criticalbasics.xyz/posts/vim-setup-vim-plug/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/vim-setup-vim-plug/">&lt;p&gt;So you’ve found an exciting Vim plugin—perhaps for journaling with &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;vimwiki-journaling-tutorial&#x2F;&quot;&gt;Vimwiki&lt;&#x2F;a&gt;—and you’re ready to supercharge your editor. This guide will walk you through setting up &lt;strong&gt;&lt;code&gt;vim-plug&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;, a fast, minimalist, and incredibly popular plugin manager. Once you’ve completed these steps, you’ll have a solid foundation to install any plugin you want, unlocking the true power of Vim.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-is-a-plugin-manager-and-why-vim-plug&quot;&gt;What is a Plugin Manager and Why &lt;code&gt;vim-plug&lt;&#x2F;code&gt;?&lt;&#x2F;h2&gt;
&lt;p&gt;A plugin manager automates the tedious process of:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Downloading plugin files from sources like GitHub.&lt;&#x2F;li&gt;
&lt;li&gt;Placing them in the correct directories.&lt;&#x2F;li&gt;
&lt;li&gt;Loading them when Vim starts.&lt;&#x2F;li&gt;
&lt;li&gt;Updating and removing them easily.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I recommend &lt;strong&gt;&lt;code&gt;vim-plug&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt; because it is:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Minimalist:&lt;&#x2F;strong&gt; It’s just a single file, making installation trivial.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fast:&lt;&#x2F;strong&gt; It can install and update plugins in parallel.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Easy to Use:&lt;&#x2F;strong&gt; The commands are simple and memorable.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-1-install-vim-plug&quot;&gt;Step 1: Install &lt;code&gt;vim-plug&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;vim-plug&lt;&#x2F;code&gt; itself needs to be downloaded first. The official and easiest way is to run a single command in your terminal. This command downloads the &lt;code&gt;plug.vim&lt;&#x2F;code&gt; file and places it in Vim’s &lt;code&gt;autoload&lt;&#x2F;code&gt; directory, which ensures it’s loaded automatically when Vim starts.&lt;&#x2F;p&gt;
&lt;p&gt;Open your terminal and execute:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -fLo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;.vim&#x2F;autoload&#x2F;plug.vim&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; --create-dirs \&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;    https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;junegunn&#x2F;vim-plug&#x2F;master&#x2F;plug.vim&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That’s it. The plugin manager is now “installed.”&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-2-structure-your-vimrc-for-plugins&quot;&gt;Step 2: Structure Your &lt;code&gt;.vimrc&lt;&#x2F;code&gt; for Plugins&lt;&#x2F;h2&gt;
&lt;p&gt;Next, you need to tell Vim which plugins you want to use. This is done in your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt; file inside a special block.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Open your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Add the following structure. All your plugin declarations must go &lt;strong&gt;between&lt;&#x2F;strong&gt; the &lt;code&gt;call plug#begin()&lt;&#x2F;code&gt; and &lt;code&gt;call plug#end()&lt;&#x2F;code&gt; lines.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; 1. VIM-PLUG SECTION&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; This block must be at the top of your .vimrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; plug#begin&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;~&#x2F;.vim&#x2F;plugged&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; List your plugins here&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Example:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Plug&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;vimwiki&#x2F;vimwiki&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Plug&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;dracula&#x2F;vim&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;, { &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;as&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;dracula&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; &amp;quot; A popular theme&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;call&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; plug#end&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; 2. YOUR CONFIGURATIONS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; All other settings go AFTER the vim-plug block&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;syntax enable&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;colorscheme&lt;&#x2F;span&gt;&lt;span&gt; dracula&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_list&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [{ &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;path&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;~&#x2F;vimwiki&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt; }]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; ... and so on&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;plug#begin()&lt;&#x2F;code&gt;: Initializes the plugin manager. The argument (&lt;code&gt;&#x27;~&#x2F;.vim&#x2F;plugged&#x27;&lt;&#x2F;code&gt;) is the directory where &lt;code&gt;vim-plug&lt;&#x2F;code&gt; will download and store all your plugins.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;Plug &#x27;author&#x2F;repository&#x27;&lt;&#x2F;code&gt;: This is the command to declare a plugin.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;plug#end()&lt;&#x2F;code&gt;: Finalizes the list and loads the plugins.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-3-install-the-plugins-with-pluginstall&quot;&gt;Step 3: Install the Plugins with &lt;code&gt;:PlugInstall&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Now that your &lt;code&gt;.vimrc&lt;&#x2F;code&gt; is configured, you can tell &lt;code&gt;vim-plug&lt;&#x2F;code&gt; to fetch and install the plugins you’ve listed.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Save your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt; file and &lt;strong&gt;restart Vim&lt;&#x2F;strong&gt;, or source the file with &lt;code&gt;:so ~&#x2F;.vimrc&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Run the &lt;code&gt;vim-plug&lt;&#x2F;code&gt; installation command inside Vim:&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:PlugInstall&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;A new window will open, showing the installation progress for each plugin. Once you see “Finished!”, you can close the status window (&lt;code&gt;:q&lt;&#x2F;code&gt;) and start using your new plugins.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;your-plugin-management-cheat-sheet&quot;&gt;Your Plugin Management Cheat Sheet&lt;&#x2F;h2&gt;
&lt;p&gt;Managing plugins is now simple. Here are the essential commands you’ll use:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:PlugInstall&lt;&#x2F;code&gt;: Install any new plugins you’ve added to your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;:PlugUpdate&lt;&#x2F;code&gt;: Update all installed plugins to their latest versions.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;:PlugClean&lt;&#x2F;code&gt;: Remove any plugins that are in your &lt;code&gt;plugged&lt;&#x2F;code&gt; directory but no longer listed in your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;:PlugStatus&lt;&#x2F;code&gt;: Show the status of all your plugins.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary-your-foundation-is-ready&quot;&gt;Summary: Your Foundation is Ready&lt;&#x2F;h2&gt;
&lt;p&gt;Congratulations! You have successfully set up a robust system for managing Vim plugins. You now understand:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;How to install &lt;code&gt;vim-plug&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;How to structure your &lt;code&gt;.vimrc&lt;&#x2F;code&gt; to declare plugins.&lt;&#x2F;li&gt;
&lt;li&gt;How to install, update, and manage them with simple commands.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;You are now fully equipped to customize Vim to your heart’s content and can confidently follow tutorials like our guides to &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;vimwiki-journaling-tutorial&#x2F;&quot;&gt;setting up a Vimwiki journal&lt;&#x2F;a&gt; or creating a &lt;a href=&quot;https:&#x2F;&#x2F;criticalbasics.xyz&#x2F;posts&#x2F;vimwiki-dual-journaling&#x2F;&quot;&gt;dual-journaling system&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            A NOTE ON THE &amp;lt;LEADER&amp;gt; KEY
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Many Vim tutorials (including ours) use shortcuts like &lt;code&gt;&amp;lt;leader&amp;gt;wp&lt;&#x2F;code&gt;. The &lt;code&gt;&amp;lt;leader&amp;gt;&lt;&#x2F;code&gt; key is a placeholder that you can map to any key you want, preventing conflicts with Vim’s built-in commands. By default, it’s the backslash (&lt;code&gt;\&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;You can set it to a more convenient key, like the comma, by adding this to your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;:
&lt;code&gt;let mapleader = &quot;,&quot;&lt;&#x2F;code&gt;
Now, &lt;code&gt;&amp;lt;leader&amp;gt;wp&lt;&#x2F;code&gt; would be typed as &lt;code&gt;,wp&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
</description>
      </item>
      <item>
          <title>Spell Checking in Vim: A Comprehensive Guide</title>
          <pubDate>Wed, 25 Jun 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/vim-spell-check/</link>
          <guid>https://criticalbasics.xyz/posts/vim-spell-check/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/vim-spell-check/">&lt;p&gt;Spell checking is an essential feature for any editor, and Vim comes with a powerful built-in solution. This guide will walk you through everything you need—from basic activation to advanced customization and keyboard-layout considerations.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-06-25&lt;&#x2F;td&gt;&lt;td&gt;Added QWERTZ key mappings and &lt;code&gt;.sug&lt;&#x2F;code&gt; file clarification.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-25&lt;&#x2F;td&gt;&lt;td&gt;Initial version of the guide.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;enabling-spell-checking&quot;&gt;Enabling Spell Checking&lt;&#x2F;h2&gt;
&lt;p&gt;To enable Vim’s spell checker, use the &lt;code&gt;:set spell&lt;&#x2F;code&gt; command. You can type this directly into Vim for the current session, or add it to your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt; file for permanent activation.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spell&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;            &amp;quot; Turn on spell checking&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spelllang&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;en_us&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Set the default language (e.g., US English)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The first time you set a language, Vim may offer to download the dictionary file for you. This is a one-time setup for each language.&lt;&#x2F;p&gt;
&lt;p&gt;For German, switch to:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spelllang&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;de_de&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;  &amp;quot; Set German dictionary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can list multiple languages, and Vim will check against all of them:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spelllang&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;de_de,en_us&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Pro-tip: Vim supports regional variants like &lt;code&gt;en_gb&lt;&#x2F;code&gt; (British), &lt;code&gt;en_ca&lt;&#x2F;code&gt; (Canadian), and &lt;code&gt;en_au&lt;&#x2F;code&gt; (Australian).&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;managing-spell-files&quot;&gt;Managing Spell Files&lt;&#x2F;h2&gt;
&lt;p&gt;Vim uses two main types of files for spell checking:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The main dictionary (&lt;code&gt;.spl&lt;&#x2F;code&gt; file), a compressed word list used for all checks.&lt;&#x2F;li&gt;
&lt;li&gt;A supplementary suggestions file (&lt;code&gt;.sug&lt;&#x2F;code&gt; file), which pre-computes lists of similar words to provide fast suggestions.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;benefits-and-trade-offs-of-the-sug-file&quot;&gt;Benefits and Trade-offs of the &lt;code&gt;.sug&lt;&#x2F;code&gt; file&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;With&lt;&#x2F;strong&gt; &lt;code&gt;.sug&lt;&#x2F;code&gt; &lt;strong&gt;downloaded&lt;&#x2F;strong&gt;: &lt;code&gt;z=&lt;&#x2F;code&gt; suggestion requests are fast and comprehensive, as Vim doesn’t need to calculate similarities on the fly.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Without&lt;&#x2F;strong&gt; &lt;code&gt;.sug&lt;&#x2F;code&gt;: Vim computes suggestions at runtime, saving disk space and RAM until a suggestion is needed.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;on-demand-loading&quot;&gt;On-Demand Loading&lt;&#x2F;h4&gt;
&lt;p&gt;Vim &lt;strong&gt;only loads&lt;&#x2F;strong&gt; the &lt;code&gt;.sug&lt;&#x2F;code&gt; file into memory when you invoke suggestions (e.g., by pressing &lt;code&gt;z=&lt;&#x2F;code&gt;). Simply enabling spell check and navigating errors with &lt;code&gt;]s&lt;&#x2F;code&gt;&#x2F;&lt;code&gt;[s&lt;&#x2F;code&gt; won’t load the larger &lt;code&gt;.sug&lt;&#x2F;code&gt; file, keeping your memory footprint minimal until you request corrections.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;quick-navigation-and-corrections&quot;&gt;Quick Navigation and Corrections&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;]s&lt;&#x2F;code&gt; : Jump to the next misspelled word&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[s&lt;&#x2F;code&gt; : Jump to the previous misspelled word&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;z=&lt;&#x2F;code&gt; : On a highlighted word, opens the suggestion list&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;zg&lt;&#x2F;code&gt; : Add word to &lt;strong&gt;g&lt;&#x2F;strong&gt;ood list (your personal dictionary)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;zw&lt;&#x2F;code&gt; : Mark word as &lt;strong&gt;w&lt;&#x2F;strong&gt;rong&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Example vimrc settings:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spell&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spelllang&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span&gt;de_de,en_us&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Optional: Define a custom file for your personal dictionary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;set&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; spellfile&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DBEDFF;&quot;&gt;&#x2F;.vim&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;spell&lt;&#x2F;span&gt;&lt;span&gt;&#x2F;en.utf-&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;8&lt;&#x2F;span&gt;&lt;span&gt;.add&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;keyboard-layouts-and-key-mappings&quot;&gt;Keyboard Layouts and Key Mappings&lt;&#x2F;h2&gt;
&lt;p&gt;Vim’s navigation commands rely on specific characters (&lt;code&gt;]&lt;&#x2F;code&gt;, &lt;code&gt;[&lt;&#x2F;code&gt;, &lt;code&gt;s&lt;&#x2F;code&gt;), not on physical keys. Below we cover the standard QWERTY layout and the German QWERTZ variant.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;international-qwerty-default-mapping&quot;&gt;International QWERTY (Default Mapping)&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;]&lt;&#x2F;code&gt; then &lt;code&gt;s&lt;&#x2F;code&gt; to go to the next misspelling.&lt;&#x2F;li&gt;
&lt;li&gt;Press &lt;code&gt;[&lt;&#x2F;code&gt; then &lt;code&gt;s&lt;&#x2F;code&gt; to go to the previous misspelling.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;No special configuration is needed on US&#x2F;UK keyboards, where &lt;code&gt;[&lt;&#x2F;code&gt; and &lt;code&gt;]&lt;&#x2F;code&gt; are directly accessible.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;german-qwertz-layout&quot;&gt;German QWERTZ Layout&lt;&#x2F;h3&gt;
&lt;p&gt;On German keyboards, the square brackets require &lt;code&gt;AltGr&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[&lt;&#x2F;code&gt;: &lt;code&gt;AltGr + 8&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;]&lt;&#x2F;code&gt;: &lt;code&gt;AltGr + 9&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Thus, to navigate spelling corrections:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AltGr + 9&lt;&#x2F;code&gt;, then &lt;code&gt;s&lt;&#x2F;code&gt; → &lt;code&gt;]s&lt;&#x2F;code&gt; (next error)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;AltGr + 8&lt;&#x2F;code&gt;, then &lt;code&gt;s&lt;&#x2F;code&gt; → &lt;code&gt;[s&lt;&#x2F;code&gt; (previous error)&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            QUICK KEY MAPPINGS ON QWERTZ
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;To simplify this, add these mappings to your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; F7: Next misspelling&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;F7&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; ]s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; F6: Previous misspelling&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;nnoremap&lt;&#x2F;span&gt;&lt;span&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;F6&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt; [s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We use &lt;code&gt;nnoremap&lt;&#x2F;code&gt; to create a non-recursive mapping in Normal mode, which is the safest way to define custom shortcuts. Now a single press of &lt;code&gt;F7&lt;&#x2F;code&gt; or &lt;code&gt;F6&lt;&#x2F;code&gt; navigates errors without needing &lt;code&gt;AltGr&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;Vim’s spell checker is both versatile and efficient. By understanding its core commands and how to adapt them to your keyboard layout, you can keep your writing error-free across multiple languages. Incorporate these settings into your Vim configuration for a seamless workflow.&lt;&#x2F;p&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            KEY COMMANDS AT A GLANCE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Quick reference: Navigate Errors with &lt;code&gt;]s&lt;&#x2F;code&gt; (next) and &lt;code&gt;[s&lt;&#x2F;code&gt; (previous); get suggestions with &lt;code&gt;z=&lt;&#x2F;code&gt;; add to dictionary with &lt;code&gt;zg&lt;&#x2F;code&gt;; mark as wrong with &lt;code&gt;zw&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;p&gt;For a deeper dive into all available options, the official documentation is an excellent resource.&lt;&#x2F;p&gt;
&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;vimhelp.org&amp;#x2F;spell.txt.html&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📖&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;READ THE OFFICIAL DOCS&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
</description>
      </item>
      <item>
          <title>How to Keep a Structured Markdown Journal Using Vimwiki</title>
          <pubDate>Thu, 19 Jun 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/vimwiki-journaling-tutorial/</link>
          <guid>https://criticalbasics.xyz/posts/vimwiki-journaling-tutorial/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/vimwiki-journaling-tutorial/">&lt;p&gt;Journaling has long been an effective way to reflect, track tasks, and document ideas or conversations. But if you’re a terminal-based user who enjoys the minimalism of Vim, Markdown, and data ownership — you’re in luck. In this post, you’ll learn how to set up a &lt;strong&gt;lightweight, private, and highly productive journaling system&lt;&#x2F;strong&gt; using &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;vimwiki&#x2F;vimwiki&quot;&gt;&lt;code&gt;vimwiki&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;, all in plain text files synced via Nextcloud.&lt;&#x2F;p&gt;
&lt;p&gt;Whether you’re logging calls, capturing thoughts, or tracking your daily wins, this setup will help you keep everything organized — without giving up control to a third-party app.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-06-19&lt;&#x2F;td&gt;&lt;td&gt;Restructured article to move quick access methods into Step 3 for better visibility.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-18&lt;&#x2F;td&gt;&lt;td&gt;Major revision: Added to-do lists, improved configuration, and corrected template&#x2F;alias usage.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-17&lt;&#x2F;td&gt;&lt;td&gt;Initial version of this article.&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;why-use-vimwiki-for-journaling&quot;&gt;Why Use Vimwiki for Journaling?&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;vimwiki&lt;&#x2F;code&gt; is a Vim plugin that transforms your editor into a personal wiki. It’s lightweight, fast, and supports:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Daily journal entries (diary mode)&lt;&#x2F;li&gt;
&lt;li&gt;Linked notes for projects or topics&lt;&#x2F;li&gt;
&lt;li&gt;To-do lists and simple task tracking&lt;&#x2F;li&gt;
&lt;li&gt;Markdown syntax for compatibility&lt;&#x2F;li&gt;
&lt;li&gt;Full offline access — works with Nextcloud or any sync service&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;If you’re already storing notes in Markdown, this is a perfect upgrade.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;step-1-install-vimwiki&quot;&gt;Step 1: Install &lt;code&gt;vimwiki&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Using &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;junegunn&#x2F;vim-plug&quot;&gt;&lt;code&gt;vim-plug&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; (or your plugin manager of choice), add this to your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;Plug&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;vimwiki&#x2F;vimwiki&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then launch Vim and run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:PlugInstall&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you’re not using &lt;code&gt;vim-plug&lt;&#x2F;code&gt;, check the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;vimwiki&#x2F;vimwiki&quot;&gt;installation instructions here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-2-configure-vimwiki-to-use-markdown&quot;&gt;Step 2: Configure Vimwiki to Use Markdown&lt;&#x2F;h2&gt;
&lt;p&gt;In your &lt;code&gt;~&#x2F;.vimrc&lt;&#x2F;code&gt;, configure &lt;code&gt;vimwiki&lt;&#x2F;code&gt; to store files in a Markdown format inside your Nextcloud folder. This configuration is cleaner and easier to maintain.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Vimwiki Configuration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_list&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;path&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki&#x2F;&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt; &amp;quot; Path to your wiki&amp;#39;s root folder&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;syntax&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;markdown&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;             &amp;quot; Use Markdown syntax&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;  \&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;ext&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;: &lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;.md&amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;                      &amp;quot; Use .md as the file extension&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;\&lt;&#x2F;span&gt;&lt;span&gt;}]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Ensures that created links include the .md extension for better compatibility&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_markdown_link_ext&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;&amp;quot; Automatically creates an index of all diary entries&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_auto_diary_index&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create the necessary folders manually if they don’t exist:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;mkdir&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; -p&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; ~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki&#x2F;diary&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-3-creating-and-accessing-your-daily-journal&quot;&gt;Step 3: Creating and Accessing Your Daily Journal&lt;&#x2F;h2&gt;
&lt;p&gt;The core of your journaling workflow is creating or opening the note for the current day. Here are the best ways to do it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-basic-command&quot;&gt;The Basic Command&lt;&#x2F;h3&gt;
&lt;p&gt;The fundamental command to create or open today’s journal entry is:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:VimwikiMakeDiaryNote&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This command will create a file like &lt;code&gt;~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki&#x2F;diary&#x2F;2025-06-21.md&lt;&#x2F;code&gt; if it doesn’t exist, and open it otherwise.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;recommended-methods-for-quick-access&quot;&gt;Recommended Methods for Quick Access&lt;&#x2F;h3&gt;
&lt;p&gt;While the basic command works, typing it every time is impractical. For a fast and efficient workflow, use these shortcuts instead.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;method-1-from-inside-vim-the-fastest-way&quot;&gt;Method 1: From Inside Vim (The Fastest Way)&lt;&#x2F;h4&gt;
&lt;p&gt;&lt;code&gt;vimwiki&lt;&#x2F;code&gt; comes with a built-in keyboard shortcut that is perfect for daily use. While in Vim’s normal mode, simply press:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;leader&amp;gt;w&amp;lt;leader&amp;gt;w&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is the most efficient way to open your journal when you are already working in Vim. The &lt;code&gt;&amp;lt;leader&amp;gt;&lt;&#x2F;code&gt; key is typically the backslash (&lt;code&gt;\&lt;&#x2F;code&gt;) by default.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;method-2-from-your-terminal&quot;&gt;Method 2: From Your Terminal&lt;&#x2F;h4&gt;
&lt;p&gt;For moments when you want to jump directly into your journal from the command line, a shell alias is the perfect tool. Add this line to your &lt;code&gt;.bashrc&lt;&#x2F;code&gt; or &lt;code&gt;.zshrc&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;alias&lt;&#x2F;span&gt;&lt;span&gt; journal&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;#39;vim -c &amp;quot;VimwikiMakeDiaryNote&amp;quot;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After reloading your shell, you can now simply type &lt;code&gt;journal&lt;&#x2F;code&gt; in your terminal. This will launch Vim and immediately open today’s diary entry, applying your template if it’s a new day.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;example-entry&quot;&gt;Example Entry&lt;&#x2F;h3&gt;
&lt;p&gt;Regardless of which method you use to open it, your daily note will look something like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;# 2025-06-21&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 09:02 – Call with Sarah&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Discussed the project milestones. Need to follow up next Tuesday.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 13:45 – Idea&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Use &lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;`jrnl`&lt;&#x2F;span&gt;&lt;span&gt; CLI for quick journal entries via terminal.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 20:15 – Reflection&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Today was productive. Really enjoying the new Vim-based workflow.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-4-create-and-follow-internal-links&quot;&gt;Step 4: Create and Follow Internal Links&lt;&#x2F;h2&gt;
&lt;p&gt;Link to another page in your wiki using &lt;code&gt;vimwiki&lt;&#x2F;code&gt;’s native syntax:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[[Project Alpha]]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Pressing &lt;code&gt;Enter&lt;&#x2F;code&gt; on this link will create and navigate to &lt;code&gt;Project Alpha.md&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For universal compatibility with other Markdown editors (like Obsidian or QOwnNotes), you can use a standard Markdown link. &lt;code&gt;vimwiki&lt;&#x2F;code&gt; will still follow it if you press &lt;code&gt;Enter&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DBEDFF;text-decoration: underline;&quot;&gt;Project Alpha&lt;&#x2F;span&gt;&lt;span&gt;](&lt;&#x2F;span&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Project%20Alpha.md&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The key difference is that &lt;code&gt;[[Project Alpha]]&lt;&#x2F;code&gt; is deeply integrated into &lt;code&gt;vimwiki&lt;&#x2F;code&gt;’s features (like backlinking), while the standard link is more portable across different applications.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;step-5-create-a-diary-template-optional&quot;&gt;Step 5: Create a Diary Template (Optional)&lt;&#x2F;h2&gt;
&lt;p&gt;Add a default template for your daily entries. It’s best practice to store the template in your wiki’s root directory.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create the template file: &lt;code&gt;~&#x2F;Nextcloud&#x2F;Notes&#x2F;wiki&#x2F;template.md&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;&#x2F;strong&gt; &lt;code&gt;vimwiki&lt;&#x2F;code&gt; uses &lt;code&gt;strftime&lt;&#x2F;code&gt; format codes, not &lt;code&gt;{{placeholders}}&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;# %Y-%m-%d&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## ☎️ Calls&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 💡 Ideas&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## ✅ Tasks&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 📌 Notes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;## 🔁 Reflection&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Add this line to your &lt;code&gt;.vimrc&lt;&#x2F;code&gt;. Using a relative path makes your config more robust.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;viml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; g:vimwiki_diary_template&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;#39;template.md&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Every new diary file created with &lt;code&gt;:VimwikiMakeDiaryNote&lt;&#x2F;code&gt; (or the shortcuts) will now use this layout.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;bonus-tips&quot;&gt;Bonus Tips&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Manage To-Do Lists:&lt;&#x2F;strong&gt; &lt;code&gt;vimwiki&lt;&#x2F;code&gt; has excellent support for task lists. Use &lt;code&gt;g&amp;lt;Space&amp;gt;&lt;&#x2F;code&gt; on a list item in Vim to cycle through states.&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [ ] An open task&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DBEDFF;text-decoration: underline;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span&gt;] A task in progress&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFAB70;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt; [&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DBEDFF;text-decoration: underline;&quot;&gt;X&lt;&#x2F;span&gt;&lt;span&gt;] A completed task&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Quick Navigation:&lt;&#x2F;strong&gt; After following a link, press &lt;code&gt;Ctrl-O&lt;&#x2F;code&gt; to go back to the previous location and &lt;code&gt;Ctrl-I&lt;&#x2F;code&gt; to go forward.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Diary Index:&lt;&#x2F;strong&gt; Use &lt;code&gt;:VimwikiDiaryIndex&lt;&#x2F;code&gt; to open the &lt;code&gt;diary&#x2F;index.md&lt;&#x2F;code&gt; — a central view of all your entries.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Search:&lt;&#x2F;strong&gt; Use &lt;code&gt;:VimwikiSearch KEYWORD&lt;&#x2F;code&gt; to find entries across your entire wiki.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Syncing:&lt;&#x2F;strong&gt; Sync your &lt;code&gt;wiki&#x2F;&lt;&#x2F;code&gt; folder with &lt;strong&gt;Nextcloud&lt;&#x2F;strong&gt;, and view or edit it from mobile apps like &lt;strong&gt;Markor (Android)&lt;&#x2F;strong&gt; or &lt;strong&gt;1Writer (iOS)&lt;&#x2F;strong&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;&#x2F;h2&gt;
&lt;p&gt;With &lt;code&gt;vimwiki&lt;&#x2F;code&gt;, you can build a minimal yet powerful journaling system:&lt;&#x2F;p&gt;
&lt;p&gt;✅ Fully Markdown-compatible
✅ Terminal- and Vim-native
✅ Works offline and syncs via Nextcloud
✅ Extendable with links, to-do lists, templates, and more&lt;&#x2F;p&gt;
&lt;p&gt;No bloated app, no subscription, no cloud lock-in.&lt;&#x2F;p&gt;
&lt;!-- Retro-Button Shortcode using the same styles as tag buttons --&gt;
&lt;!-- Usage: retro_button(url=&quot;#&quot;, text=&quot;Click me&quot;, icon=&quot;🔗&quot;) --&gt;




&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;vimwiki&amp;#x2F;vimwiki&quot; class=&quot;retro-button&quot;&gt;
    &lt;span class=&quot;emoji&quot;&gt;📂&lt;&#x2F;span&gt;&lt;span class=&quot;button-text&quot;&gt;TRY VIMWIKI NOW&lt;&#x2F;span&gt;
&lt;&#x2F;a&gt;
&lt;hr &#x2F;&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            LOOKING FOR MORE VIM TIPS?
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;In a future post, we’ll explore how to integrate &lt;code&gt;jrnl&lt;&#x2F;code&gt; CLI with &lt;code&gt;vimwiki&lt;&#x2F;code&gt;, add backlinks support, and create a task dashboard — all using plain Markdown.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
</description>
      </item>
      <item>
          <title>Retro-Compatible Zola Theme Showcase</title>
          <pubDate>Mon, 16 Jun 2025 00:00:00 +0000</pubDate>
          <author>Unknown</author>
          <link>https://criticalbasics.xyz/posts/theme-showcase/</link>
          <guid>https://criticalbasics.xyz/posts/theme-showcase/</guid>
          <description xml:base="https://criticalbasics.xyz/posts/theme-showcase/">&lt;p&gt;Welcome to this comprehensive showcase of the Retro-Compatible Zola Theme! This article demonstrates all the features, elements, shortcodes, and styling options available in this unique theme designed for maximum backward compatibility with browsers dating back to the 90s.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;&#x2F;h2&gt;
&lt;div class=&quot;styled-table-container changelog-table&quot;&gt;
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Date&lt;&#x2F;th&gt;&lt;th&gt;Change&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;2025-07-11&lt;&#x2F;td&gt;&lt;td&gt;Improved accessibility with skip links, focus indicators, and screenreader support&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-16&lt;&#x2F;td&gt;&lt;td&gt;Initial version of the theme showcase&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-16&lt;&#x2F;td&gt;&lt;td&gt;Added code block styling with retro terminal look&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-16&lt;&#x2F;td&gt;&lt;td&gt;Integration of additional fonts (Visitor, PixelOperator, Petiote, Virtual DJ, 5x5, Ambitsek, AddStandardBitmap)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-16&lt;&#x2F;td&gt;&lt;td&gt;Headings highlighted with color (Purple)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;2025-06-16&lt;&#x2F;td&gt;&lt;td&gt;Added changelog table&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;what-is-zola&quot;&gt;What is Zola?&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;&quot;&gt;Zola&lt;&#x2F;a&gt; is a blazing-fast static site generator (SSG) written in Rust. It takes your content written in Markdown, applies templates, and generates a complete HTML website that can be served by any web server. Some key features of Zola include:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Speed&lt;&#x2F;strong&gt;: Built with Rust for exceptional performance&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Simplicity&lt;&#x2F;strong&gt;: Easy to use with a single binary&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Flexibility&lt;&#x2F;strong&gt;: Powerful templating with Tera&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Built-in Features&lt;&#x2F;strong&gt;: Syntax highlighting, search, and more&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Live Reload&lt;&#x2F;strong&gt;: Instant preview of changes during development&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;about-this-theme&quot;&gt;About This Theme&lt;&#x2F;h1&gt;
&lt;p&gt;The Retro-Compatible Zola Theme combines nostalgic aesthetics with modern functionality, offering:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Maximum Backward Compatibility&lt;&#x2F;strong&gt;: Support for browsers dating back to the 90s&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Responsive Design&lt;&#x2F;strong&gt;: Optimized for desktop, tablet, and mobile devices&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Retro Shortcodes&lt;&#x2F;strong&gt;: Special retro-style formatting elements&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Pixel Fonts&lt;&#x2F;strong&gt;: VT323 and Perfect DOS VGA 437 for the authentic look&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Three-Column Layout&lt;&#x2F;strong&gt;: Classic web design with modern responsiveness&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            THEME PURPOSE
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This theme was specifically designed to provide a nostalgic web experience while maintaining compatibility with both vintage and modern browsers. It’s perfect for retro computing enthusiasts, digital preservation projects, or anyone who appreciates the aesthetic of early web design.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;compatibility-features&quot;&gt;Compatibility Features&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;browser-compatibility&quot;&gt;Browser Compatibility&lt;&#x2F;h2&gt;
&lt;p&gt;This theme is designed to work with browsers dating back to the 90s, including:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Netscape Navigator 3.0 and earlier&lt;&#x2F;li&gt;
&lt;li&gt;Internet Explorer 3.0 and earlier&lt;&#x2F;li&gt;
&lt;li&gt;Opera 3.0 and earlier&lt;&#x2F;li&gt;
&lt;li&gt;Early WebTV browsers&lt;&#x2F;li&gt;
&lt;li&gt;Text-based browsers like Lynx&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;technical-compatibility-features&quot;&gt;Technical Compatibility Features&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;HTML 4.01 Strict Doctype&lt;&#x2F;strong&gt;: For maximum compatibility&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Table-based layouts&lt;&#x2F;strong&gt;: Instead of Flexbox or Grid&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Simple color definitions&lt;&#x2F;strong&gt;: Using hexadecimal color codes&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;No JavaScript dependencies&lt;&#x2F;strong&gt;: All features work without JavaScript&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Email-based forms&lt;&#x2F;strong&gt;: For guestbook and contact functionality&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;font-showcase&quot;&gt;Font Showcase&lt;&#x2F;h1&gt;
&lt;p&gt;This theme uses special pixel fonts to create an authentic retro look. Here’s a showcase of the main fonts used:&lt;&#x2F;p&gt;
&lt;h2 id=&quot;main-fonts&quot;&gt;Main Fonts&lt;&#x2F;h2&gt;
&lt;div style=&quot;margin: 30px 0; padding: 20px; background-color: #1e1e1e; border: 1px solid #333;&quot;&gt;
  &lt;p style=&quot;font-family: &#x27;VT323&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;VT323&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Perfect DOS VGA 437&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Perfect DOS VGA 437&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Commodore 64&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Commodore 64&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Consolas&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Consolas&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Courier New&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Courier New&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Visitor&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Visitor&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;PixelOperator&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;PixelOperator&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Petiote&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Petiote&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Virtual DJ&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Virtual DJ&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;5x5&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;5x5&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Ambitsek&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;Ambitsek&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;AddStandardBitmap&#x27;, monospace; font-size: 24px; margin-bottom: 10px;&quot;&gt;
    &lt;strong&gt;AddStandardBitmap&lt;&#x2F;strong&gt;: The quick brown fox jumps over the lazy dog. 1234567890 !@#$%^&amp;*()
  &lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;special-font-serenityos-emoji&quot;&gt;Special Font: SerenityOS-Emoji&lt;&#x2F;h2&gt;
&lt;div style=&quot;margin: 30px 0; padding: 20px; background-color: #1e1e1e; border: 1px solid #333;&quot;&gt;
  &lt;p style=&quot;font-family: &#x27;SerenityOS-Emoji&#x27;; font-size: 32px; line-height: 1.5; letter-spacing: 5px;&quot;&gt;
    😀 😃 😄 😁 😆 😅 😂 🤣 🥲 ☺️ 😊 😇 🙂 🙃 😉 😌 😍 🥰 😘 😗 😙 😚 😋 😛 😝 😜
  &lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;font-combinations&quot;&gt;Font Combinations&lt;&#x2F;h2&gt;
&lt;div style=&quot;margin: 30px 0; padding: 20px; background-color: #1e1e1e; border: 1px solid #333;&quot;&gt;
  &lt;h3 style=&quot;font-family: &#x27;VT323&#x27;, &#x27;Perfect DOS VGA 437&#x27;, monospace; margin-bottom: 15px;&quot;&gt;
    Header Style (VT323, Perfect DOS VGA 437)
  &lt;&#x2F;h3&gt;
  &lt;p style=&quot;font-family: &#x27;VT323&#x27;, monospace; margin-bottom: 15px;&quot;&gt;
    This is a paragraph in VT323 font. It&#x27;s designed to look like old terminal text but with better readability for longer content blocks.
  &lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;Perfect DOS VGA 437&#x27;, monospace; margin-bottom: 15px; font-size: 16px;&quot;&gt;
    &lt;code&gt;This is code text in Perfect DOS VGA 437 font.&lt;&#x2F;code&gt;
  &lt;&#x2F;p&gt;
&lt;p&gt;&lt;button class=&quot;retro-button&quot; style=&quot;margin-bottom: 10px; display: block;&quot;&gt;Button Text&lt;&#x2F;button&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;font-sizes-comparison&quot;&gt;Font Sizes Comparison&lt;&#x2F;h2&gt;
&lt;div style=&quot;margin: 30px 0; padding: 20px; background-color: #1e1e1e; border: 1px solid #333;&quot;&gt;
  &lt;h1 style=&quot;font-family: &#x27;VT323&#x27;, &#x27;Perfect DOS VGA 437&#x27;, monospace;&quot;&gt;Heading 1 (26px)&lt;&#x2F;h1&gt;
  &lt;h2 style=&quot;font-family: &#x27;VT323&#x27;, &#x27;Perfect DOS VGA 437&#x27;, monospace;&quot;&gt;Heading 2 (22px)&lt;&#x2F;h2&gt;
  &lt;h3 style=&quot;font-family: &#x27;VT323&#x27;, &#x27;Perfect DOS VGA 437&#x27;, monospace;&quot;&gt;Heading 3 (20px)&lt;&#x2F;h3&gt;
  &lt;p style=&quot;font-family: &#x27;VT323&#x27;, monospace;&quot;&gt;Regular paragraph text (20px)&lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;VT323&#x27;, monospace; font-size: 16px;&quot;&gt;Small text (16px)&lt;&#x2F;p&gt;
  &lt;p style=&quot;font-family: &#x27;VT323&#x27;, monospace; font-size: 14px;&quot;&gt;Extra small text (14px)&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;h1 id=&quot;shortcodes&quot;&gt;Shortcodes&lt;&#x2F;h1&gt;
&lt;p&gt;The theme includes various shortcodes to enhance your content with retro-style elements.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;infoboxes&quot;&gt;Infoboxes&lt;&#x2F;h2&gt;
&lt;p&gt;Infoboxes are used to highlight important information in different styles:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;information-box&quot;&gt;Information Box&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            INFORMATION
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This is a standard information box for general notices and information.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;warning-box&quot;&gt;Warning Box&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            WARNING
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This is a warning box for important notices and potential issues.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h3 id=&quot;tip-box&quot;&gt;Tip Box&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            TIP
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;This is a helpful tip to improve your experience with the theme.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h2 id=&quot;retro-dividers&quot;&gt;Retro Dividers&lt;&#x2F;h2&gt;
&lt;p&gt;Dividers help separate content sections with retro-style lines:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;single-line-divider&quot;&gt;Single Line Divider&lt;&#x2F;h3&gt;
&lt;!-- Retro-Trennlinie Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: retro_divider(style=&quot;dots&quot;) --&gt;
&lt;!-- Styles: dots, double, dashed, solid, shadow --&gt;


&lt;hr size=&quot;1&quot; noshade color=&quot;#666666&quot; style=&quot;margin: 15px 0;&quot;&gt;

&lt;h3 id=&quot;double-line-divider&quot;&gt;Double Line Divider&lt;&#x2F;h3&gt;
&lt;!-- Retro-Trennlinie Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: retro_divider(style=&quot;dots&quot;) --&gt;
&lt;!-- Styles: dots, double, dashed, solid, shadow --&gt;


&lt;hr size=&quot;2&quot; noshade color=&quot;#666666&quot; style=&quot;margin: 15px 0; border-style: double;&quot;&gt;

&lt;h3 id=&quot;dashed-line-divider&quot;&gt;Dashed Line Divider&lt;&#x2F;h3&gt;
&lt;!-- Retro-Trennlinie Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: retro_divider(style=&quot;dots&quot;) --&gt;
&lt;!-- Styles: dots, double, dashed, solid, shadow --&gt;


&lt;hr size=&quot;1&quot; noshade color=&quot;#666666&quot; style=&quot;margin: 15px 0; border-style: dashed;&quot;&gt;

&lt;h2 id=&quot;ascii-art&quot;&gt;ASCII Art&lt;&#x2F;h2&gt;
&lt;p&gt;The theme supports ASCII art through a dedicated shortcode:&lt;&#x2F;p&gt;
&lt;!-- ASCII-Art Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: ascii_art() mit ASCII-Kunst als Inhalt --&gt;

&lt;pre style=&quot;font-family: &#x27;Perfect DOS VGA 437&#x27;, monospace; 
            line-height: 1.0; 
            color: #e0e0e0; 
            background-color: #121212; 
            padding: 15px; 
            border: 1px solid #666666; 
            overflow: auto; 
            white-space: pre; 
            font-size: 14px;&quot;&gt;____      _             ____            _          
 &amp;#x2F; ___|_ __(_) |_ _   _  | __ )  __ _ ___(_) ___ ___ 
| |   | &amp;#x27;__| | __| | | | |  _ \ &amp;#x2F; _` &amp;#x2F; __| |&amp;#x2F; __&amp;#x2F; __|
| |___| |  | | |_| |_| | | |_) | (_| \__ \ | (__\__ \
 \____|_|  |_|\__|\__, | |____&amp;#x2F; \__,_|___&amp;#x2F;_|\___|___&amp;#x2F;
                  |___&amp;#x2F;&lt;&#x2F;pre&gt;
&lt;!-- ASCII-Art Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: ascii_art() mit ASCII-Kunst als Inhalt --&gt;

&lt;pre style=&quot;font-family: &#x27;Perfect DOS VGA 437&#x27;, monospace; 
            line-height: 1.0; 
            color: #e0e0e0; 
            background-color: #121212; 
            padding: 15px; 
            border: 1px solid #666666; 
            overflow: auto; 
            white-space: pre; 
            font-size: 14px;&quot;&gt;_____  _____  _____  _____  _____  _____  _____  _____  _____  _____ 
|_____||_____||_____||_____||_____||_____||_____||_____||_____||_____|
                                                                      
 _____                                                         _____ 
|_____|  _____ _____ _____ _____ _____ _____ _____ _____      |_____|
        |_____||_____||_____||_____||_____||_____||_____|            
 _____                                                         _____ 
|_____|  _____ _____ _____ _____ _____ _____ _____ _____      |_____|
        |_____||_____||_____||_____||_____||_____||_____|            
 _____                                                         _____ 
|_____||_____||_____||_____||_____||_____||_____||_____||_____||_____|&lt;&#x2F;pre&gt;
&lt;!-- ASCII-Art Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: ascii_art() mit ASCII-Kunst als Inhalt --&gt;

&lt;pre style=&quot;font-family: &#x27;Perfect DOS VGA 437&#x27;, monospace; 
            line-height: 1.0; 
            color: #e0e0e0; 
            background-color: #121212; 
            padding: 15px; 
            border: 1px solid #666666; 
            overflow: auto; 
            white-space: pre; 
            font-size: 14px;&quot;&gt;_______ _    _ ______  __  __  ______      _______ _    _ _____  ______          _______ ______ 
 |__   __| |  | |  ____|&amp;#x2F;_ |&amp;#x2F;_ |&amp;#x2F; __ \ \    &amp;#x2F; &amp;#x2F; ____| |  | |  __ \|  ____|   &amp;#x2F;\   |__   __|  ____|
    | |  | |__| | |__    | | | | |  | \ \  &amp;#x2F; &amp;#x2F; (___ | |__| | |  | | |__     &amp;#x2F;  \     | |  | |__   
    | |  |  __  |  __|   | | | | |  | |\ \&amp;#x2F; &amp;#x2F; \___ \|  __  | |  | |  __|   &amp;#x2F; &amp;#x2F;\ \    | |  |  __|  
    | |  | |  | | |____  | | | | |__| | \  &amp;#x2F;  ____) | |  | | |__| | |____ &amp;#x2F; ____ \   | |  | |____ 
    |_|  |_|  |_|______| |_| |_|\____&amp;#x2F;   \&amp;#x2F;  |_____&amp;#x2F;|_|  |_|_____&amp;#x2F;|______&amp;#x2F;_&amp;#x2F;    \_\  |_|  |______|
                                                                                                  
  _______ _    _ ______  __  __  ______      _______ _    _ _____  ______          _______ ______ 
 |__   __| |  | |  ____|&amp;#x2F;_ |&amp;#x2F;_ |&amp;#x2F; __ \ \    &amp;#x2F; &amp;#x2F; ____| |  | |  __ \|  ____|   &amp;#x2F;\   |__   __|  ____|
    | |  | |__| | |__    | | | | |  | \ \  &amp;#x2F; &amp;#x2F; (___ | |__| | |  | | |__     &amp;#x2F;  \     | |  | |__   
    | |  |  __  |  __|   | | | | |  | |\ \&amp;#x2F; &amp;#x2F; \___ \|  __  | |  | |  __|   &amp;#x2F; &amp;#x2F;\ \    | |  |  __|  
    | |  | |  | | |____  | | | | |__| | \  &amp;#x2F;  ____) | |  | | |__| | |____ &amp;#x2F; ____ \   | |  | |____ 
    |_|  |_|  |_|______| |_| |_|\____&amp;#x2F;   \&amp;#x2F;  |_____&amp;#x2F;|_|  |_|_____&amp;#x2F;|______&amp;#x2F;_&amp;#x2F;    \_\  |_|  |______|
                                                                                                  
  _______ _    _ ______  __  __  ______      _______ _    _ _____  ______          _______ ______ 
 |__   __| |  | |  ____|&amp;#x2F;_ |&amp;#x2F;_ |&amp;#x2F; __ \ \    &amp;#x2F; &amp;#x2F; ____| |  | |  __ \|  ____|   &amp;#x2F;\   |__   __|  ____|
    | |  | |__| | |__    | | | | |  | \ \  &amp;#x2F; &amp;#x2F; (___ | |__| | |  | | |__     &amp;#x2F;  \     | |  | |__   
    | |  |  __  |  __|   | | | | |  | |\ \&amp;#x2F; &amp;#x2F; \___ \|  __  | |  | |  __|   &amp;#x2F; &amp;#x2F;\ \    | |  |  __|  
    | |  | |  | | |____  | | | | |__| | \  &amp;#x2F;  ____) | |  | | |__| | |____ &amp;#x2F; ____ \   | |  | |____ 
    |_|  |_|  |_|______| |_| |_|\____&amp;#x2F;   \&amp;#x2F;  |_____&amp;#x2F;|_|  |_|_____&amp;#x2F;|______&amp;#x2F;_&amp;#x2F;    \_\  |_|  |______|&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;additional-code-examples&quot;&gt;Additional Code Examples&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;rust-example-zola-is-written-in-rust&quot;&gt;Rust Example (Zola is written in Rust!)&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;use&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; std&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;collections&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;HashMap&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;fn&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; main&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &#x2F;&#x2F; Create a new HashMap to store user scores&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    let mut&lt;&#x2F;span&gt;&lt;span&gt; scores&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; HashMap&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;new&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &#x2F;&#x2F; Insert some values&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    scores&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;insert&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Blue&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 10&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    scores&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;insert&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Yellow&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 50&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    scores&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;insert&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Red&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;),&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 25&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &#x2F;&#x2F; Access a value&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; team_name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; String&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;::&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;from&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Blue&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span&gt; score&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; scores&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;get&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;team_name)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;unwrap_or&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;    println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Team {} score: {}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, team_name, score);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6A737D;&quot;&gt;    &#x2F;&#x2F; Iterate over all key-value pairs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;    for&lt;&#x2F;span&gt;&lt;span&gt; (key, value)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt; in &amp;amp;&lt;&#x2F;span&gt;&lt;span&gt;scores {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt;        println!&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;{}: {}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;, key, value);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;html-example&quot;&gt;HTML Example&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;html&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;DOCTYPE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; HTML PUBLIC&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;-&#x2F;&#x2F;W3C&#x2F;&#x2F;DTD HTML 4.01&#x2F;&#x2F;EN&amp;quot; &amp;quot;http:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;html4&#x2F;strict.dtd&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;html&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;head&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;title&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Retro Web Page&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;title&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;meta&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; http-equiv&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;Content-Type&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; content&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;text&#x2F;html; charset=utf-8&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;style&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B392F0;&quot;&gt; type&lt;&#x2F;span&gt;&lt;span&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt;&amp;quot;text&#x2F;css&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;        body&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            background-color&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; #000000&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            color&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; #33ff33&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            font-family&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #9ECBFF;&quot;&gt; &amp;quot;Courier New&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; monospace&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;        table&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            border-collapse&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; collapse&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            width&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 100&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;%&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;        td&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            border&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;px&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; solid #444444&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt;            padding&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;&quot;&gt; 8&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F97583;&quot;&gt;px&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;style&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;head&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;body&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;h1&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Welcome to My Retro Website&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;h1&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;This is a simple example of HTML 4.01 Strict.&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;p&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;table&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Row 1, Cell 1&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Row 1, Cell 2&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Row 2, Cell 1&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;Row 2, Cell 2&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;td&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;tr&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;table&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;body&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;&quot;&gt;html&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h1 id=&quot;layout-features&quot;&gt;Layout Features&lt;&#x2F;h1&gt;
&lt;p&gt;The theme uses a three-column layout:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Left Sidebar&lt;&#x2F;strong&gt;: Navigation, search, and status panels&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Main Content&lt;&#x2F;strong&gt;: Articles and primary content&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Right Sidebar&lt;&#x2F;strong&gt;: Additional links, visitor counter, and GIF panels&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The layout automatically collapses on mobile devices for better readability.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;retro-panels&quot;&gt;Retro Panels&lt;&#x2F;h2&gt;
&lt;p&gt;The theme includes various retro-style panels:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Status Panel&lt;&#x2F;strong&gt;: Displays an animated GIF showing the current status&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Links Panel&lt;&#x2F;strong&gt;: List of useful web links with matching emojis&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Obligatory GIFs Panel&lt;&#x2F;strong&gt;: Display of animated GIFs in retro style&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Visitor Counter&lt;&#x2F;strong&gt;: Simulated visitor counter that grows over time&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;improved-accessibility&quot;&gt;Improved Accessibility&lt;&#x2F;h1&gt;
&lt;p&gt;The theme has been equipped with numerous accessibility improvements:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Skip Links&lt;&#x2F;strong&gt;: Allow skipping the navigation to get directly to the main content.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Focus Indicators&lt;&#x2F;strong&gt;: Clearly visible focus styles for all interactive elements.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Screen Reader Support&lt;&#x2F;strong&gt;: Use of ARIA attributes and semantic HTML.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;High Contrast&lt;&#x2F;strong&gt;: High-contrast color scheme for better readability.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h1 id=&quot;customization-options&quot;&gt;Customization Options&lt;&#x2F;h1&gt;
&lt;p&gt;The theme offers extensive customization options:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Central configuration&lt;&#x2F;strong&gt; in &lt;code&gt;sass&#x2F;partials&#x2F;_variables.scss&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Customizable header&lt;&#x2F;strong&gt; with background image&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Adjustable logo sizes&lt;&#x2F;strong&gt; for desktop and mobile&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Configurable GIF panels&lt;&#x2F;strong&gt; in different areas of the page&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Button styling&lt;&#x2F;strong&gt; and appearance settings&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            CUSTOMIZATION TIP
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;All design elements can be configured centrally in the file &lt;code&gt;sass&#x2F;partials&#x2F;_variables.scss&lt;&#x2F;code&gt;, making it easy to maintain a consistent look throughout your site.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h1 id=&quot;form-elements&quot;&gt;Form Elements&lt;&#x2F;h1&gt;
&lt;p&gt;The theme includes retro-styled form elements:&lt;&#x2F;p&gt;
&lt;div style=&quot;margin: 30px 0; padding: 20px; background-color: #1e1e1e; border: 1px solid #333;&quot;&gt;
  &lt;input type=&quot;text&quot; class=&quot;retro-input-unset&quot; placeholder=&quot;Input field text&quot; style=&quot;margin-bottom: 10px; display: block;&quot;&gt;
&lt;p&gt;&lt;button class=&quot;retro-button&quot; style=&quot;margin-bottom: 10px; display: block;&quot;&gt;Button Text&lt;&#x2F;button&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;h1 id=&quot;tables&quot;&gt;Tables&lt;&#x2F;h1&gt;
&lt;p&gt;The Retro-Compatible Zola Theme offers three different table shortcodes, each optimized for different use cases.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;table-with-custom-column-widths&quot;&gt;Table with Custom Column Widths&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;code&gt;table&lt;&#x2F;code&gt; shortcode allows you to set the width of each column individually. The column widths are specified as percentages and must add up to 100%.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Syntax:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% table(cols=&amp;quot;30%,70%&amp;quot;) %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Property | Description |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|----------|-------------|&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Name     | The name of the property |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Value    | A longer description that needs more space |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% end %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;

  



  





&lt;div class=&quot;styled-table-container&quot;&gt;
  &lt;table id=&quot;custom-table&quot; &gt;
    
      &lt;colgroup&gt;
        
          &lt;col width=&quot;30%&quot;&gt;
        
          &lt;col width=&quot;70%&quot;&gt;
        
      &lt;&#x2F;colgroup&gt;
    

    &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Property&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Name&lt;&#x2F;td&gt;&lt;td&gt;The name of the property&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Value&lt;&#x2F;td&gt;&lt;td&gt;A longer description that needs more space&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;

  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;example-with-4-columns-of-different-sizes&quot;&gt;Example with 4 Columns of Different Sizes&lt;&#x2F;h3&gt;
&lt;p&gt;You can define any number of columns with different widths:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% table(cols=&amp;quot;15%,25%,20%,40%&amp;quot;) %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| ID | Category | Priority | Description |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|----|----------|----------|-------------|&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| 001 | Hardware | High | New graphics card for workstation |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| 002 | Software | Medium | Operating system update |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| 003 | Network  | Low      | Office Wi-Fi optimization |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% end %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The result looks like this:&lt;&#x2F;p&gt;

  



  





&lt;div class=&quot;styled-table-container&quot;&gt;
  &lt;table id=&quot;custom-table&quot; &gt;
    
      &lt;colgroup&gt;
        
          &lt;col width=&quot;15%&quot;&gt;
        
          &lt;col width=&quot;25%&quot;&gt;
        
          &lt;col width=&quot;20%&quot;&gt;
        
          &lt;col width=&quot;40%&quot;&gt;
        
      &lt;&#x2F;colgroup&gt;
    

    &lt;thead&gt;&lt;tr&gt;&lt;th&gt;ID&lt;&#x2F;th&gt;&lt;th&gt;Category&lt;&#x2F;th&gt;&lt;th&gt;Priority&lt;&#x2F;th&gt;&lt;th&gt;Description&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;001&lt;&#x2F;td&gt;&lt;td&gt;Hardware&lt;&#x2F;td&gt;&lt;td&gt;High&lt;&#x2F;td&gt;&lt;td&gt;New graphics card for workstation&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;002&lt;&#x2F;td&gt;&lt;td&gt;Software&lt;&#x2F;td&gt;&lt;td&gt;Medium&lt;&#x2F;td&gt;&lt;td&gt;Operating system update&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;003&lt;&#x2F;td&gt;&lt;td&gt;Network&lt;&#x2F;td&gt;&lt;td&gt;Low&lt;&#x2F;td&gt;&lt;td&gt;Office Wi-Fi optimization&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;

  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;shortcut-table&quot;&gt;Shortcut Table&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;code&gt;shortcut_table&lt;&#x2F;code&gt; shortcode is specifically optimized for displaying keyboard shortcuts. It uses fixed column widths (40% for the first column, 60% for the second) to ensure a consistent presentation.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Syntax:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% shortcut_table() %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Action | Shortcut |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|--------|----------|&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Copy | Ctrl+C |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Paste | Ctrl+V |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% end %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;div class=&quot;styled-table-container shortcut-table&quot;&gt;
 
   &lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Action&lt;&#x2F;th&gt;&lt;th&gt;Shortcut&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Copy&lt;&#x2F;td&gt;&lt;td&gt;Ctrl+C&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Paste&lt;&#x2F;td&gt;&lt;td&gt;Ctrl+V&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Save&lt;&#x2F;td&gt;&lt;td&gt;Ctrl+S&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Open&lt;&#x2F;td&gt;&lt;td&gt;Ctrl+O&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;

 &lt;&#x2F;div&gt;
&lt;h2 id=&quot;changelog-table&quot;&gt;Changelog Table&lt;&#x2F;h2&gt;
&lt;p&gt;The &lt;code&gt;changelog_table&lt;&#x2F;code&gt; shortcode is optimized for changelogs. It gives the date column a fixed width (100px) so that dates are displayed uniformly.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Syntax:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% changelog_table() %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| Date | Changes |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;|------|--------|&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| 2025-01-01 | Initial release |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;| 2025-01-15 | Bug fixes |&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{​% end %​}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;&#x2F;strong&gt;
The changelog table at the beginning of this page uses the &lt;code&gt;changelog_table&lt;&#x2F;code&gt; shortcode.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;note-on-displaying-shortcode-examples&quot;&gt;Note on Displaying Shortcode Examples&lt;&#x2F;h2&gt;
&lt;p&gt;To display shortcode examples in the documentation without them being executed, a special trick is used: invisible spaces (Zero-Width Spaces &lt;code&gt;\u200b&lt;&#x2F;code&gt;) are inserted between the curly braces and the percent signs. This prevents Zola from recognizing and executing the shortcodes, but they are not visible to the user.&lt;&#x2F;p&gt;
&lt;p&gt;Example: &lt;code&gt;{\u200b% shortcode %\u200b}&lt;&#x2F;code&gt; instead of &lt;code&gt;{% shortcode %}&lt;&#x2F;code&gt; (with an invisible space between &lt;code&gt;{&lt;&#x2F;code&gt; and &lt;code&gt;%&lt;&#x2F;code&gt; and between &lt;code&gt;%&lt;&#x2F;code&gt; and &lt;code&gt;}&lt;&#x2F;code&gt;)&lt;&#x2F;p&gt;
&lt;h1 id=&quot;markdown-troubleshooting&quot;&gt;Markdown Troubleshooting&lt;&#x2F;h1&gt;
&lt;h2 id=&quot;common-layout-issues&quot;&gt;Common Layout Issues&lt;&#x2F;h2&gt;
&lt;p&gt;When working with this theme (or any Markdown-based system), certain formatting issues can break your layout. Here are some common problems and solutions:&lt;&#x2F;p&gt;
&lt;h3 id=&quot;html-like-syntax-in-markdown&quot;&gt;HTML-Like Syntax in Markdown&lt;&#x2F;h3&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ffcccc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ⚠️ 
            AVOID RAW HTML TAGS IN TEXT
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;Using angle brackets (&lt;code&gt;&amp;lt;&lt;&#x2F;code&gt; and &lt;code&gt;&amp;gt;&lt;&#x2F;code&gt;) in your Markdown text can cause layout problems because they might be interpreted as HTML tags. This can break the entire page layout if the “tag” is never closed.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;h4 id=&quot;problem-example&quot;&gt;Problem Example:&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Select &lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;**&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;font-weight: bold;&quot;&gt;Yes&lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;gt;**&lt;&#x2F;span&gt;&lt;span&gt; to enable automatic updates.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In this example, &lt;code&gt;&amp;lt;Yes&amp;gt;&lt;&#x2F;code&gt; might be interpreted as an HTML tag named “Yes”, causing layout issues.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;solutions&quot;&gt;Solutions:&lt;&#x2F;h4&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use quotes instead of angle brackets:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Select &lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;**&amp;quot;Yes&amp;quot;**&lt;&#x2F;span&gt;&lt;span&gt; to enable automatic updates.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use backticks to format as code:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Select &lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;**&lt;&#x2F;span&gt;&lt;span style=&quot;color: #79B8FF;font-weight: bold;&quot;&gt;`&amp;lt;Yes&amp;gt;`&lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;**&lt;&#x2F;span&gt;&lt;span&gt; to enable automatic updates.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use HTML entities:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Select &lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;**&amp;amp;lt;Yes&amp;amp;gt;**&lt;&#x2F;span&gt;&lt;span&gt; to enable automatic updates.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use escape characters:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #E1E4E8; background-color: #24292E;&quot;&gt;&lt;code data-lang=&quot;markdown&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Select &lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;**\&amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #85E89D;font-weight: bold;&quot;&gt;Yes\&lt;&#x2F;span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;gt;**&lt;&#x2F;span&gt;&lt;span&gt; to enable automatic updates.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;other-common-markdown-issues&quot;&gt;Other Common Markdown Issues&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unclosed code blocks&lt;&#x2F;strong&gt;: Always ensure your code blocks have opening and closing backticks on their own lines.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Malformed tables&lt;&#x2F;strong&gt;: Tables require a specific format with headers and separators.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Nested HTML&lt;&#x2F;strong&gt;: Be careful when nesting HTML elements inside Markdown content.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#ccffcc&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            💡 
            DEBUGGING LAYOUT ISSUES
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;If your page layout breaks, try removing sections of content one by one until the layout displays correctly. This can help identify which specific content is causing the problem.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;!-- Retro-Trennlinie Shortcode - Kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: retro_divider(style=&quot;dots&quot;) --&gt;
&lt;!-- Styles: dots, double, dashed, solid, shadow --&gt;


&lt;hr size=&quot;2&quot; noshade color=&quot;#666666&quot; style=&quot;margin: 15px 0; border-style: double;&quot;&gt;

&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;getting-started&quot;&gt;Getting Started&lt;&#x2F;h1&gt;
&lt;!-- Infobox Shortcode - Retro-kompatibel mit Browsern der 90er Jahre --&gt;
&lt;!-- Verwendung: infobox(type=&quot;info&quot;, title=&quot;Titel&quot;) mit Inhalt der Box --&gt;
&lt;!-- Types: info, warning, tip, note --&gt;


&lt;table class=&quot;retro-infobox&quot; width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;10&quot; border=&quot;1&quot;&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#eeeeee&quot; style=&quot;color: #000000; font-weight: bold;&quot;&gt;
            ℹ️ 
            GETTING STARTED
        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
    &lt;tr&gt;
        &lt;td bgcolor=&quot;#000000&quot; style=&quot;color: #ffffff;&quot;&gt;
            &lt;p&gt;To get started with this theme:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Clone the repository into your Zola &lt;code&gt;themes&lt;&#x2F;code&gt; directory&lt;&#x2F;li&gt;
&lt;li&gt;Activate the theme in your &lt;code&gt;config.toml&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Run &lt;code&gt;zola serve&lt;&#x2F;code&gt; to see a preview&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;For detailed instructions, see the &lt;a href=&quot;..&#x2F;..&#x2F;docs&#x2F;README.md&quot;&gt;Main Documentation&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;

        &lt;&#x2F;td&gt;
    &lt;&#x2F;tr&gt;
&lt;&#x2F;table&gt;
&lt;hr &#x2F;&gt;
&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h1&gt;
&lt;p&gt;The Retro-Compatible Zola Theme offers a unique combination of nostalgic design and modern functionality. It’s perfect for:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Retro computing enthusiasts&lt;&#x2F;li&gt;
&lt;li&gt;Digital preservation projects&lt;&#x2F;li&gt;
&lt;li&gt;Personal websites with a nostalgic touch&lt;&#x2F;li&gt;
&lt;li&gt;Anyone who appreciates the aesthetic of early web design&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</description>
      </item>
    </channel>
</rss>
