<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Forgejo on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/forgejo/</link><description>Recent content in Forgejo on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Mon, 06 May 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/forgejo/index.xml" rel="self" type="application/rss+xml"/><item><title>Upgrading to Forgejo 7.0.1</title><link>https://blog.iankulin.com/upgrading-to-forgejo-7-0-1/</link><pubDate>Mon, 06 May 2024 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/upgrading-to-forgejo-7-0-1/</guid><description>&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2024-04-28-at-1.08.21-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-04-28-at-1.08.21-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not that long ago that &lt;a href="https://blog.iankulin.com/my-web-app-update-process/"&gt;I wrote about&lt;/a&gt; doing routine upgrades on containerised web apps using Forgejo as an example as I upgraded Forgejo (my git repository manager) between patch versions of 1.21, then a few days later, they dropped 7.0.0&lt;/p&gt;
&lt;p&gt;&lt;a href="https://forgejo.org/2024-04-release-v7-0/"&gt;They say&lt;/a&gt; the major version jump is due to it being an LTS (long term support) release, and changing to &lt;a href="https://semver.org/spec/v2.0.0.html"&gt;semantic versioning 2.0.0&lt;/a&gt; , but that doesn&amp;rsquo;t quite explain it to me, and I assume this is partly signifying the fork&amp;rsquo;s drift away from the gitea codebase. In any case, the upgrade to 7.0.0 it does involve some breaking changes, and signifies to me that a lot has been on, which makes me keen to wait for a patch release (I&amp;rsquo;m always keen for other people to debug these things) which has now landed.&lt;/p&gt;
&lt;p&gt;The reason I think the upgrade process is worth mentioning, is that the steps we went through to move from 1.21.0 to 1.21.8:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;docker compose down&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker pull codeberg.org/forgejo/forgejo:1.21&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker compose up&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;will not work this time, and gives me the excuse to talk about container tags.&lt;/p&gt;
&lt;h3 id="container-tags"&gt;Container Tags&lt;/h3&gt;
&lt;p&gt;When the developers had built their release for 1.21.8, they would have pushed the exact same image to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:1.21.8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:1.21&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:latest&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;that way, people like me who had specified &lt;code&gt;codeberg.org/forgejo/forgejo:1.21&lt;/code&gt; in their docker-compose.yml files just had to down/pull/up to be in business.&lt;/p&gt;
&lt;p&gt;If they had released another patch version, say 1.21.10, they they would have pushed the new image to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:1.21.10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:1.21&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codeberg.org/forgejo/forgejo:latest&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;i.e. the old 1.21.8 image would have stayed the same, so anyone who had depended on that not changing will still be fine, but people like me who want all the patch versions updated (but not a minor version change) would get the new one.&lt;/p&gt;
&lt;p&gt;Normally you can just click on &amp;rsquo;tags&amp;rsquo; for an image on Docker Hub, but since this one is hosted on Codeburg&amp;rsquo;s Forgejo instance, you need to go &lt;a href="https://codeberg.org/forgejo/-/packages/container/forgejo/versions"&gt;https://codeberg.org/forgejo/-/packages/container/forgejo/versions&lt;/a&gt; to see all the tags they&amp;rsquo;ve pushed to.&lt;/p&gt;
&lt;h3 id="upgrade-steps"&gt;Upgrade steps&lt;/h3&gt;
&lt;p&gt;The extra step we&amp;rsquo;ll need to go through this time is to decide what level of version we want to specify in our docker-compose. I&amp;rsquo;ll stick to specifying to the minor version so my new &lt;code&gt;docker-compose.yml&lt;/code&gt; will be:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;version: &amp;#39;3&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;networks:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; forgejo:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; external: false
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;services:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; server:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image: codeberg.org/forgejo/forgejo:7.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; container_name: forgejo
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; environment:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - USER_UID=112
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - USER_GID=103
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; restart: always
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; networks:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - forgejo
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; volumes:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - ./forgejo:/data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - /etc/timezone:/etc/timezone:ro
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - /etc/localtime:/etc/localtime:ro
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ports:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &amp;#39;80:3000&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &amp;#39;2200:22&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once that decision is made, it&amp;rsquo;s just the same:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;backup the LXC&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker compose down&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker pull codeberg.org/forgejo/forgejo:7.0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker compose up&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Then some testing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We could probably skip that pull step - when you compose up the system would notice the version change and pull it for us.&lt;/p&gt;</description></item><item><title>My Web App Update Process</title><link>https://blog.iankulin.com/my-web-app-update-process/</link><pubDate>Mon, 01 Apr 2024 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/my-web-app-update-process/</guid><description>&lt;p&gt;I&amp;rsquo;ve settled on a very standard, reproducible setup for services in my homelab. This post looks at that, then runs through the update I did today to Forgejo which only took a few minutes and felt relatively risk free.&lt;/p&gt;
&lt;h3 id="standard-setups"&gt;Standard Setups&lt;/h3&gt;
&lt;p&gt;My system is based around Proxmox. I have three physical machines - one for production apps, a production spare, and a development/testbed machine. A Synology NAS serves for backups. Moving a VM or LXC between the machines is trivial; but it&amp;rsquo;s done manually - the machines are not clustered for high availability.&lt;/p&gt;
&lt;p&gt;Most workloads are Docker containers &lt;em&gt;inside&lt;/em&gt; an LXC. This works fine with a couple of caveats. I have an LXC template saved with Docker and Tailscale installed, my non-root user added, the mount for the NAS, and SSH keys. Setting up a new app starts with a full clone of this, a &lt;code&gt;dpkg-reconfigure openssh-server&lt;/code&gt; and &lt;code&gt;tailscale up&lt;/code&gt; and changing the root &amp;amp; non-root users&amp;rsquo; passwords.&lt;/p&gt;
&lt;p&gt;Next I create a sub directory for the app and write the &lt;code&gt;docker-compose.yaml&lt;/code&gt; in there. Then it&amp;rsquo;s just a matter of &lt;code&gt;docker compose up -d&lt;/code&gt;. If there&amp;rsquo;s any data, it goes in a another sub directory off this one.&lt;/p&gt;
&lt;p&gt;Unless I need something else, nightly backups to the NAS happen automatically for all the VMs and containers handled by a setting in Proxmox.&lt;/p&gt;
&lt;h3 id="upgrading-an-app"&gt;Upgrading an App&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve noticed a couple of posts about a new release of &lt;a href="https://forgejo.org/"&gt;Forgejo&lt;/a&gt; on Mastodon in the past few days, so I figure I should look at that. My version is 1.21.1 and the new one is 1.21.8&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.44.36-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Because of &lt;a href="https://semver.org/"&gt;semantic versioning&lt;/a&gt;, I&amp;rsquo;m confident this is not going to break anything, but I check the release notes anyway. It looks good.&lt;/p&gt;
&lt;h4 id="backup"&gt;Backup&lt;/h4&gt;
&lt;p&gt;I jump into the Proxmox web gui and make a backup of the container.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.47.06-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;h4 id="docker-compose"&gt;Docker Compose&lt;/h4&gt;
&lt;p&gt;I ssh in to look at the image tag in the docker-compose.yml file. The reason I&amp;rsquo;m interested in this is that if the compose is set to &lt;code&gt;codeberg.org/forgejo/forgejo:1.21.1&lt;/code&gt; then it will be locked into that patch version, but it says &lt;code&gt;codeberg.org/forgejo/forgejo:1.21&lt;/code&gt; so we&amp;rsquo;re good.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.48.38-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Now I take the service down from the CLI with &lt;code&gt;sudo docker compose down&lt;/code&gt;, then pull the new image with &lt;code&gt;sudo docker pull codeberg.org/forgejo/forgejo:1.21&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-9.24.21-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The to start it again, it&amp;rsquo;s just a &lt;code&gt;docker compose up -d&lt;/code&gt; and we&amp;rsquo;re live again.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.52.45-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.52.45-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="testing"&gt;Testing&lt;/h4&gt;
&lt;p&gt;My testing of this was pretty brief since (a) I&amp;rsquo;ve got high confidence in the developers at &lt;a href="https://blog.iankulin.com/gogs-gitea-forgejo/"&gt;gitea and forgejo&lt;/a&gt; and (b) this app gets pretty much daily use so if there are issues I&amp;rsquo;ll surface them pretty quickly, (c) anything I&amp;rsquo;m actively working on had full git histories on my laptop, and (d) the releases since my last update are pretty much just bug fixes.&lt;/p&gt;
&lt;p&gt;Nevertheless, I clicked around the web gui, and tried some pushes, pulls and clones and everything seemed fine.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m very comfortable with the way I&amp;rsquo;ve put all this together now. It&amp;rsquo;s a reliable, easily managed setup that makes maintenance like this simple and safe.&lt;/p&gt;</description></item><item><title>Gogs, Gitea, Forgejo</title><link>https://blog.iankulin.com/gogs-gitea-forgejo/</link><pubDate>Mon, 18 Dec 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/gogs-gitea-forgejo/</guid><description>&lt;img src="https://blog.iankulin.com/images/img_7071-1.png" width="640" alt=""&gt;
&lt;p&gt;I&amp;rsquo;ve been really pleased with &lt;a href="https://blog.iankulin.com/tags/gogs/"&gt;Gogs&lt;/a&gt; - it&amp;rsquo;s lightweight, was simple to spin up, and has worked perfectly. But then this morning on Mastodon, there&amp;rsquo;s a &lt;a href="https://mastodon.social/@Codeberg@social.anoxinon.de/111471407276450348"&gt;post from @Codeberg.org&lt;/a&gt; describing a security vulnerability in their Git hosting project Forgejo. This issue also apparently affects Gitea and Gogs - what&amp;rsquo;s up with that?&lt;/p&gt;
&lt;p&gt;I actually already did spend a bit of time comparing Gogs and Gitea before deciding on Gogs, since I&amp;rsquo;d heard of people running Gitea over the past year or so, but only seen that Gogs seemed to be popular with self-hosters in a Lemmy post I&amp;rsquo;d read. My first impression was that Gitea was more focused on CI/CD and seemed to have a more complicated install process.&lt;/p&gt;
&lt;p&gt;What I didn&amp;rsquo;t do, was think about the project management and teams. It turns out that &lt;a href="https://about.gitea.com/"&gt;Gitea&lt;/a&gt; was forked from &lt;a href="https://gogs.io/"&gt;Gogs&lt;/a&gt; by contributors in 2016 due to &lt;a href="https://blog.gitea.com/welcome-to-gitea/"&gt;disagreements about the project management&lt;/a&gt;. Then at the end of 2022 &lt;a href="https://forgejo.org/"&gt;Forgejo&lt;/a&gt; was forked from Gitea due to &lt;a href="https://forgejo.org/2022-12-15-hello-forgejo/"&gt;Gitea moving the trademarks and domain into a company&lt;/a&gt; providing Gitea support.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://forgejo.org/2023-11-release-v1-20-5-1/"&gt;CVE announcement from Forgeo&lt;/a&gt;, while a little snarky about their ancestors, does give the impression of a functional organisation that&amp;rsquo;s able to deal with issues as they come up. It&amp;rsquo;s a credit to the group to be in that position after just a year, and their &lt;a href="https://codeberg.org/forgejo/forgejo"&gt;repo&lt;/a&gt; (which is dogfooded) seems plenty active.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve only just started on Gogs, so it&amp;rsquo;s still easy to move if that&amp;rsquo;s what I decide. I guess my learning from stumbling upon this security announcement is more that I should:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;take into account more than just project features when making these decisions&lt;/li&gt;
&lt;li&gt;I need to be subscribed to the channels where I&amp;rsquo;d learn about security issues in the projects I&amp;rsquo;m using and their major dependencies.&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>