{"@attributes":{"version":"2.0"},"channel":{"title":"Charlz' Realm","description":"Just some random thoughts, experiments and discoveries","link":"https:\/\/www.charlz.net\/","item":[{"title":"How to Build an Incus Buster Image","description":"\n          \n          <p>It\u2019s always nice to have container images of Debian releases to test things,\nrun applications or explore a bit without polluting your host machine. From\nsome Brazilian friends (you know who you are ;-), I\u2019ve learned the best way to\ndebug a problem or test a fix is spinning up an incus container, getting to it\nand finding the minimum reproducer. So the combination incus + Debian is\nsomething that I\u2019m very used to, but the problem is there are no images for\nDebian ELTS and testing security fixes to see if they actually fix the\nvulnerability and don\u2019t break anything else is very important.<\/p>\n\n<p>Well, the regular images don\u2019t materialize out of thin air, right? So we can\nlearn how they are made and try to generate ELTS images in the same way -\nshouldn\u2019t be that difficult, right? Well, kinda ;-)<\/p>\n\n<p>The images available by default in incus come from\n<a href=\"https:\/\/images.linuxcontainers.org\/\">images.linuxcontainers.org<\/a> and are built\nby Jenkins using distrobuilder. If you follow the links, you will find the\nrepository containing the yaml image definitions used by distrobuilder at\n<a href=\"https:\/\/github.com\/lxc\/lxc-ci\">github.com\/lxc\/lxc-ci<\/a>. With a bit of\ninvestigation work, a <a href=\"https:\/\/github.com\/charles2910\/lxc-ci\">fork<\/a>, an incus\nVM with distrobuilder installed and some magic (also called trial and error) I\nwas able to build a buster image! Whooray, but VM and stretch images are still\nwork in progress.<\/p>\n\n<p>Anyway, I wanted to share how you can build your images and document this\nprocess so I don\u2019t forget, so here we are\u2026<\/p>\n\n<h2 id=\"building-instructions\">Building Instructions<\/h2>\n\n<p>We will use an incus trixie VM to perform the build so we don\u2019t clutter our own\nmachine.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>incus launch images:debian\/trixie &lt;instance-name&gt; <span class=\"nt\">--vm<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Then let\u2019s hop into the machine and install the dependencies.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>incus shell &lt;instance-name&gt;\n<\/code><\/pre><\/div><\/div>\n\n<p>And\u2026<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>apt <span class=\"nb\">install <\/span>git distrobuilder\n<\/code><\/pre><\/div><\/div>\n\n<p>Let\u2019s clone the repository with the yaml definition to build a buster\ncontainer.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>git clone <span class=\"nt\">--branch<\/span> support-debian-buster https:\/\/github.com\/charles2910\/lxc-ci.git\n<span class=\"c\"># and cd into it<\/span>\n<span class=\"nb\">cd <\/span>lxc-ci\n<\/code><\/pre><\/div><\/div>\n\n<p>Then all we need is to pass the correct arguments to distrobuilder so it can build\nthe image. It can output the image in the current directory or in a pre-defined\nplace, so let\u2019s create an easy place for the images.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">mkdir<\/span> <span class=\"nt\">-p<\/span> \/tmp\/images\/buster\/container\n<span class=\"c\"># and perform the build<\/span>\ndistrobuilder build-incus images\/debian.yaml \/tmp\/images\/buster\/container\/ <span class=\"se\">\\<\/span>\n            <span class=\"nt\">-o<\/span> image.architecture<span class=\"o\">=<\/span>amd64 <span class=\"se\">\\<\/span>\n            <span class=\"nt\">-o<\/span> image.release<span class=\"o\">=<\/span>buster <span class=\"se\">\\<\/span>\n            <span class=\"nt\">-o<\/span> image.variant<span class=\"o\">=<\/span>default  <span class=\"se\">\\<\/span>\n            <span class=\"nt\">-o<\/span> source.url<span class=\"o\">=<\/span><span class=\"s2\">\"http:\/\/archive.debian.org\/debian\"<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>It requires a build definition written in yaml format to perform the build. If\nyou are curious, check the <code class=\"language-plaintext highlighter-rouge\">images\/<\/code> subdir.<\/p>\n\n<p>If all worked correctly, you should have two files in your pre-defined target\ndirectory. In our case, <code class=\"language-plaintext highlighter-rouge\">\/tmp\/images\/buster\/container\/<\/code> contains:<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>incus.tar.xz  rootfs.squashfs\n<\/code><\/pre><\/div><\/div>\n\n<p>Let\u2019s copy it to our host so we can add the image to our incus server.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>incus file pull &lt;instance-name&gt;\/tmp\/images\/buster\/container\/incus.tar.xz <span class=\"nb\">.<\/span>\nincus file pull &lt;instance-name&gt;\/tmp\/images\/buster\/container\/rootfs.squashfs <span class=\"nb\">.<\/span>\n<span class=\"c\"># and import it as debian\/10<\/span>\nincus image import incus.tar.xz rootfs.squashfs <span class=\"nt\">--alias<\/span> debian\/10\n<\/code><\/pre><\/div><\/div>\n\n<p>If we are lucky, we can run our Debian buster container now!<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>incus launch <span class=\"nb\">local<\/span>:debian\/10 &lt;debian-buster-instance&gt;\nincus shell &lt;debian-buster-instance&gt;\n<\/code><\/pre><\/div><\/div>\n\n<p>Well, now all that is left is to <a href=\"https:\/\/www.freexian.com\/lts\/extended\/docs\/how-to-use-extended-lts\/\">install Freexian\u2019s ELTS package\nrepository<\/a>\nand update the image to get a lot of CVE fixes.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>apt <span class=\"nb\">install<\/span> <span class=\"nt\">--assume-yes<\/span> wget\nwget https:\/\/deb.freexian.com\/extended-lts\/archive-key.gpg <span class=\"nt\">-O<\/span> \/etc\/apt\/trusted.gpg.d\/freexian-archive-extended-lts.gpg\n<span class=\"nb\">cat<\/span> <span class=\"o\">&lt;&lt;<\/span><span class=\"no\">EOF<\/span><span class=\"sh\"> &gt;\/etc\/apt\/sources.list.d\/extended-lts.list\ndeb http:\/\/deb.freexian.com\/extended-lts buster-lts main contrib non-free\n<\/span><span class=\"no\">EOF\n<\/span>apt update\napt <span class=\"nt\">--assume-yes<\/span> upgrade\n<\/code><\/pre><\/div><\/div>\n\n        ","pubDate":"Thu, 09 Oct 2025 00:01:09 -0300","link":"https:\/\/www.charlz.net\/2025-10-09-buster-incus-image\/","guid":"https:\/\/www.charlz.net\/2025-10-09-buster-incus-image\/"},{"title":"Making KGB less noisy","description":"\n          \n          <p>This past month I did setup KGB to send notifications to #debian-lts when new\nmerge requests were created in the LTS website\u2019s repo and I learned a couple\ncool things. I\u2019ve been trying to document things more so I don\u2019t have to\nresearch the same topic months later, hence the blog seemed like a good idea,\nspecially since many debianites have KGB set on their favorite IRC channel\nand this post will go to planet.debian.org.<\/p>\n\n<h2 id=\"selecting-what-goes-to-irc\">Selecting What Goes to IRC<\/h2>\n\n<p>Salsa (Debian\u2019s GitLab instance) can <a href=\"https:\/\/docs.gitlab.com\/user\/project\/integrations\/webhook_events\/\">generate a lot of\nevents<\/a> for\nthings that happen on a repository and a lot of them can be <a href=\"https:\/\/salsa.debian.org\/kgb-team\/kgb\/-\/wikis\/usage\">pushed to KGB via\nwebhooks<\/a>. Generally I\nprefer a minimal set enabled otherwise it\u2019s too much clutter on the IRC side,\nbut it\u2019s important to go through each option to see what makes sense or not.\nFrom the experience I had, the following ones are the most useful to have it\non:<\/p>\n\n<ul>\n  <li>Push events<\/li>\n  <li>Tag push events<\/li>\n  <li>Comments<\/li>\n  <li>Issue events<\/li>\n  <li>Merge request events<\/li>\n  <li>Pipeline events<\/li>\n<\/ul>\n\n<h2 id=\"reducing-the-noise\">Reducing the Noise<\/h2>\n\n<p>For Debian packaging, one may find it useful to add a pattern filter so only\nthe packaging branch updates go to IRC. If you are using\n<a href=\"https:\/\/dep-team.pages.debian.net\/deps\/dep14\/\">DEP-14<\/a>, that\u2019s pretty easy,\n\u201cdebian\/*\u201d will do the job.<\/p>\n\n<p>Notably, \u201cJob events\u201d are left out. Basically it\u2019s just too much info, you get\none alert when a job is scheduled, then when it\u2019s started and another one when\nit\u2019s completed. Well, each pipeline has at least a few of them, multiply by\nthree and you can understand my point.<\/p>\n\n<p>Besides that, pipelines also generate the same amount of events as jobs, so it\nmight be a problem too. Well, KGB comes to the rescue. It allows you to filter\npipeline events, because you really only care about the pipeline when it fails\n;-) To do just that, <code class=\"language-plaintext highlighter-rouge\">pipeline_only_status=failed<\/code>.<\/p>\n\n<p>Another interesting option is limiting the commits shown when the push event\nhas too many of them. One can do that with <code class=\"language-plaintext highlighter-rouge\">squash_threshold=3<\/code>. Remember I\nwant less clutter?! Three commits is my limit here.<\/p>\n\n<h2 id=\"final-result\">Final Result<\/h2>\n\n<p>The final URL for me looks like this (newlines added for clarity):<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>http:\/\/kgb.debian.net:9418\/webhook\/?channel=debian-&lt;your_preferred_channel&gt;&amp;\n                                    network=oftc&amp;\n                                    private=1&amp;\n                                    use_color=1&amp;\n                                    use_irc_notices=1&amp;\n                                    squash_threshold=3&amp;\n                                    pipeline_only_status=failed\n<\/code><\/pre><\/div><\/div>\n\n<p>You can see there are more options than the ones I described earlier, well, now\nit\u2019s your time to go through <a href=\"https:\/\/salsa.debian.org\/kgb-team\/kgb\/-\/wikis\/usage\">KGB\u2019s\ndocumentation<\/a> and learn a\nthing or two ;-)<\/p>\n\n        ","pubDate":"Mon, 01 Sep 2025 21:18:09 -0300","link":"https:\/\/www.charlz.net\/2025-09-01-kgb-tips\/","guid":"https:\/\/www.charlz.net\/2025-09-01-kgb-tips\/"},{"title":"Hello World","description":"\n          Or how it took more than a year for me to set up this website - \n          <p>As the computer science tradition demands, we must start with a <strong>Hello World<\/strong>.<\/p>\n\n<p>Though I have to say this hello world took quite a long time to reach the\ninternet. I\u2019ve been thinking about setting up this website for way over a year,\nbut there are always too many things to decide - what Static Site Generator\nwill I use? Where should I get a domain from? Which registrar would be better\nnow? What if I want to set up a mail server, is it good enough? Oh, and what\nabout the theme, which one to choose? Can I get one simple enough to not fetch\njavascript or css from external sources?<\/p>\n\n<p>This was taking so long that even my friends were saying \u201cPlease, just share\nyour screen and let\u2019s do it <strong>now<\/strong>!\u201d. Well, rejoice friends, now it\u2019s done!<\/p>\n\n        ","pubDate":"Sun, 01 Dec 2024 23:18:09 -0300","link":"https:\/\/www.charlz.net\/2024-12-01-hello-world\/","guid":"https:\/\/www.charlz.net\/2024-12-01-hello-world\/"}]}}