<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>The Wombelix Post - FreeBSD</title><link href="https://dominik.wombacher.cc/" rel="alternate"/><link href="/feeds/tag_freebsd.atom.xml" rel="self"/><id>https://dominik.wombacher.cc/</id><updated>2022-03-18T00:00:00+01:00</updated><entry><title>FreeBSD 13 Base System OpenSSH Server Hardening</title><link href="https://dominik.wombacher.cc/posts/freebsd_13_base_system_openssh_server_hardening.html" rel="alternate"/><published>2022-03-17T00:00:00+01:00</published><updated>2022-03-18T00:00:00+01:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2022-03-17:/posts/freebsd_13_base_system_openssh_server_hardening.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;Default sshd configs tend to focus more on compatibility instead security. Therefore hardening
should be one of the first things after setup a new system.&lt;/p&gt;
&lt;p&gt;I'm using the OpenSSH Daemon  ... &lt;a class="read-more" href="/posts/freebsd_13_base_system_openssh_server_hardening.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;Default sshd configs tend to focus more on compatibility instead security. Therefore hardening
should be one of the first things after setup a new system.&lt;/p&gt;
&lt;p&gt;I'm using the OpenSSH Daemon which comes with the FreeBSD Base System.
When you want to use the &lt;code&gt;openssh-portable&lt;/code&gt; port instead, skip &lt;em&gt;Step 3&lt;/em&gt;, the rest should be identical.&lt;/p&gt;
&lt;p&gt;Step 1) Delete existing host keys, generate new rsa and ed25519 key:&lt;/p&gt;
&lt;pre class="code bash literal-block"&gt;
rm&lt;span class="pygments-w"&gt; &lt;/span&gt;/etc/ssh/ssh_host_*&lt;span class="pygments-w"&gt;
&lt;/span&gt;ssh-keygen&lt;span class="pygments-w"&gt; &lt;/span&gt;-q&lt;span class="pygments-w"&gt; &lt;/span&gt;-t&lt;span class="pygments-w"&gt; &lt;/span&gt;rsa&lt;span class="pygments-w"&gt; &lt;/span&gt;-b&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-m"&gt;4096&lt;/span&gt;&lt;span class="pygments-w"&gt; &lt;/span&gt;-f&lt;span class="pygments-w"&gt; &lt;/span&gt;ssh_host_rsa_key&lt;span class="pygments-w"&gt; &lt;/span&gt;-N&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;ssh-keygen&lt;span class="pygments-w"&gt; &lt;/span&gt;-q&lt;span class="pygments-w"&gt; &lt;/span&gt;-t&lt;span class="pygments-w"&gt; &lt;/span&gt;ed25519&lt;span class="pygments-w"&gt; &lt;/span&gt;-f&lt;span class="pygments-w"&gt; &lt;/span&gt;ssh_host_ed25519_key&lt;span class="pygments-w"&gt; &lt;/span&gt;-N&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Step 2) Create new Diffie-Hellman groups and avoid small moduli&lt;/p&gt;
&lt;pre class="code bash literal-block"&gt;
ssh-keygen&lt;span class="pygments-w"&gt; &lt;/span&gt;-G&lt;span class="pygments-w"&gt; &lt;/span&gt;moduli-3072.candidates&lt;span class="pygments-w"&gt; &lt;/span&gt;-b&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-m"&gt;3072&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;ssh-keygen&lt;span class="pygments-w"&gt; &lt;/span&gt;-T&lt;span class="pygments-w"&gt; &lt;/span&gt;moduli-3072&lt;span class="pygments-w"&gt; &lt;/span&gt;-f&lt;span class="pygments-w"&gt; &lt;/span&gt;moduli-3072.candidates&lt;span class="pygments-w"&gt;
&lt;/span&gt;mv&lt;span class="pygments-w"&gt; &lt;/span&gt;moduli-3072&lt;span class="pygments-w"&gt; &lt;/span&gt;/etc/ssh/moduli&lt;span class="pygments-w"&gt;
&lt;/span&gt;rm&lt;span class="pygments-w"&gt; &lt;/span&gt;moduli-3072.candidates&lt;span class="pygments-w"&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Step 3) Disable DSA and ECDSA host keys, only use RSA and ED25519&lt;/p&gt;
&lt;pre class="code bash literal-block"&gt;
sysrc&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-nv"&gt;sshd_dsa_enable&lt;/span&gt;&lt;span class="pygments-o"&gt;=&lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;sysrc&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-nv"&gt;sshd_ecdsa_enable&lt;/span&gt;&lt;span class="pygments-o"&gt;=&lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;sysrc&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-nv"&gt;sshd_ed25519_enable&lt;/span&gt;&lt;span class="pygments-o"&gt;=&lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;sysrc&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-nv"&gt;sshd_rsa_enable&lt;/span&gt;&lt;span class="pygments-o"&gt;=&lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Step 4) Optimize &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;, improve security, restrict allowed key exchange, cipher and MAC algorithms&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
# Hardening
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
KexAlgorithms curve25519-sha256,curve25519-sha256&amp;#64;libssh.org,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256
Ciphers chacha20-poly1305&amp;#64;openssh.com,aes256-gcm&amp;#64;openssh.com,aes128-gcm&amp;#64;openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-256-etm&amp;#64;openssh.com,hmac-sha2-512-etm&amp;#64;openssh.com,umac-128-etm&amp;#64;openssh.com
HostKeyAlgorithms ssh-ed25519,ssh-ed25519-cert-v01&amp;#64;openssh.com

