The Wombelix Post - Githttps://dominik.wombacher.cc/2023-10-14T00:00:00+02:00Git repos moved to Sourcehut, with mirrors on Codeberg, GitLab and GitHub2023-10-14T00:00:00+02:002023-10-14T00:00:00+02:00Dominik Wombachertag:dominik.wombacher.cc,2023-10-14:/posts/git-repos-moved-to-sourcehut-with-mirrors-on-codeberg-gitlab-and-github.html<!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher <dominik@wombacher.cc> -->
<!-- -->
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<p>When I <a class="reference external" href="https://dominik.wombacher.cc/posts/website-migration-and-temporary-shutdown-of-onion-service.html">moved from a VPC to classic webhosting</a>
I had to shutdown my self-hosted git repos as well. I had <a class="reference external" href="https://sourcehut.org">Sourcehut</a> on my list for years and decided it's ... <a class="read-more" href="/posts/git-repos-moved-to-sourcehut-with-mirrors-on-codeberg-gitlab-and-github.html"> [read more]</a></p><!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher <dominik@wombacher.cc> -->
<!-- -->
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<p>When I <a class="reference external" href="https://dominik.wombacher.cc/posts/website-migration-and-temporary-shutdown-of-onion-service.html">moved from a VPC to classic webhosting</a>
I had to shutdown my self-hosted git repos as well. I had <a class="reference external" href="https://sourcehut.org">Sourcehut</a> on my list for years and decided it's finally
time to test it. If you are used to (bloated) platforms like GitHub or GitLab, then Sourcehut is kind of shocking, in a positive way.
Pure HTML, no JavaScript, every feature (git repos, docs, build service, wiki ect.) is a widely independent micro-service with it's own subdomain.</p>
<p>I really liked it and decided to go with a paid account, right now <a class="reference external" href="https://sr.ht">sr.ht</a> is in alpha state and payment is optional.
But alone the very nice build system and a fast loading page without tracking is more than worth it!</p>
<p>From now on, <a class="reference external" href="https://dominik.wombacher.cc/~git/">~git/</a> redirects to <a class="reference external" href="https://git.sr.ht/~wombelix/">git.sr.ht/~wombelix/</a>, for
better visibility, I decided to also mirror to <a class="reference external" href="https://codeberg.org/wombelix">codeberg.org/wombelix</a>,
<a class="reference external" href="https://gitlab.com/wombelix">gitlab.com/wombelix</a> and <a class="reference external" href="https://github.com/wombelix">github.com/wombelix</a>.</p>
<p>I don't want to force someone to follow a specific process or be limited to a single platform, if you like my projects
and want to contribute, use whatever site and workflow you prefer to create an issue or pull/merge-request, or send me a good old Email :).</p>
<p>If I should create a list or tracker on sr.ht and have a preferred process one day,
I will add it to the README and/or CONTRIBUTE file in my projects.</p>
Pagure on FreeBSD in Bastille powered Jail - Part 12021-03-13T00:00:00+01:002021-03-13T00:00:00+01:00Dominik Wombachertag:dominik.wombacher.cc,2021-03-13:/posts/pagure-on-freebsd-in-bastille-powered-jail-part1.html<!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher <dominik@wombacher.cc> -->
<!-- -->
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<p>A few months ago I started experimenting with <a class="reference external" href="https://www.freebsd.org">FreeBSD</a> and
Jails managed by <a class="reference external" href="https://www.bastillebsd.org">Bastille</a>.</p>
<p>And tbh, I love it, simple, lightweight, it's just fun to work with, but that's a ... <a class="read-more" href="/posts/pagure-on-freebsd-in-bastille-powered-jail-part1.html"> [read more]</a></p><!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher <dominik@wombacher.cc> -->
<!-- -->
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<p>A few months ago I started experimenting with <a class="reference external" href="https://www.freebsd.org">FreeBSD</a> and
Jails managed by <a class="reference external" href="https://www.bastillebsd.org">Bastille</a>.</p>
<p>And tbh, I love it, simple, lightweight, it's just fun to work with, but that's a
different Story for future Posts ;)</p>
<p>More important, I wanted to start self-host my Git repositories and to use <a class="reference external" href="https://www.github.com">Github</a>,
<a class="reference external" href="https://www.gitlab.com">Gitlab</a>, <a class="reference external" href="https://www.codeberg.org">Codeberg</a> and <a class="reference external" href="https://www.notabug.org">Notabug</a>
primary as Mirror. That should improve the visibility, compared to only self-hosting and help to reach
potential contributors, independent of the Platform.</p>
<p>So I decided to setup <a class="reference external" href="https://pagure.io/pagure">Pagure</a>, it's written in Python and seem to be the
only Solution, that support pull requests from remote repositories.</p>
<p>But just installing the RPM Packages on a Supported OS like openSUSE or Fedora would be too easy ;)</p>
<p>This Project was therefore the perfect candidate, to get some more Hands on Experience with FreeBSD and Bastille.</p>
<p>I created a new Jail, mounted the Ports Tree from my FreeBSD Host and connected to the new Instance.</p>
<pre class="code text literal-block">
bastille create pagure 12.2-RELEASE 172.31.255.30 bastille0
bastille mount pagure /usr/ports /usr/ports nullfs rw 0 0
bastille console pagure
</pre>
<p>Based on the <a class="reference external" href="https://docs.pagure.org/pagure/install.html">Pagure Documentation</a> and some research,
I installed the following packages:</p>
<pre class="code text literal-block">
pkg install git libgit2 python3-3_3 apache24-2.4.46 py37-pip-20.2.3 py37-wheel-0.30.0_1 wget py37-pillow-7.0.0 py37-Flask-1.1.2 vim-tiny
</pre>
<p>The available libgit2 Port was to old and due to some further dependencies, an official update wasn't
available yet, so I had to update it on my own. Further reading: <a class="reference external" href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252098">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252098</a></p>
<p><em>/usr/ports/devel/libgit2/Makefile.patch</em></p>
<pre class="code diff literal-block">
<span class="pygments-gd">--- Makefile.orig 2021-03-10 23:58:49.921923000 +0100</span><span class="pygments-w">
</span><span class="pygments-gi">+++ Makefile 2021-03-11 00:13:22.452236000 +0100</span><span class="pygments-w">
</span><span class="pygments-gu">@@ -6,7 +6,7 @@</span><span class="pygments-w">
</span># Tools/scripts/search_lib_depends_and_bump.sh devel/libgit2<span class="pygments-w">
</span>PORTNAME= libgit2<span class="pygments-w">
</span><span class="pygments-gd">-PORTVERSION= 1.0.1</span><span class="pygments-w">
</span><span class="pygments-gi">+PORTVERSION= 1.1.0</span><span class="pygments-w">
</span>CATEGORIES= devel<span class="pygments-w">
</span>MASTER_SITES= https://github.com/libgit2/libgit2/releases/download/v${PORTVERSION}/<span class="pygments-w">
</span><span class="pygments-gu">@@ -37,7 +37,7 @@</span><span class="pygments-w">
</span>.if ${SSL_DEFAULT} == base<span class="pygments-w">
</span>post-patch:<span class="pygments-w">
</span> @${REINPLACE_CMD} -e "/LIBGIT2_PC_REQUIRES.*openssl/ d" \<span class="pygments-w">
</span><span class="pygments-gd">- ${WRKSRC}/cmake/Modules/SelectHTTPSBackend.cmake</span><span class="pygments-w">
</span><span class="pygments-gi">+ ${WRKSRC}/cmake/SelectHTTPSBackend.cmake</span><span class="pygments-w">
</span>.endif<span class="pygments-w">
</span>do-test:<span class="pygments-w">
</span>
</pre>
<p>Patch applied, compiled and installed:</p>
<pre class="code text literal-block">
patch -u -b Makefile -i Makefile.patch
make makesum
make install clean
</pre>
<p>Pagure Release 5.13.2 build and installed</p>
<pre class="code text literal-block">
cd
mkdir src
cd src
git clone https://pagure.io/pagure.git
cd pagure
git checkout -b 5.13.2 e1a8b5e4a2a347ab29de7cc21d9d2c89f55dd076
python3 setup.py build
python3 setup.py install
</pre>
<p>I wrote a little helper Script, to create some necessary folder structures and copy
config files to the right location.</p>
<pre class="code text literal-block">
#!/bin/sh
mkdir -p /usr/local/etc/pagure
mkdir -p /usr/local/share/pagure
cp pagure/files/pagure.cfg.sample /usr/local/etc/pagure/pagure.cfg
cp pagure/files/alembic.ini /usr/local/etc/pagure/alembic.ini
cp pagure/files/pagure-apache-httpd.conf /usr/local/etc/apache24/Includes/pagure.conf
cp pagure/files/pagure.wsgi /usr/local/share/pagure/pagure.wsgi
cp pagure/createdb.py /usr/local/share/pagure/pagure_createdb.py
mkdir -p /usr/local/www/apache24/data/releases
chown git:git /usr/local/www/apache24/data/releases
mkdir -p /usr/local/git/repositories/{docs,forks,tickets,requests,remotes}
</pre>
<p>Dedicated Git User and Group created, would be cool in one single command, but
that's <a class="reference external" href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=172965">not yet implemented</a></p>
<pre class="code text literal-block">
pw group add -n git
pw user add -n git -d /usr/local/git -c "Pagure Git User" -g git
</pre>
<p>That's all I have so far, unfortunately there wasn't enough time to finish the Installation.</p>
<p>Next Step based on the Pagure Install Guide is to set specific ACLs, but the syntax between
Linux and FreeBSD differ, first I have to figure out how to adapt them.</p>
<p>Also there might be further adjustments required until Pagure is working as expected and
behave similar as on a Linux system.</p>
<p>As soon I find some time to proceed, I will publish Part 2.</p>