{"id":1420,"date":"2024-09-16T12:00:00","date_gmt":"2024-09-16T19:00:00","guid":{"rendered":"https:\/\/letsbuildroboticswithshadow8472.com\/?p=1420"},"modified":"2024-09-13T16:38:23","modified_gmt":"2024-09-13T23:38:23","slug":"server-rebuild-with-quadlet","status":"publish","type":"post","link":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/2024\/09\/16\/server-rebuild-with-quadlet\/","title":{"rendered":"Server Rebuild With Quadlet"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Good Morning from my Robotics Lab! This is Shadow_8472, and today I am continuing my work on my home\u2019s network. Let\u2019s get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">State of the Homelab<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Bitwarden. I self host using Vaultwarden, a 3rd party server. Done properly, it fits nicely in a larger homelab stack, but its OCI container can stand alone in a development environment. Due to skill limitations, I\u2019ve been using it in this configuration. My recent network work has invalidated my manually self-signed certificates, and I\u2019d rather focus my efforts on upgrades instead of re-learning the old system to maintain it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, I am working on my newest server, Joystick (Rocky Linux 9). I compiled some command-by-command notes on using `podman generate systemd` to make self-starting, rootless containers, but just as I was getting the hang of it again, a warning message encouraged me to use a newer technique: Quadlet.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quadlet<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Quadlets? I\u2019ve studied them before, but failed to grasp key concepts. It finally clicked though: they replace not just running `podman generate systemd` once I have a working prototype setup, but also everything I might want to do leading up to that point including defining Podman networks and volumes. Just make your Quadlet definitions once, and the system handles the rest.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The tutorial I found that best matches my use case can be found at mo8it.com [1]. Follow the link under Works Cited for the full text. It\u2019s very detailed; I couldn\u2019t have done a better job myeslf. But it doesn\u2019t cover everything, like how `sudo su user` isn\u2019t a true login for `systemctl &#8211;user \u2026`. I had to use a twitchy Cockpit terminal for that (Wayland-Firefox bug).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Caddy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Caddy is the base of my dream homelab tech tree, so I\u2019ll start there. My existing prototype calls for a Podman network, two Podman volumes, and a Caddyfile I\u2019m mounting as a volume from the file system. I threw together caddy.container based on my script, but only the supporting network and volumes showed up. Systemd picked up on \u201cmysleep.container,\u201d an example from RedHat.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As it turned out, caddy.container had missed a capitalization. I found the problem by commenting out lines, reloading, and running `systemctl &#8211;user list-unit-files` to see when it didn\u2019t load. Likewise, my Caddyfile volume had a file path bug to squash.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Vaultwarden<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Good, that\u2019s started and should be stable. On to Vaultwarden. I updated both ButtonMash and Joystick\u2019s NFS unit files to copy over relevant files, but Joystick\u2019s SELinux didn\u2019t like my user\u2019s fingerprints (owner\/group\/SELinux data) on the NFS definitions. I cleaned those up with a series of cp and mv commands with sudo and then I could enable the automounts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Vaultwarden went up with simple enough debugging, but the challenge was in accessing it. I toyed with Cerberus\/OPNsense (hardware firewall) DNS overrides until Caddy returned a test message from &lt;domain.lan&gt;:&lt;port#&gt;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Everything<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">My next battle was with Joystick\u2019s firewall: I forgot to forward tcp traffic from ports 80 and 443 to 8000 and 44300, respectively. Back on Cerberus, I had to actually figure out the alias system and use that. Firefox needed Caddy\u2019s root certificate. Bouncing back to the network Quadlet, I configured it according to another tutorial doing something very similar to what I want [2]. I configured mine without an external DNS. A final adjustment to my Caddyfile to correct Vaultwarden\u2019s fully qualified domain name, and I was in \u2013 padlock and everything.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Takeaways<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I come out of this project with an intuition of how to manage Systemd files \u2013 especially Quadlet. The Quadlet workflow makes Podman container recipes for Systemd, and a working container will work forever \u2013 baring bad updates. I would still recommend prototyping with scripts when stuck though. When a Quadlet fails, there is no obvious error message to look up \u2013 it just fails to show up.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even though it is still new, a lot of my time on Joystick this week was diagnosing my own sloppiness. Reboots helped when I got stuck, and thanks to Quadlet, I didn\u2019t have to worry about spaghetti scripts like how I originally organized ButtonMash and never stabilized this victory I re-achieved today.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final Question<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">NextCloud is going to be very similar, which I will make a pod along with MariaDB and Redis containers. But I am still missing one piece: NFS. How do I do that?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I look forward to your answers below or on my <a href=\"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/discord-invite\/\" target=\"_blank\" rel=\"noreferrer noopener\">Socials<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Works Cited<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">[1] mo8bit, \u201cQuadlet: Running Podman containers under systemd,\u201d <em>mo8it.com<\/em>, Jan. 2-Feb. 19, 2024. [Online]. Available: <a href=\"https:\/\/mo8it.com\/blog\/quadlet\/\">https:\/\/mo8it.com\/blog\/quadlet\/<\/a>. [accessed: Sept. 13, 2024].<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a><\/a>[2] G. Coletto, \u201cHow to install multi-container applications with Podman quadlets,\u201d <em>giacomo.coletto.io<\/em>, May 25, 2024. [Online]. Available: <a href=\"https:\/\/giacomo.coletto.io\/blog\/podman-quadlets\/\">https:\/\/giacomo.coletto.io\/blog\/podman-quadlets\/<\/a>. [accessed: Sept. 13, 2024].<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good Morning from my Robotics Lab! This is Shadow_8472, and today I am continuing my work on my home\u2019s network. Let\u2019s get started! State of the Homelab Bitwarden. I self host using Vaultwarden, a 3rd party server. Done properly, it fits nicely in a larger homelab stack, but its OCI container can stand alone in &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/2024\/09\/16\/server-rebuild-with-quadlet\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Server Rebuild With Quadlet&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[14,195],"tags":[62,128,138,308,55,291],"class_list":["post-1420","post","type-post","status-publish","format-standard","hentry","category-networking","category-server","tag-bitwarden","tag-caddy","tag-podman","tag-quadlet","tag-systemd","tag-vaultwarden"],"_links":{"self":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/1420","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/comments?post=1420"}],"version-history":[{"count":1,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/1420\/revisions"}],"predecessor-version":[{"id":1421,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/1420\/revisions\/1421"}],"wp:attachment":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/media?parent=1420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/categories?post=1420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/tags?post=1420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}