# Security
PermitRootLogin no
AuthenticationMethods publickey
ChallengeResponseAuthentication no
UsePAM no
VersionAddendum none
X11Forwarding no
AuthorizedKeysFile .ssh/authorized_keys
Subsystem sftp /usr/libexec/sftp-server

&lt;/pre&gt;
&lt;p&gt;Run &lt;code&gt;service sshd restart&lt;/code&gt; to apply the new settings, to verify the results of your hardening,
you can use the CLI Tool &lt;a class="reference external" href="https://github.com/jtesta/ssh-audit"&gt;ssh-audit&lt;/a&gt;
which is also available as &lt;a class="reference external" href="https://www.ssh-audit.com"&gt;Online Version&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Following a Custom Policy for ssh-audit based on the above recommendations:&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
name = &amp;quot;Custom Policy - FreeBSD 13 Base System OpenSSH Daemon (2022/03/17)&amp;quot;
version = 1
dh_modulus_size_diffie-hellman-group-exchange-sha256 = 2048
host keys = ssh-ed25519
key exchanges = curve25519-sha256, curve25519-sha256&amp;#64;libssh.org, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512, diffie-hellman-group-exchange-sha256
ciphers = chacha20-poly1305&amp;#64;openssh.com, aes256-gcm&amp;#64;openssh.com, aes128-gcm&amp;#64;openssh.com, aes256-ctr, aes192-ctr, aes128-ctr
macs = hmac-sha2-256-etm&amp;#64;openssh.com, hmac-sha2-512-etm&amp;#64;openssh.com, umac-128-etm&amp;#64;openssh.com

&lt;/pre&gt;
&lt;p&gt;Copy the policy into a file and run &lt;code&gt;ssh-audit -P=&amp;lt;policy.txt&amp;gt; &amp;lt;servername&amp;gt;&lt;/code&gt;.
The result should be similar to following example without warnings or errors:&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
# general
(gen) banner: SSH-2.0-OpenSSH_8.8
(gen) software: OpenSSH 8.8
(gen) compatibility: OpenSSH 7.4+, Dropbear SSH 2018.76+
(gen) compression: enabled (zlib&amp;#64;openssh.com)

# key exchange algorithms
(kex) curve25519-sha256                     -- [info] available since OpenSSH 7.4, Dropbear SSH 2018.76
(kex) curve25519-sha256&amp;#64;libssh.org          -- [info] available since OpenSSH 6.5, Dropbear SSH 2013.62
(kex) diffie-hellman-group16-sha512         -- [info] available since OpenSSH 7.3, Dropbear SSH 2016.73
(kex) diffie-hellman-group18-sha512         -- [info] available since OpenSSH 7.3
(kex) diffie-hellman-group-exchange-sha256 (2048-bit) -- [info] available since OpenSSH 4.4

# host-key algorithms
(key) ssh-ed25519                           -- [info] available since OpenSSH 6.5

# encryption algorithms (ciphers)
(enc) chacha20-poly1305&amp;#64;openssh.com         -- [info] available since OpenSSH 6.5
                                            `- [info] default cipher since OpenSSH 6.9.
(enc) aes256-gcm&amp;#64;openssh.com                -- [info] available since OpenSSH 6.2
(enc) aes128-gcm&amp;#64;openssh.com                -- [info] available since OpenSSH 6.2
(enc) aes256-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52
(enc) aes192-ctr                            -- [info] available since OpenSSH 3.7
(enc) aes128-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52

# message authentication code algorithms
(mac) hmac-sha2-256-etm&amp;#64;openssh.com         -- [info] available since OpenSSH 6.2
(mac) hmac-sha2-512-etm&amp;#64;openssh.com         -- [info] available since OpenSSH 6.2
(mac) umac-128-etm&amp;#64;openssh.com              -- [info] available since OpenSSH 6.2

# fingerprints
(fin) ssh-ed25519: SHA256:uN9Oton+VmLL793KirVFB+ilD3Bndra4I/3yFntgX8k

# algorithm recommendations (for OpenSSH 8.8)
(rec) +diffie-hellman-group14-sha256        -- kex algorithm to append
(rec) +rsa-sha2-256                         -- key algorithm to append
(rec) +rsa-sha2-512                         -- key algorithm to append

&lt;/pre&gt;
&lt;p&gt;Sources:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="https://ozgurkazancci.com/ssh-server-security-audit-hardening-freebsd"&gt;https://ozgurkazancci.com/ssh-server-security-audit-hardening-freebsd&lt;/a&gt;
(Archive: &lt;a class="reference external" href="https://web.archive.org/web/20220311055553/https://ozgurkazancci.com/ssh-server-security-audit-hardening-freebsd/"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://archive.today/2022.03.17-211815/https://ozgurkazancci.com/ssh-server-security-audit-hardening-freebsd/"&gt;[2]&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://gist.github.com/koobs/e01cf8869484a095605404cd0051eb11"&gt;https://gist.github.com/koobs/e01cf8869484a095605404cd0051eb11&lt;/a&gt;
(Archive: &lt;a class="reference external" href="https://web.archive.org/web/20220313140130/https://gist.github.com/koobs/e01cf8869484a095605404cd0051eb11"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://archive.today/2021.09.16-082343/https://gist.github.com/koobs/e01cf8869484a095605404cd0051eb11"&gt;[2]&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://www.ssh-audit.com/hardening_guides.html"&gt;https://www.ssh-audit.com/hardening_guides.html&lt;/a&gt;
(Archive: &lt;a class="reference external" href="https://web.archive.org/web/20220113100935/https://www.ssh-audit.com/hardening_guides.html"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://archive.today/2022.03.17-211934/https://www.ssh-audit.com/hardening_guides.html"&gt;[2]&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
</content><category term="Unix"/><category term="FreeBSD"/><category term="OpenSSH"/><category term="Hardening"/><category term="SSH"/></entry><entry><title>Now available as Onion Service through the Tor Network</title><link href="https://dominik.wombacher.cc/posts/now_available_as_onion_service_through_the_tor_network.html" rel="alternate"/><published>2022-03-13T00:00:00+01:00</published><updated>2022-03-13T00:00:00+01:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2022-03-13:/posts/now_available_as_onion_service_through_the_tor_network.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;I'm happy to announce that this site is also published as Onion Service from now on,
which means a focus on privacy, security, freedom and support for the Tor Project  ... &lt;a class="read-more" href="/posts/now_available_as_onion_service_through_the_tor_network.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;I'm happy to announce that this site is also published as Onion Service from now on,
which means a focus on privacy, security, freedom and support for the Tor Project
as well as a statement against censorship.&lt;/p&gt;
&lt;p&gt;The new Tor URL: &lt;a class="reference external" href="http://2xwpdwnzmag3ewobwsdewpor4gmca4d5gltviol3u6upihb6m6m6xaad.onion"&gt;http://2xwpdwnzmag3ewobwsdewpor4gmca4d5gltviol3u6upihb6m6m6xaad.onion&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also it was fun to setup ;) To ensure the right URLs are used, I decided to publish two versions,
which was quite a simple task by adjusting a few lines in my &lt;a class="reference external" href="https://getpelican.com"&gt;Pelican&lt;/a&gt; configs.&lt;/p&gt;
&lt;p&gt;The Tor Service is running on the same FreeBSD Jail as my (static) site and nginx, let me share some technical details.&lt;/p&gt;
&lt;p&gt;Installing Tor is straight forward, just run &lt;code&gt;pkg install tor&lt;/code&gt; and &lt;code&gt;sysrc tor_enable=&amp;quot;YES&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Two lines in &lt;code&gt;/usr/local/etc/tor/torrc&lt;/code&gt; are enough to enable a new Onion Hidden Service:&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
HiddenServiceDir /var/db/tor/keys/&amp;lt;website&amp;gt;/
HiddenServicePort 80 unix:/var/run/tor-&amp;lt;website&amp;gt;.sock

&lt;/pre&gt;
&lt;p&gt;For nginx I adjusted the existing https config to publish the
&lt;a class="reference external" href="https://support.torproject.org/onionservices/onion-location/"&gt;Onion-Location&lt;/a&gt;
(Archive: &lt;a class="reference external" href="https://web.archive.org/web/20220101193148/https://support.torproject.org/onionservices/onion-location"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://archive.today/2022.03.13-233520/https://support.torproject.org/onionservices/onion-location/"&gt;[2]&lt;/a&gt;)
header, which will advertise the &lt;em&gt;.onion&lt;/em&gt; URL of this Site to visitors that are using the Tor Browser.&lt;/p&gt;
&lt;p&gt;The Onion URL can be found in &lt;code&gt;/var/db/tor/keys/&amp;lt;website&amp;gt;/hostname&lt;/code&gt;.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
server {
        listen 443 ssl http2;
        # Tor unrelated config omitted
        add_header Onion-Location http://&amp;lt;onion_url&amp;gt;$request_uri;
}

&lt;/pre&gt;
&lt;p&gt;As recommend in the &lt;a class="reference external" href="https://community.torproject.org/onion-services/setup/"&gt;Tor Setup Guide&lt;/a&gt;
(Archive: &lt;a class="reference external" href="https://web.archive.org/web/20211108203156/https://community.torproject.org/onion-services/setup"&gt;[1]&lt;/a&gt;,
&lt;a class="reference external" href="https://archive.today/2021.09.28-062404/https://community.torproject.org/onion-services/setup/"&gt;[2]&lt;/a&gt;)
I added an additional server section and use a unix socket to listen for Tor requests.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
server {
        listen unix:/var/run/&amp;lt;website&amp;gt;.sock;
        # Tor unrelated config omitted
        server_name &amp;lt;onion_url&amp;gt;;
        root &amp;lt;path_to_web_document_root&amp;gt;;
}

&lt;/pre&gt;
&lt;p&gt;From a Pelican perspective, I created a second &lt;code&gt;publishconf&lt;/code&gt; to set the &lt;code&gt;SITEURL&lt;/code&gt;
to my &amp;lt;onion_url&amp;gt; and adjusted the &lt;code&gt;Makefile&lt;/code&gt; a little to upload the &lt;em&gt;regular&lt;/em&gt; and the &lt;em&gt;tor&lt;/em&gt; version at once.&lt;/p&gt;
&lt;p&gt;Following the additions on top of the standard Makefile when installing Pelican.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
PUBLISHCONF_TOR=$(BASEDIR)/publishconf_tor.py
SSH_TARGET_DIR_TOR=&amp;lt;path_to_web_document_root&amp;gt;

# Tor unrelated config omitted

rsync_upload_tor: publish_tor
        rsync -e &amp;quot;ssh -p $(SSH_PORT)&amp;quot; -P -rvzc --include tags --cvs-exclude --delete &amp;quot;$(OUTPUTDIR)&amp;quot;/ &amp;quot;$(SSH_USER)&amp;#64;$(SSH_HOST):$(SSH_TARGET_DIR_TOR)&amp;quot;

rsync_upload_all: rsync_upload rsync_upload_tor

&lt;/pre&gt;
&lt;p&gt;Last step was to start the tor service &lt;code&gt;service tor start&lt;/code&gt;,
apply the new nginx config &lt;code&gt;service nginx reload&lt;/code&gt; and to
publish the site &lt;code&gt;make rsync_upload_all&lt;/code&gt;.&lt;/p&gt;
</content><category term="Misc"/><category term="Tor"/><category term="Onion Service"/><category term="FreeBSD"/><category term="nginx"/><category term="Pelican"/></entry><entry><title>Pagure on FreeBSD in Bastille powered Jail - Part 1</title><link href="https://dominik.wombacher.cc/posts/pagure-on-freebsd-in-bastille-powered-jail-part1.html" rel="alternate"/><published>2021-03-13T00:00:00+01:00</published><updated>2021-03-13T00:00:00+01:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2021-03-13:/posts/pagure-on-freebsd-in-bastille-powered-jail-part1.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;A few months ago I started experimenting with &lt;a class="reference external" href="https://www.freebsd.org"&gt;FreeBSD&lt;/a&gt; and
Jails managed by &lt;a class="reference external" href="https://www.bastillebsd.org"&gt;Bastille&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And tbh, I love it, simple, lightweight, it's just fun to work with, but that's a  ... &lt;a class="read-more" href="/posts/pagure-on-freebsd-in-bastille-powered-jail-part1.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;A few months ago I started experimenting with &lt;a class="reference external" href="https://www.freebsd.org"&gt;FreeBSD&lt;/a&gt; and
Jails managed by &lt;a class="reference external" href="https://www.bastillebsd.org"&gt;Bastille&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And tbh, I love it, simple, lightweight, it's just fun to work with, but that's a
different Story for future Posts ;)&lt;/p&gt;
&lt;p&gt;More important, I wanted to start self-host my Git repositories and to use &lt;a class="reference external" href="https://www.github.com"&gt;Github&lt;/a&gt;,
&lt;a class="reference external" href="https://www.gitlab.com"&gt;Gitlab&lt;/a&gt;, &lt;a class="reference external" href="https://www.codeberg.org"&gt;Codeberg&lt;/a&gt; and &lt;a class="reference external" href="https://www.notabug.org"&gt;Notabug&lt;/a&gt;
primary as Mirror. That should improve the visibility, compared to only self-hosting and help to reach
potential contributors, independent of the Platform.&lt;/p&gt;
&lt;p&gt;So I decided to setup &lt;a class="reference external" href="https://pagure.io/pagure"&gt;Pagure&lt;/a&gt;, it's written in Python and seem to be the
only Solution, that support pull requests from remote repositories.&lt;/p&gt;
&lt;p&gt;But just installing the RPM Packages on a Supported OS like openSUSE or Fedora would be too easy ;)&lt;/p&gt;
&lt;p&gt;This Project was therefore the perfect candidate, to get some more Hands on Experience with FreeBSD and Bastille.&lt;/p&gt;
&lt;p&gt;I created a new Jail, mounted the Ports Tree from my FreeBSD Host and connected to the new Instance.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
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

&lt;/pre&gt;
&lt;p&gt;Based on the &lt;a class="reference external" href="https://docs.pagure.org/pagure/install.html"&gt;Pagure Documentation&lt;/a&gt; and some research,
I installed the following packages:&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
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

&lt;/pre&gt;
&lt;p&gt;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: &lt;a class="reference external" href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252098"&gt;https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252098&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;/usr/ports/devel/libgit2/Makefile.patch&lt;/em&gt;&lt;/p&gt;
&lt;pre class="code diff literal-block"&gt;
&lt;span class="pygments-gd"&gt;--- Makefile.orig       2021-03-10 23:58:49.921923000 +0100&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-gi"&gt;+++ Makefile    2021-03-11 00:13:22.452236000 +0100&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-gu"&gt;&amp;#64;&amp;#64; -6,7 +6,7 &amp;#64;&amp;#64;&lt;/span&gt;&lt;span class="pygments-w"&gt;
 &lt;/span&gt;# Tools/scripts/search_lib_depends_and_bump.sh devel/libgit2&lt;span class="pygments-w"&gt;

 &lt;/span&gt;PORTNAME=      libgit2&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-gd"&gt;-PORTVERSION=   1.0.1&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-gi"&gt;+PORTVERSION=   1.1.0&lt;/span&gt;&lt;span class="pygments-w"&gt;
 &lt;/span&gt;CATEGORIES=    devel&lt;span class="pygments-w"&gt;
 &lt;/span&gt;MASTER_SITES=  https://github.com/libgit2/libgit2/releases/download/v${PORTVERSION}/&lt;span class="pygments-w"&gt;

&lt;/span&gt;&lt;span class="pygments-gu"&gt;&amp;#64;&amp;#64; -37,7 +37,7 &amp;#64;&amp;#64;&lt;/span&gt;&lt;span class="pygments-w"&gt;
 &lt;/span&gt;.if ${SSL_DEFAULT} == base&lt;span class="pygments-w"&gt;
 &lt;/span&gt;post-patch:&lt;span class="pygments-w"&gt;
 &lt;/span&gt;       &amp;#64;${REINPLACE_CMD} -e &amp;quot;/LIBGIT2_PC_REQUIRES.*openssl/ d&amp;quot; \&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-gd"&gt;-               ${WRKSRC}/cmake/Modules/SelectHTTPSBackend.cmake&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-gi"&gt;+               ${WRKSRC}/cmake/SelectHTTPSBackend.cmake&lt;/span&gt;&lt;span class="pygments-w"&gt;
 &lt;/span&gt;.endif&lt;span class="pygments-w"&gt;

 &lt;/span&gt;do-test:&lt;span class="pygments-w"&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Patch applied, compiled and installed:&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
patch -u -b Makefile -i Makefile.patch
make makesum
make install clean

&lt;/pre&gt;
&lt;p&gt;Pagure Release 5.13.2 build and installed&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
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

&lt;/pre&gt;
&lt;p&gt;I wrote a little helper Script, to create some necessary folder structures and copy
config files to the right location.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
#!/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}

&lt;/pre&gt;
&lt;p&gt;Dedicated Git User and Group created, would be cool in one single command, but
that's &lt;a class="reference external" href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=172965"&gt;not yet implemented&lt;/a&gt;&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
pw group add -n git
pw user add -n git -d /usr/local/git -c &amp;quot;Pagure Git User&amp;quot; -g git

&lt;/pre&gt;
&lt;p&gt;That's all I have so far, unfortunately there wasn't enough time to finish the Installation.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Also there might be further adjustments required until Pagure is working as expected and
behave similar as on a Linux system.&lt;/p&gt;
&lt;p&gt;As soon I find some time to proceed, I will publish Part 2.&lt;/p&gt;
</content><category term="Unix"/><category term="FreeBSD"/><category term="Pagure"/><category term="Git"/><category term="Bastille"/><category term="Port"/></entry></feed>