<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
	<title>LandChad.net</title>
	<link>https://landchad.net/</link>
	<description>Recent content on LandChad.net</description>
	<generator>Hugo -- gohugo.io</generator>
	<language>en-us</language>
	<lastBuildDate>Tue, 16 Jul 2024 00:00:00 +0000</lastBuildDate>
    
        <atom:link href="https://landchad.net/index.xml" rel="self" type="application/rss+xml" />
	
	
	<item>
		<title>Alps</title>
		<link>https://landchad.net/alps/</link>
		<pubDate>Tue, 16 Jul 2024 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/alps/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://git.sr.ht/~migadu/alps&#34;&gt;Alps&lt;/a&gt;
is a webmail client, a program that allows you to access your email
online like Gmail. It is useful to be able to access you email from a
web browser because it allows you to easily access your email from any
device with a web browser without much additional setup.&lt;/p&gt;
&lt;h2 id=&#34;instructions&#34;&gt;Instructions&lt;/h2&gt;
&lt;p&gt;There is no Debian package so we are going to build it from source. You need to
have a newer Go compiler installed than what is in the Debian repos. You can
follow the &lt;a href=&#34;https://www.vultr.com/docs/install-the-latest-version-of-golang-on-Debian/&#34;&gt;instructions
here&lt;/a&gt;
to install Go.&lt;/p&gt;
&lt;p&gt;Then, we can clone and build alps.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone https://git.sr.ht/~migadu/alps /opt/alps
cd /opt/alps
go build ./cmd/alps
mv alps /usr/local/bin/alps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, we are going to create a login key with this command.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;go run github.com/fernet/fernet-go/cmd/fernet-keygen
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, we need to create a systemd service to auto start it on boot.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;Alps Webmail&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Wants&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network-online.target&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Restart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;simple&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/usr/local/bin/alps -theme alps -addr 127.0.0.1:1323 -login-key yourloginkey imaps://mail.example.org:993 smtps://mail.example.org:465&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WorkingDirectory&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/opt/alps&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Environment&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;GOPATH=/opt/alps/.gopath&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Environment&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;GOCACHE=/opt/alps/.gocache&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you run Postfix and Dovecot on the same machine, you could change the &lt;code&gt;After&lt;/code&gt; string to the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;After=network.target postfix.service dovecot.service
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Put that in &lt;code&gt;/etc/systemd/system/alps.service&lt;/code&gt; and fill in your login key and your mail domain.&lt;/p&gt;
&lt;p&gt;Now, reload and start Alps.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl daemon-reload
systemctl enable --now alps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will need to have already set up nginx. Add this to a file in &lt;code&gt;/etc/nginx/sites-available/alps.conf&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;mail.example.com&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:1323&lt;/span&gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, link it to &lt;code&gt;/etc/nginx/sites-enabled/alps.conf&lt;/code&gt; with this command.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/alps.conf /etc/nginx/sites-enabled/alps.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, run &lt;code&gt;certbot&lt;/code&gt; and select your new domain to setup ssl on it.&lt;/p&gt;
&lt;p&gt;Finally, you can access your web mail at &lt;code&gt;mail.example.org&lt;/code&gt; and log in with your email and password.&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;p&gt;XMR: &lt;code&gt;86MMzQFTWgWHdLmJgdUSyKYKitVtgw3Dbfe2hTFeZmSC92FUE7wFcEF5AA4ugqyge4hGdL8PwvZKB49fsGLbUtYdGmNgNU9&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Transmission</title>
		<link>https://landchad.net/transmission/</link>
		<pubDate>Sat, 22 Jul 2023 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/transmission/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://transmissionbt.com/&#34;&gt;Transmission&lt;/a&gt; allows you to send and receive files via the BitTorrent
protocol. This tutorial shows you how to use Transmission to run a
&amp;ldquo;seedbox&amp;rdquo; - a server for downloading and seeding torrents.&lt;/p&gt;
&lt;p&gt;(For an explanation of BitTorrent, see &lt;a href=&#34;#appendix-1-what-is-bittorrent&#34;&gt;Appendix 1&lt;/a&gt;.)&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;The Transmission daemon is available in the Debian repositories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install transmission-daemon
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Besides installing Transmission, this command creates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A user for running the service (&lt;code&gt;debian-transmission&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;A default configuration file
(&lt;code&gt;/var/lib/transmission-daemon/info/settings.json&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;A default service file
(&lt;code&gt;/etc/systemd/system/multi-user.target.wants/transmission-daemon.service&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;h3 id=&#34;transmission-daemon&#34;&gt;Transmission-Daemon&lt;/h3&gt;
&lt;p&gt;Any time you need to modify Transmission&#39;s configuration, you must stop
the &lt;code&gt;transmission-daemon&lt;/code&gt; service. Otherwise, Transmission will
overwrite your changes.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;service transmission-daemon stop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Open &lt;code&gt;/var/lib/transmission-daemon/info/settings.json&lt;/code&gt; to view
Transmission&#39;s configuration. The file should look something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;{
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-down&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;50&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-time-begin&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;540&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-time-day&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;127&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-time-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-time-end&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1020&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;alt-speed-up&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;50&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;bind-address-ipv4&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;0.0.0.0&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;bind-address-ipv6&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;::&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;blocklist-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;blocklist-url&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;http://www.example.com/blocklist&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;cache-size-mb&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;dht-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;download-dir&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/var/lib/transmission-daemon/downloads&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;download-limit&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;download-limit-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;download-queue-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;download-queue-size&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;encryption&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;idle-seeding-limit&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;30&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;idle-seeding-limit-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;incomplete-dir&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/var/lib/transmission-daemon/Downloads&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;incomplete-dir-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;lpd-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;max-peers-global&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;message-level&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-congestion-algorithm&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-id-ttl-hours&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;6&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-limit-global&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-limit-per-torrent&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;50&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-port&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;51413&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-port-random-high&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;65535&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-port-random-low&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;49152&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-port-random-on-start&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;peer-socket-tos&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;default&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;pex-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;port-forwarding-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;preallocation&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;prefetch-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;queue-stalled-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;queue-stalled-minutes&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;30&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;ratio-limit&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;ratio-limit-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rename-partial-files&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-authentication-required&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-bind-address&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;0.0.0.0&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-host-whitelist&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-host-whitelist-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-password&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{224c4b5e26569d0baa8a161a68263253bbc69c26dnhxDeWg&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-port&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;9091&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-url&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/transmission/&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-username&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;transmission&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-whitelist&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;127.0.0.1&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;rpc-whitelist-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;scrape-paused-torrents-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;script-torrent-done-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;script-torrent-done-filename&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;seed-queue-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;seed-queue-size&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;speed-limit-down&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;speed-limit-down-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;speed-limit-up&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;speed-limit-up-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;start-added-torrents&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;trash-original-torrent-files&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;umask&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;18&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;upload-limit&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;upload-limit-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;upload-slots-per-torrent&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;14&lt;/span&gt;,
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;utp-enabled&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here are the options you should definitely look at:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;download-dir&lt;/code&gt; specifies where Transmission should save downloaded
torrents. (You can probably leave this at the default of
&lt;code&gt;/var/lib/transmission-daemon/downloads&lt;/code&gt;.) If you change this, make
sure &lt;code&gt;debian-transmission&lt;/code&gt; has permissions to use the directory.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;peer-port&lt;/code&gt; specifies what port Transmission should listen on to
connect to peers. (You can probably leave this at the default of
&lt;code&gt;51413&lt;/code&gt;.)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rpc-password&lt;/code&gt; specifies the password required to control
Transmission. Change this by typing it in as plaintext. When the
Transmission service starts, it will be hashed and prefixed with a
left curly bracket (&lt;code&gt;{&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rpc-port&lt;/code&gt; specifies the port Transmission will listen on for remote
commands. (You can probably leave this at the default of &lt;code&gt;9091&lt;/code&gt;,
unless you have another service listening on this port for some
reason.)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rpc-username&lt;/code&gt; specifies the username required to control
Transmission. The default is &lt;code&gt;transmission&lt;/code&gt;, but feel free to change
this.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;firewall&#34;&gt;Firewall&lt;/h3&gt;
&lt;p&gt;If &lt;code&gt;peer-port-random-on-start&lt;/code&gt; is set to the default of &lt;code&gt;false&lt;/code&gt;, your
firewall must allow TCP and UDP traffic on the &lt;code&gt;peer-port&lt;/code&gt;. Assuming you
are using &lt;code&gt;ufw&lt;/code&gt;, and &lt;code&gt;peer-port&lt;/code&gt; is at the default of &lt;code&gt;51413&lt;/code&gt;, enter:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;51413&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;note-on-port-randomization&#34;&gt;Note on Port Randomization&lt;/h4&gt;
&lt;p&gt;If you set &lt;code&gt;peer-port-random-on-start&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, your firewall must
allow both TCP and UDP traffic on the port range specified by
&lt;code&gt;peer-port-random-low&lt;/code&gt; and &lt;code&gt;peer-port-random-high&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Assuming you are using &lt;code&gt;ufw&lt;/code&gt;, and &lt;code&gt;peer-port-random-high&lt;/code&gt; is &lt;code&gt;65535&lt;/code&gt;,
and &lt;code&gt;peer-port-random-low&lt;/code&gt; is &lt;code&gt;49152&lt;/code&gt;, enter:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow 49152:65535/tcp
ufw allow 49152:65535/udp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;starting-the-service&#34;&gt;Starting the Service&lt;/h3&gt;
&lt;p&gt;After modifying and saving the &lt;code&gt;transmission-daemon&lt;/code&gt; configuration,
start the service:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;service transmission-daemon start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Transmission will hash your password in the configuration. You should be
able to connect to the daemon with &lt;code&gt;transmission-remote&lt;/code&gt; locally on the
server using your credentials as shown next.&lt;/p&gt;
&lt;h2 id=&#34;controlling-transmission-locally&#34;&gt;Controlling Transmission Locally&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;transmission-daemon&lt;/code&gt; runs your torrent session in the background. It is
controlled by an HTTP API that it serves on the &lt;code&gt;rpc-port&lt;/code&gt; at
&lt;code&gt;localhost&lt;/code&gt;. &lt;code&gt;transmission-remote&lt;/code&gt; is the command line utility you can
use to control the daemon, and it was installed automatically when you
installed &lt;code&gt;transmission-daemon&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;authentication&#34;&gt;Authentication&lt;/h3&gt;
&lt;p&gt;You first need to authenticate &lt;code&gt;transmission-remote&lt;/code&gt; using the username
and password you set up in &lt;code&gt;settings.json&lt;/code&gt;. There are 2 basic ways you
can do this.&lt;/p&gt;
&lt;h4 id=&#34;netrc-file&#34;&gt;.netrc File&lt;/h4&gt;
&lt;p&gt;The first method is via a &lt;code&gt;.netrc&lt;/code&gt; file in your home directory. The
advantage of this method is that you do not need to provide your
credentials every time you run a &lt;code&gt;transmission-remote&lt;/code&gt; command. The
disadvantage is that your Transmission password is stored in your home
folder as plaintext.&lt;/p&gt;
&lt;p&gt;To add the necessary record to your &lt;code&gt;.netrc&lt;/code&gt; file, run the following
command, where &lt;code&gt;&amp;lt;username&amp;gt;&lt;/code&gt; is the &lt;code&gt;rpc-username&lt;/code&gt;, and &lt;code&gt;&amp;lt;password&amp;gt;&lt;/code&gt; is
the plaintext version of &lt;code&gt;rpc-password&lt;/code&gt; in &lt;code&gt;settings.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;machine localhost login &amp;lt;username&amp;gt; password &amp;lt;password&amp;gt;&amp;#34;&lt;/span&gt; &amp;gt;&amp;gt; ~/.netrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, to authenticate, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --netrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Subsequent &lt;code&gt;transmission-remote&lt;/code&gt; commands will not require entering your
credentials.&lt;/p&gt;
&lt;h4 id=&#34;--auth-flag&#34;&gt;--auth Flag&lt;/h4&gt;
&lt;p&gt;The second method to authenticate is to include an &lt;code&gt;auth&lt;/code&gt; flag in every
&lt;code&gt;transmission-remote&lt;/code&gt; command you execute. Substituting your credentials
for &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt;, you can enter the following command to
list your torrents:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --auth&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;username:password --list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, you should be able to use &lt;code&gt;transmission-remote&lt;/code&gt; on your
server to manage your torrents.&lt;/p&gt;
&lt;h3 id=&#34;hosting-torrents&#34;&gt;Hosting Torrents&lt;/h3&gt;
&lt;p&gt;Here is a cookbook of common &lt;code&gt;transmission-remote&lt;/code&gt; commands for hosting
torrents.&lt;/p&gt;
&lt;p&gt;Add a torrent via a magnet link:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --add &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;magnet:link&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add a torrent via a .torrent file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --add &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your.torrent&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;List the status of your torrents (and get their numerical IDs):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Get information about a specific torrent (where &lt;code&gt;ID&lt;/code&gt; is the torrent ID
from the prior command):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --torrent&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ID --info
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Remove a torrent and keep its data (where &lt;code&gt;ID&lt;/code&gt; is the torrent ID):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --torrent&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ID --remove
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Remove a torrent and delete its data (where &lt;code&gt;ID&lt;/code&gt; is the torrent ID):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --torrent&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ID --remove-and-delete
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Get information about the current Transmission session:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --session-info
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Get statistics about the current Transmission session:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --session-stats
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;downloading-completed-torrents-via-secure-shell&#34;&gt;Downloading Completed Torrents via Secure Shell&lt;/h3&gt;
&lt;p&gt;Completed torrent downloads will be saved in the directory indicated by
&lt;code&gt;download-dir&lt;/code&gt; in your configuration. (This is
&lt;code&gt;/var/lib/transmission-daemon/downloads&lt;/code&gt; by default.)&lt;/p&gt;
&lt;p&gt;You should be able to download those files and directories from your
seedbox using tools like &lt;a href=&#34;../rsync/&#34;&gt;&lt;code&gt;rsync&lt;/code&gt;&lt;/a&gt;, &lt;code&gt;(s)ftp&lt;/code&gt;, and &lt;code&gt;scp&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If this is sufficient for you, you do not need to configure Transmission
for remote access.&lt;/p&gt;
&lt;h2 id=&#34;creating-new-torrents&#34;&gt;Creating New Torrents&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;transmission-create&lt;/code&gt; is used to create torrents. It was installed
automatically on your server when you installed &lt;code&gt;transmission-daemon&lt;/code&gt;.
You can use it on any machine that has it installed and has a copy of
the file or directory you want to share.&lt;/p&gt;
&lt;p&gt;(&lt;code&gt;transmission-edit&lt;/code&gt; is also available to edit .torrent files. It can do
things like add and delete tracker urls. However, this tool tends to be
more useful when working with other&#39;s .torrent files and less so when
creating torrents from scratch.)&lt;/p&gt;
&lt;h3 id=&#34;creating-the-torrent-file&#34;&gt;Creating the .torrent File&lt;/h3&gt;
&lt;p&gt;Here is a template command for creating a .torrent file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-create --outfile &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my.torrent&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;                    --comment &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;My cool torrent&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;                    --tracker &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://tracker1.example.org/announce&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;                    --tracker &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://tracker2.example.org/announce&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;path/to/my/file/or/directory&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;outfile&lt;/code&gt; specifies where to write the .torrent file.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;comment&lt;/code&gt; specifies a comment for the torrent.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tracker&lt;/code&gt; specifies a torrent tracker to use. You can have multiple of
these. &lt;code&gt;udp://open.tracker.cl:1337/announce&lt;/code&gt; is usually a good choice,
but there are many others.&lt;/li&gt;
&lt;li&gt;The path indicates the file or directory you want to make a torrent
of.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;generating-the-magnet-link&#34;&gt;Generating the Magnet Link&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;transmission-show&lt;/code&gt; is used to generate magnet links from .torrent
files, and it was installed when you installed &lt;code&gt;transmission-daemon&lt;/code&gt;.
Given any .torrent file, you can run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-show --magnet &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;my.torrent&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;seeding-your-new-torrent&#34;&gt;Seeding Your New Torrent&lt;/h3&gt;
&lt;p&gt;First, copy the file or directory that you are hosting to the download
directory (&lt;code&gt;download-dir&lt;/code&gt;) specified in the &lt;code&gt;transmission-daemon&lt;/code&gt;
configuration. If the &lt;code&gt;download-dir&lt;/code&gt; is at the default, you could write:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;the-file-or-directory-to-share&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;   &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/var/lib/transmission-daemon/downloads/&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, add your torrent to Transmission via your .torrent file or magnet
link:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --add &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;the-torrent-file-or-magnet-link&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Your server should begin seeding your torrent, and you can share it via
the .torrent file or magnet link.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Make sure you copy the file or directory you are seeding to
the &lt;code&gt;download-dir&lt;/code&gt; directory &lt;em&gt;before&lt;/em&gt; adding the torrent to
Transmission. If you copy the source file/directory into your download
directory &lt;em&gt;after&lt;/em&gt; adding the torrent, run &lt;code&gt;transmission-remote&lt;/code&gt; to get
the ID of your torrent:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, where &lt;code&gt;ID&lt;/code&gt; is the ID of the torrent, run this command so
Transmission will know it already has the data:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote --torrent&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;ID --verify
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The torrent should then begin seeding.&lt;/p&gt;
&lt;h2 id=&#34;controlling-transmission-remotely&#34;&gt;Controlling Transmission Remotely&lt;/h2&gt;
&lt;p&gt;At this point, you should be able to manage your seedbox locally by
using &lt;code&gt;transmission-remote&lt;/code&gt; on your server via secure shell. However, it
may be convenient to also configure the box for remote access. You can
do this by exposing Transmission&#39;s HTTP API, which includes a web app.&lt;/p&gt;
&lt;p&gt;The Transmission web app acts as a graphical stand-in for
&lt;code&gt;transmission-remote&lt;/code&gt;. You can manage your torrents and the daemon with
it.&lt;/p&gt;
&lt;p&gt;Similar to &lt;code&gt;transmission-remote&lt;/code&gt; itself, however, you cannot download
completed torrents via the web app. (That requires serving the files via
a different channel, whether that be &lt;code&gt;rsync&lt;/code&gt;, &lt;code&gt;sftp&lt;/code&gt;, &lt;code&gt;scp&lt;/code&gt;, &lt;code&gt;http(s)&lt;/code&gt;,
etc. Serving completed torrents via &lt;code&gt;http(s)&lt;/code&gt; is explained later.)&lt;/p&gt;
&lt;p&gt;Exposing Transmission&#39;s HTTP interface to the internet additionally
allows you to control your seedbox from a different machine using
&lt;code&gt;transmission-remote&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;configuring-remote-access&#34;&gt;Configuring Remote Access&lt;/h3&gt;
&lt;p&gt;By default, &lt;code&gt;transmission-daemon&lt;/code&gt; only allows RPC commands from
&lt;code&gt;localhost&lt;/code&gt;. For remote access, it must allow connections from the IP
addresses you want to access the daemon from. The most direct way of
doing this is by disabling the whitelist, which allows all IP addresses,
but you can specify a whitelist if you like.&lt;/p&gt;
&lt;p&gt;Stop &lt;code&gt;transmission-daemon&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;service transmission-daemon stop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, set &lt;code&gt;rpc-whitelist-enabled&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in your configuration. This
makes it so that any IP address can connect and control
&lt;code&gt;transmission-daemon&lt;/code&gt;. (You will just need your &lt;code&gt;rpc-username&lt;/code&gt; and the
plaintext version of your &lt;code&gt;rpc-password&lt;/code&gt; to authenticate.)&lt;/p&gt;
&lt;p&gt;Alternatively, if you want to use the whitelist, set
&lt;code&gt;rpc-whitelist-enabled&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, and set &lt;code&gt;rpc-whitelist&lt;/code&gt; to a
comma-separated list of IP addresses. (Asterisks are used as wildcards.)
For example, you could write:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;101.125.137.168,89.72.*.221
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While you have the configuration open, take note of the value of
&lt;code&gt;rpc-port&lt;/code&gt;, which is 9091 by default. This value will be necessary for
configuring remote access.&lt;/p&gt;
&lt;p&gt;After saving your configuration, start &lt;code&gt;transmission-daemon&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;service transmission-daemon start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;running-nginx-as-a-reverse-proxy&#34;&gt;Running Nginx as a Reverse Proxy&lt;/h3&gt;
&lt;p&gt;It is possible to open remote access to &lt;code&gt;transmission-daemon&lt;/code&gt; simply by
opening its &lt;code&gt;rpc-port&lt;/code&gt; in the firewall, 9091 by default. This connection
will be run over insecure HTTP, so your username and password will be
sent unencrypted. While this may be acceptable when testing a system, it
is generally preferable to use a web server with TLS as a reverse proxy
to Transmission&#39;s HTTP interface.&lt;/p&gt;
&lt;p&gt;If you are already running nginx with working TLS, allowing access to
Transmission&#39;s web interface simply requires adding a &lt;code&gt;location&lt;/code&gt; block
to your &lt;code&gt;server&lt;/code&gt; block in your nginx configuration. Assuming &lt;code&gt;rpc-port&lt;/code&gt;
is 9091, and &lt;code&gt;rpc-url&lt;/code&gt; is &lt;code&gt;/transmission/&lt;/code&gt; in your &lt;code&gt;transmission-daemon&lt;/code&gt;
configuration, add the following block to your nginx configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/transmission/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:9091/transmission/&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reload nginx so your changes takes effect:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nginx -s reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, if &lt;code&gt;example.org&lt;/code&gt; is your domain, and you are connected
from a permitted IP address:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Transmission web app will be available at
&lt;code&gt;https://example.org/transmission/web/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;transmission-remote&lt;/code&gt; will be able to connect to
&lt;code&gt;https://example.org/transmission&lt;/code&gt;. (Note the omission of the trailing
forward slash.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;serving-transmission-at-a-different-path&#34;&gt;Serving Transmission at a Different Path&lt;/h4&gt;
&lt;p&gt;By default, Transmission serves it&#39;s interface at the path
&lt;code&gt;/transmission/&lt;/code&gt;. You can change this in the configuration, but note
that your chosen path must start and end with a forward slash.&lt;/p&gt;
&lt;p&gt;For example, to serve Transmission&#39;s interface at &lt;code&gt;/~luke/torrents/&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stop the &lt;code&gt;transmission-daemon&lt;/code&gt; service.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;rpc-url&lt;/code&gt; in the configuration to your chosen path. That is
&lt;code&gt;/~luke/torrents/&lt;/code&gt; in this example.&lt;/li&gt;
&lt;li&gt;Modify the &lt;code&gt;location&lt;/code&gt; block&#39;s path pattern and &lt;code&gt;proxy_pass&lt;/code&gt; url in
your nginx configuration to use the new path (and the correct
&lt;code&gt;rpc-port&lt;/code&gt;). For this example, that is:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/~luke/torrents/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:9091/~luke/torrents/&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;Start the &lt;code&gt;transmission-daemon&lt;/code&gt; service.&lt;/li&gt;
&lt;li&gt;Reload nginx.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The Transmission web app will then be accessible at
&lt;code&gt;https://example.org/~luke/torrents/web/&lt;/code&gt;. &lt;code&gt;transmission-remote&lt;/code&gt; will be
able to connect to &lt;code&gt;https://example.org/~luke/torrents&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;connecting-via-a-browser&#34;&gt;Connecting via a Browser&lt;/h3&gt;
&lt;p&gt;Where &lt;code&gt;example.org&lt;/code&gt; is your website, and &lt;code&gt;/transmission/&lt;/code&gt; is the
&lt;code&gt;rpc-url&lt;/code&gt; in your &lt;code&gt;transmission-daemon&lt;/code&gt; configuration, point your web
browser to &lt;code&gt;https://example.org/transmission/web/&lt;/code&gt;. After entering your
credentials into the login (using your &lt;code&gt;rpc-username&lt;/code&gt; and plaintext
&lt;code&gt;rpc-password&lt;/code&gt;), you will be greeted by the web interface with a list of
your torrents.&lt;/p&gt;
&lt;p&gt;Here is a Transmission instance that is downloading one torrent:&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/transmission-web-interface.png&#34; alt=&#34;A screenshot of the Transmission web interface&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;h3 id=&#34;connecting-via-transmission-remote&#34;&gt;Connecting via Transmission-Remote&lt;/h3&gt;
&lt;p&gt;You can control &lt;code&gt;transmission-daemon&lt;/code&gt; on your server from other machines
that have &lt;code&gt;transmission-remote&lt;/code&gt; installed. You do this by calling
&lt;code&gt;transmission-remote&lt;/code&gt; with a url consisting of the domain name (or IP),
the &lt;code&gt;rpc-port&lt;/code&gt;, and the path specified by &lt;code&gt;rpc-url&lt;/code&gt; in the configuration
(&lt;code&gt;/transmission/&lt;/code&gt; by default) with the trailing forward slash omitted.
For example, after inserting your credentials for &lt;code&gt;username&lt;/code&gt; and
&lt;code&gt;password&lt;/code&gt;, assuming the &lt;code&gt;rpc-url&lt;/code&gt; is at the default of
&lt;code&gt;/transmission/&lt;/code&gt;, you could invoke the following command on your local
machine to list the status of the torrents on your server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;transmission-remote https://example.org/transmission &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;                    --auth&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;username:password &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;                    --list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note how the &lt;code&gt;rpc-url&lt;/code&gt; is &lt;code&gt;/transmission/&lt;/code&gt;, but &lt;code&gt;/transmission&lt;/code&gt; is
specified in the command.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; The Transmission web app and &lt;code&gt;transmission-remote&lt;/code&gt; both
allow you to make changes to Transmission&#39;s port settings. Be careful
change these, because you might also need to update your server&#39;s
firewall configuration.&lt;/p&gt;
&lt;h2 id=&#34;serving-complete-torrent-downloads-via-https&#34;&gt;Serving Complete Torrent Downloads via HTTP(S)&lt;/h2&gt;
&lt;p&gt;The Transmission web interface and &lt;code&gt;transmission-remote&lt;/code&gt; do not allow
you to download completed torrents from your seedbox via HTTP(S).
However, in some scenarios, downloading via HTTP(S) may be preferable
where shell access and other supporting tools (&lt;code&gt;rsync&lt;/code&gt;, &lt;code&gt;scp&lt;/code&gt;, &lt;code&gt;sftp&lt;/code&gt;,
&lt;code&gt;ftp&lt;/code&gt;, etc.) are unavailable on the client machine. Serving completed
torrent downloads involves configuring nginx to serve the &lt;code&gt;download-dir&lt;/code&gt;
of &lt;code&gt;transmission-daemon&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;(Serving completed torrent downloads via HTTP(S) does not require
exposing Transmission&#39;s HTTP API and web app.)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; The Transmission interfaces give you the option of saving
completed torrent downloads to directories other than the &lt;code&gt;download-dir&lt;/code&gt;
specified in your &lt;code&gt;transmission-daemon&lt;/code&gt; configuration. Downloading a
torrent to a different directory and not serving that directory with
nginx will prevent that completed torrent from being served to clients
via the static file server shown here.&lt;/p&gt;
&lt;p&gt;Assuming you wish to serve your completed torrents from the directory
&lt;code&gt;/downloads/&lt;/code&gt; on your web server, and &lt;code&gt;download-dir&lt;/code&gt; is at the default
of &lt;code&gt;/var/lib/transmission-daemon/downloads/&lt;/code&gt;, you can add this
&lt;code&gt;location&lt;/code&gt; block into the &lt;code&gt;server&lt;/code&gt; block of your nginx configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/downloads&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/lib/transmission-daemon/downloads&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;proxy_max_temp_file_size&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;autoindex&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note how the trailing forward slash has been omitted in both the
&lt;code&gt;location&lt;/code&gt; pattern and the &lt;code&gt;root&lt;/code&gt; path.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;proxy_max_temp_file_size&lt;/code&gt; option prevents disk caching that would
potentially break nginx&#39;s ability to serve files larger than a few
gigabytes.&lt;/p&gt;
&lt;p&gt;If you omit the &lt;code&gt;autoindex&lt;/code&gt; option or set it to &lt;code&gt;off&lt;/code&gt;, nginx will not
show a directory listing of your downloaded torrents. (You will need the
direct link to download a given torrent.)&lt;/p&gt;
&lt;p&gt;After saving the configuration, reload nginx.&lt;/p&gt;
&lt;p&gt;Where &lt;code&gt;example.org&lt;/code&gt; is your website, and assuming &lt;code&gt;autoindex&lt;/code&gt; is &lt;code&gt;on&lt;/code&gt;,
opening &lt;code&gt;https://example.org/downloads/&lt;/code&gt; in a web browser should show a
list of links to download your completed torrents.&lt;/p&gt;
&lt;p&gt;While downloading via HTTP(S) can be convenient, resuming interrupted
downloads can be a nuisance. See &lt;a href=&#34;#appendix-2-reliable-downloading-via-https&#34;&gt;Appendix 2&lt;/a&gt; for tips on how to combat
this.&lt;/p&gt;
&lt;h3 id=&#34;preventing-unauthorized-downloading&#34;&gt;Preventing Unauthorized Downloading&lt;/h3&gt;
&lt;p&gt;If you want to prevent others from downloading completed torrents via
HTTP(S) from your seedbox, you have a few options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When defining the nginx &lt;code&gt;location&lt;/code&gt; block, you can use some random
string for the path match pattern, like &lt;code&gt;/DJRmdL8HPn&lt;/code&gt;. Only those who
know the path will able to download your completed torrents.&lt;/li&gt;
&lt;li&gt;You can protect the directory with a username and password using
&lt;a href=&#34;../auth/&#34;&gt;HTTP basic authentication&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;journalctl&lt;/code&gt; can be used to view the logs of &lt;code&gt;transmission-daemon&lt;/code&gt;. For
example, you could run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;journalctl | grep transmission-daemon
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Transmission&#39;s &lt;a href=&#34;https://github.com/transmission/transmission/blob/main/docs/README.md&#34;&gt;documentation&lt;/a&gt; contains help and answers to common
questions.&lt;/p&gt;
&lt;h2 id=&#34;appendix-1-what-is-bittorrent&#34;&gt;Appendix 1: What is BitTorrent?&lt;/h2&gt;
&lt;p&gt;Many protocols for sending files over the internet, such as Hypertext
Transfer Protocol (HTTP) and File Transfer Protocol (FTP), operate on a
&amp;quot;client-server&amp;quot; (or &amp;quot;server-client&amp;quot;) model. A server will store a
file. A client will send a request for the file from the server. If the
request is accepted, the server will respond with the file.&lt;/p&gt;
&lt;p&gt;In contrast, BitTorrent is a decentralized, peer-to-peer, file-sharing
protocol. Instead of relying on a dedicated server, a file will be
assembled by downloading it in chunks from many different hosts. Anyone
who has the file (or pieces of it) can then help serve the file to
others. This makes file-sharing via BitTorrent much less susceptible to
data loss and downtime than the client-server model since the file can
be replicated and shared across a potentially large number of
independent hosts.&lt;/p&gt;
&lt;p&gt;The individual hosts are called &amp;quot;peers&amp;quot;. The process of a host
offering their copy of the file for download to others is called
&amp;quot;seeding&amp;quot;. The set of peers collectively hosting the file is called a
&amp;quot;swarm&amp;quot;.&lt;/p&gt;
&lt;p&gt;The peers usually find out about each other using &amp;quot;trackers&amp;quot;,
dedicated servers that help peers find those who possess or want a
specific file. Trackers are identified by URLs. A peer can &amp;quot;announce&amp;quot;
to a tracker that it possesses a specific file. If a peer wants to
download a file, the peer can ask the tracker for peers that possess the
file. Trackers do not actually transfer the torrent between peers. They
simply facilitate peer-discovery.&lt;/p&gt;
&lt;p&gt;The BitTorrent network also uses other mechanisms for peer-discovery,
including a &amp;quot;DHT&amp;quot;, or Distributed Hash Table. Similar to trackers,
these help peers find each other. Unlike trackers, a DHT is entirely
peer-to-peer as it is based on a distributed data structure rather than
a dedicated server. The DHT that BitTorrent uses is called the Mainline
DHT. Most modern torrent clients will give you the option of using it to
help you find peers. (Transmission supports it.)&lt;/p&gt;
&lt;p&gt;Before downloading a desired file or directory, you will need its
.torrent file or magnet link. These are usually distributed via
webpages, and they contain metadata and other information required for
downloading the file, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The cryptographic hash of the file for validating its integrity. (A
.torrent file will also include hashes for individual chunks of the
file.)&lt;/li&gt;
&lt;li&gt;The name of the torrent.&lt;/li&gt;
&lt;li&gt;A list of tracker URLs to use for finding peers.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once the .torrent file or magnet link has been imported into a torrent
client, the client will query the network to discover peers that possess
the file. The swarm will then work together to send the user the file in
chunks. The chunks will be cryptographically validated and assembled to
create the final file. After the user has downloaded the file (or even
if they only have pieces of it), they also can be part of the swarm by
helping to seed the file to others who want it.&lt;/p&gt;
&lt;p&gt;&amp;quot;Leeching&amp;quot; is when a user downloads torrents and does not seed them to
others. This practice hurts the overall functioning of the swarm and
will also usually reduce the bandwidth that other peers are willing to
dedicate to you in the future. Always reseed. 🌱&lt;/p&gt;
&lt;h2 id=&#34;appendix-2-reliable-downloading-via-https&#34;&gt;Appendix 2: Reliable Downloading via HTTP(S)&lt;/h2&gt;
&lt;p&gt;Downloading via HTTP(S) can be very convenient when shell access is
unavailable. It can also be very troublesome with large files due to
interrupted or corrupted downloads. Thankfully, utilities like &lt;code&gt;wget&lt;/code&gt;
and &lt;code&gt;zsync&lt;/code&gt; can help combat this.&lt;/p&gt;
&lt;h3 id=&#34;wget&#34;&gt;wget&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;wget&lt;/code&gt; supports resuming interrupted downloads. It isn&#39;t as robust for
this use case as other utilities (like &lt;code&gt;zsync&lt;/code&gt;), but it can be
convenient because:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It doesn&#39;t require any extra setup on your server.&lt;/li&gt;
&lt;li&gt;It comes preinstalled on most *nix systems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Supposing you want to download a very large file from your web server
and save it to your current directory, you might run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget https://example.org/downloads/large.file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If this command is stopped or interrupted, running it again with the
&lt;code&gt;--continue&lt;/code&gt; flag will cause &lt;code&gt;wget&lt;/code&gt; to resume your download:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget --continue https://example.org/downloads/large.file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If your network connection is particularly poor, you can also specify
the &lt;code&gt;--tries=0&lt;/code&gt; flag. &lt;code&gt;wget&lt;/code&gt; will retry connecting indefinitely, so you
don&#39;t need to run the command multiple times if it disconnects.&lt;/p&gt;
&lt;p&gt;One major downside of using &lt;code&gt;wget&lt;/code&gt; is that the resumption of the
download is based on the difference between the file length on the
server and the length of the partial file on your disk. No cryptography
or checksum is used to validate the file&amp;rsquo;s integrity.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wget&lt;/code&gt; also supports downloading directories, but this can be finicky.
You might need to experiment with the arguments depending on the
contents of the directory. For example, assuming directory listing is
enabled in the relevant directory on your web server, you might run a
command like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget --recursive --no-parent &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;     https://example.org/downloads/large-directory/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;--recursive&lt;/code&gt; flag indicates that &lt;code&gt;wget&lt;/code&gt; should download the
contents of the directory as well as its subdirectories up to 5 levels
deep.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--no-parent&lt;/code&gt; flag indicates that &lt;code&gt;wget&lt;/code&gt; should not download any
files at higher levels in the directory hierarchy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Enabling &lt;code&gt;autoindex&lt;/code&gt; for a directory in nginx implicitly
creates &lt;code&gt;index.html&lt;/code&gt; files in the directory and its subdirectories from
the perspective of HTTP(S) clients like &lt;code&gt;wget&lt;/code&gt;. However, the &lt;code&gt;--reject index.html&lt;/code&gt; flag is omitted in the above command because &lt;code&gt;wget&lt;/code&gt; needs
the links in those index files to download all of the files in the
target directory. (In fact, for this reason, the above command might
potentially fail to download all the files in the directory if the
target directory contains &lt;code&gt;index.html&lt;/code&gt; files.) Once the directory has
been downloaded to your disk, you would then need to delete the
&lt;code&gt;index.html&lt;/code&gt; files that were created by the web server&amp;rsquo;s directory
listing in your downloaded copy. Additionally, the actual directory
structure created on your disk with this example would be
&lt;code&gt;example.org/downloads/large-directory/&lt;/code&gt;, not &lt;code&gt;large-directory/&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;zsync&#34;&gt;zsync&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;zsync&lt;/code&gt; is another option for more reliable HTTP(S) downloading.&lt;/p&gt;
&lt;p&gt;The advantages of &lt;code&gt;zsync&lt;/code&gt; include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It offers significantly more data validation than &lt;code&gt;wget&lt;/code&gt; by using
hashes and checksums.&lt;/li&gt;
&lt;li&gt;By using the &lt;code&gt;-i&lt;/code&gt; flag, you can specify file chunks you have on disk
from the same or similar downloads to potentially accelerate the
current download.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The disadvantages of &lt;code&gt;zsync&lt;/code&gt; include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It does not usually come pre-installed on *nix systems.&lt;/li&gt;
&lt;li&gt;Unlike &lt;code&gt;wget&lt;/code&gt;, it does not support downloading directories. It only
supports files.&lt;/li&gt;
&lt;li&gt;It must be installed on the client-side.&lt;/li&gt;
&lt;li&gt;It requires additional setup on the server-side.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;zsync&lt;/code&gt; is available in the Debian repositories. Install it on your
server by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install zsync
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(You will also need to install it on your client machine.)&lt;/p&gt;
&lt;p&gt;On your server, change your directory to your torrent download
directory, &lt;code&gt;/var/lib/transmission-daemon/downloads/&lt;/code&gt; by default. Then,
run &lt;code&gt;zsyncmake&lt;/code&gt; by providing the url and name of the file you want to
use &lt;code&gt;zsync&lt;/code&gt; on:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;zsyncmake -u &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://example.org/downloads/large.file&amp;#34;&lt;/span&gt; large.file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will create a new file with the same name as your original file but
with the &lt;code&gt;.zsync&lt;/code&gt; extension added: &lt;code&gt;large.file.zsync&lt;/code&gt; in this case.
(Note that if the file you are sharing changes, you need to regenerate
the &lt;code&gt;.zsync&lt;/code&gt; file.)&lt;/p&gt;
&lt;p&gt;If you view your torrent download directory in a browser, and nginx has
&lt;code&gt;autoindex&lt;/code&gt; turned &lt;code&gt;on&lt;/code&gt;, you should notice the addition of the &lt;code&gt;.zsync&lt;/code&gt;
file in the directory.&lt;/p&gt;
&lt;p&gt;On your HTTP(S) client, where the provided url is the link to the new
&lt;code&gt;.zsync&lt;/code&gt; file, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;zsync &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://example.org/downloads/large.file.zsync&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If your download is interrupted, just run the command again, and &lt;code&gt;zsync&lt;/code&gt;
will read your partial download, resume it, checksum it, and cleanly
assemble the target file, &lt;code&gt;large.file&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If your downloads directory is protected with HTTP basic authentication,
you can specify your credentials by adding an &lt;code&gt;-A&lt;/code&gt; flag before the URL:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;zsync -A example.org&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;username:password &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;      &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://example.org/downloads/large.file.zsync&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you have a piece of the file with a different name or a different
version of the file, you can specify those pieces with the &lt;code&gt;-i&lt;/code&gt; flag to
potentially reduce what &lt;code&gt;zsync&lt;/code&gt; needs to fetch over the network:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;zsync -i &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;large.file.piece&amp;#34;&lt;/span&gt; -i &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;large.file.old&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;      &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://example.org/downloads/large.file.zsync&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;zsync&lt;/code&gt; will attempt to look for file chunks in &lt;code&gt;large.file.piece&lt;/code&gt; and
&lt;code&gt;large.file.old&lt;/code&gt; that can be used to help assemble &lt;code&gt;large.file&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For example, if you have a Linux ISO on your computer, and you want to
download an updated version from your seedbox, there&#39;s a good chance
that only certain sections of the ISO changed from the version you
already have. You can specify the old version of the ISO you have with
the &lt;code&gt;-i&lt;/code&gt; flag to potentially reuse chunks from the old version when
downloading the new ISO.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Written by: Luke Hamann&lt;/em&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Mumble</title>
		<link>https://landchad.net/mumble/</link>
		<pubDate>Sun, 02 Jul 2023 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/mumble/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://mumble.info&#34;&gt;Mumble&lt;/a&gt; is an open source, low latency and high quality voice chat software, being the best open source alternative to TeamSpeak.
VoIP communications are mandatory encrypted by default using OCB-AES128, it has integrations for gamers (like overlays), it&amp;rsquo;s stable and it&amp;rsquo;s resource friendly.&lt;/p&gt;
&lt;p&gt;The server can also be run &lt;a href=&#34;https://gitlab.torproject.org/legacy/trac/-/wikis/doc/TorifyHOWTO/Mumble&#34;&gt;behind Tor&lt;/a&gt; without any issue.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Mumble has a Debian repository for client and server, however it&amp;rsquo;s very outdated so we are going to build the server instead.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I suggest to build both binaries on your local machine and &lt;a href=&#34;#extra&#34;&gt;transfer the &lt;code&gt;mumble-server&lt;/code&gt; to your remote server using &lt;code&gt;scp&lt;/code&gt;&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Install dependencies:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install build-essential cmake pkg-config qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qttools5-dev qttools5-dev-tools libqt5svg5-dev libboost-dev libssl-dev libprotobuf-dev protobuf-compiler libprotoc-dev libcap-dev libxi-dev libasound2-dev libogg-dev libsndfile1-dev libspeechd-dev libavahi-compat-libdnssd-dev libxcb-xinerama0 libzeroc-ice-dev libpoco-dev g++-multilib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Git clone the repo.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone https://github.com/mumble-voip/mumble.git &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; cd mumble
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Initialize all the submodules.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git submodule update --init
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Create a build directory and run &lt;code&gt;cmake&lt;/code&gt;.
Cmake will create all the necessary files to build the mumble-server and client.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir build &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; cd build &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; cmake ..
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Build using &lt;code&gt;cmake&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cmake
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After the build you will now find a file named &lt;code&gt;mumble-server&lt;/code&gt;, one &lt;code&gt;mumble&lt;/code&gt; (which is the client) and a file named &lt;code&gt;mumble-server.ini&lt;/code&gt; (aka the config file).&lt;/p&gt;
&lt;h2 id=&#34;running-your-mumble-server&#34;&gt;Running your Mumble server&lt;/h2&gt;
&lt;p&gt;If you built it on local machine you can check out &lt;a href=&#34;#extra&#34;&gt;how to move it to your remote server&lt;/a&gt; first.&lt;/p&gt;
&lt;p&gt;After that, start with making your &lt;code&gt;mumble-server&lt;/code&gt; executable and move it in &lt;code&gt;/usr/bin&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chmod +x mumble-server &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; mv mumble-server /usr/bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create a folder in &lt;code&gt;/etc/&lt;/code&gt; move your config files there.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir /etc/mumble &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; mv mumble-server.ini /etc/mumble
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By default, mumble-server uses port 64738, so make sure to open that port on your firewall (if you&amp;rsquo;re using one), or whatever other port you selected on your configuration file. If you&amp;rsquo;re using &lt;code&gt;ufw&lt;/code&gt; as your firewall, the command is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;64738&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we can run the server passing the config and a superuser password that can be used to connect and authenticate as an administrator from any client&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mumble-server -ini mumble-server.ini -supw &amp;lt;your_password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check if it&amp;rsquo;s running in the backgroud with &lt;code&gt;ps aux&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ps aux | grep mumble-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will have an output like this.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;root   &lt;span style=&#34;color:#ae81ff&#34;&gt;127181&lt;/span&gt;  0.1  0.1 &lt;span style=&#34;color:#ae81ff&#34;&gt;261064&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;21640&lt;/span&gt; ?        Sl   19:18   0:01 ./mumble-server
root   &lt;span style=&#34;color:#ae81ff&#34;&gt;127689&lt;/span&gt;  0.0  0.1 &lt;span style=&#34;color:#ae81ff&#34;&gt;112956&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;22572&lt;/span&gt; ?        Sl   19:19   0:00 ./mumble-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;connecting-to-your-mumble-server-as-a-superuser&#34;&gt;Connecting to your mumble-server as a SuperUser&lt;/h2&gt;
&lt;p&gt;You will probably will be left with your &lt;code&gt;mumble&lt;/code&gt; binary in the build folder on your local machine.&lt;/p&gt;
&lt;p&gt;Now you should make it executable and move it in the &lt;code&gt;/usr/bin&lt;/code&gt; folder.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chmod +x mumble &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; mv mumble /usr/bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Run it the GUI with one command.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mumble
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will have something like this opening up.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/mumble/mumble-1.png&#34; alt=&#34;connect window&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Click on the button &lt;code&gt;Add New...&lt;/code&gt; and fill out the information need to connect to your server.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/mumble/mumble-2.png&#34; alt=&#34;add server window&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;If you haven&amp;rsquo;t edited the port, &lt;code&gt;64738&lt;/code&gt; will be default one.&lt;/p&gt;
&lt;p&gt;Click on &lt;code&gt;Ok&lt;/code&gt;, select your server from the list and click &lt;code&gt;Connect&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Now you are connected to your very own Mumble server as a SuperUser!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now, you will want to setup a regular user to be an administrator of the server. Follow the &lt;a href=&#34;https://wiki.mumble.info/wiki/Murmurguide#Becoming_Administrator_and_Registering_a_User&#34;&gt;official documentation&lt;/a&gt; in order to do that, it is well-explained, so I won&amp;rsquo;t repeat it here.&lt;/p&gt;
&lt;p&gt;Also, you might want to take a look at the &lt;a href=&#34;https://wiki.mumble.info/wiki/Murmurguide#Set_Up_Server&#34;&gt;options for your config file&lt;/a&gt;, since mumble let&amp;rsquo;s you set up a good amount of things, including a server password, a welcome message, and how to make your server public for the whole internet to see.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;extra&#34;&gt;Extra&lt;/h2&gt;
&lt;h3 id=&#34;move-binary-with-scp&#34;&gt;Move binary with scp&lt;/h3&gt;
&lt;p&gt;Move your binary to the folder &lt;code&gt;~&lt;/code&gt; of your remote server.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;scp &amp;lt;your_binary&amp;gt; root@&amp;lt;your_server_ip&amp;gt;:~
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;p&gt;Written by &lt;a href=&#34;https://notmtth.xyz&#34;&gt;NotMtth&lt;/a&gt; (Tor access warning)&lt;/p&gt;
&lt;p&gt;Donate Monero at: &lt;code&gt;donate.notmtth.xyz&lt;/code&gt; (&lt;a href=&#34;https://openalias.org/&#34;&gt;OpenAlias&lt;/a&gt;)&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Matrix Dendrite</title>
		<link>https://landchad.net/dendrite/</link>
		<pubDate>Tue, 21 Mar 2023 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/dendrite/</guid>
		<description>&lt;p&gt;The Matrix protocol&amp;rsquo;s default implementation, &lt;a href=&#34;https://landchad.net/matrix&#34;&gt;Synapse,&lt;/a&gt; is very memory and processor hungry, mostly due to it being written in the &lt;em&gt;interpreted Python programming language.&lt;/em&gt; This means that running Synapse on less powerful servers may &lt;strong&gt;take a lot of resources away&lt;/strong&gt; from other services. If you need a more efficient and less memory-intensive but still fully functional Matrix server, then &lt;a href=&#34;https://github.com/matrix-org/dendrite&#34;&gt;Dendrite&lt;/a&gt; is for you.&lt;/p&gt;
&lt;h2 id=&#34;prerequisities&#34;&gt;Prerequisities&lt;/h2&gt;
&lt;h3 id=&#34;dns-records-and-delegation&#34;&gt;DNS Records and Delegation&lt;/h3&gt;
&lt;p&gt;You are &lt;strong&gt;not required&lt;/strong&gt; to run a Matrix server under a subdomain (like &lt;strong&gt;matrix.example.org&lt;/strong&gt;), regardless of server software. You can run your server under &lt;strong&gt;example.org&lt;/strong&gt; to ensure usernames and rooms look like &lt;code&gt;@user:example.org&lt;/code&gt; and &lt;code&gt;#room:example.org&lt;/code&gt; respectively.&lt;/p&gt;
&lt;p&gt;Because Matrix uses &lt;strong&gt;HTTP&lt;/strong&gt; for transport over the SSL ports (443 and 8448), you&amp;rsquo;ll have to configure NGINX for it to work. This can cause confusion, especially if you&amp;rsquo;re running both a &lt;a href=&#34;https://landchad.net/basic/nginx/&#34;&gt;static website&lt;/a&gt; and Matrix server under the same domain (like &lt;strong&gt;example.org&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;Depending on your setup, there are 2 different configurations to achieve this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Your &lt;em&gt;desired&lt;/em&gt; domain (&lt;strong&gt;example.org&lt;/strong&gt;) has an &lt;a href=&#34;https://landchad.net/basic/dns/&#34;&gt;A DNS record&lt;/a&gt; that already poinst to your desired Matrix server, so you can configure this or add to your existing NGINX static site configuration to setup Matrix.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You wish to use Matrix with your &lt;em&gt;desired&lt;/em&gt; domain (&lt;strong&gt;example.org&lt;/strong&gt;) but this domain&amp;rsquo;s A record points to a different server, accessible through another domain (like &lt;strong&gt;matrix.example.org&lt;/strong&gt;). In this case, look into &lt;a href=&#34;https://matrix-org.github.io/synapse/latest/delegate.html&#34;&gt;delegation.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;nginx-configuration&#34;&gt;NGINX Configuration&lt;/h3&gt;
&lt;p&gt;Here&amp;rsquo;s an example configuration for a Matrix server running under &lt;strong&gt;example.org:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;8448&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:8448&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~&lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^(\/_matrix|\/_synapse|\/_client)&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:8008&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Forwarded-For&lt;/span&gt; $remote_addr;
                &lt;span style=&#34;color:#f92672&#34;&gt;client_max_body_size&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;50M&lt;/mark&gt;&lt;/span&gt;;
        }

        &lt;span style=&#34;color:#75715e&#34;&gt;# These sections are required for client and federation discovery
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# (AKA: Client Well-Known URI)
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/matrix/client&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;m.homeserver&amp;#34;:&lt;/span&gt; {&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;base_url&amp;#34;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://&lt;mark&gt;example.org&lt;/mark&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;default_type&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/json&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Access-Control-Allow-Origin&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt;;
        }

        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/matrix/server&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;m.server&amp;#34;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;example.org&lt;/mark&gt;:443&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;default_type&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/json&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Access-Control-Allow-Origin&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt;;
        }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s say you also want to run a &lt;strong&gt;static website&lt;/strong&gt; under &lt;strong&gt;example.org.&lt;/strong&gt; This can be achieved by adding these usual lines under the &lt;code&gt;server&lt;/code&gt; section:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;		&lt;span style=&#34;color:#75715e&#34;&gt;# Basic static site configuration, like any other site
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;		&lt;span style=&#34;color:#66d9ef&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt;;
		&lt;span style=&#34;color:#66d9ef&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.html&lt;/span&gt;;		

		&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;;
        }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;certbot-certificates&#34;&gt;Certbot Certificates&lt;/h4&gt;
&lt;p&gt;Finally, make sure to download and enable TLS certificates for this setup by using the &lt;code&gt;certbot&lt;/code&gt; command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx -d &lt;mark&gt;example.org&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Dendrite has no official distribution packages at the time of writing. To install and run it, you must first install &lt;em&gt;the Go programming language&lt;/em&gt; and then compile the Dendrite software from source.&lt;/p&gt;
&lt;h3 id=&#34;installing-go&#34;&gt;Installing Go&lt;/h3&gt;
&lt;p&gt;First, download the latest Go tarball:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl -fLO &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://dl.google.com/go/&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;curl https://go.dev/VERSION?m&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;text&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.linux-amd64.tar.gz&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, extract the contents to &lt;code&gt;/usr/local&lt;/code&gt;, which will create the directory &lt;code&gt;/usr/local/go&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;tar -C /usr/local -xzfv go*.tar.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then finally, make sure the &lt;code&gt;/usr/local/go/bin/&lt;/code&gt; path is accessible in the &lt;code&gt;$PATH&lt;/code&gt; variable for every user by editing &lt;code&gt;/etc/profile&lt;/code&gt; and adding the following line:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;export PATH&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;$PATH:/usr/local/go/bin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;compiling-and-installing-dendrite&#34;&gt;Compiling and Installing Dendrite&lt;/h3&gt;
&lt;p&gt;Besides Go, we also need the &lt;code&gt;build-essential&lt;/code&gt; package to compile software:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install build-essential
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now download the Dendrite repository using &lt;code&gt;git&lt;/code&gt; and change directory to it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone https://github.com/matrix-org/dendrite
cd dendrite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, compile Dendrite using &lt;code&gt;go build&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;go build -o bin/ ./cmd/...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;This might take a few minutes,&lt;/em&gt; but once the process is finished you should find the final Dendrite programs populating the &lt;code&gt;bin/&lt;/code&gt; directory.&lt;/p&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;To configure Dendrite, begin by coping the &lt;code&gt;dendrite-sample.yaml&lt;/code&gt; configuration file to &lt;code&gt;dendrite.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp dendrite-sample.yaml dendrite.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To configure your domain, edit the following under the &lt;code&gt;global:&lt;/code&gt; section:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;server-signing-keys&#34;&gt;Server Signing Keys&lt;/h3&gt;
&lt;p&gt;Generate the signing keys used by your homeserver with the following command, ran from the Dendrite repository:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./bin/generate-keys --private-key matrix_key.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also import old keys from Synapse, by specifying their file path in the &lt;code&gt;old_private_keys:&lt;/code&gt; variable in &lt;code&gt;dendrite.yaml&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;database-configuration&#34;&gt;Database Configuration&lt;/h3&gt;
&lt;p&gt;By default, Dendrite will create SQLite databases for all its various components. On most server deployments however, it is beneficial to run Dendrite with a more efficient database backend, like PostgreSQL.&lt;/p&gt;
&lt;p&gt;Begin by installing PostgreSQL:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then start the daemon:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now create a user named &lt;code&gt;dendrite&lt;/code&gt; to manage your database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;createuser --pwprompt dendrite&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And finally, create the actual database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;psql -c &amp;#39;CREATE DATABASE dendrite ENCODING &amp;#39;UTF8&amp;#39; LC_COLLATE=&amp;#39;C&amp;#39; LC_CTYPE=&amp;#39;C&amp;#39; template=template0 OWNER dendrite;&amp;#39;&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we can configure this in &lt;code&gt;dendrite.yaml&lt;/code&gt; using the &lt;code&gt;connection_string:&lt;/code&gt; option under the &lt;code&gt;database:&lt;/code&gt; section:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;database&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;connection_string&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;postgres://dendrite:&lt;mark&gt;password&lt;/mark&gt;@localhost/dendrite?sslmode=disable&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;max_open_conns&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;90&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;max_idle_conns&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;conn_max_lifetime&lt;/span&gt;: -&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; If you find &lt;code&gt;database:&lt;/code&gt; sub-sections under the individual Dendrite modules in &lt;code&gt;dendrite.yaml&lt;/code&gt; (&lt;code&gt;app_service_api&lt;/code&gt;, &lt;code&gt;federation_api&lt;/code&gt;, &lt;code&gt;key_server&lt;/code&gt;, &lt;code&gt;media_api&lt;/code&gt;, &lt;code&gt;mscs&lt;/code&gt;, &lt;code&gt;room_server&lt;/code&gt;, &lt;code&gt;sync_api&lt;/code&gt; and &lt;code&gt;user_api&lt;/code&gt;), make sure to &lt;strong&gt;comment these out&lt;/strong&gt; as these would override the global &lt;code&gt;database&lt;/code&gt; configuration.&lt;/p&gt;
&lt;h3 id=&#34;voice-and-video-calls&#34;&gt;Voice and Video Calls&lt;/h3&gt;
&lt;p&gt;Dendrite supports native voice and video calling by connecting to a compatible TURN and STUN server.&lt;/p&gt;
&lt;p&gt;Begin by setting up the &lt;a href=&#34;https://landchad.net/coturn&#34;&gt;coturn&lt;/a&gt; TURN server using the guide provided, setting either a shared secret or a username-password pair for authentication.&lt;/p&gt;
&lt;p&gt;Then edit the &lt;code&gt;turn:&lt;/code&gt; section in &lt;code&gt;dendrite.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;turn&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;turn_user_lifetime&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;5m&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;turn_uris&lt;/span&gt;:
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;turn:&lt;mark&gt;turn.example.org&lt;/mark&gt;?transport=udp&lt;/span&gt;
      - &lt;span style=&#34;color:#ae81ff&#34;&gt;turn:&lt;mark&gt;turn.example.org&lt;/mark&gt;?transport=tcp&lt;/span&gt;

    &lt;span style=&#34;color:#f92672&#34;&gt;turn_shared_secret&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;your_shared_secret&lt;/mark&gt;&amp;#34;&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# If your TURN server requires static credentials, then you will need to enter&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# them here instead of supplying a shared secret. Note that these credentials&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# will be visible to clients!&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# turn_username: &amp;#34;&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# turn_password: &amp;#34;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;file-directory-and-ownership&#34;&gt;File Directory and Ownership&lt;/h3&gt;
&lt;p&gt;Like &lt;a href=&#34;https://landchad.net/matrix&#34;&gt;Synapse,&lt;/a&gt; it&amp;rsquo;s recommended you place the Dendrite program files in &lt;code&gt;/opt&lt;/code&gt; to keep your server organized:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mv dendrite/ /opt/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s also recommended you create a &lt;code&gt;dendrite&lt;/code&gt; user, who will own the &lt;code&gt;/opt/dendrite&lt;/code&gt; directory, so it can be used to run Dendrite as a service:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd dendrite -d /opt/dendrite
chown -R dendrite:dendrite /opt/dendrite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;setting-up-a-systemd-service&#34;&gt;Setting up a systemd Service&lt;/h3&gt;
&lt;p&gt;Now setup a &lt;strong&gt;systemd service&lt;/strong&gt; in &lt;code&gt;/etc/systemd/system/dendrite.service&lt;/code&gt; to run Dendrite automatically for you. Make sure to set the &lt;code&gt;WorkingDirectory&lt;/code&gt; to the directory where your Dendrite repository is located!&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;Dendrite (Matrix Homeserver)&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;syslog.target&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;postgresql.service ## Remove this if you&amp;#39;re not using PostgreSQL&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Environment&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;GODEBUG=madvdontneed=1&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;RestartSec&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;2s&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;simple&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;User&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;dendrite&lt;/mark&gt;&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Group&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;dendrite&lt;/mark&gt;&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WorkingDirectory&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;/opt/dendrite/&lt;/mark&gt;&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;/opt/dendrite/bin/dendrite&lt;/mark&gt;&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Restart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;LimitNOFILE&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;65535&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Refresh the systemd daemon configuration by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And finally, &lt;strong&gt;run Dendrite&lt;/strong&gt; by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart dendrite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;using-dendrite&#34;&gt;Using Dendrite&lt;/h2&gt;
&lt;h3 id=&#34;creating-users&#34;&gt;Creating Users&lt;/h3&gt;
&lt;p&gt;To create users on the Dendrite server, first ensure it is running. Then, enter a secret value into the &lt;code&gt;registration_shared_secret:&lt;/code&gt; field under the &lt;code&gt;client_api&lt;/code&gt; section:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;registration_shared_secret&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your_secret_string&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, use the &lt;code&gt;./bin/create-account&lt;/code&gt; tool located in its repository:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./bin/create-account -config dendrite.yaml -username &lt;mark&gt;user&lt;/mark&gt; -admin 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will automatically prompt you for a password.&lt;/p&gt;
&lt;p&gt;Congratulations! You&amp;rsquo;ve installed the Matrix Dendrite homeserver. Now you can login with any &lt;a href=&#34;https://matrix.org/clients/&#34;&gt;Matrix client&lt;/a&gt; you wish, and chat securely.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Written by &lt;a href=&#34;https://denshi.org&#34;&gt;Denshi.&lt;/a&gt;
Donate Monero at:
&lt;code&gt;48dnPpGgo8WernVJp5VhvhaX3u9e46NujdYA44u8zuMdETNC5jXiA9S7JoYMM6qRt1ZcKpt1J3RZ3JPuMyXetmbHH7Mnc9C&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>DokuWiki</title>
		<link>https://landchad.net/dokuwiki/</link>
		<pubDate>Mon, 30 Jan 2023 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/dokuwiki/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://www.dokuwiki.org&#34;&gt;DokuWiki&lt;/a&gt; is a simple wiki software, similar to MediaWiki. Unlike MediaWiki, it uses plain text files to store its content, not databases, making it simpler to configure than MediaWiki. It&amp;rsquo;s a good choice if you want a simple wiki engine without all the bells and whistles of MediaWiki and the additional step of setting up databases.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Although DokuWiki is available on the main debian repos, it is outdated and has a different directory structure, which may lead to problems with plugins and make it harder to follow the official documentation, so we&amp;rsquo;re gonna install it from a tarball.&lt;/p&gt;
&lt;p&gt;First, install the dependencies.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install nginx php php-fpm php-xml php-mbstring php-zip php-intl php-gd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, get the tarball.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
tar xzvf dokuwiki-stable.tgz
mv dokuwiki-*a /var/www/dokuwiki
chown -R www-data:www-data /var/www/dokuwiki
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;nginx-configuration&#34;&gt;Nginx Configuration&lt;/h2&gt;
&lt;p&gt;Create a file named &lt;code&gt;/etc/nginx/sites-available/dokuwiki&lt;/code&gt; using your favorite text editor and add the following lines, based on the configuration &lt;a href=&#34;https://www.dokuwiki.org/install:nginx&#34;&gt;here&lt;/a&gt;. &lt;strong&gt;Remember to change &lt;code&gt;wiki.example.org&lt;/code&gt; to your website&amp;rsquo;s name.&lt;/strong&gt; Also, pay attention to the lines containing &lt;code&gt;client_max_body_size&lt;/code&gt;, which determines the maximum file size allowed for uploads, and the first &lt;code&gt;location&lt;/code&gt; line, because it needs to be commented during the installation and uncommented when it&amp;rsquo;s done.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;wiki.example.org&lt;/span&gt;;

    &lt;span style=&#34;color:#75715e&#34;&gt;# Maximum file upload size is 4MB - change accordingly if needed
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;client_max_body_size&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;4M&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;client_body_buffer_size&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;128k&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/dokuwiki&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;doku.php&lt;/span&gt;;

    &lt;span style=&#34;color:#75715e&#34;&gt;#Remember to comment the below out when you&amp;#39;re installing, and uncomment it when done.
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#location ~ /(conf/|bin/|inc/|vendor/|install.php) { deny all; }
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;#Support for X-Accel-Redirect
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;^/data/&lt;/span&gt; { &lt;span style=&#34;color:#f92672&#34;&gt;internal&lt;/span&gt; ; }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;expires&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;365d&lt;/span&gt;;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; { &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ &lt;span style=&#34;color:#e6db74&#34;&gt;@dokuwiki&lt;/span&gt;; }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;@dokuwiki&lt;/span&gt; {
        &lt;span style=&#34;color:#75715e&#34;&gt;# rewrites &amp;#34;doku.php/&amp;#34; out of the URLs if you set the userwrite setting to .htaccess in dokuwiki config page
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;rewrite&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^/_media/(.*)&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/lib/exe/fetch.php?media=&lt;/span&gt;$1 &lt;span style=&#34;color:#e6db74&#34;&gt;last&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;rewrite&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^/_detail/(.*)&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/lib/exe/detail.php?media=&lt;/span&gt;$1 &lt;span style=&#34;color:#e6db74&#34;&gt;last&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;rewrite&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^/_export/([^/]+)/(.*)&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/doku.php?do=export_&lt;/span&gt;$1&amp;amp;id=$2 &lt;span style=&#34;color:#e6db74&#34;&gt;last&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;rewrite&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^/(.*)&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/doku.php?id=&lt;/span&gt;$1&amp;amp;$args &lt;span style=&#34;color:#e6db74&#34;&gt;last&lt;/span&gt;;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.php$&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ &lt;span style=&#34;color:#e6db74&#34;&gt;/doku.php&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;fastcgi_params&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;SCRIPT_FILENAME&lt;/span&gt; $document_root$fastcgi_script_name;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;REDIRECT_STATUS&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/var/run/php/php-fpm.sock&lt;/span&gt;;
        &lt;span style=&#34;color:#75715e&#34;&gt;# fastcgi_pass unix:/var/run/php5-fpm.sock; #old php version
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enable the website.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/dokuwiki /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Generate a SSL certificate for the subdomain.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restart nginx and php in order for the changes to take effect.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart nginx &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl restart php8.2-fpm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, go to &lt;code&gt;wiki.yourwebsite.com/install.php&lt;/code&gt; to finish the installation process. Read up &lt;a href=&#34;https://www.dokuwiki.org/installer&#34;&gt;the documentation&lt;/a&gt; in order to understand what each of those itens mean.&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s done, remember to uncomment the &lt;code&gt;location&lt;/code&gt; line on the nginx configuration file. Open &lt;code&gt;/etc/nginx/sites-available/dokuwiki&lt;/code&gt; with a text editor and remove the &amp;ldquo;#&amp;rdquo; symbol at the beginning of the line.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#Remember to comment the below out when you&amp;#39;re installing, and uncomment it when done.
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;/(conf/|bin/|inc/|vendor/|install.php)&lt;/span&gt; { &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt;; }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reload nginx once again for the changes to take effect.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Your wiki is now live! Have fun and happy hacking.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt; - &lt;a href=&#34;https://github.com/AdachiWasRight&#34;&gt;Adachi&lt;/a&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Harden your E-mail Server</title>
		<link>https://landchad.net/mail/security/</link>
		<pubDate>Mon, 05 Dec 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/mail/security/</guid>
		<description>&lt;h2 id=&#34;hardening-postfix&#34;&gt;Hardening Postfix&lt;/h2&gt;
&lt;p&gt;Put restrictions on servers sending mail to you.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;postconf -e &#39;smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_unknown_recipient_domain&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;anonymize-headers&#34;&gt;Anonymize Headers&lt;/h2&gt;
&lt;p&gt;Use some regular expressions to prevent some meta data like a client&amp;rsquo;s ip address
from being leaked.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &amp;quot;/^Received:.*/     IGNORE
/^X-Originating-IP:/    IGNORE
/^User-Agent:/        IGNORE
/^X-Mailer:/        IGNORE&amp;quot; &amp;gt;&amp;gt; /etc/postfix/header_checks
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add this file to the postfix configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;postconf -e &amp;quot;header_checks = regexp:/etc/postfix/header_checks&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;fail2ban&#34;&gt;Fail2Ban&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;re not familiar with fail2Ban, it&amp;rsquo;s essentially a program which
blocks bot&amp;rsquo;s and hacker&amp;rsquo;s login requests after a few invalid attempts.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt-get install fail2ban
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Make a local copy of the configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Go down to the &lt;code&gt;# Mail servers&lt;/code&gt; line and paste this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[postfix]

enabled  = true
port     = smtp,ssmtp,submission
filter   = postfix
logpath = %(postfix_log)s
backend = systemd


[sasl]

enabled  = true
port     = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter   = postfix[mode=auth]
# You might consider monitoring /var/log/mail.warn instead if you are
# running postfix since it would provide the same log lines at the
# &amp;quot;warn&amp;quot; level but overall at the smaller filesize.
logpath = %(postfix_log)s
backend = systemd
maxretry = 1
bantime  = 21600

[dovecot]

enabled = true
port    = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter  = dovecot
logpath = %(dovecot_log)s
backend = systemd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will only grant 2 login attempts and then block the requester for 6 hours. Now restart &lt;code&gt;fail2ban&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;systemctl restart fail2ban
&lt;/code&gt;&lt;/pre&gt;
</description>
	</item>
	
	<item>
		<title>Setting up an E-mail Inbox</title>
		<link>https://landchad.net/mail/inbox/</link>
		<pubDate>Sun, 04 Dec 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/mail/inbox/</guid>
		<description>&lt;p&gt;In the article on &lt;a href=&#34;https://landchad.net/mail/smtp&#34;&gt;SMTP and Postfix&lt;/a&gt;, we set up a simple
Postfix server that we could use to programatically send mail with the
&lt;code&gt;mail&lt;/code&gt; command. In order to have a true and fully-functional mail
server, users should be able to login to a mail client where they
can read their inbox and send mail remotely. In order to achieve this we need Dovecot,
which can store mails received by the server,
authenticate user accounts and interact with mail.&lt;/p&gt;
&lt;p&gt;If we&amp;rsquo;re setting up an inbox we will also want spam detection software, such
as spam assassin.&lt;/p&gt;
&lt;h2 id=&#34;dovecot-and-spamassassin&#34;&gt;Dovecot and Spamassassin&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;apt install dovecot-imapd dovecot-sieve spamassassin spamc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unblock the imap port:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ufw allow 993
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;certificate&#34;&gt;Certificate&lt;/h2&gt;
&lt;p&gt;We will want a SSL certificate for the &lt;code&gt;mail.&lt;/code&gt; subdomain. We can get
this with &lt;a href=&#34;https://landchad.net/basic/certbot/&#34;&gt;Certbot&lt;/a&gt;. Assuming we are using Nginx for our
server otherwise, run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;certbot --nginx certonly -d mail.example.org
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;dns&#34;&gt;DNS&lt;/h2&gt;
&lt;p&gt;We also need two little DNS records set on your domain registrar&amp;rsquo;s site/DNS server:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An MX record. Just put your domain, &lt;strong&gt;example.org&lt;/strong&gt;, in the &amp;ldquo;Points to&amp;rdquo; field.&lt;/li&gt;
&lt;li&gt;A CNAME record. Host field: &lt;strong&gt;mail.example.org&lt;/strong&gt;. &amp;ldquo;Points to&amp;rdquo; field: &lt;strong&gt;example.org.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configuring-dovecot&#34;&gt;Configuring Dovecot&lt;/h2&gt;
&lt;p&gt;Dovecot&#39;s configuration file is in &lt;code&gt;/etc/dovecot/dovecot.conf&lt;/code&gt;. If you
open that file, you will see this line: &lt;code&gt;!include conf.d/*.conf&lt;/code&gt; which adds
all the &lt;code&gt;.conf&lt;/code&gt; files in &lt;code&gt;/etc/dovecot/conf.d/&lt;/code&gt; to the Dovecot
configuration.&lt;/p&gt;
&lt;p&gt;One can edit each of these files individually to get the needed
configuration, but to make things easy here, delete or backup the main
configuration file and we will replace it with one single config file
with all important settings in it. Make sure you change &lt;code&gt;ssl_cert&lt;/code&gt;
and &lt;code&gt;ssl_key&lt;/code&gt; accordingly.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-wide&#34; data-lang=&#34;wide&#34;&gt;# Note that in the dovecot conf, you can use:
# %u for username
# %n for the name in name@domain.tld
# %d for the domain
# %h the user&#39;s home directory

# Connections between the mail client and Dovecot needs to be encrypted
ssl = required
ssl_cert = &amp;lt;/etc/letsencrypt/live/mail.example.org/fullchain.pem
ssl_key = &amp;lt;/etc/letsencrypt/live/mail.example.org/privkey.pem
ssl_min_protocol = TLSv1.2
ssl_cipher_list = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED
ssl_prefer_server_ciphers = yes
ssl_dh = &amp;lt;/usr/share/dovecot/dh.pem
auth_mechanisms = plain login
auth_username_format = %n

protocols = $protocols imap

# Search for valid users in /etc/passwd
userdb {
    driver = passwd
}
#Fallback: Use plain old PAM to find user passwords
passdb {
    driver = pam
}

# Our mail for each user will be in ~/Mail, and the inbox will be ~/Mail/Inbox
mail_location = maildir:~/Mail:INBOX=~/Mail/Inbox:LAYOUT=fs
namespace inbox {
    inbox = yes
    mailbox Drafts {
    special_use = \Drafts
    auto = subscribe
}
    mailbox Junk {
    special_use = \Junk
    auto = subscribe
    autoexpunge = 30d
}
    mailbox Sent {
    special_use = \Sent
    auto = subscribe
}
    mailbox Trash {
    special_use = \Trash
}
    mailbox Archive {
    special_use = \Archive
}
}

# Here we let Postfix use Dovecot&#39;s authetication system.
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0660
    user = postfix
    group = postfix
}
}

protocol lda {
  mail_plugins = $mail_plugins sieve
}
protocol lmtp {
  mail_plugins = $mail_plugins sieve
}
plugin {
	sieve = ~/.dovecot.sieve
	sieve_default = /var/lib/dovecot/sieve/default.sieve
	sieve_dir = ~/.sieve
	sieve_global_dir = /var/lib/dovecot/sieve/
}
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;settings-explained&#34;&gt;Settings Explained&lt;/h3&gt;
&lt;p&gt;Take a good look at the above settings to understand what&#39;s going on. Some of
the settings include:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;SSL settings to allow encrypted connections.&lt;/li&gt;
&lt;li&gt;The mail server will authenticate users against PAM/passwd, which
means users you create on the server (so long as they are part of
the &lt;code&gt;mail&lt;/code&gt; group) will be able to receive and send mail.&lt;/li&gt;
&lt;li&gt;Default directories for a mail account: Inbox, Sent, Drafts, Junk,
Trash and Archive.&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;unix_listener&lt;/code&gt; that will allow Postfix to authenticate
users via Dovecot.&lt;/li&gt;
&lt;li&gt;Setup the Dovecot sieve plugin, which provides mail filtering facilities
at time of final message delivery. Sieve scripts can be used to
customize how messages are delivered, whether they&amp;rsquo;re forwarded
or stored in special folders.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Next, we can tell sieve to automatically move mail flagged as spam to
the junk folder:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &amp;quot;require [\&amp;quot;fileinto\&amp;quot;, \&amp;quot;mailbox\&amp;quot;];
if header :contains \&amp;quot;X-Spam-Flag\&amp;quot; \&amp;quot;YES\&amp;quot;
        {
                fileinto \&amp;quot;Junk\&amp;quot;;
        }&amp;quot; &amp;gt; /var/lib/dovecot/sieve/default.sieve
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After that, we should create the &lt;code&gt;vmail&lt;/code&gt; user and group, which will
access the mails, and then update the sieve configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;grep -q &#39;^vmail:&#39; /etc/passwd || useradd vmail
chown -R vmail:vmail /var/lib/dovecot
sievec /var/lib/dovecot/sieve/default.sieve
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, enable pam authentication for Dovecot:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &amp;quot;auth    required        pam_unix.so nullok
account required        pam_unix.so&amp;quot; &amp;gt;&amp;gt; /etc/pam.d/dovecot
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;connecting-postfix-and-dovecot&#34;&gt;Connecting Postfix and Dovecot&lt;/h2&gt;
&lt;p&gt;We need to tell Postfix to look to Dovecot for authenticating users/passwords.
Dovecot will be putting an authentication socket in &lt;code&gt;/var/spool/postfix/private/auth&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;postconf -e &#39;smtpd_sasl_auth_enable = yes&#39;
postconf -e &#39;smtpd_sasl_type = dovecot&#39;
postconf -e &#39;smtpd_sasl_path = private/auth&#39;
postconf -e &#39;mailbox_command = /usr/lib/dovecot/deliver&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;connecting-postfix-and-spamassassin&#34;&gt;Connecting Postfix and Spamassassin&lt;/h2&gt;
&lt;p&gt;We will change &lt;code&gt;/etc/postifx/master.cf&lt;/code&gt; so postfix can route mail through spamassassin. First
we can cleanup the default configuration. Feel free to make a backup.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sed -i &#39;/^\s*-o/d;/^\s*submission/d;/^\s*smtp/d&#39; /etc/postfix/master.cf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, run this command to finish the configuration for spamassassin.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &amp;quot;smtp unix - - n - - smtp
smtp inet n - y - - smtpd
  -o content_filter=spamassassin
submission inet n       -       y       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_tls_auth_only=yes
smtps     inet  n       -       y       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
spamassassin unix -     n       n       -       -       pipe
  user=debian-spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f \${sender} \${recipient}&amp;quot; &amp;gt;&amp;gt; /etc/postfix/master.cf
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;make-new-mail-accounts&#34;&gt;Make new mail accounts&lt;/h2&gt;
&lt;p&gt;This is the easy part. Let&amp;rsquo;s say we want to add a user Billy and let him
receive mail, run this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;useradd -m -G mail billy
passwd billy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any user added to the &lt;code&gt;mail&lt;/code&gt; group will be able to receive mail. Suppose a user
Cassie already exists and we want to let her receive mail too. Just run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;usermod -a -G mail cassie
&lt;/code&gt;&lt;/pre&gt;
</description>
	</item>
	
	<item>
		<title>Validate Email with DNS Records</title>
		<link>https://landchad.net/mail/validate/</link>
		<pubDate>Sat, 03 Dec 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/mail/validate/</guid>
		<description>&lt;p&gt;Email is a lot like real-life mail. You can send email to anyone, but
you can also write whatever return address you&#39;d like. That is, it&#39;s
pretty easy to pretend to be someone else via mail, and that was
originally the case with email as well: email is just text, and you
could just change your &lt;code&gt;From:&lt;/code&gt; address to any email address you wanted!
DKIM (Domain Keys Identified Mail) helps solve this issue.&lt;/p&gt;
&lt;p&gt;OpenDKIM will generate a public/private cryptographic key pair for your
server. The public key will be made available publicly in your server&#39;s
DNS records and the private key will be used to sign every single email
that leaves the server. This means that people receiving mail from your
server can now be absolutely sure that it originated from your server
because their servers can check the cryptographic signature on the email
with the public key!&lt;/p&gt;
&lt;p&gt;OpenDKIM ensures that email originated from the server it claims it did,
but it does not ensure that it originated from the user account it
claims it did. This easier problem is solved by server-side
authorization settings.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install opendkim opendkim-tools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;the-keys-and-files&#34;&gt;The Keys and Files&lt;/h2&gt;
&lt;p&gt;We have to generate the DKIM keys and create some secondary files that
will be required for our configuration.&lt;/p&gt;
&lt;h3 id=&#34;generate-the-dkim-key&#34;&gt;Generate the DKIM key&lt;/h3&gt;
&lt;!--
TODO: Make a unique directory for each domain to later allow multiple domain
DKIM validation for servers serving more than one domain name.
--&gt;
&lt;p&gt;Here we create directories for the OpenDKIM keys, generate them, and
ensure they have the right file permissions.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir -p /etc/postfix/dkim
opendkim-genkey -D /etc/postfix/dkim/ -d example.org -s mail
chgrp opendkim /etc/postfix/dkim/*
chmod g+r /etc/postfix/dkim/*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;create-the-key-table&#34;&gt;Create the key table&lt;/h3&gt;
&lt;p&gt;Now we&#39;ll tell OpenDKIM where the newly generated keys are on the file
system.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;mail._domainkey.example.org example.org:mail:/etc/postfix/dkim/mail.private&amp;#34;&lt;/span&gt; &amp;gt; /etc/postfix/dkim/keytable
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;create-the-signing-table&#34;&gt;Create the signing table&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*@example.org mail._domainkey.example.org&amp;#34;&lt;/span&gt; &amp;gt; /etc/postfix/dkim/signingtable
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;adding-trusted-hosts&#34;&gt;Adding trusted hosts&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;127.0.0.1
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;10.1.0.0/16
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;1.2.3.4/24&amp;#34;&lt;/span&gt; &amp;gt; /etc/postfix/dkim/trustedhosts
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuring-opendkimconf&#34;&gt;Configuring opendkim.conf&lt;/h2&gt;
&lt;p&gt;Now we have all the raw material, so open up &lt;code&gt;/etc/opendkim.conf&lt;/code&gt; and we
can finalize our server settings. First, add these lines that will
source the files we just created.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;KeyTable file:/etc/postfix/dkim/keytable&lt;/span&gt;
&lt;span style=&#34;color:#ae81ff&#34;&gt;SigningTable refile:/etc/postfix/dkim/signingtable&lt;/span&gt;
&lt;span style=&#34;color:#ae81ff&#34;&gt;InternalHosts refile:/etc/postfix/dkim/trustedhosts&lt;/span&gt;

&lt;span style=&#34;color:#ae81ff&#34;&gt;Canonicalization        relaxed/simple&lt;/span&gt;
&lt;span style=&#34;color:#ae81ff&#34;&gt;Socket                  inet:12301@localhost&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There will already be an uncommented &lt;code&gt;Socket&lt;/code&gt; directive, so delete,
comment out or replace it with the above.&lt;/p&gt;
&lt;h2 id=&#34;interfacing-with-postfix&#34;&gt;Interfacing with Postfix&lt;/h2&gt;
&lt;p&gt;There are a couple things we must add to the Postfix SMTP server
settings to interface it with OpenDKIM. Specifically, we have to set our
OpenDKIM server, which will be running on port &lt;code&gt;12301&lt;/code&gt;, as a milter
(mail filter). This is easy to do with the four commands below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;myhostname = &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;cat /etc/mailname&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;milter_default_action = accept&amp;#34;&lt;/span&gt;
postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;milter_protocol = 6&amp;#34;&lt;/span&gt;
postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;smtpd_milters = inet:localhost:12301&amp;#34;&lt;/span&gt;
postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;non_smtpd_milters = inet:localhost:12301&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;restart-and-reload-postfix-and-dkim&#34;&gt;Restart and reload Postfix and DKIM&lt;/h2&gt;
&lt;p&gt;Now that we have all our settings in place:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart opendkim
systemctl enable opendkim
systemctl reload postfix
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;adding-the-dns-record&#34;&gt;Adding the DNS record!&lt;/h2&gt;
&lt;p&gt;We are only one step away from having functioning OpenDKIM. We must add the
DKIM public key to our server&#39;s DNS settings, so go ahead and open up your
registrar&#39;s site or wherever your site&#39;s DNS settings are.&lt;/p&gt;
&lt;p&gt;The public key is found in the file &lt;code&gt;/etc/postfix/dkim/mail.txt&lt;/code&gt;, but it
will display as multiple lines and multiple quoted strings, which is
annoying and hard to copy-and-paste into your registrar. To make things
easier, run the following command to format the key in the way we need
it for the DNS TXT entry:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;v=DKIM1; k=rsa; &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;tr -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &amp;lt;/etc/postfix/dkim/mail.txt | sed &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;s/k=rsa.* \&amp;#34;p=/k=rsa; p=/;s/\&amp;#34;\s*\&amp;#34;//;s/\&amp;#34;\s*).*//&amp;#34;&lt;/span&gt; | grep -o &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;p=.*&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Take the very long output of that command, which will start with
&lt;code&gt;v=DKIM1&lt;/code&gt; and add it as a TXT entry in your DNS settings as below. The
host we put it for is &lt;code&gt;mail._domainkey&lt;/code&gt;.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dkim-01.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dkim-01.png&#34; alt=&#34;Adding the OpenDKIM TXT entry in DNS settings&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;On my registrar, this is how it is input, but on some registrars, it may be
required to include your domain name as well as &lt;code&gt;mail._domainkey.example.org&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you have your own DNS server, add a TXT entry as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;mail._domainkey.example.org TXT v=DKIM1; k=rsa; p=ThatLongRandomSequenceOfLettersAndNumbersOfYours
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;testing-it-out&#34;&gt;Testing it out!&lt;/h2&gt;
&lt;p&gt;Now we want to send an email to make sure that your emails will now be
signed with OpenDKIM.&lt;/p&gt;
&lt;h3 id=&#34;hostname&#34;&gt;Hostname&lt;/h3&gt;
&lt;p&gt;If you&#39;ve followed these instructions, all emails from the domain
&lt;strong&gt;example.org&lt;/strong&gt; will now have a DKIM signature on them. If we send mail
via the &lt;code&gt;mail&lt;/code&gt; command, however, their domain of origin will be whatever
your server&#39;s hostname is, which you may have set to something
different than your domain.&lt;/p&gt;
&lt;p&gt;You can permanently change your hostname by changing it in
&lt;code&gt;/etc/hostname&lt;/code&gt; and rebooting, or you can just run
&lt;code&gt;hostname example.org&lt;/code&gt; to change it temporarily for testing. Either way,
this will allow us to run the &lt;code&gt;mail&lt;/code&gt; command as in &lt;a href=&#34;../smtp&#34;&gt;the SMTP
article&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Hi there.
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;This is the text.&amp;#34;&lt;/span&gt; | mail -s &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Email from the server&amp;#34;&lt;/span&gt; your@emailaddress.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;more-helpful-troubleshooting&#34;&gt;More helpful troubleshooting.&lt;/h3&gt;
&lt;p&gt;You can also go to &lt;a href=&#34;https://appmaildev.com/en/dkim&#34;&gt;this site&lt;/a&gt;, which
will help you troubleshoot any other DKIM problems if you mistyped
something.&lt;/p&gt;
&lt;h2 id=&#34;dmarc&#34;&gt;DMARC&lt;/h2&gt;
&lt;p&gt;DMARC (Domain-based Message Authentication Protocol) is a protocol designed
to give email domain owners the ability to protect their domain from
unauthorized use.&lt;/p&gt;
&lt;p&gt;Add the dmarc user:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;useradd -m -G mail dmarc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Open up your registrar or DNS settings again, and make a new TXT record like
we did with DKIM, except now use the output from the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &amp;quot;_dmarc.$(cat /etc/mailname)&amp;quot;
echo &amp;quot;v=DMARC1; p=reject; rua=mailto:dmarc@$(cat /etc/mailname); fo=1&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first line is the Host field. The latter is the TXT value.&lt;/p&gt;
&lt;h3 id=&#34;sender-policy-framework&#34;&gt;Sender Policy Framework&lt;/h3&gt;
&lt;p&gt;Saving the easiest for last, we should add a TXT record for SPF,
an email-authentication standard used to prevent spammers from sending messages
that appear to come from a spoofed domain.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cat /etc/mailname
IP4=&amp;lt;your VPS&#39;s IPv4 address&amp;gt;
IP6=&amp;lt;your VPS&#39;s IPv6 address&amp;gt;
echo &amp;quot;v=spf1 mx a:mail.$(cat /etc/mailname) ip4:$IP4 ip6:$IP6 -all&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: previous versions of this guide didn&amp;rsquo;t ask you to specify the &lt;code&gt;ip4&lt;/code&gt;
and &lt;code&gt;ip6&lt;/code&gt; mechanisms. If you don&amp;rsquo;t include them, some email hosts (most
notoriously gmail) will not accept mail from your server.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;IP4&lt;/code&gt; and &lt;code&gt;IP6&lt;/code&gt; values should be the same as what you set your &lt;a href=&#34;../rdns&#34;&gt;PTR
records&lt;/a&gt; to.&lt;/p&gt;
&lt;p&gt;The output of &lt;code&gt;cat /etc/mailname&lt;/code&gt; is the Host field. The output of the second command is the TXT value.&lt;/p&gt;
&lt;p&gt;Again, you can check &lt;a href=&#34;https://appmaildev.com/en/spf&#34;&gt;that site&lt;/a&gt;
to make sure your DKIM, DMARC, and SPF entries are valid. That&amp;rsquo;s it!&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;SPF mechanisms updated by Martin Chrzanowski -- &lt;a href=&#34;https://m-chrzan.xyz&#34;&gt;website&lt;/a&gt;, &lt;a href=&#34;https://m-chrzan.xyz/donate.html&#34;&gt;donate&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Setup rDNS</title>
		<link>https://landchad.net/mail/rdns/</link>
		<pubDate>Fri, 02 Dec 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/mail/rdns/</guid>
		<description>&lt;p&gt;While &lt;a href=&#34;https://landchad.net/basic/dns&#34;&gt;DNS records&lt;/a&gt; refer a domain name to the IP address
where the the website is hosted, there is also rDNS (reverse DNS) and
specifically PTR (pointer) records which do the reverse: link a
server&#39;s IP to a domain name.&lt;/p&gt;
&lt;p&gt;This is important for many things, but especially email. Many email
servers require that other servers that send them mail have PTR records
to prevent spam.&lt;/p&gt;
&lt;h2 id=&#34;setting-your-ptr-record&#34;&gt;Setting your PTR Record&lt;/h2&gt;
&lt;p&gt;DNS settings are set with your registrar, while rDNS settings are set
with your server or VPS provider. &lt;strong&gt;Remember to set records for both
IPv4 and IPv6!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In &lt;a href=&#34;https://www.vultr.com/?ref=8384069-6G&#34;&gt;Vultr&lt;/a&gt; we want to set the
IPv4 record, click on the server, then &amp;quot;Settings,&amp;quot; and make sure the
&amp;quot;IPv4&amp;quot; tab is selected. We can then edit the &amp;quot;Reverse DNS&amp;quot; blank
shown below.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/rdns-01.png&#34; alt=&#34;IPv4 rDNS PTR record set in Vultr&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;The setting for IPv6 is obviosuly under the IPv6 tab. Note here that we
copy the full IPv6 address from above and create a new rDNS entry by
pasting that and the domain name in the blanks below. Then just select
&amp;quot;Add.&amp;quot;&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/rdns-02.png&#34; alt=&#34;IPv6 rDNS PTR record set in Vultr&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;That&#39;s it!&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Sending and Receiving Email</title>
		<link>https://landchad.net/mail/smtp/</link>
		<pubDate>Thu, 01 Dec 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/mail/smtp/</guid>
		<description>&lt;p&gt;The first step to setting up an email server is having an SMTP server.
SMTP sends and receives email. Whether we want a full email server or
just the ability to send automated email by script, we will need SMTP,
and Postfix is the standard SMTP server.&lt;/p&gt;
&lt;p&gt;Here let&#39;s set a server up. Note that our goal is to be able to send
emails from our server. If you want a full email server, this is the
first step, and we will address the rest later.&lt;/p&gt;
&lt;h2 id=&#34;before-beginning&#34;&gt;Before beginning!&lt;/h2&gt;
&lt;p&gt;Whatever VPS (&lt;a href=&#34;https://www.vultr.com/?ref=8384069-6G&#34;&gt;Vultr&lt;/a&gt; or
&lt;a href=&#34;https://my.frantech.ca/aff.php?aff=3886&#34;&gt;Frantech&lt;/a&gt;) or IPS you are
using, it is a very common policy to &lt;strong&gt;automatically block all email
ports by default&lt;/strong&gt;. VPS providers do this to prevent spammers from using
their services.&lt;/p&gt;
&lt;p&gt;If you want to start an email server, therefore, go to your VPS&#39;s site
and open a ticket or make a request to open up email ports, notably port &lt;code&gt;25&lt;/code&gt;. This is a
simple process that requires nothing too special. One of the wagies at
your VPS will kindly do the needful and open your ports for you. Note
that this is not the same as unblocking a port with &lt;a href=&#34;https://landchad.net/../ufw&#34;&gt;ufw&lt;/a&gt;,
which still needs to be done for SMTP to work.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ufw allow 25,587 proto tcp
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;First, we install Postfix and also &lt;code&gt;mailutils&lt;/code&gt;, which comes with some
mail programs we will use.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt install -y mailutils postfix
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Installing Postfix for the first time will give us some graphical
options.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/smtp-01.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/smtp-01.png&#34; alt=&#34;SMTP Postfix internet site choice&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;When asked for a &amp;quot;mail name&amp;quot;, give your full domain name from which
you would like mail to come and go, e.g. &lt;strong&gt;example.org&lt;/strong&gt; or
&lt;strong&gt;landchad.net&lt;/strong&gt;&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/smtp-02.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/smtp-02.png&#34; alt=&#34;SMTP Postfix fully qualified domain name&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;h2 id=&#34;test-the-email&#34;&gt;Test the email&lt;/h2&gt;
&lt;p&gt;That is actually all you need to have set up to have a barebones,
send-only email server. We can test our server by running a &lt;code&gt;mail&lt;/code&gt;
command like that below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;echo &amp;quot;Hi there.

This is the text.&amp;quot; | mail -s &amp;quot;Email from the server&amp;quot; your@emailaddress.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This type of command is sufficient enough for your server to send mail.
Note that we use the &lt;code&gt;-s&lt;/code&gt; option to specify the email&#39;s subject while
we pipe the email content into the &lt;code&gt;mail&lt;/code&gt; command via standard input. In
this example I use a quoted multiline email as an example.&lt;/p&gt;
&lt;h2 id=&#34;do-you-see-your-message&#34;&gt;Do you see your message?&lt;/h2&gt;
&lt;p&gt;If you sent the above test message to an account on Gmail or another
major email provider, there is &lt;strong&gt;very high&lt;/strong&gt; chance of the message you
sent above being marked as spam or not appearing at all!&lt;/p&gt;
&lt;p&gt;Don&#39;t worry, we&#39;ll take care of that in the next two articles where we
set up rDNS with your VPS provider and various other DNS
records to validate the emails you send.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Dnsmasq</title>
		<link>https://landchad.net/dnsmasq/</link>
		<pubDate>Tue, 13 Sep 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/dnsmasq/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://dnsmasq.org&#34;&gt;Dnsmasq&lt;/a&gt; is a libre DNS and DHCP system that allows anyone to run a DNS server to resolve domains.
Normally to block domains and ads, users on most operating systems can edit their &lt;strong&gt;&lt;code&gt;/etc/hosts&lt;/code&gt; file&lt;/strong&gt; or use one of the many existing ad-blocking hosts collections available online.
However, if you&amp;rsquo;re trying to block ads &lt;strong&gt;over your entire home network&lt;/strong&gt; and do not have access to your router&amp;rsquo;s hosts file,
then setting up your own DNS server can be very advantageous.&lt;/p&gt;
&lt;p&gt;This also comes with the benefit of increased flexibility regarding name resolution;
for example, with Dnsmasq, you can employ the usage of &lt;strong&gt;wildcard domains&lt;/strong&gt; to block massive ranges of ads, trackers and entire social media networks.&lt;/p&gt;
&lt;h2 id=&#34;before-we-begin&#34;&gt;Before we begin&amp;hellip;&lt;/h2&gt;
&lt;p&gt;while Dnsmasq is very versatile software that can be used for a variety of networking and DNS applications,
this guide assumes you only want to setup Dnsmasq to &lt;strong&gt;block domains from resolving&lt;/strong&gt; (ie. ads and social media sites).
It is possible to get &lt;strong&gt;custom domain resolution&lt;/strong&gt; and &lt;strong&gt;internal network services&lt;/strong&gt; running using Dnsmasq,
but this is beyond the scope of this article.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Dnsmasq is available in the Debian repositories:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt install dnsmasq
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;h3 id=&#34;basic-configuration&#34;&gt;Basic configuration&lt;/h3&gt;
&lt;p&gt;By default, Dnsmasq will start a DNS server listening on &lt;code&gt;localhost:53&lt;/code&gt;.
You can even test this if you have the &lt;code&gt;bind9&lt;/code&gt; package installed:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;dig @localhost example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command should return the A DNS records for &lt;code&gt;example.org&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can configure Dnsmasq to listen on the public internet by editing its config file, &lt;code&gt;/etc/dnsmasq.conf&lt;/code&gt;.
In this file, you&amp;rsquo;ll find this line, commented out:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#interface=&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We need to specify the &lt;strong&gt;interface we wish to listen on&lt;/strong&gt; to provide the DNS service.
In most cases (such as when using a Debian VPS) this will simply be &lt;code&gt;eth0&lt;/code&gt;.
However, please run &lt;code&gt;ip a&lt;/code&gt; to determine which interface is correct for your system, if you&amp;rsquo;re unsure.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;interface&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;eth0&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s also &lt;strong&gt;highly recommended&lt;/strong&gt; to uncomment this following line,
just to prevent Dnsmasq from forwarding requests to local names.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;domain-needed
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now all we have to do is restart Dnsmasq&amp;rsquo;s systemd service:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart dnsmasq
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And, on our &lt;strong&gt;local machine,&lt;/strong&gt; we can try using the &lt;code&gt;bind9&lt;/code&gt; utilities to test our DNS server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;dig @&lt;mark&gt;your_servers_public_ip&lt;/mark&gt; example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This should return the correct A DNS records for &lt;code&gt;example.org&lt;/code&gt;, like when testing using &lt;code&gt;localhost&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;changing-authoritative-dns-providers&#34;&gt;Changing Authoritative DNS Providers&lt;/h3&gt;
&lt;p&gt;By default, Dnsmasq will use the DNS servers provided in &lt;code&gt;/etc/resolv.conf&lt;/code&gt;.
You can change this file directly, altering DNS resolution for your entire system:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Quad9 DNS Server&lt;/span&gt;
nameserver  &lt;mark&gt;9.9.9.9&lt;/mark&gt;
nameserver  &lt;mark&gt;149.112.112.112&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;blocking-dns-requests&#34;&gt;Blocking DNS Requests&lt;/h2&gt;
&lt;h3 id=&#34;using-a-hostsfile&#34;&gt;Using a Hostsfile&lt;/h3&gt;
&lt;p&gt;As mentioned previously, one of Dnsmasq&amp;rsquo;s advantages is that it can read &lt;code&gt;/etc/hosts&lt;/code&gt; and other host resolution files.
This makes it 100% compatible with existing ad-blocking hosts files.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;0.0.0.0     www.youtube.com
0.0.0.0     www.reddit.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This hosts file blocks &lt;code&gt;www.youtube.com&lt;/code&gt; and &lt;code&gt;www.reddit.com&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To read another hosts file, in addition to &lt;code&gt;/etc/hosts&lt;/code&gt;, you can use the following in &lt;code&gt;/etc/dnsmasq&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;addn-hosts&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/etc/hosts.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The only complication is that &lt;strong&gt;every time you update the hosts file, Dnsmasq must be restarted:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart dnsmasq
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;using-dnsmasqs-configuration&#34;&gt;Using Dnsmasq&amp;rsquo;s Configuration&lt;/h3&gt;
&lt;p&gt;For more advanced forms of DNS blocking, such as &lt;strong&gt;domain wildcards,&lt;/strong&gt; you can edit &lt;code&gt;/etc/dnsmasq.conf&lt;/code&gt; directly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;address&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/&lt;mark&gt;netflix.com&lt;/mark&gt;/0.0.0.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This configuration will block all requests to &lt;code&gt;netflix.com&lt;/code&gt; and its subdomains. This way you &lt;strong&gt;don&amp;rsquo;t need a massive hosts file&lt;/strong&gt; containing every single possible subdomain. All you need to know is the root domain.&lt;/p&gt;
&lt;p&gt;And as usual, remember to restart the Dnsmasq systemd service every time the configuration is altered.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;systemctl restart dnsmasq
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;using-dnsmasq&#34;&gt;Using Dnsmasq&lt;/h2&gt;
&lt;p&gt;If you intend to use your new DNS server on your home network,
this is as easy as setting your primary DNS resolver in your router&amp;rsquo;s settings to your &lt;strong&gt;DNS server&amp;rsquo;s public IP address.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For example, on a local Linux machine, you could edit &lt;code&gt;/etc/resolv.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nameserver  &lt;mark&gt;your_servers_public_ip&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Generally this should be an intuitive process on most router interfaces,
and most OS&#39; will let you edit the DNS in their respective network settings.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Written by &lt;a href=&#34;https://denshi.org&#34;&gt;Denshi.&lt;/a&gt;
Donate Monero at:
&lt;code&gt;48dnPpGgo8WernVJp5VhvhaX3u9e46NujdYA44u8zuMdETNC5jXiA9S7JoYMM6qRt1ZcKpt1J3RZ3JPuMyXetmbHH7Mnc9C&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Wireguard</title>
		<link>https://landchad.net/wireguard/</link>
		<pubDate>Tue, 26 Jul 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/wireguard/</guid>
		<description>&lt;p&gt;Looking for lightweight privacy on the go? Then consider hosting a WireGuard VPN service.
In addition to this setup guide, we&amp;rsquo;ll also demonstrate how to tunnel
your WireGuard traffic through a TLS WebSocket connection to circumvent some
deep packet inspection systems.&lt;/p&gt;
&lt;p&gt;As an example, we&amp;rsquo;ll be using a virtual 172.16.0.0/24 network, but any private ip range will suffice.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;h3 id=&#34;on-the-server&#34;&gt;On the Server&lt;/h3&gt;
&lt;p&gt;Install the WireGuard management tools:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt install wireguard
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Enable IPv4 forwarding by uncommenting the following line in &lt;code&gt;/etc/sysctl.d/99-sysctl.conf&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;net.ipv4.ip_forward=1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Run the following command to apply the change:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sysctl -w net.ipv4.ip_forward=1
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;on-the-client&#34;&gt;On the Client&lt;/h3&gt;
&lt;p&gt;Use your package manager to install the WireGuard Management Tools.
On Arch and Fedora based distros the package is &lt;code&gt;wireguard-tools&lt;/code&gt;. For Debian based, it&amp;rsquo;s listed above.&lt;/p&gt;
&lt;p&gt;Create the public and private keys for your machine:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo bash -c &amp;quot;umask 077 ; wg genkey &amp;gt; /etc/wireguard/client_priv.key&amp;quot;
sudo bash -c &amp;quot;wg pubkey &amp;lt; /etc/wireguard/client_priv.key &amp;gt; /etc/wireguard/client_pub.key&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;back-to-the-server&#34;&gt;Back to the Server&lt;/h3&gt;
&lt;p&gt;Generate the public and private keys for your server:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;umask 077 ; wg genkey &amp;gt; /etc/wireguard/server_priv.key
wg pubkey &amp;lt; /etc/wireguard/server_priv.key &amp;gt; /etc/wireguard/server_pub.key
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create a WireGuard configuration file &lt;code&gt;/etc/wireguard/wg0.conf&lt;/code&gt;, where &lt;code&gt;wg0&lt;/code&gt; is the name of the network interface:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[Interface]
Address = 172.16.0.1/24
ListenPort = 51820
PrivateKey = (server&#39;s private key goes here)
# Firewall rules
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
# Client #1 details
PublicKey = (client&#39;s public key goes here)
# Traffic to route to this client
AllowedIPs = 172.16.0.2/32
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Paste the server&amp;rsquo;s private key and client&amp;rsquo;s public key on their respective
lines, each being around 45 characters with an equal sign at the end.&lt;/p&gt;
&lt;h4 id=&#34;note-on-extra-peers&#34;&gt;Note on extra peers&lt;/h4&gt;
&lt;p&gt;In our example, the subnet could recognize up to 254 other peers. Add the new
peer&amp;rsquo;s info below the first peer and update the &lt;code&gt;AllowedIPS&lt;/code&gt; line to the next virtual
ip. Don&amp;rsquo;t change the &lt;code&gt;32&lt;/code&gt;: this ensures everyone&amp;rsquo;s tunnel is isolated.
Use this optionally for extra devices or for friends.&lt;/p&gt;
&lt;p&gt;Enable and start the WireGuard service:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;systemctl enable --now wg-quick@wg0.service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Change &lt;code&gt;wg0&lt;/code&gt; to match the name of the config file if you called it something different.&lt;/p&gt;
&lt;h3 id=&#34;back-to-the-client&#34;&gt;Back to the Client&lt;/h3&gt;
&lt;p&gt;Create another WireGuard configuration file in &lt;code&gt;/etc/wireguard/myvpn.conf&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[Interface]
Address = 172.16.0.2/24
PrivateKey = (client&#39;s private key goes here)
# Set to your desired DNS server
# DNS = 9.9.9.9

[Peer]
PublicKey = (server&#39;s public key goes here)
# Endpoint (server) can be a domain name or IP address
Endpoint = (server&#39;s IP address goes here):51820
# Traffic to route to server
AllowedIPs = 0.0.0.0/0, ::/0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fill in your information where needed. Remember to use your server&amp;rsquo;s public ip address, not the wireguard one.&lt;/p&gt;
&lt;p&gt;Start WireGuard:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo wg-quick up myvpn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you cannot ping &lt;code&gt;172.16.0.1&lt;/code&gt; or reach the Internet, and have meticulously followed this guide so far,
there&amp;rsquo;s a good chance you&amp;rsquo;re behind a corporate firewall. Read on.&lt;/p&gt;
&lt;h2 id=&#34;websocket-tunnel&#34;&gt;WebSocket Tunnel&lt;/h2&gt;
&lt;h4 id=&#34;note-on-tls&#34;&gt;Note on TLS&lt;/h4&gt;
&lt;p&gt;If your server hosts a website with https, you won&amp;rsquo;t be able to use port 443 to
obfuscate your WireGuard packets as TLS traffic. You may use some other innocuous
port, but there&amp;rsquo;s no guarantee you&amp;rsquo;ll punch through the picky firewall.&lt;/p&gt;
&lt;h3 id=&#34;on-the-server-1&#34;&gt;On the Server&lt;/h3&gt;
&lt;p&gt;Download and install wstunnel:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wget https://github.com/erebe/wstunnel/releases/download/v4.0/wstunnel-x64-linux
mv wstunnel-x64-linux /usr/local/bin/wstunnel
chmod uo+x /usr/local/bin/wstunnel
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/wstunnel
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Make a new systemd service config file, &lt;code&gt;/etc/systemd/system/wstunnel.service&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[Unit]
Description=Tunnel WireGuard UDP over websocket
After=network.target

[Service]
Type=simple
User=nobody
ExecStart=/usr/local/bin/wstunnel -v --server wss://0.0.0.0:443 --restrictTo=127.0.0.1:51820
Restart=no

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Enable and start wstunnel:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;systemctl enable --now wstunnel
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;on-the-client-1&#34;&gt;On the Client&lt;/h3&gt;
&lt;p&gt;Download and install wstunnel and a helper script:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wget https://github.com/erebe/wstunnel/releases/download/v4.0/wstunnel-x64-linux
sudo mv wstunnel-x64-linux /usr/local/bin/wstunnel
sudo chmod +x /usr/local/bin/wstunnel
wget https://raw.githubusercontent.com/jnsgruk/wireguard-over-wss/master/wstunnel.sh
sudo mv wstunnel.sh /etc/wireguard/wstunnel.sh
sudo chmod +x /etc/wireguard/wstunnel.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create the wstunnel configuration file, &lt;code&gt;/etc/wireguard/myvpn.wstunnel&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;REMOTE_HOST=(server&#39;s IP address goes here)
REMOTE_PORT=51820
# Use the following line if you&#39;re connecting to your VPN server using a domain name.
# UPDATE_HOSTS=&#39;/etc/hosts&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Edit &lt;code&gt;/etc/wireguard/myvpn.conf&lt;/code&gt;. Change the &lt;code&gt;Endpoint&lt;/code&gt; line to &lt;code&gt;127.0.0.1:51820&lt;/code&gt; and add these four lines to the &lt;code&gt;[Interface]&lt;/code&gt; section:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Table = off
PreUp = source /etc/wireguard/wstunnel.sh &amp;amp;&amp;amp; pre_up %i
PostUp = source /etc/wireguard/wstunnel.sh &amp;amp;&amp;amp; post_up %i
PostDown = source /etc/wireguard/wstunnel.sh &amp;amp;&amp;amp; post_down %i
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Start WireGuard again:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo wg-quick up myvpn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To disconnect, type &lt;code&gt;down&lt;/code&gt; instead of &lt;code&gt;up&lt;/code&gt;. And just like that, you now host a WireGuard VPN server!&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Networking Basics</title>
		<link>https://landchad.net/networking/</link>
		<pubDate>Fri, 01 Jul 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/networking/</guid>
		<description>&lt;h2 id=&#34;a-quick-detour-to-binary&#34;&gt;A quick detour to binary&lt;/h2&gt;
&lt;p&gt;You probably know that everything computers do, they do in binary
(zeroes and ones) under the hood. But how does that actually work?&lt;/p&gt;
&lt;p&gt;Binary is just another numbering system like decimal (there are many
others!), so while with decimal each digit can have 10 different values
(0-9, hence &lt;strong&gt;deci&lt;/strong&gt;mal), numbers represented in binary have 2 possible
values (0-1, hence &lt;strong&gt;bi&lt;/strong&gt;nary). In binary a digit is called a bit.&lt;/p&gt;
&lt;p&gt;What is the highest number you can represent with one digit in decimal?
Easy: 9. So how many different values are there? 10 (0-9).&lt;/p&gt;
&lt;p&gt;What about 2 digits? 99 and 100, respectively. 3 digits? 999 and 1000.
I&#39;m sure I don&#39;t need to bore you by continueing.&lt;/p&gt;
&lt;h3 id=&#34;the-maths-behind-it&#34;&gt;The maths behind it&lt;/h3&gt;
&lt;p&gt;Can we define a formula for the amount of possible values a decimal
number with &lt;code&gt;n&lt;/code&gt; digits can have?&lt;/p&gt;
&lt;p&gt;It&#39;s pretty easy: &lt;code&gt;10&lt;sup&gt;n&lt;/sup&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now the 10 there in a numbering system where each digit can have 10
different values can&#39;t be a coincidence!&lt;/p&gt;
&lt;p&gt;So we can generalize: In a numbering system where each digit can have
&lt;code&gt;x&lt;/code&gt; different values, the amount of possible values for a number with
&lt;code&gt;n&lt;/code&gt; digits is &lt;code&gt;x&lt;sup&gt;n&lt;/sup&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So how many different values can we represent with 8 Bits (1 Byte)?
&lt;code&gt;2&lt;sup&gt;8&lt;/sup&gt; = 256&lt;/code&gt; (0-255).&lt;/p&gt;
&lt;p&gt;The IPv4 addresses you know are 32 bits long. So how many computers
could we theoretically assign unique IPs to on the internet?
&lt;code&gt;2&lt;sup&gt;32&lt;/sup&gt; = 4,294,967,296&lt;/code&gt;. That&#39;s 4 Billion! However there are far more
computers than that on the internet now, which is why people had to come
up with hacks (which we&#39;ll talk about later) so that we can today still
predominantly use pretty IPv4, as opposed to that ugly new IPv6 (eww).&lt;/p&gt;
&lt;p&gt;We&#39;ll say &amp;quot;IP address&amp;quot; instead of &amp;quot;IPv4 address&amp;quot; from here on.&lt;/p&gt;
&lt;p&gt;By the way, this principle goes a long way in computing! Say, for
example, I know your password is 7 letters long and contains only
lowercase english letters (a-z). How many times would I have to guess at
maximum to crack your password? &lt;code&gt;25&lt;sup&gt;7&lt;/sup&gt; = 6,103,515,625&lt;/code&gt; times.&lt;/p&gt;
&lt;h3 id=&#34;converting-from-binary-to-decimal&#34;&gt;Converting from binary to decimal&lt;/h3&gt;
&lt;p&gt;You can use the same principle to convert from one numbering system to
another. Each digit gains &amp;quot;significance&amp;quot;, starting at zero going from
right to left. This is easiest understood through an example from
decimal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;943 = 9*10&lt;sup&gt;2&lt;/sup&gt; + 4*10&lt;sup&gt;1&lt;/sup&gt; + 3*10&lt;sup&gt;0&lt;/sup&gt; = 900 + 40 + 3 = 943&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The same holds true for binary:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;11001101 = 2&lt;sup&gt;7&lt;/sup&gt; + 2&lt;sup&gt;6&lt;/sup&gt; + 2&lt;sup&gt;3&lt;/sup&gt; + 2&lt;sup&gt;2&lt;/sup&gt; + 2&lt;sup&gt;0&lt;/sup&gt; = 128 + 64 + 8 + 4 + 1 = 205&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;the-binary-behind-ip-addresses&#34;&gt;The binary behind IP addresses&lt;/h3&gt;
&lt;p&gt;As mentioned, IP addresses are made up of 32 bit, or 4 byte. IP
addresses are usually represented in &amp;quot;dotted-decimal&amp;quot; notation, where
we write the decimal value of the first byte (left-to-right), a dot,
then the decimal value of the second byte, etc.&lt;/p&gt;
&lt;p&gt;So, in theory, the lowest possible IP address is &lt;code&gt;0.0.0.0&lt;/code&gt; (all bits are
0) and the highest possible IP address is &lt;code&gt;255.255.255.255&lt;/code&gt; (all bits
are 1).&lt;/p&gt;
&lt;h2 id=&#34;subnetting&#34;&gt;Subnetting&lt;/h2&gt;
&lt;p&gt;Open up a terminal and run&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see many names, such as &lt;code&gt;wlan*&lt;/code&gt; or &lt;code&gt;wlp*&lt;/code&gt; for wireless
interfaces or something like &lt;code&gt;eth*&lt;/code&gt; or &lt;code&gt;enp*&lt;/code&gt; for ethernet interfaces.
I&#39;ve used a new word here: &amp;quot;interfaces&amp;quot;, we&#39;ll talk more about what
those are later.&lt;/p&gt;
&lt;p&gt;Here&#39;s my WiFi interface:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-wlan0.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-wlan0.png&#34; alt=&#34;wifi interface&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;We can see an IP address, &lt;code&gt;192.168.1.221&lt;/code&gt;, and another one which we&#39;ll
ignore for now. Did I just leak my IP address? No, it is only my local
IP, it could even be that yours is the same as mine!&lt;/p&gt;
&lt;p&gt;There are two reasons for this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;There is a &lt;a href=&#34;https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv4&#34;&gt;list of IP address
ranges&lt;/a&gt;
reserved for you to use however you want, here in local networking.
You will not find a server on the internet that has an IP in one of
those ranges.&lt;/li&gt;
&lt;li&gt;The hack to get around the limitations of IPv4 I mentioned earlier
is &lt;a href=&#34;https://en.wikipedia.org/wiki/Network_address_translation&#34;&gt;NAT (Network Address
Translation)&lt;/a&gt;.
Your router gives every device in your local network one of those
reserved IPs and manages one public IP towards the internet for all
of them. So instead of every device needing one of those 4 Billions
IPs, only every house needs one. And some ISPs take this a level
further and again put multiple houses under one NAT, so multiple
houses can share one IP towards the internet (Carrier-Grade NAT).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you followed the link for reserved IP address ranges or looked closer
at my screenshot, you will see IP addresses followed by a slash and then
some number, here &lt;code&gt;/24&lt;/code&gt;. This is how we denote IP ranges in networking,
the so-called CIDR-Notation. The first ip address in the range is the
&lt;strong&gt;Network ID&lt;/strong&gt; and the number after the slash is the &lt;strong&gt;subnet mask&lt;/strong&gt;. It
might look strange at first, but makes a lot of sense: The subnet mask
is the amount of bits &lt;strong&gt;fixed&lt;/strong&gt;. So here in my case the first 24 bits (3
bytes) are fixed and my local network&#39;s IP range, also called
&lt;strong&gt;subnet&lt;/strong&gt;, goes from &lt;code&gt;192.168.1.0&lt;/code&gt; to &lt;code&gt;192.168.1.255&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here are two popular reserved subnets and their IP ranges:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;192.168.0.0/16: 192.168.0.0 – 192.168.255.255
10.0.0.0/8:     10.0.0.0    – 10.255.255.255
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here&#39;s another popular one, but note that the subnet mask isn&#39;t
divisible by 8, so it is a bit less easy to deal with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;172.16.0.0/12: 172.16.0.0 – 172.31.255.255
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The way this works is the first byte is fully fixed, and then the first
4 bits of the second byte are fixed too, the rest is usable by us. So in
the second byte the last &lt;code&gt;8-4 = 4&lt;/code&gt; bits are free. &lt;code&gt;2&lt;sup&gt;4&lt;/sup&gt; = 16&lt;/code&gt;, giving us
the actual highest number 15. We add this to the &amp;quot;starting point&amp;quot;, the
current value of the second byte, and arrive at &lt;code&gt;16+15 = 31&lt;/code&gt;!&lt;/p&gt;
&lt;p&gt;Don&#39;t worry if that last part about uneven subnet-masks was confusing
to you, you won&#39;t have to deal with them as a regular user.
Additionally there are websites where you can enter subnets and they do
the maths for you.&lt;/p&gt;
&lt;h2 id=&#34;interfaces&#34;&gt;Interfaces&lt;/h2&gt;
&lt;p&gt;I&#39;ve mentioned interfaces a few times now without really explaining
what they are. Generally you can think of interfaces as physical
networking devices. If you have a WiFi-Card in your computer, it will
get an interface. If you have an ethernet card, it will get another one.
If you now plug in something like a USB WiFi dongle, it will get another
interface.&lt;/p&gt;
&lt;p&gt;There are also virtual interfaces. For example if you run a virtual
machine with something like virt-manager, use containers with docker or
connect to a VPN through OpenVPN or WireGuard, all those get virtual
interfaces.&lt;/p&gt;
&lt;p&gt;We can assign IP addresses to interfaces and Linux then knows that when
it receives a packet who&#39;s recipient is that IP, it is meant for us.
Then later with routing we can tell Linux to send packets destined to,
say, &lt;code&gt;192.168.3.0/24&lt;/code&gt;, to our ethernet interface, which will make Linux
send that data to the ethernet card, which will in turn send it through
the actual physical cable!&lt;/p&gt;
&lt;p&gt;Here&#39;s a bigger picture of the full output of &lt;code&gt;ip a&lt;/code&gt; on my machine:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-interfaces.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-interfaces.png&#34; alt=&#34;output of ip a&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;We can see a few interfaces here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;lo&lt;/code&gt;: The loopback interface. A virtual interface that makes packets
to &lt;code&gt;127.0.0.1&lt;/code&gt; go straight back to your own machine.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wlan0&lt;/code&gt;: My WiFi interface. We can see its state is &lt;code&gt;UP&lt;/code&gt;, I have the
IP &lt;code&gt;192.168.1.221&lt;/code&gt; on the network and the subnet mask is &lt;code&gt;/24&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;virbr0&lt;/code&gt;: My KVM interface. We can see its state is &lt;code&gt;DOWN&lt;/code&gt;, I have
the IP &lt;code&gt;192.168.122.1&lt;/code&gt; on the network and the subnet mask is &lt;code&gt;/24&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wgpi&lt;/code&gt;: An interface for the WireGuard connection I have to my
Raspberry Pi. I have the IP &lt;code&gt;10.91.0.2&lt;/code&gt; on the network and the
subnet mask is &lt;code&gt;/24&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;wgnord&lt;/code&gt;: An interface for the WireGuard connection I have to a
remote VPN server. I have the IP &lt;code&gt;10.5.0.2&lt;/code&gt; on the network and the
subnet mask is &lt;code&gt;/32&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;routing&#34;&gt;Routing&lt;/h2&gt;
&lt;p&gt;Okay, so we&#39;ve learned about interfaces now. Those don&#39;t do much by
themselves though, since right now Linux will never really use them. To
make use of them we need to use routing to tell Linux which packets it
should put into those interfaces. These definitions of what outgoing
traffic to put into which interfaces are called routes!&lt;/p&gt;
&lt;p&gt;To view the routes set up on your machine, run this command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip r
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here&#39;s the command&#39;s output on my server:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-server-routes.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-server-routes.png&#34; alt=&#34;output of ip r&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;And here&#39;s an excerpt of the interfaces on my server:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-server-interfaces.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-server-interfaces.png&#34; alt=&#34;network interface&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;The first route containing &lt;code&gt;default via&lt;/code&gt; is special: All packets that
don&#39;t match other routes are automatically sent to this interface
(&lt;code&gt;ens3&lt;/code&gt;). Now you might remember &lt;code&gt;172.31.1.1&lt;/code&gt; is in one of those
reserved subnets, so this isn&#39;t another machine on the internet! This
is my server&#39;s &amp;quot;gateway&amp;quot;. At home your gateway probably is your
router: You send everything to it and it then forwards those packets to
the internet (or another device on your local network, if you&#39;re
speaking to another IP within your subnet).&lt;/p&gt;
&lt;p&gt;Note also that my server&#39;s &lt;code&gt;ens3&lt;/code&gt; interface has an IP address assigned
which is not one of the reserved ones. Therefore my server isn&#39;t behind
NAT and this is the actual IP my server can be reached at on the
internet! Also note that the subnet mask is &lt;code&gt;/32&lt;/code&gt;, or &amp;quot;all bits in this
IP are fixed&amp;quot;.&lt;/p&gt;
&lt;p&gt;The second line is for the virtual interface created by docker. All
containers get assigned an IP within the subnet &lt;code&gt;172.17.0.0/16&lt;/code&gt;, and
this route tells Linux to put packets destined for said subnet into the
&lt;code&gt;docker0&lt;/code&gt; virtual interface, which then ends up at the container having
that IP. We can see some additional info too: The IP packet&#39;s source
will be set to &lt;code&gt;172.17.0.1&lt;/code&gt; and the &lt;code&gt;linkdown&lt;/code&gt; state signifies that we
have a route set up, but the interface for that route is in &lt;code&gt;DOWN&lt;/code&gt;
state.&lt;/p&gt;
&lt;h2 id=&#34;putting-it-all-into-practice&#34;&gt;Putting it all into practice&lt;/h2&gt;
&lt;p&gt;Now it might be interesting and all to know how Linux does networking,
but as a regular user you&#39;ve probably never had to touch the &lt;code&gt;ip&lt;/code&gt;
command in the past: Your server comes set up out of the box and if you
connect to a WiFi, the interface and routes are configured automatically
for you. This is done by your network manager through
&lt;a href=&#34;https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol&#34;&gt;DHCP&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Recently I&#39;ve had a use case where I had to configure networking
manually: I wanted to move around 200GB of data from one laptop to
another. Now there are a few ways I could go about this: I could look
for a big enough USB-Drive and move the data that way. Or I could
connect both devices to the same WiFi (they already were) and move the
data over the network using rsync, or sshfs, or scp, or nfs, ... But
the problem here is that my local WiFi is only about 100Mbit/s fast,
moving 200GB at that speed would take over 4 hours, if my math is
correct, and would congest the WiFi for all that time. But your standard
ethernet can do a stable 1Gbit/s, which would drop the time down to 26
minutes!&lt;/p&gt;
&lt;p&gt;So I take an ethernet cable and directly connect both laptops with that.
On both machines &lt;code&gt;ip a&lt;/code&gt; now shows something like this:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-ethernet-unconfigured.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-ethernet-unconfigured.png&#34; alt=&#34;new output of ip a&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;There is no DHCP-Server running on either machine, so we&#39;ll have to do
the configuring ourselves! From here on we&#39;ll have Computer A with
interface &lt;code&gt;eth0&lt;/code&gt; and Computer B with interface &lt;code&gt;eth1&lt;/code&gt;, for clarity.&lt;/p&gt;
&lt;p&gt;First we must choose what subnet our ethernet interface should use. We
can freely choose from the list of reserved subnets here, as long as the
subnet isn&#39;t occupied by another interface on either machine. We&#39;ll
say &lt;code&gt;192.168.50.0/24&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note also that the first and last address on each subnet, here
&lt;code&gt;192.168.50.0&lt;/code&gt; and &lt;code&gt;192.168.50.255&lt;/code&gt;, respectively, can&#39;t actually be
assigned to any device. The first is called &amp;quot;Network ID&amp;quot;, as mentioned
previously, and the last is called &amp;quot;broadcast IP&amp;quot;.&lt;/p&gt;
&lt;p&gt;So we&#39;ll give Computer A the IP &lt;code&gt;192.168.50.1&lt;/code&gt; and Computer B the IP
&lt;code&gt;192.168.50.2&lt;/code&gt;. To do that we use the &lt;code&gt;ip&lt;/code&gt; command aswell.&lt;/p&gt;
&lt;p&gt;Computer A:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip addr add 192.168.50.1/24 dev eth0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Computer B:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip addr add 192.168.50.2/24 dev eth1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this now:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-ethernet-ip.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-ethernet-ip.png&#34; alt=&#34;new ip addresses&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Now we change the interface&#39;s state to &lt;code&gt;UP&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;Computer A:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip link set eth0 up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Computer B:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip link set eth1 up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this now:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-ethernet-ip-up.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-ethernet-ip-up.png&#34; alt=&#34;ethernet output&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Are we done? You can try pinging one IP from another. It won&#39;t work,
because we don&#39;t have routes set up yet. So lets&#39;s do that:&lt;/p&gt;
&lt;p&gt;Computer A:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip route add 192.168.50.0/24 dev eth0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Computer B:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ip route add 192.168.50.0/24 dev eth1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see something like this in &lt;code&gt;ip r&lt;/code&gt;:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/networking-ethernet-route.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/networking-ethernet-route.png&#34; alt=&#34;ip routes final&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;They are now able to talk to each other!&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://phire.cc&#34;&gt;phire&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>SSH - Advanced Usage</title>
		<link>https://landchad.net/ssh-advanced/</link>
		<pubDate>Fri, 01 Jul 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/ssh-advanced/</guid>
		<description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This page is dedicated to advanced SSH usage examples. We will discuss
the following concepts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;config files (for client)&lt;/li&gt;
&lt;li&gt;tunneling&lt;/li&gt;
&lt;li&gt;jumping&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;config-files&#34;&gt;Config files&lt;/h2&gt;
&lt;p&gt;Config files allow you to specify certain rules for all or chosen hosts.
The file has a really simple structure. It is divided into sections
which begin with the &lt;code&gt;Host&lt;/code&gt; keyword. Sections are read one by one and
&lt;strong&gt;the first matching section takes precedence over the remaining
sections&lt;/strong&gt;&amp;mdash;you write more specific sections at the top and the more
general sections below.&lt;/p&gt;
&lt;h3 id=&#34;why-even-bother&#34;&gt;Why even bother?&lt;/h3&gt;
&lt;p&gt;You might say that SSH client doesn&#39;t need any special configuration -
you just type user@host and that&#39;s it. Well, what happens when you
manage multiple servers? Maybe you want to use a different pair of keys
for each servers? Maybe the server uses a port other than the default 22
to avoid automated bots trying to log in?&lt;/p&gt;
&lt;p&gt;That&#39;s where config files come in handy!&lt;/p&gt;
&lt;h3 id=&#34;example-scenario&#34;&gt;Example scenario&lt;/h3&gt;
&lt;p&gt;Let&#39;s assume that you manage 3 servers, with the following access info:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;very.long.hostname.example1.com
&lt;ul&gt;
&lt;li&gt;user: admin&lt;/li&gt;
&lt;li&gt;port: 22&lt;/li&gt;
&lt;li&gt;key name: id_rsa&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;example2.com
&lt;ul&gt;
&lt;li&gt;user: billthemaster&lt;/li&gt;
&lt;li&gt;port: 2222&lt;/li&gt;
&lt;li&gt;key name: example2_ecdsa&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;192.168.133.7
&lt;ul&gt;
&lt;li&gt;user: management&lt;/li&gt;
&lt;li&gt;port: 22&lt;/li&gt;
&lt;li&gt;key name: id_rsa&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You got tired having to always specify the identity file location with
the &lt;code&gt;-i&lt;/code&gt; option and the port with &lt;code&gt;-p&lt;/code&gt; option for example2.com. Don&#39;t
even mention &lt;code&gt;admin@very.long.hostname.example1.com&lt;/code&gt;!&lt;/p&gt;
&lt;p&gt;In the given example, the config file could look like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;Host server1
  HostName very.long.hostname.example1.com
  User admin
  IdentityFile ~/.ssh/id_rsa

Host server2
  HostName example2.com
  Port 2222
  User billthemaster
  IdentityFile ~/.ssh/example2_ecdsa

Host server3
  HostName 192.168.133.7
  User management
  IdentityFile ~/.ssh/id_rsa

Host *
  IdentityFile /path/to/some/other/key
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can see here usage of &lt;code&gt;Host *&lt;/code&gt;. Options specified in this section
will affect all other hosts.&lt;/p&gt;
&lt;h3 id=&#34;but-where-do-i-put-this-file&#34;&gt;But where do I put this file?&lt;/h3&gt;
&lt;p&gt;SSH looks for the options in the following order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;command line arguments&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.ssh/config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/ssh/ssh_config&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can also specify a custom path with the &lt;code&gt;-F&lt;/code&gt; argument, for example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -F ~/Documents/projects/someproject/config/ssh production
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;...or discard any config file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -F /dev/null username@hostname
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&#39;s more to ssh config files, but I direct you to &lt;code&gt;man ssh_config&lt;/code&gt;
for more information&lt;/p&gt;
&lt;h2 id=&#34;ssh-tunneling-portforwarding&#34;&gt;SSH Tunneling (&amp;quot;port forwarding&amp;quot;)&lt;/h2&gt;
&lt;p&gt;SSH tunneling gives you the ability to route TCP traffic from your
location to the remote server or the other way around (if server allows
for this). Thanks to it, you can set up a secure connection with a
service that doesn&#39;t provide any encryption by default. You can treat
it like a lite VPN.&lt;/p&gt;
&lt;p&gt;You can for example access your SQL server via SSH without opening the
port for public - you just need SSH port opened on the server&#39;s
firewall. It&#39;s also a great way of creating a secure channel for
connecting with other hosts on the server&#39;s network.&lt;/p&gt;
&lt;h3 id=&#34;local-to-remote&#34;&gt;Local to remote&lt;/h3&gt;
&lt;p&gt;You can route traffic from your local network to the remote server&#39;s
network by using the &lt;code&gt;-L&lt;/code&gt; option. Let&#39;s say you want to access a MySQL
service on the remote server. You can tell SSH to route any traffic that
comes to your 3000 port to port 3306 on the remote server with the
following example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -L 3000:localhost:3306 username@example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above command states that anyone connecting to your port 3000 will
be routed via the SSH connection to the localhost:3306 from the remote
server&#39;s perspective&lt;/p&gt;
&lt;p&gt;If you can&#39;t understand the above description, let&#39;s take a look at
another example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -L localhost:8080:192.168.178.25:80 username@example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above command states that any traffic coming from your device (and
only yours, because of &lt;code&gt;localhost&lt;/code&gt;) will be routed via the SSH channel
to &lt;code&gt;192.168.178.25:80&lt;/code&gt; in the server&#39;s network.&lt;/p&gt;
&lt;p&gt;In general, the argument&#39;s structure is as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;-L &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;local_address:&lt;span style=&#34;color:#f92672&#34;&gt;][&lt;/span&gt;local_port&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;:&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;remote_address&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;:&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;remote_port&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;local_address&lt;/code&gt; can be your LAN IP, &lt;code&gt;localhost&lt;/code&gt; or any other address
that your device has. Depending on it, other devices in the specified
network will be able to connect to you or not.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;remote_address&lt;/code&gt; can be any address reachable from the server.&lt;/p&gt;
&lt;p&gt;You can, of course, route multiple ports. For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -L 8000:localhost:8000 -L 8001:localhost:8001 username@example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Please, remember, this works &lt;strong&gt;only&lt;/strong&gt; on TCP based services, &lt;strong&gt;not&lt;/strong&gt; UDP
based.&lt;/p&gt;
&lt;h3 id=&#34;remote-to-local&#34;&gt;Remote to local&lt;/h3&gt;
&lt;p&gt;There might come a need for you to open your locally running service
(for example a game server) to external connections. Let&#39;s say you
can&#39;t or don&#39;t want to set up port forwarding on your router.&lt;/p&gt;
&lt;p&gt;You can use SSH to forward any traffic that is coming to a port on
remote server to a port on your local network host. The same as in the
case &amp;quot;Local to remote&amp;quot;, but the other way around.&lt;/p&gt;
&lt;p&gt;However, there is one additional step that is neccessary and requires
you to have a root access to the remote server. You have to edit
&lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; file, to instruct SSH server to route traffic to
the other end of SSH connection - your device.&lt;br&gt;
Find and uncomment or append the one of the following lines to the file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;GatewayPorts yes # to allow all remote devices
GatewayPorts clientspecified # to allow only specific remote devices
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can then specify the forwarding rule with the &lt;code&gt;-R&lt;/code&gt; option, for
example open &lt;code&gt;192.168.178.2:21&lt;/code&gt; on your local network, to be accessible
from a remote server on port 2100:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -R 2100:localhost:21 username@example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;...or provide access only to your friend with an IP &lt;code&gt;111.111.111.111&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -R 111.111.111.111:2100:localhost:21 username@example.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can replace &lt;code&gt;localhost&lt;/code&gt; with any host accessible from your local
device, for example your local media server etc.&lt;/p&gt;
&lt;h2 id=&#34;ssh-jumping&#34;&gt;SSH Jumping&lt;/h2&gt;
&lt;p&gt;Jumping is a method of connecting to a target via one or more
intermediate servers. This can be used to access servers behind
firewalls etc. All connections on the chain are encrypted and routed via
SSH.&lt;/p&gt;
&lt;p&gt;You can easily jump as shown in the following example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -J username1@example1.com username2@example2.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also specify multiple intermediaries, by separating them with a
comma:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh -J username1@example2.com,username2@example.com username3@example3.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There is also a possibility to set up &amp;quot;jumping&amp;quot; connection in a config
file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;Host intermediary1
  HostName target.intermediary-example.com
  User john

Host target1
  HostName target.example.com
  ProxyJump intermediary1

Host target2
  HostName target2.example.com
  ProxyJump username@example1.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
	</item>
	
	<item>
		<title>Yarr</title>
		<link>https://landchad.net/yarr/</link>
		<pubDate>Fri, 01 Jul 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/yarr/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://github.com/nkanaev/yarr&#34;&gt;Yarr&lt;/a&gt; (yet another rss reader) is a web-based feed aggregator which can be used both as a desktop application and a personal self-hosted server.&lt;/p&gt;
&lt;p&gt;It is written in Go with the frontend in Vue.js. The storage is backed by SQLite.&lt;/p&gt;
&lt;h2 id=&#34;installing-yarr&#34;&gt;Installing Yarr&lt;/h2&gt;
&lt;p&gt;Firstly, we have to download yarr binary from github on our system&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget https://github.com/nkanaev/yarr/releases/download/v2.3/yarr-v2.3-linux64.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unzip the archive&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;unzip -x yarr-v2.3-linux64.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Move the binary to your bin folder&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mv yarr /usr/local/bin/yarr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;Now we need to create a &lt;code&gt;auth.conf&lt;/code&gt; file that include user and password to create a local yarr account.
I personnaly store this file in a directory called yarr in &lt;code&gt;~/.config&lt;/code&gt; folder, but you can place the file wherever you want.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir ~/.config/yarr
echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;landchad:password&amp;#39;&lt;/span&gt; &amp;gt; ~/.config/yarr/auth.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;creating-a-service&#34;&gt;Creating a service&lt;/h2&gt;
&lt;p&gt;Create a new file /etc/systemd/system/yarr.service and add the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;Yarr&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Environment&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;HOME=/home/landchad&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/usr/bin/env yarr -addr 0.0.0.0:7070 -auth-file=/home/landchad/.config/yarr/auth.conf -db=/home/landchad/.config/yarr/feed.sql -log-file=/home/landchad/.config/yarr/access.log&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Restart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;on-failure&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After creating the config, load, start and enable the service with the following commands.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl daemon-reload
systemctl enable --now yarr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;nginx-configuration&#34;&gt;Nginx configuration&lt;/h2&gt;
&lt;p&gt;Create an Nginx configuration file for Yarr, say /etc/nginx/sites-available/yarr and add the content below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
	&lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt; ;
	&lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt; ;

	&lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;rss.example.org&lt;/span&gt; ;

	&lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:7070/&lt;/span&gt;;
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let&amp;rsquo;s enable the Nginx Yarr site and reload Nginx to make it active.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/yarr /etc/nginx/sites-enabled
systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;encryption&#34;&gt;Encryption&lt;/h3&gt;
&lt;p&gt;You can encrypt your yarr subdomain as well. Let&amp;rsquo;s do that with certbot:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx -d rss.example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you can go to rss.example.org, login and start to add your feeds!&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;p&gt;Author: Jppaled &amp;ndash; &lt;a href=&#34;https://jppaled.xyz&#34;&gt;jppaled.xyz&lt;/a&gt; -- XMR: &lt;code&gt;86bVp8bcx1F3y3NsfuTRs6D7FfnDyLomV7dLJmus2YMiY9Aat6W5m8JGwuvH39HKrq3immS7noKq8HeW4gb4BFbyLoz5WSZ&lt;/code&gt;{.crypto}&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Fosspay</title>
		<link>https://landchad.net/fosspay/</link>
		<pubDate>Thu, 30 Jun 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/fosspay/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://sr.ht/~sircmpwn/fosspay/&#34;&gt;Fosspay&lt;/a&gt; is a free-software web frontend for receiving donations and
subscriptions, similar to Patreon or Liberapay, but which can be hosted
on your own server. It can also interface with Patreon or Github
Sponsors to aggregate all your donations.&lt;/p&gt;
&lt;h2 id=&#34;stripe-setup&#34;&gt;Stripe Setup&lt;/h2&gt;
&lt;p&gt;Fosspay uses &lt;a href=&#34;https://stripe.com&#34;&gt;Stripe&lt;/a&gt; as a payment processor. You first must go to &lt;a href=&#34;https://stripe.com&#34;&gt;their website&lt;/a&gt; and create an account.&lt;/p&gt;
&lt;p&gt;Once you set everything up, you can go to &lt;a href=&#34;https://dashboard.stripe.com/account/apikeys&#34;&gt;https://dashboard.stripe.com/account/apikeys&lt;/a&gt; and get your &amp;ldquo;Publishable Key&amp;rdquo; and &amp;ldquo;Secret Key&amp;rdquo; which will be all you need to set up Fosspay.&lt;/p&gt;
&lt;aside&gt;
&lt;h3 id=&#34;note-on-free-software&#34;&gt;Note on Free Software&lt;/h3&gt;
&lt;p&gt;Stripe is perhaps the best way to transact in the legacy financial system
online, but you are still not using free and privacy respecting software.
Fosspay is an open source payment gateway, but it still connects to Stripe.
The only way to transact value over the internet on all free software is
&lt;a href=&#34;https://landchad.net/monero/&#34;&gt;crypto-currency&lt;/a&gt;.&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&#34;dependencies&#34;&gt;Dependencies&lt;/h2&gt;
&lt;p&gt;We will need git, postgres and the ability to make a python virtual
environment:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install git python3-venv python3-dev postgresql libpq-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;download-and-installation&#34;&gt;Download and Installation&lt;/h2&gt;
&lt;p&gt;We will download fosspay to &lt;code&gt;/var/www/fosspay/&lt;/code&gt;. This directory will
also serve as our virtual environement.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone https://git.sr.ht/~sircmpwn/fosspay /var/www/fosspay
python3 -m venv /var/www/fosspay
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Activate the python environment with the command below, then we will
install the dependencies.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;source /var/www/fosspay/bin/activate
cd /var/www/fosspay
pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Be sure you are still in &lt;code&gt;/var/www/fosspay&lt;/code&gt;, then we will build the
package and create the configuration file.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;make
cp config.ini.example config.ini
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;create-a-database&#34;&gt;Create a Database&lt;/h2&gt;
&lt;p&gt;Fosspay uses a PostgreSQL database to store donation information, so
let&#39;s create a database and user for it.&lt;/p&gt;
&lt;p&gt;First, become the &lt;code&gt;postgres&lt;/code&gt; user and run the &lt;code&gt;psql&lt;/code&gt; command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su postgres
psql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We will create a database named &lt;code&gt;fosspay&lt;/code&gt; controled by a user named
&lt;code&gt;fosspay&lt;/code&gt; (also identified by a a password &lt;code&gt;fosspay&lt;/code&gt;).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;create&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;database&lt;/span&gt; fosspay ;
&lt;span style=&#34;color:#66d9ef&#34;&gt;create&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;user&lt;/span&gt; fosspay &lt;span style=&#34;color:#66d9ef&#34;&gt;with&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;encrypted&lt;/span&gt; password &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;fosspay&amp;#39;&lt;/span&gt; ;
&lt;span style=&#34;color:#66d9ef&#34;&gt;grant&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;all&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;privileges&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;database&lt;/span&gt; fosspay &lt;span style=&#34;color:#66d9ef&#34;&gt;to&lt;/span&gt; fosspay ;
&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;\&lt;/span&gt;q
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that if you want to use a different username or password for
whatever reason, change them in the command above, but also in the
&lt;code&gt;connection-string&lt;/code&gt; variable in the configuration file.&lt;/p&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;Now open up &lt;code&gt;/var/www/fosspay/config.ini&lt;/code&gt; and we will set things up.
Here are a list of things to edit.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;domain&lt;/code&gt; should be set to &lt;code&gt;&lt;mark&gt;donate.example.org&lt;/mark&gt;&lt;/code&gt;, with your domain.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;protocol&lt;/code&gt; can be set to &lt;code&gt;https&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Get or create an email account to use as a mailer and add the account/server
information to the email settings.&lt;/li&gt;
&lt;li&gt;Add your public and secret Stripe keys to the information.&lt;/li&gt;
&lt;li&gt;Change the &lt;code&gt;connection-string&lt;/code&gt; to
&lt;code&gt;postgresql://fosspay:fosspay@localhost/fosspay&lt;/code&gt; as set up above.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;An important note:&lt;/strong&gt; mail ports &lt;em&gt;must&lt;/em&gt; be opened on the server you&#39;re using,
or else Fosspay will silently fail to send mails when someone tries to donate
or reset their password. You do not have to run a mail server on the same
server as Fosspay, but either way, mail submission ports must be opened. This
usually requires contacting your VPS provider and requesting it from them.
Aside from this, any error in the email setup will cause Fosspay to crash
silently.&lt;/p&gt;
&lt;h3 id=&#34;optional-integration-with-patreon-github-liberapay&#34;&gt;Optional Integration with Patreon, Github, Liberapay&lt;/h3&gt;
&lt;p&gt;Note that if you have a previous Patreon, Github Sponsors or Liberapay
account, you can create an access token for Fosspay, so that you can
display your income from those sources along side Fosspay monthly
donations.&lt;/p&gt;
&lt;p&gt;For Liberapay, you only need to include your username. You must create a
&lt;a href=&#34;https://github.com/settings/tokens&#34;&gt;Github access token&lt;/a&gt; with the
&amp;quot;user&amp;quot; access to interface with it, and you have to add several
&lt;a href=&#34;https://www.patreon.com/portal/registration/register-clients&#34;&gt;Patreon client
parameters&lt;/a&gt;
for it.&lt;/p&gt;
&lt;h2 id=&#34;nginx-configuration&#34;&gt;Nginx configuration&lt;/h2&gt;
&lt;p&gt;Fosspay runs on port 5000, so we can have Nginx show the site. Create an
Nginx configuration file modeled as below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;donate.example.org&lt;/mark&gt;&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:5000&lt;/span&gt; ;
        }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After that, &lt;a href=&#34;https://landchad.net/basic/certbot&#34;&gt;remember to get HTTPS for the subdomain!&lt;/a&gt;
HTTPS is absolutely required for using Stripe as a payment processor.&lt;/p&gt;
&lt;h2 id=&#34;systemd-file&#34;&gt;Systemd File&lt;/h2&gt;
&lt;p&gt;We can now create a systemd service file for Fosspay. Create a file in
&lt;code&gt;/etc/systemd/system/fosspay.service&lt;/code&gt; as below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;fosspay website&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Wants&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Wants&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;postgresql.target&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Before&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Before&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;postgresql.target&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;simple&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WorkingDirectory&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/fosspay&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;VIRTUAL_ENV&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/fosspay&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Environment&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;PATH=$VIRTUAL_ENV/bin:$PATH&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/fosspay/bin/gunicorn app:app -b 127.0.0.1:5000&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStop&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/fosspay/bin/gunicorn&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that for safety, we are running fosspay through &lt;code&gt;gunicorn&lt;/code&gt; in our
virtual environment.&lt;/p&gt;
&lt;p&gt;We can now run &lt;code&gt;systemctl start fosspay&lt;/code&gt; to start the service, and it
should appear at the URL you designated above.&lt;/p&gt;
&lt;h2 id=&#34;customizing-the-page&#34;&gt;Customizing the Page&lt;/h2&gt;
&lt;p&gt;Within &lt;code&gt;/var/www/fosspay/templates&lt;/code&gt;, there are various files that you
can change to add text and other features to the page. The main file is
&lt;code&gt;summary.html&lt;/code&gt;, where you can add a description and other information
that will appear. Restart the service after updating files to make
changes live.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Rainloop</title>
		<link>https://landchad.net/rainloop/</link>
		<pubDate>Sat, 25 Jun 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/rainloop/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://www.rainloop.net/&#34;&gt;Rainloop&lt;/a&gt;
is a webmail client, a program that allows you to access your email
online like Gmail. It is useful to be able to access you email from a
web browser because it allows you to easily access your email from any
device with a web browser without any additional setup.&lt;/p&gt;
&lt;p&gt;If you set up
&lt;a href=&#34;https://landchad.net/nextcloud&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/nextcloud.svg&#34; alt=&#34;logo&#34;&gt;Nextcloud&lt;/a&gt;
then you do not need to install Rainloop because Nextcloud comes with a
webmail client. However, if all you want is a webmail client and you do
not need all of the extra things that Nextcloud provides, Rainloop would
be the better choice out of the two since it is less bloated and simpler
to install.&lt;/p&gt;
&lt;h2 id=&#34;instructions&#34;&gt;Instructions&lt;/h2&gt;
&lt;p&gt;First we will install the required packages for Rainloop with the
following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt-get install php php-common php-curl php-xml php-fpm php-json php-dev php-mysql unzip -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we will download the community version of Rainloop, unzip it into
an appropriate directory and fix all of the file permissions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl -L &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://www.rainloop.net/repository/webmail/rainloop-latest.zip&amp;#34;&lt;/span&gt; -o &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;rainloop.zip&amp;#34;&lt;/span&gt;
unzip rainloop.zip -d /var/www/mail
chown -R www-data: /var/www/mail
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We have installed Rainloop itself, but now we need Nginx to serve the
client. We do that by adding the following text into the file
&lt;code&gt;/etc/nginx/sites-available/mail&lt;/code&gt; (you can replace the bold text with
whatever is appropriate for your server).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {

    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;mail.example.org&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/mail&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.php&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/log/nginx/rainloop_access.log&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;error_log&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/log/nginx/rainloop_error.log&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php?&lt;/span&gt;$query_string;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.php$&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.php&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_split_path_info&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^(.+\.php)(.*)&lt;/span&gt;$;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_keep_conn&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/var/run/php/php-fpm.sock&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/nginx/fastcgi_params&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;SCRIPT_FILENAME&lt;/span&gt; $document_root$fastcgi_script_name;
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;/\.ht&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt;;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^~&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/data&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then enable the site by linking it to the sites-enabled directory:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/mail /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reload nginx:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally get certifications if you are using a new subdomain:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After that go to &lt;code&gt;mail.example.org/?admin&lt;/code&gt; and login with the default
username and password: admin, 12345. Now you are in the admin panel and
the first thing you do should be to change the adminsitrator password by
looking in the security tab on the left.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/rainloop-1.png&#34; alt=&#34;rainloop&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;After securing the admin account you can go to domains and add your own
email address.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/rainloop-2.png&#34; alt=&#34;rainloop&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Finally, go to &lt;code&gt;mail.example.org&lt;/code&gt; and login with your email address and
password.&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://deniz.telci.org/&#34;&gt;Deniz Telci&lt;/a&gt; - XMR:
&lt;code&gt;4AcKbpTUc3QX2zHYdh9HZwJAQyexdybFhF1WhXTFhxAcV9jgzB6kroqGZDgeW3rQqXEMYJioYo61kaLBqstwecty9Bjbr4v&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Nginx Tweaks</title>
		<link>https://landchad.net/nginx-tweaks/</link>
		<pubDate>Thu, 16 Jun 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/nginx-tweaks/</guid>
		<description>&lt;p&gt;The point of this article is to show you how to do some commonly-desired tweaks
in Nginx while in the meantime helping you understand how it works.&lt;/p&gt;
&lt;h2 id=&#34;do-not-require-html-in-urls&#34;&gt;Do not require &lt;code&gt;.html&lt;/code&gt; in URLs&lt;/h2&gt;
&lt;p&gt;If your website is using lots of &lt;code&gt;.html&lt;/code&gt; files for pages, it&#39;s sort of
overkill to make people type that in for every page they are looking for. We
can remove that requirement with Nginx.&lt;/p&gt;
&lt;p&gt;Open your site&#39;s configuration file in &lt;code&gt;/etc/nginx/sites-enabled/&lt;/code&gt; and within
the &lt;code&gt;server&lt;/code&gt; block, there should be a &lt;code&gt;location&lt;/code&gt; block that looks something
like this if you have followed &lt;a href=&#34;https://landchad.net/basic/nginx&#34;&gt;the guide here&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What this means is that in the file location of &lt;code&gt;/&lt;/code&gt;, i.e. anywhere and
everywhere in the root file system, We will look for the three things listed in
&lt;code&gt;try_files&lt;/code&gt; in that order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;$uri&lt;/code&gt;: a file that directly matches the content added after the domain.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$uri/&lt;/code&gt;: a &lt;em&gt;directory&lt;/em&gt; that directly matches the content added after the
domain.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;=404&lt;/code&gt;: if neither of those is found, we give a 404 error, which as you
probably know, signified &amp;quot;Page not found.&amp;quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We will now change the content inside the &lt;code&gt;location&lt;/code&gt; block to the below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;(&lt;/span&gt;$request_uri ~ &lt;span style=&#34;color:#e6db74&#34;&gt;^/(.*)\.html$)&lt;/span&gt; { &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;302&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt;$1; }
    &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri.html $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;$1&lt;/code&gt; here refers to the first content in the parentheses &lt;code&gt;()&lt;/code&gt; in the preceeding
regular expression.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>SearXNG</title>
		<link>https://landchad.net/searxng/</link>
		<pubDate>Mon, 16 May 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/searxng/</guid>
		<description>&lt;p&gt;SearXNG is a free internet metasearch engine which aggregates results
from more than 70 search services. This guide sets up a working instance
that can be accessed using a domain over HTTPS. Features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Self-hosted&lt;/li&gt;
&lt;li&gt;No user tracking&lt;/li&gt;
&lt;li&gt;No user profiling&lt;/li&gt;
&lt;li&gt;About 70 supported search engines&lt;/li&gt;
&lt;li&gt;Easy integration with any search engine&lt;/li&gt;
&lt;li&gt;Cookies are not used by default&lt;/li&gt;
&lt;li&gt;Secure, encrypted connections (HTTPS/SSL)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Install the required packages.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install git nginx nginx-extras -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Open http and https ports.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;iptables -I INPUT -m state --state NEW -p tcp --dport &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt; -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; -j ACCEPT
netfilter-persistent save
ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;First we will create a user for SearX.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;useradd -mr -d &amp;quot;/usr/local/searxng&amp;quot; -c &#39;Privacy-respecting metasearch engine&#39; -s /bin/bash searxng
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Although the auto-install script below we create this user itself, we can go ahead and make it to give the cloned repository the correct permissions.&lt;/p&gt;
&lt;p&gt;Now we clone the SearXNG Repository into the &lt;code&gt;searx&lt;/code&gt; user&amp;rsquo;s home.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone https://github.com/searxng/searxng /usr/local/searxng/searxng-src
cd /usr/local/searxng/searxng-src
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Installing SearXNG.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./utils/searxng.sh install all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configure-nginx&#34;&gt;Configure Nginx&lt;/h2&gt;
&lt;p&gt;Create a new file &lt;code&gt;/etc/nginx/sites-available/searxng.conf&lt;/code&gt; and add the
following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {

    &lt;span style=&#34;color:#75715e&#34;&gt;# Listens on http
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt;;

    &lt;span style=&#34;color:#75715e&#34;&gt;# Your server name
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;searx.&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt; ;

    &lt;span style=&#34;color:#75715e&#34;&gt;# If you want to log user activity, comment these
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/dev/null&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;error_log&lt;/span&gt;  &lt;span style=&#34;color:#e6db74&#34;&gt;/dev/null&lt;/span&gt;;

    &lt;span style=&#34;color:#75715e&#34;&gt;# X-Frame-Options (XFO) header set to DENY
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Frame-Options&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;DENY&amp;#34;&lt;/span&gt;;

    &lt;span style=&#34;color:#75715e&#34;&gt;# HTTP Strict Transport Security (HSTS) header
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Strict-Transport-Security&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;max-age=31536000&lt;/span&gt;; &lt;span style=&#34;color:#f92672&#34;&gt;includeSubDomains&amp;#34;&lt;/span&gt;;

    &lt;span style=&#34;color:#75715e&#34;&gt;# Content Security Policy (CSP)
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Content-Security-Policy&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;default-src&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;self&amp;#39;&lt;/span&gt;;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:///usr/local/searxng/run/socket&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;uwsgi_params&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_param&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_HOST&lt;/span&gt;             $host;
        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_param&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_CONNECTION&lt;/span&gt;       $http_connection;

        &lt;span style=&#34;color:#75715e&#34;&gt;# see flaskfix.py
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_param&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_X_SCHEME&lt;/span&gt;         $scheme;
        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_param&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_X_SCRIPT_NAME&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;/searxng&lt;/span&gt;;

        &lt;span style=&#34;color:#75715e&#34;&gt;# see limiter.py
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_param&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_X_REAL_IP&lt;/span&gt;        $remote_addr;
        &lt;span style=&#34;color:#f92672&#34;&gt;uwsgi_param&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_X_FORWARDED_FOR&lt;/span&gt;  $proxy_add_x_forwarded_for;

    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now create a symbolic link to enable this site.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/searxng.conf /etc/nginx/sites-enabled/searxng.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restart Nginx and SearXNG.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart nginx
service uwsgi restart searxng
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configure-https-with-certbot&#34;&gt;Configure HTTPS with Certbot&lt;/h2&gt;
&lt;p&gt;Install certbot.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Install a Let&#39;s Encrypt SSL certificate to Nginx and optionally let it
configure HTTPS for you. &lt;a href=&#34;https://landchad.net/basic/certbot&#34;&gt;Detailed instructions and additional information&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;SearXNG should now be available from your domain.&lt;/p&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;You can change settings by editing &lt;code&gt;/etc/searxng/settings.yml&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;p&gt;Author: goshawk22 &amp;ndash; &lt;a href=&#34;https://goshawk22.uk&#34;&gt;website&lt;/a&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Prosody</title>
		<link>https://landchad.net/prosody/</link>
		<pubDate>Sun, 03 Apr 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/prosody/</guid>
		<description>&lt;p&gt;XMPP is a fantastically simple protocol that&amp;rsquo;s usually used as a messenger. It&amp;rsquo;s highly extensible, better than IRC, lighter and more decentralized than Matrix, and normie social media like Telegram can&amp;rsquo;t hold a candle to it.&lt;/p&gt;
&lt;p&gt;XMPP is so decentralized and extensible that there are many &lt;a href=&#34;https://landchad.net/ejabberd&#34;&gt;&lt;em&gt;different&lt;/em&gt;&lt;/a&gt; XMPP servers. Here, let&amp;rsquo;s set up a &lt;a href=&#34;https://prosody.im/&#34;&gt;Prosody&lt;/a&gt; XMPP server.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;To install Prosody, first add the official Prosody repositories for Debian:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Install extrepo if you already haven&amp;#39;t&lt;/span&gt;
apt install extrepo
extrepo enable prosody
apt update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, install Prosody:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install prosody
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;The Prosody configuration file is in &lt;code&gt;/etc/prosody/prosody.cfg.lua&lt;/code&gt;. To set it all up, we will be changing several things.&lt;/p&gt;
&lt;h3 id=&#34;setting-admins&#34;&gt;Setting Admins&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s go ahead and set who our admin(s) will be. Find the line that says &lt;code&gt;admins = { }&lt;/code&gt; and to this we can specify one or more server admins.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# To add one admin:&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;admins&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;{ &amp;#34;chad@example.org&amp;#34; }&lt;/span&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;# We can add more than one by separating them by commas. (This file is written in Lua.)&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;admins&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;{ &amp;#34;chad@example.org&amp;#34;, &amp;#34;chadmin@example.org&amp;#34; }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that we have not created these accounts yet, we will do this &lt;a href=&#34;#user&#34;&gt;below&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;set-the-server-url&#34;&gt;Set the Server URL&lt;/h3&gt;
&lt;p&gt;Find the line &lt;code&gt;VirtualHost &amp;quot;localhost&amp;quot;&lt;/code&gt; and replace &lt;code&gt;localhost&lt;/code&gt; with your domain. In our case, we will have &lt;code&gt;VirtualHost &amp;quot;example.org&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;multi-user-chats&#34;&gt;Multi-User Chats&lt;/h3&gt;
&lt;p&gt;Most people will probably want the ability to have chats with more than two users. This is easily enough to enable. In the config file, add the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Component &amp;#34;chat.example.org&amp;#34; &amp;#34;muc&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#a6e22e&#34;&gt;modules_enabled&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;{ &amp;#34;muc_mam&amp;#34; }
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    restrict_room_creation = &amp;#34;admin&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On the first line, you must have a separate subdomain for your multi-user chats. I use the &lt;code&gt;chat.&lt;/code&gt; subdomain, but some use &lt;code&gt;muc.&lt;/code&gt;. Anything is possible.&lt;/p&gt;
&lt;p&gt;The second line is important because it prevents non-admins from creating and squatting rooms on your server. The only situation where you might not want that is if you indend to open a general public chat system for people you don&amp;rsquo;t know.&lt;/p&gt;
&lt;p&gt;Read more about the &lt;code&gt;muc&lt;/code&gt; plugin on the Prosody documentation page &lt;a href=&#34;https://prosody.im/doc/modules/mod_muc&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;enabling-chat-histories&#34;&gt;Enabling Chat Histories&lt;/h3&gt;
&lt;p&gt;By default, Prosody will send out messages received only to the first available clients.
That means that if you have your desktop client turned off and your cell phone receives a message,
it will &lt;em&gt;not&lt;/em&gt; be available to the desktop client when you start it.&lt;/p&gt;
&lt;p&gt;While this may be preferred in some cases,
enable the &lt;code&gt;mam&lt;/code&gt; module (Message Archive Management) to have the server hold on messages and sync them to all clients.&lt;/p&gt;
&lt;p&gt;Within the &lt;code&gt;modules_enabled&lt;/code&gt; block, you can uncomment the &lt;code&gt;mam&lt;/code&gt; line to enable it.
You can see other settings for this module &lt;a href=&#34;https://prosody.im/doc/modules/mod_mam&#34;&gt;here&lt;/a&gt;
like, for example, how long a server should hold on to message histories for synching.&lt;/p&gt;
&lt;p&gt;Note also that Prosody comes with the &lt;code&gt;carbons&lt;/code&gt; activated module by default, which is related.
This will send received messages to &lt;em&gt;all&lt;/em&gt; active clients (your phone and desktop),
although it will not save messages like MAM for clients not online or to be added later.&lt;/p&gt;
&lt;h3 id=&#34;file-sharing&#34;&gt;File sharing&lt;/h3&gt;
&lt;p&gt;With this we can bring XMPP to the level of other popular instant messaging applications like Matrix and whatsapp.
It is extremely easy to setup.
This part is optional, but it can make XMPP more normie-friendly if you plan on moving family members and friends over to XMPP.&lt;/p&gt;
&lt;p&gt;Add the following line to your prosody config file to enable file uploads:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Component &amp;#34;&lt;mark&gt;uploads.example.org&lt;/mark&gt;&amp;#34; &amp;#34;http_file_share&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you will notice, you need another subdomain for this. We will add an ssl certficate for this later.&lt;/p&gt;
&lt;h3 id=&#34;proxy-support&#34;&gt;Proxy Support&lt;/h3&gt;
&lt;p&gt;This helps with file transfers for devices behind a NAT, and unless you are using XMPP in a LAN, you &lt;strong&gt;probably need this.&lt;/strong&gt;
Enable the proxy by adding the following line to the config:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Component &amp;#34;&lt;mark&gt;proxy.example.org&lt;/mark&gt;&amp;#34; &amp;#34;proxy65&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, another subdomain is needed. We will add ssl certificates for this later.&lt;/p&gt;
&lt;p&gt;At this point, file sharing is now setup and ready to be used. Although there are some concerns that should be addressed.&lt;/p&gt;
&lt;p&gt;A big concern with file sharing is large files, seeing as all files shared over XMPP will be stored on your server. This can become a problem when many (and large) files are being shared. We can put a cap on large files by adding the following line to our config:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;http_file_share_size_limit&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;20971520&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This puts a 20MB cap on all files being shared. The value is specified in bytes. You can also specify after how long files should be deleted by adding the following line:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;http_file_share_expire_after&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;60 * 60 * 24 * 7&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The value is specified in seconds. The above line will make prosody delete files after a week.&lt;/p&gt;
&lt;h3 id=&#34;database-setup&#34;&gt;Database Setup&lt;/h3&gt;
&lt;p&gt;Prosody includes the &lt;code&gt;internal&lt;/code&gt; and &lt;code&gt;sql&lt;/code&gt; storage backends by default.
If you wish to run Prosody with PostgreSQL, begin by installing the PostgreSQL:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install postgresql lua-dbi-postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then start the daemon:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now create a user named &lt;code&gt;prosody&lt;/code&gt; to manage your database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;createuser --pwprompt prosody&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And finally, create the actual database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;psql -c &amp;#39;CREATE DATABASE prosody OWNER prosody;&amp;#39;&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, in &lt;code&gt;/etc/prosody/prosody.cfg.lua&lt;/code&gt;, edit the following lines:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;storage&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;sql&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#a6e22e&#34;&gt;sql&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;{
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    driver = &amp;#34;PostgreSQL&amp;#34;,
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    database = &amp;#34;&lt;mark&gt;prosody&lt;/mark&gt;&amp;#34;,
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    username = &amp;#34;&lt;mark&gt;prosody&lt;/mark&gt;&amp;#34;,
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    password = &amp;#34;&lt;mark&gt;password&lt;/mark&gt;&amp;#34;,
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    host = &amp;#34;localhost&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;voice-and-video-calling&#34;&gt;Voice and Video Calling&lt;/h3&gt;
&lt;p&gt;Prosody supports XMPP voice and video calls through an external TURN and STUN server.&lt;/p&gt;
&lt;p&gt;First, follow the guide on installing and setting up &lt;a href=&#34;https://landchad.net/coturn&#34;&gt;coturn,&lt;/a&gt; setting  &lt;strong&gt;only a shared secret&lt;/strong&gt; for authentication.&lt;/p&gt;
&lt;p&gt;Then, uncomment the &lt;code&gt;turn_external&lt;/code&gt; module in the modules section in &lt;code&gt;prosody.cfg.lua&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;&amp;#34;turn_external&amp;#34;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, specify the host and credentials lower in the config:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-cfg&#34; data-lang=&#34;cfg&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;-- Specify the address of the TURN service (you may use the same domain as XMPP)&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;turn_external_host&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;turn.example.org&lt;/mark&gt;&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#a6e22e&#34;&gt;-- This secret must be set to the same value in both Prosody and the TURN server&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;turn_external_secret&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;your shared secret&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;other-things-to-check&#34;&gt;Other things to check&lt;/h3&gt;
&lt;p&gt;Check the config file for other settings you might want to change. For example, if you want to run a general public XMPP server, you can allow anyone to create an account by changing &lt;code&gt;allow_registration&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Another thing you can do is enable the &lt;code&gt;csi_simple&lt;/code&gt; module, which will add some optimizations for mobile devices.&lt;/p&gt;
&lt;p&gt;Another thing worth noting is the &lt;code&gt;archive_expires_after = &amp;quot;1w&amp;quot;&lt;/code&gt; line. This specifies after how long message archives will be deleted.&lt;/p&gt;
&lt;p&gt;Also the &lt;code&gt;smacks&lt;/code&gt; module helps a lot with slow internet connections.&lt;/p&gt;
&lt;h2 id=&#34;certificates&#34;&gt;Certificates&lt;/h2&gt;
&lt;p&gt;Obviously, we want to have client-to-server and server-to-server encryption. Nowadays, use can use Certbot to generate certificates and use a convenient command below &lt;code&gt;prosodyctl&lt;/code&gt; to import them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If you have multi-user chat enabled, be sure to get a certificate for that subdomain as well.&lt;/strong&gt; Include the &lt;code&gt;--nginx&lt;/code&gt; option assuming you have an Nginx server running.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot -d &lt;mark&gt;chat.example.org&lt;/mark&gt; --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;If you have file sharing enabled, be sure to get a certificate for those subdomains as well.&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot -d &lt;mark&gt;uploads.example.org&lt;/mark&gt; --nginx
certbot -d &lt;mark&gt;proxy.example.org&lt;/mark&gt; --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you have the certificates for encryption, run the following to import them into Prosody.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;prosodyctl --root cert import /etc/letsencrypt/live/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that you might get an error that a certificate has not been found if your &lt;code&gt;muc&lt;/code&gt; subdomain and your main domain share a certificate. It should still work, this is just notifying you that no specific certificate for the subdomain.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The above command will need to be rerun when certificates are renewed. You may want to create a &lt;a href=&#34;https://landchad.net/cron&#34;&gt;cronjob&lt;/a&gt; to have this done automatically.&lt;/p&gt;
&lt;h2 id=&#34;user&#34;&gt;Creating users/admins manually&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s manually create the admin user we prepared for above. Note that you can indeed do this in your XMPP client if you have not disabled registration, but this is how it is done on the command line:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;prosodyctl adduser &lt;mark&gt;chad@example.org&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will prompt you to create a password as well.&lt;/p&gt;
&lt;h2 id=&#34;make-changes-active&#34;&gt;Make changes active&lt;/h2&gt;
&lt;p&gt;With any system service, use &lt;code&gt;systemctl reload&lt;/code&gt; or &lt;code&gt;systemctl restart&lt;/code&gt; to make the new settings active:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart prosody
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;using-your-server&#34;&gt;Using your Server!&lt;/h2&gt;
&lt;p&gt;Once your server is set up, you just need an XMPP client to use your new and secure chat system.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GNU/Linux: &lt;a href=&#34;https://dino.im/&#34;&gt;Dino&lt;/a&gt; or &lt;a href=&#34;https://gajim.org/&#34;&gt;Gajim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Windows: &lt;a href=&#34;https://gajim.org/&#34;&gt;Gajim&lt;/a&gt; also runs on Windows.&lt;/li&gt;
&lt;li&gt;Android: &lt;a href=&#34;https://conversations.im/&#34;&gt;Conversations.im&lt;/a&gt; or
&lt;a href=&#34;https://snikket.org/&#34;&gt;snikket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Mac/iOS: &lt;a href=&#34;https://monal-im.org/&#34;&gt;Monal IM&lt;/a&gt; or
&lt;a href=&#34;https://siskin.im/&#34;&gt;Siskin&lt;/a&gt; for iOS alone&lt;/li&gt;
&lt;li&gt;command-line (GNU/Linux, MacOS, Windows):
&lt;a href=&#34;https://profanity-im.github.io/&#34;&gt;Profanity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://xmpp.org/software/clients.html&#34;&gt;See a more complete list kept by
XMPP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Install whichever of these clients you want on your computer or phone and you can log into your new XMPP server with the account you made. Note that if you enabled public registration, anyone can create an account on your server through one of these clients.&lt;/p&gt;
&lt;h3 id=&#34;account-addresses&#34;&gt;Account addresses&lt;/h3&gt;
&lt;p&gt;XMPP account addresses look just like email addresses: &lt;code&gt;username@example.org&lt;/code&gt;. You can message any account on any XMPP server on the internet with that format.&lt;/p&gt;
&lt;h3 id=&#34;note-on-mucs-multi-user-chats&#34;&gt;Note on MUCs (multi-user chats)&lt;/h3&gt;
&lt;p&gt;Remember that MUCs are kept on a separate subdomain that we created and should&amp;rsquo;ve gotten a certificate for above, for example, &lt;code&gt;chat.example.org&lt;/code&gt;. Chatrooms are created and referred to in the following format: &lt;code&gt;#chatroomname@chat.example.org&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;note-on-firewalls-and-opening-ports&#34;&gt;Note on firewalls and opening ports&lt;/h3&gt;
&lt;p&gt;If you use a firewall, you should open ports 5222 and 5281. The first one is needed for clients to be able to connect to your server. The second is only necessary if you are using the &lt;code&gt;http_file_share&lt;/code&gt; module for file sharing, as 5281 is the port for serving content over HTTPS.&lt;/p&gt;
&lt;p&gt;A complete list of ports used by Prosody can be found &lt;a href=&#34;https://prosody.im/doc/ports&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Coturn</title>
		<link>https://landchad.net/coturn/</link>
		<pubDate>Tue, 29 Mar 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/coturn/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://github.com/coturn/coturn&#34;&gt;Coturn&lt;/a&gt; is a libre &lt;strong&gt;STUN&lt;/strong&gt; and &lt;strong&gt;TURN&lt;/strong&gt; server software that allows users of internet applications or protocols (Such as &lt;a href=&#34;https://landchad.net/prosody&#34;&gt;XMPP&lt;/a&gt; and &lt;a href=&#34;https://landchad.net/matrix&#34;&gt;Matrix&lt;/a&gt;) to perform WebRTC &lt;strong&gt;voice and video calls&lt;/strong&gt; despite them being behind NATs.&lt;/p&gt;
&lt;p&gt;If you want to add video and voice calling natively to your XMPP or Matrix server (or a myriad of various other applications), you&amp;rsquo;ll need to install Coturn and configure it appropriately.&lt;/p&gt;
&lt;h3 id=&#34;note-on-ejabberd&#34;&gt;Note on ejabberd&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re installing &lt;a href=&#34;https://landchad.net/ejabberd&#34;&gt;ejabberd,&lt;/a&gt; then &lt;em&gt;you don&amp;rsquo;t need Coturn.&lt;/em&gt; Ejabberd comes with a TURN server built-in, and you should only setup ejabberd to connect to Coturn if you intend on running &lt;strong&gt;multiple chat services&lt;/strong&gt; like Matrix and XMPP.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Coturn is available in the Debian repositories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install coturn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;h3 id=&#34;base-configuration&#34;&gt;Base configuration&lt;/h3&gt;
&lt;p&gt;Coturn&#39;s configuration file is &lt;code&gt;/etc/turnserver.conf&lt;/code&gt;. There are a few
aspects that need to be changed in order to get a fully-functioning
turnserver.&lt;/p&gt;
&lt;p&gt;Here is an example of some sane defaults:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;server-name=&lt;mark&gt;turn.example.org&lt;/mark&gt;
realm=&lt;mark&gt;turn.example.org&lt;/mark&gt;
listening-ip=your_public_ip

listening-port=3478
min-port=10000
max-port=20000

## The &amp;#34;verbose&amp;#34; option is useful for debugging issues
verbose
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;authentication&#34;&gt;Authentication&lt;/h3&gt;
&lt;p&gt;There are two options for authentication on a turnserver:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Usernames&lt;/strong&gt; and &lt;strong&gt;passwords&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication secrets&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Depending on what self-hosted service is being used in conjunction with Coturn, you may need one or the other of these two options.&lt;/p&gt;
&lt;h4 id=&#34;usernames-and-passwords&#34;&gt;Usernames and Passwords&lt;/h4&gt;
&lt;p&gt;To utilize username and password authentication with Coturn, add the following configuration in &lt;code&gt;turnserver.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;lt-cred-mech
user=username:password
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;authentication-secrets&#34;&gt;Authentication Secrets&lt;/h4&gt;
&lt;p&gt;To utilize authentication secrets with Coturn, add the following
configuration in &lt;code&gt;turnserver.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;use-auth-secret
static-auth-secret=&lt;mark&gt;your_auth_secret&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;turns-tls-encryption&#34;&gt;TURNS (TLS Encryption)&lt;/h3&gt;
&lt;p&gt;Some self-hosted services may support the use of &lt;strong&gt;TURNS:&lt;/strong&gt; An encrypted version of TURN, which allows for WebRTC connections to be established with the use of an encrypted TLS tunnel, just like HTTPS allows for encrypted viewing of websites.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: This does &lt;strong&gt;not&lt;/strong&gt; affect the encryption of the audio or video feeds. This only makes the requests to the TURN servers encrypted, which is still desireable for security. Any encryption of the call contents will be handled by the client and server of the application you are using.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;To utilize TURNS, certificates need to be declared for &lt;strong&gt;turn.example.org&lt;/strong&gt; in &lt;code&gt;turnserver.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;cert=/etc/letsencrypt/live/&lt;mark&gt;turn.example.org&lt;/mark&gt;/fullchain.pem
pkey=/etc/letsencrypt/live/&lt;mark&gt;turn.example.org&lt;/mark&gt;/privkey.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this example, Letsencrypt certificates generated with &lt;code&gt;certbot&lt;/code&gt; are used.&lt;/p&gt;
&lt;h2 id=&#34;starting-coturn&#34;&gt;Starting Coturn&lt;/h2&gt;
&lt;p&gt;After all configuration changes are complete, Coturn can be started with its systemd daemon:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart coturn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuring-your-application&#34;&gt;Configuring your application&lt;/h2&gt;
&lt;p&gt;At this stage, you should look in your application&amp;rsquo;s own guide on how to set the TURN and STUN server settings. Configure it to point at &lt;strong&gt;turn.example.org&lt;/strong&gt; and use either your &lt;strong&gt;username and password pair&lt;/strong&gt; or your super-secure &lt;strong&gt;authentication secret.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://landchad.net/ejabberd#voice-and-video-calls&#34;&gt;How to configure TURN on ejabberd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://landchad.net/prosody#voice-and-video-calls&#34;&gt;How to configure TURN on Prosody&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://landchad.net/matrix#voice-and-video-calls&#34;&gt;How to configure TURN on Matrix Synapse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://landchad.net/dendrite#voice-and-video-calls&#34;&gt;How to configure TURN on Matrix Dendrite&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Congratulations! You&amp;rsquo;ve successfully setup a Coturn server!&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Written by &lt;a href=&#34;https://denshi.org&#34;&gt;Denshi.&lt;/a&gt;
Donate Monero at: &lt;code&gt;48dnPpGgo8WernVJp5VhvhaX3u9e46NujdYA44u8zuMdETNC5jXiA9S7JoYMM6qRt1ZcKpt1J3RZ3JPuMyXetmbHH7Mnc9C&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>ejabberd</title>
		<link>https://landchad.net/ejabberd/</link>
		<pubDate>Tue, 29 Mar 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/ejabberd/</guid>
		<description>&lt;p&gt;&lt;a href=&#34;https://ejabberd.im&#34;&gt;Ejabberd&lt;/a&gt; is a server for the XMPP protocol written in Erlang. It&amp;rsquo;s more scalable, and easier to setup than &lt;a href=&#34;https://landchad.net/prosody&#34;&gt;Prosody&lt;/a&gt; due to having most of its modules built-in and pre-configured by default.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;h3 id=&#34;subdomains&#34;&gt;Subdomains&lt;/h3&gt;
&lt;p&gt;Ejabberd presumes that you have already created all the &lt;strong&gt;required and optional subdomains&lt;/strong&gt; for its operation prior to running it.&lt;/p&gt;
&lt;p&gt;Depending on the usecase, you may need any or all of the following domains for XMPP functionality:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;example.org&lt;/strong&gt; - Your XMPP hostname&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;conference.example.org&lt;/strong&gt; - For &lt;code&gt;mod_muc&lt;/code&gt;, Multi User Chats (MUCs)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;upload.example.org&lt;/strong&gt; - For &lt;code&gt;mod_http_upload&lt;/code&gt;, file upload support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;proxy.example.org&lt;/strong&gt; - For &lt;code&gt;mod_proxy65&lt;/code&gt;, SOCKS5 proxy support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pubsub.example.org&lt;/strong&gt; - For &lt;code&gt;mod_pubsub&lt;/code&gt;, publish-subscribe support (A fancier RSS)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Only the &lt;strong&gt;example.org&lt;/strong&gt; domain is required for basic, private chat usage.
If you do &lt;strong&gt;not&lt;/strong&gt; wish to use a certain domain, just disable it&amp;rsquo;s associated module and ejabberd won&amp;rsquo;t complain when it can&amp;rsquo;t find it&amp;rsquo;s associated certificate.
For example, if you don&amp;rsquo;t want &lt;a href=&#34;https://xmpp.org/extensions/xep-0060.html&#34;&gt;Publish-Subscribe&lt;/a&gt; support, just comment out the &lt;code&gt;mod_pubsub&lt;/code&gt; config in &lt;code&gt;/etc/ejabberd.yml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;##  mod_pubsub:&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##    access_createnode: pubsub_createnode&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##    plugins:&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##      - flat&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##      - pep&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##    force_node_config:&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##      ## Avoid buggy clients to make their bookmarks public&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##      storage:bookmarks:&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;##        access_model: whitelist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This guide will assume &lt;strong&gt;all these subdomains&lt;/strong&gt; have been created.&lt;/p&gt;
&lt;h4 id=&#34;custom-subdomains&#34;&gt;Custom Subdomains&lt;/h4&gt;
&lt;p&gt;If you wish to customize any of these domains, edit &lt;code&gt;/etc/ejabberd.yml&lt;/code&gt; and under every appropriate module that needs a subdomain, add the following setting:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_muc&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;host&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;muc.example.org&lt;/mark&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;To get the latest version of ejabberd, you need to first setup the ejabberd apt repositories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl -o /etc/apt/sources.list.d/ejabberd.list https://repo.process-one.net/ejabberd.list
curl -o /etc/apt/trusted.gpg.d/ejabberd.gpg https://repo.process-one.net/ejabberd.gpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then update the repositories and install the &lt;code&gt;ejabberd&lt;/code&gt; package:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update
apt install ejabberd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;The ejabberd server is configured in &lt;code&gt;/etc/ejabberd/ejabberd.yml&lt;/code&gt;.
Changes are only applied by restarting the ejabberd daemon in systemd:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart ejabberd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;hostnames&#34;&gt;Hostnames&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;XMPP hostname&lt;/strong&gt; is specified in the &lt;code&gt;hosts&lt;/code&gt; section of
&lt;code&gt;ejabberd.yml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;hosts&lt;/span&gt;:
  - &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;certificates&#34;&gt;Certificates&lt;/h3&gt;
&lt;p&gt;Unlike &lt;a href=&#34;https://prosody.im&#34;&gt;Prosody,&lt;/a&gt; ejabberd doesn&#39;t come equipped
with a script that can automatically copy over the relevant certificates
to a directory where the ejabberd user can read them.&lt;/p&gt;
&lt;p&gt;One way of organizing certificates for ejabberd is to have them stored
in &lt;code&gt;/etc/ejabberd/certs&lt;/code&gt;, with each domain having a separate directory
for both the fullchain cert and private key.&lt;/p&gt;
&lt;p&gt;Using certbot, this process can be easily automated with these commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;DOMAIN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;example.org&lt;/mark&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;# Set the domain names you want here&lt;/span&gt;
declare -a subdomains&lt;span style=&#34;color:#f92672&#34;&gt;=(&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;conference.&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;proxy.&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;pubsub.&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;upload.&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; i in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;subdomains[@]&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    certbot --nginx -d $i$DOMAIN certonly
    mkdir -p /etc/ejabberd/certs/$i$DOMAIN
    cp /etc/letsencrypt/live/$i$DOMAIN/fullchain.pem /etc/ejabberd/certs/$i$DOMAIN
    cp /etc/letsencrypt/live/$i$DOMAIN/privkey.pem /etc/ejabberd/certs/$i$DOMAIN
&lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Note: Just like with Prosody, you might want to write this script to a file and setup a &lt;a href=&#34;https://landchad.net/cron&#34;&gt;cronjob&lt;/a&gt; to run it periodically. This should help prevent your certificates from expiring.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Make sure all the certificates are readable by the &lt;code&gt;ejabberd&lt;/code&gt; user:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chown -R ejabberd:ejabberd /etc/ejabberd/certs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To enable the use of all these certificates in ejabberd, the following
configuration is necessary:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;certfiles&lt;/span&gt;:
  - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/etc/ejabberd/certs/*/*.pem&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;admin-user&#34;&gt;Admin User&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;admin user&lt;/strong&gt; can be specified in &lt;code&gt;ejabberd.yml&lt;/code&gt; under the &lt;code&gt;acl&lt;/code&gt;
section:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;acl&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;admin&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;user&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;admin&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This would make &lt;strong&gt;&lt;a href=&#34;mailto:admin@example.org&#34;&gt;admin@example.org&lt;/a&gt;&lt;/strong&gt; the user with administrator
privileges.&lt;/p&gt;
&lt;h3 id=&#34;file-uploads&#34;&gt;File Uploads&lt;/h3&gt;
&lt;p&gt;To ensure full compliance with XMPP standards, add the following configuration to &lt;code&gt;mod_http_upload&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_http_upload&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;put_url&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;https://@HOST@:5443/upload&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;docroot&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;/var/www/upload&lt;/mark&gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;custom_headers&lt;/span&gt;:
      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Access-Control-Allow-Origin&amp;#34;: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://@HOST@&amp;#34;&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Access-Control-Allow-Methods&amp;#34;: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;GET,HEAD,PUT,OPTIONS&amp;#34;&lt;/span&gt;
      &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;Access-Control-Allow-Headers&amp;#34;: &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Content-Type&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make sure to create and give the &lt;code&gt;ejabberd&lt;/code&gt; user ownership of &lt;code&gt;/var/www/upload&lt;/code&gt; or any other directory you choose to use for file uploads:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chown -R ejabberd:ejabberd /var/www/upload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;message-archives&#34;&gt;Message Archives&lt;/h3&gt;
&lt;p&gt;The ejabberd server supports keeping archives of messages through its &lt;code&gt;mod_mam&lt;/code&gt; module. This can be enabled by uncommenting the following lines:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_mam&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;assume_mam_usage&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;default&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;always&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;database&#34;&gt;Database&lt;/h2&gt;
&lt;h3 id=&#34;why-use-a-database&#34;&gt;Why use a database?&lt;/h3&gt;
&lt;p&gt;We can find the following comment in the &lt;code&gt;mod_mam&lt;/code&gt; section of &lt;code&gt;/etc/ejabberd.yml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_mam&lt;/span&gt;:
  &lt;span style=&#34;color:#75715e&#34;&gt;## Mnesia is limited to 2GB, better to use an SQL backend&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;## For small servers SQLite is a good fit and is very easy&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;## to configure. Uncomment this when you have SQL configured:&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;## db_type: sql&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As these comments imply, an &lt;strong&gt;SQL backend&lt;/strong&gt; is strongly recommended if you wish to use your ejabberd server for anything more than just testing. Ejabberd supports &lt;strong&gt;MySQL, SQLite&lt;/strong&gt; and &lt;strong&gt;PostgreSQL.&lt;/strong&gt; For the purpose of efficiency, this guide will use &lt;strong&gt;PostgresSQL&lt;/strong&gt; because other server software like &lt;a href=&#34;https://landchad.net/matrix&#34;&gt;Matrix&lt;/a&gt; and &lt;a href=&#34;https://landchad.net/peertube&#34;&gt;PeerTube&lt;/a&gt; support it.&lt;/p&gt;
&lt;h3 id=&#34;installing-postgresql&#34;&gt;Installing PostgreSQL&lt;/h3&gt;
&lt;p&gt;PostgreSQL is available in the Debian repositories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In addition, you will have to install the &lt;strong&gt;appropriate headers for Erlang,&lt;/strong&gt; the language ejabberd is written in, so it can actually interact with the PostgreSQL server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install erlang-p1-pgsql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Start the PostgreSQL daemon to begin using it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl start postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;creating-the-database&#34;&gt;Creating the Database&lt;/h3&gt;
&lt;p&gt;To create the database, first create a PostgreSQL user for ejabberd:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;createuser --pwprompt ejabberd&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, create the database and make &lt;code&gt;ejabberd&lt;/code&gt; its owner:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;psql -c &amp;#39;CREATE DATABASE ejabberd OWNER ejabberd;&amp;#39;&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;importing-database-scheme&#34;&gt;Importing Database Scheme&lt;/h3&gt;
&lt;p&gt;Ejabberd does &lt;strong&gt;not&lt;/strong&gt; create the database scheme by default; It has to be imported into the database before use.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;curl -s https://raw.githubusercontent.com/processone/ejabberd/master/sql/pg.sql | psql ejabberd&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-ejabberd-to-use-postgresql&#34;&gt;Configuring ejabberd to use PostgreSQL&lt;/h3&gt;
&lt;p&gt;Finally, add the following configuration to &lt;code&gt;ejabberd.yml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;sql_type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;pgsql&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;sql_server&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;localhost&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;sql_database&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;ejabberd&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;sql_username&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;ejabberd&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;sql_password&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;psql_password&lt;/mark&gt;&amp;#34;&lt;/span&gt;

&lt;span style=&#34;color:#f92672&#34;&gt;default_db&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;sql&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That line at the end sets &lt;strong&gt;every module&amp;rsquo;s database&lt;/strong&gt; to default to the &lt;code&gt;sql&lt;/code&gt; backend. This includes the &lt;code&gt;mod_mam&lt;/code&gt; module, so all our data is being stored with PostgreSQL.&lt;/p&gt;
&lt;h3 id=&#34;voice-and-video-calls&#34;&gt;Voice and Video Calls&lt;/h3&gt;
&lt;p&gt;Ejabberd supports the &lt;strong&gt;TURN&lt;/strong&gt; and &lt;strong&gt;STUN&lt;/strong&gt; protocols to allow internet users behind NATs to perform voice and video calls with other XMPP users. &lt;strong&gt;This is enabled by default using &lt;a href=&#34;https://docs.ejabberd.im/admin/configuration/listen#ejabberd-stun-1&#34;&gt;ejabberd_stun&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;However,&lt;/strong&gt; if you plan on running ejabberd alongside &lt;strong&gt;other applications&lt;/strong&gt; that require TURN and STUN, such as Matrix, then you&amp;rsquo;ll have to setup your own external TURN server using Coturn.&lt;/p&gt;
&lt;h4 id=&#34;setup-with-coturn-and-mod_stun_disco&#34;&gt;Setup with Coturn and &lt;code&gt;mod_stun_disco&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;Firstly, setup a TURN and STUN server with &lt;a href=&#34;https://landchad.net/coturn&#34;&gt;Coturn,&lt;/a&gt; using an &lt;strong&gt;authentication secret.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Then, edit &lt;code&gt;mod_stun_disco&lt;/code&gt; to contain the appropriate information for
your turnserver:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;mod_stun_disco&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;secret&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;your_auth_secret&lt;/mark&gt;&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
      -
        &lt;span style=&#34;color:#f92672&#34;&gt;host&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;turn.example.org&lt;/mark&gt;&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;stun&lt;/span&gt;
      -
        &lt;span style=&#34;color:#f92672&#34;&gt;host&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;turn.example.org&lt;/mark&gt;&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;turn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;using-ejabberd&#34;&gt;Using ejabberd&lt;/h2&gt;
&lt;h3 id=&#34;registering-the-admin-user&#34;&gt;Registering the Admin User&lt;/h3&gt;
&lt;p&gt;To begin using ejabberd, firstly start the ejabberd daemon:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart ejabberd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, using &lt;code&gt;ejabberdctl&lt;/code&gt; as the ejabberd user, register the admin user which is set in &lt;code&gt;ejabberd.yml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ejabberdctl register &lt;mark&gt;admin example.org password&lt;/mark&gt;&amp;#34;&lt;/span&gt; ejabberd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will create the user &lt;strong&gt;&lt;a href=&#34;mailto:admin@example.org&#34;&gt;admin@example.org&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&#34;using-the-web-interface&#34;&gt;Using the Web Interface&lt;/h3&gt;
&lt;p&gt;By default, ejabberd has a web interface accessible from &lt;strong&gt;&lt;a href=&#34;http://example.org:5280/admin&#34;&gt;http://example.org:5280/admin&lt;/a&gt;&lt;/strong&gt;. When accessing this interface, you will be prompted for the admin credentials:&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/ejabberd-login.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;After signing in with the admin credentials, you will be able to manage
your ejabberd server from this web interface:&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/ejabberd-admin.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;h2 id=&#34;further-configuration&#34;&gt;Further Configuration&lt;/h2&gt;
&lt;p&gt;For a deeper look into all the modules and options, have a look at the following ejabberd documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ejabberd&amp;rsquo;s &lt;a href=&#34;https://docs.ejabberd.im/admin/configuration/listen/&#34;&gt;Listen Modules&lt;/a&gt; and &lt;a href=&#34;https://docs.ejabberd.im/admin/configuration/listen-options/&#34;&gt;Listen Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ejabberd&amp;rsquo;s &lt;a href=&#34;https://docs.ejabberd.im/admin/configuration/toplevel/&#34;&gt;Top-Level Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ejabberd&amp;rsquo;s &lt;a href=&#34;https://docs.ejabberd.im/admin/configuration/modules/&#34;&gt;Modules&#39; Options&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;And with that, you&amp;rsquo;ve successfully setup your ejabberd XMPP server!&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Written by &lt;a href=&#34;https://denshi.org&#34;&gt;Denshi.&lt;/a&gt;
Donate Monero at:
&lt;code&gt;48dnPpGgo8WernVJp5VhvhaX3u9e46NujdYA44u8zuMdETNC5jXiA9S7JoYMM6qRt1ZcKpt1J3RZ3JPuMyXetmbHH7Mnc9C&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Page Quality</title>
		<link>https://landchad.net/page-quality/</link>
		<pubDate>Mon, 21 Mar 2022 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/page-quality/</guid>
		<description>&lt;p&gt;After you&#39;ve deployed your website, you may want to consider improving
its performance, accessibility, and search-engine optimization (SEO).
Doing so can help make your website more user-friendly and increase its
page rank in search results. Luckily, Google provides a &lt;a href=&#34;https://web.dev/measure&#34;&gt;measurement
tool&lt;/a&gt; to help you improve these aspects. Start by
entering your website&#39;s URL and click the &lt;em&gt;Run Audit&lt;/em&gt; button (it will
take 5-10 seconds to generate the report).&lt;/p&gt;
&lt;p&gt;Once the report has finished, you&#39;ll be greeted by a score for four
different categories: &lt;em&gt;Performance&lt;/em&gt;, &lt;em&gt;Accessibility&lt;/em&gt;, &lt;em&gt;Best Practices&lt;/em&gt;,
and &lt;em&gt;SEO&lt;/em&gt;. A lot of the tests listed are self-explanatory, and Google
provides you with articles to help you pass them. Below are some easy
ways to improve your scores, some specific to the nginx configuration
used in the &lt;a href=&#34;https://landchad.net/basic/nginx&#34;&gt;landchad website tutorial.&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;performance&#34;&gt;Performance&lt;/h2&gt;
&lt;h3 id=&#34;serving-static-assets-with-an-efficient-cache-policy&#34;&gt;Serving static assets with an efficient cache policy&lt;/h3&gt;
&lt;p&gt;Serving your files with an efficient cache policy will allow the user&#39;s
browser to cache files such as pictures and CSS so that the browser doesn&#39;t
need to fetch these files each time the page is visited.&lt;/p&gt;
&lt;p&gt;It&#39;s very easy to set this up in nginx. Just paste the following within the
server block of your website&#39;s configuration file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Media: images, icons, video, audio, HTC
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; ~&lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;\.(?:jpg|jpeg|gif|png|ico|svg|webp)&lt;/span&gt;$ {
    &lt;span style=&#34;color:#f92672&#34;&gt;expires&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;1M&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
    &lt;span style=&#34;color:#75715e&#34;&gt;# max-age must be in seconds
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Cache-Control&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;max-age=2629746,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;public&amp;#34;&lt;/span&gt;;
}

&lt;span style=&#34;color:#75715e&#34;&gt;# CSS and Javascript
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; ~&lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;\.(?:css|js)&lt;/span&gt;$ {
    &lt;span style=&#34;color:#f92672&#34;&gt;expires&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;1y&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Cache-Control&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;max-age=31556952,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;public&amp;#34;&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can add more types of file extensions (mp3, mp4, ogg) as you see
fit.&lt;/p&gt;
&lt;p&gt;If you&#39;re changing your CSS files a lot, caching could keep repeat
users from getting the most up-to-date stylesheet. To combat this, you
can version your stylesheets like so:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;link&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;rel&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;stylesheet&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;text/css&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;href&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;style.css?v=1.0.0&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Just increase the version number whenever you update your stylesheet,
and the browser will re-update its cache.&lt;/p&gt;
&lt;h3 id=&#34;enable-text-compression&#34;&gt;Enable text compression&lt;/h3&gt;
&lt;p&gt;Another easy addition to your websites configuration file. Enabling text
compression is easy and will save bandwidth for users. Simply paste the
following within the server block of your website&#39;s configuration file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;gzip&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;gzip_min_length&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1100&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;gzip_buffers&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;32k&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;gzip_types&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/plain&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/x-javascript&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/xml&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/css&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;gzip_vary&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After reloading nginx, you can test if compression is working by opening
your browsers developer tools and going to the network tab. Refresh your
website with the network tab, click on the item with your URL and look
at the response headers. You should see &lt;code&gt;Content-Encoding: gzip&lt;/code&gt; as one
of the headers displayed.&lt;/p&gt;
&lt;h3 id=&#34;properly-sizing-images&#34;&gt;Properly sizing images&lt;/h3&gt;
&lt;p&gt;If you&#39;ve put images on your webpage, you&#39;ve most definitely gotten
this warning. To pass this audit, you&#39;ll need to scale your images down
using a tool like gimp or imagemagick to a size appropriate for your
website. It doesn&#39;t make much sense to serve a high-res image for
images that are rendered much smaller on a webpage.&lt;/p&gt;
&lt;p&gt;Once you&#39;ve scaled your image down, you can use a tool like &lt;code&gt;cwebp&lt;/code&gt; to
convert your images into the .webp format, a format specifically created
for serving bandwidth concious images.&lt;/p&gt;
&lt;p&gt;First, you&#39;ll have to install the webp package:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install webp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now you can easily convert your images to webp (keep in mind that it&#39;s
much more effective to first size your images appropriately before
this). Using the below command, you can specify the quality of the photo
with the &lt;code&gt;q&lt;/code&gt; option. I typically shoot for a quality in the range of
60-80, depending on the image and how large it will be displayed on the
webpage.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cwebp -q &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt; your-photo.png -o your-photo.webp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can now check the difference in size of the images using &lt;code&gt;ls&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ls -lh your-photo*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After utilizing webp images, the audit typically goes away, but if you
didn&#39;t scale your image properly before hand, it may still linger.&lt;/p&gt;
&lt;h2 id=&#34;accessibility&#34;&gt;Accessibility&lt;/h2&gt;
&lt;h3 id=&#34;image-elements-do-not-have-alt-attributes&#34;&gt;Image elements do not have [alt] attributes&lt;/h3&gt;
&lt;p&gt;It may seem silly to add &lt;code&gt;alt&lt;/code&gt; attributes to images, but it helps screen
readers convey images to users and can help page rank as a result. The
&lt;code&gt;alt&lt;/code&gt; attribute should simply describe the image being displayed.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;img&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;src&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;img/cabin.webp&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;alt&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;A cabin nestled between pine trees&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;seo&#34;&gt;SEO&lt;/h2&gt;
&lt;h3 id=&#34;document-does-not-have-a-meta-description&#34;&gt;Document does not have a meta description&lt;/h3&gt;
&lt;p&gt;Adding meta descriptions to your webpage allow for web-crawlers and bots
to easily determine what content your website contains. Just like on
other online platforms, you can give your webpage a long list of
keywords to help increase the chance someone stumbles upon your site
from a search engine. You don&#39;t need to add all of the below meta tags
to pass the audit, only add what&#39;s necessary.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!--- Instructions for web scrapers ---&amp;gt;&lt;/span&gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;robots&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;index, follow&amp;#34;&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your website description&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;keywords&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your, keywords, here&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;author&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your name&amp;#34;&lt;/span&gt;&amp;gt;

&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!--- Facebook specific standard, but many websites use this so it has become almost standard to include ---&amp;gt;&lt;/span&gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:site_name&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Site Name&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:domain&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:domain&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example.org&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:title&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:title&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Site Name&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:description&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your website description&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:description&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:description&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;your website description&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:image&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://link-to-an-image-that-represents-your-site&amp;#34;&lt;/span&gt;&amp;gt;

&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!--- below is for twitter sharing previews
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;you can test this at cards-dev.twitter.com ---&amp;gt;&lt;/span&gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:card&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://link-to-an-image-that-represents-your-site&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:image:src&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:image:src&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://link-to-an-image-that-represents-your-site&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:image&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:image&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://link-to-an-image-that-represents-your-site&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:image:alt&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:image:alt&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;alt text for your image&amp;#34;&lt;/span&gt;&amp;gt;

&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:url&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;example.org&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;og:type&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;website&amp;#34;&lt;/span&gt;&amp;gt;

&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!--- If you have accounts on twitter or facebook that are relevant to your site ---&amp;gt;&lt;/span&gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;fb:admins&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;facebook group&amp;#34;&lt;/span&gt; &amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:site&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:site&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;@yourTwitterHandle&amp;#34;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;meta&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:creator&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;property&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;twitter:creator&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;content&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;@yourTwitterHandle&amp;#34;&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Written by &lt;a href=&#34;https://mccor.xyz&#34;&gt;Jacob.&lt;/a&gt; Donate Monero
&lt;a href=&#34;https://mccor.xyz&#34;&gt;here.&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Radicale</title>
		<link>https://landchad.net/radicale/</link>
		<pubDate>Thu, 07 Oct 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/radicale/</guid>
		<description>&lt;p&gt;Radicale is an open source calDAV server. CalDAV is a widely supported
internet standard for calendars, todo-lists and contacts. Hosting your
own calDAV server allows sharing calendars between mutliple devices.&lt;/p&gt;
&lt;p&gt;More information can be found on the projects offical website:
&lt;a href=&#34;https://radicale.org/v3.html&#34;&gt;radicale.org&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;installing-radicale&#34;&gt;Installing Radicale&lt;/h2&gt;
&lt;p&gt;Firstly, we have to install radicale on our system, luckily for us
radicale is packaged for the most used distros.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install radicale apache2-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next we need to configure Radicale. We configure radicale to be
accessible from other machines, how Radicale handles users and where the
files should be stored. Open /etc/radicale/config with your favourite
editor and add this configuration.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[server]&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# Bind all addresses&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;hosts &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 0.0.0.0:5232, [::]:5232&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[auth]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;type &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; htpasswd&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;htpasswd_filename &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; /etc/radicale/users&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;htpasswd_encryption &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; bcrypt&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[storage]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;filesystem_folder &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; /var/lib/radicale/collections&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see under [auth] we use htpasswd to manage the users.
Execute the following command to add a new user to Radicale.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;htpasswd -B -c /etc/radicale/users username
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To create additional users, htpasswd is used again but without the additional modifier.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;htpasswd -B /etc/radicale/users username2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As Radicale stands now it is fully functional and after starting it by
executing its binary, can be accessed under example.org:5232. But there
are two additional things we can do to make using and managing Radicale
way easier.&lt;/p&gt;
&lt;h3 id=&#34;setting-up-a-nginx-reverse-proxy&#34;&gt;Setting up a Nginx reverse proxy&lt;/h3&gt;
&lt;p&gt;Because the URL of your Radicale server is an URL you will have to
remember and enter it on any device you want to use your calendar on it
is advised to set up a reverse proxy.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;cal.example.org&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:5232/&lt;/span&gt;; &lt;span style=&#34;color:#75715e&#34;&gt;# The / is important!
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    }
    &lt;span style=&#34;color:#75715e&#34;&gt;# You can also leave these two lines out and use certbot
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/ssl/nginx/cal.example.com/fullchain.pem&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/ssl/nginx/cal.example.com/privkey.pem&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;run-as-a-service&#34;&gt;Run as a service&lt;/h3&gt;
&lt;p&gt;Running Radicale as a service makes managing it much easier. Add this
config to /etc/systemd/system/radicale.service.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;A simple CalDAV (calendar) and CardDAV (contact) server&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/usr/bin/env python3 -m radicale&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Restart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;on-failure&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;default.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After creating the config load, start and enable the service with the
following commands.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl daemon-reload
systemctl enable --now radicale
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;p&gt;Author: Jocomol &amp;ndash; &lt;a href=&#34;https://jocomol.ch&#34;&gt;jocomol.ch&lt;/a&gt; -- XMR:
&lt;code&gt;41kLv68Nk4N3zvTRFYtHZfRRFMgXkxK2FcXDeCSa4yNwBGTBa1WQ8HtXL8cCAcoZ2iSLBCS6HQqdpRSf56ecMBgWTkn2ARt&lt;/code&gt;{.crypto}&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Cgit</title>
		<link>https://landchad.net/cgit/</link>
		<pubDate>Tue, 14 Sep 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/cgit/</guid>
		<description>&lt;p&gt;Once you have your server hosting your git repositories, you might want
to allow others to browse your repositories on the web. Cgit is a Free
Software that allows browsing git repositories through the web.&lt;/p&gt;
&lt;p&gt;Note that Cgit is a read-only frontend for Git repositories and doesn&#39;t
have issues, pull requests or user management. If that&#39;s what you want,
consider installing &lt;a href=&#34;https://landchad.net/gitea&#34;&gt;Gitea&lt;/a&gt; instead.&lt;/p&gt;
&lt;h2 id=&#34;installing-cgit-and-fcgiwrap&#34;&gt;Installing cgit and fcgiwrap&lt;/h2&gt;
&lt;h3 id=&#34;install-fcgiwrap&#34;&gt;Install fcgiwrap&lt;/h3&gt;
&lt;p&gt;NGINX doesn&#39;t have the capability to run CGI scripts by itself, it
depends on an intermediate layer like fcgiwrap to run CGI scripts like
cgit:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install fcgiwrap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And now we can install cgit itself with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install cgit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;setting-up-nginx&#34;&gt;Setting up NGINX&lt;/h2&gt;
&lt;p&gt;You should have an NGINX server running with a TLS certificate by now.
Add the following configuration to your server to pass the requests to
Cgit, while serving static files directly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/ssl/nginx/&lt;mark&gt;git.example.org&lt;/mark&gt;.crt&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/ssl/nginx/&lt;mark&gt;git.example.org&lt;/mark&gt;.key&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;git.example.org&lt;/mark&gt;&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/usr/share/cgit&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri &lt;span style=&#34;color:#e6db74&#34;&gt;@cgit&lt;/span&gt; ;

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;/.+/(info/refs|git-upload-pack)&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt;             &lt;span style=&#34;color:#e6db74&#34;&gt;fastcgi_params&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt;       &lt;span style=&#34;color:#e6db74&#34;&gt;SCRIPT_FILENAME&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/usr/lib/git-core/git-http-backend&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt;       &lt;span style=&#34;color:#e6db74&#34;&gt;PATH_INFO&lt;/span&gt;           $uri;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt;       &lt;span style=&#34;color:#e6db74&#34;&gt;GIT_HTTP_EXPORT_ALL&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt;       &lt;span style=&#34;color:#e6db74&#34;&gt;GIT_PROJECT_ROOT&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;/var/git&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt;       &lt;span style=&#34;color:#e6db74&#34;&gt;HOME&lt;/span&gt;                &lt;span style=&#34;color:#e6db74&#34;&gt;/var/git&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/run/fcgiwrap.socket&lt;/span&gt;;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;@cgit&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;fastcgi_params&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;SCRIPT_FILENAME&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/usr/lib/cgit/cgit.cgi&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;PATH_INFO&lt;/span&gt; $uri;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;QUERY_STRING&lt;/span&gt; $args;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;HTTP_HOST&lt;/span&gt; $server_name;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/run/fcgiwrap.socket&lt;/span&gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then get NGINX to reload your configuration. This configuration also enables
cloning via HTTPS, so make sure to point the &lt;code&gt;fastcgi_param GIT_PROJECT_ROOT&lt;/code&gt;
to the directory where you store your repositories.&lt;/p&gt;
&lt;h2 id=&#34;configuring-cgit&#34;&gt;Configuring cgit&lt;/h2&gt;
&lt;p&gt;You&#39;ve got cgit up and running now, but you&#39;ll probably see it without
any style and without any repository. To change this, we need to
configure Cgit to our liking, by editing &lt;code&gt;/etc/cgitrc&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;css=/cgit.css
logo=/cgit.svg
virtual-root=/
clone-prefix=https://&lt;mark&gt;git.example.org&lt;/mark&gt;

# Title and description shown on top of each page
root-title=&lt;mark&gt;Chad&#39;s git server&lt;/mark&gt;
root-desc=&lt;mark&gt;A web interface to LandChad&#39;s git repositories, powered by Cgit&lt;/mark&gt;

# The location where git repos are stored on the server
scan-path=/var/git/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This configuration assumes you followed the &lt;a href=&#34;https://landchad.net/git&#34;&gt;git hosting guide&lt;/a&gt;
and store your repositories on the &lt;code&gt;/var/git/&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;Cgit&#39;s configuration allows changing many settings, as documented on
the cgitrc(5) manpage installed with Cgit.&lt;/p&gt;
&lt;h3 id=&#34;changing-the-displayed-repository-owner&#34;&gt;Changing the displayed repository owner&lt;/h3&gt;
&lt;p&gt;Cgit&#39;s main page shows each repo&#39;s owner, which is &amp;quot;git&amp;quot; in case you
followed the git hosting guide, but you might want to change the name to
yours. Cgit shows the owner&#39;s system name, so you need to modify the
git user to give it your name:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;usermod -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;Your Name&lt;/mark&gt;&amp;#34;&lt;/span&gt; git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;changing-the-repository-description&#34;&gt;Changing the repository description&lt;/h3&gt;
&lt;p&gt;Navigate to your bare repository on the server and edit the
&lt;code&gt;description&lt;/code&gt; file inside it&lt;/p&gt;
&lt;h3 id=&#34;displaying-the-repository-idle-time&#34;&gt;Displaying the repository idle time&lt;/h3&gt;
&lt;p&gt;To do this, we need to create a post-receive hook for each repository
that updates the file cgit uses to determine the idle time. Inside your
repository, create a file &lt;code&gt;hooks/post-receive&lt;/code&gt; and add the following
contents:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/sh
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;
agefile&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;git rev-parse --git-dir&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;/info/web/last-modified

mkdir -p &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;dirname &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$agefile&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt;
git &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt;-each-ref &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    --sort&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;-authordate --count&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    --format&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;%(authordate:iso8601)&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;    &amp;gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;$agefile&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And give it execution permissions with:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chmod +x hooks/post-receive
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next time you push to that repository, the idle time should reset and
show the correct value.&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ariel Costas &amp;ndash; &lt;a href=&#34;https://costas.dev&#34;&gt;website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Calibre</title>
		<link>https://landchad.net/calibre/</link>
		<pubDate>Tue, 03 Aug 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/calibre/</guid>
		<description>&lt;p&gt;The Calibre library server is a great way to store your eBooks. It
allows you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Share your books with others.&lt;/li&gt;
&lt;li&gt;Easily transfer your books between devices and access them from
anywhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Install the Calibre package. You might also want rsync to upload books.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install -y calibre rsync
mkdir /opt/calibre
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Either upload your existing library using &lt;code&gt;rsync&lt;/code&gt;. For example to
&lt;code&gt;/opt/calibre/&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd ~/Documents
rsync -avuP your-library-dir root@&lt;mark&gt;example.org&lt;/mark&gt;:/opt/calibre/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or create a library and add a book to it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd /opt/calibre
calibredb add book.epub --with-library your-library
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For more information about the &lt;code&gt;calibredb&lt;/code&gt; command see &lt;code&gt;man calibredb&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Add a new user to protect your server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;calibre-server --manage-users
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;creating-a-service&#34;&gt;Creating a service&lt;/h2&gt;
&lt;p&gt;Create a new file &lt;code&gt;/etc/systemd/system/calibre-server.service&lt;/code&gt; and add
the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;Calibre library server&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;simple&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;User&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;root&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Group&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;root&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibre/your_library --listen-on 127.0.0.1&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can change the port with the &lt;code&gt;--port&lt;/code&gt; prefix. Additional information
&lt;code&gt;man calibre-server&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Issue &lt;code&gt;systemctl daemon-reload&lt;/code&gt; to apply the changes.&lt;/p&gt;
&lt;p&gt;Enable and start the service.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl enable calibre-server
systemctl start calibre-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;a-reverse-proxy-with-nginx&#34;&gt;A reverse proxy with Nginx&lt;/h2&gt;
&lt;p&gt;Create a new file &lt;code&gt;/etc/nginx/sites-available/calibre&lt;/code&gt; and enter the
following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;client_max_body_size&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;64M&lt;/span&gt;; &lt;span style=&#34;color:#75715e&#34;&gt;# to upload large books
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;calibre.example.org&lt;/mark&gt;&lt;/span&gt; ;

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://127.0.0.1:8080&lt;/span&gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Issue a Let&#39;s Encrypt certificate. &lt;a href=&#34;https://landchad.net/basic/certbot&#34;&gt;Detailed instructions and additional information&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now just go to &lt;strong&gt;calibre.example.org&lt;/strong&gt;. The server will request an
username and a password.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/calibre/calibre-1.png&#34; alt=&#34;calibre&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;After login you will see something like this.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/calibre/calibre-2.png&#34; alt=&#34;calibre&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;p&gt;Author: rflx &amp;ndash; &lt;a href=&#34;https://rflx.xyz&#34;&gt;website&lt;/a&gt; -- XMR:
&lt;code&gt;48T5XpHTXAZ5Nn8YCypA4aWn1ffQLHJkFGDArXQB6cmrP6cqLY72cu7CR2iq2MmL5Ndu3d47e5MKjGpL4prYgdrTCFAHD9c&lt;/code&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Jitsi</title>
		<link>https://landchad.net/jitsi/</link>
		<pubDate>Sat, 31 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/jitsi/</guid>
		<description>&lt;p&gt;&lt;dfn&gt;Jitsi&lt;/dfn&gt; is a set of open-source projects that allows you to easily
build and deploy secure video conferencing solutions.&lt;/p&gt;
&lt;p&gt;Is really easy to install, and also a really good private, federated and
libre alternative to Zoom or other video conferencing software. You can
create calls just by typing the URL, and loging-in is not necessary.&lt;/p&gt;
&lt;h2 id=&#34;dependencies-and-installation&#34;&gt;Dependencies and Installation&lt;/h2&gt;
&lt;p&gt;First, install some dependencies:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install gpg apt-transport-https nginx python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Jitsi has its own package repository, so let&#39;s add it.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;curl https://download.jitsi.org/jitsi-key.gpg.key | gpg --dearmor &amp;gt; /usr/share/keyrings/jitsi-keyring.gpg
echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/&amp;#39;&lt;/span&gt; &amp;gt; /etc/apt/sources.list.d/jitsi-stable.list
apt update -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ok. So now we can install Jitsi, but before we do that, let&#39;s setup the
firewall &lt;code&gt;ufw&lt;/code&gt;, in case you have it enabled, and the SSL certificate.&lt;/p&gt;
&lt;h2 id=&#34;enable-required-ports&#34;&gt;Enable Required Ports&lt;/h2&gt;
&lt;p&gt;If you are using &lt;a href=&#34;https://landchad.net/ufw&#34;&gt;ufw&lt;/a&gt; or another firewall, there are several
ports we need to ensure are open:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 10000/udp
ufw allow 3478/udp
ufw allow 5349/tcp
ufw enable
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For your information, these allow the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;80 TCP &amp;ndash; Certbot.&lt;/li&gt;
&lt;li&gt;443 TCP &amp;ndash; General access to Jitsi Meet.&lt;/li&gt;
&lt;li&gt;10000 UDP &amp;ndash; General network video/audio communications.&lt;/li&gt;
&lt;li&gt;3478 UDP &amp;ndash; Quering the stun server (&lt;a href=&#34;https://landchad.net/coturn&#34;&gt;Coturn&lt;/a&gt;, optional, needs config.js change to enable it).&lt;/li&gt;
&lt;li&gt;5349 TCP &amp;ndash; Fallback network video/audio communications over TCP (when UDP is blocked for example), served by &lt;a href=&#34;https://landchad.net/coturn&#34;&gt;Coturn&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;ssl-certificate&#34;&gt;SSL certificate&lt;/h2&gt;
&lt;p&gt;I&#39;ll be using &lt;a href=&#34;https://landchad.net/basic/certbot&#34;&gt;certbot&lt;/a&gt; and
&lt;a href=&#34;https://landchad.net/basic/nginx&#34;&gt;Nginx&lt;/a&gt; to generate a certificate for the
Jitsi subdomain to allow encrypted connections.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx certonly -d &lt;mark&gt;meet.example.org&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We will not create an Nginx config file for Jitsi because the Jitsi
package we will be installing will do that automatically.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;To begin the installation process, just run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install jitsi-meet
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will ask you for your &lt;code&gt;hostname&lt;/code&gt;; there you&#39;ll need to input the
subdomain you have just added to Nginx, like &lt;code&gt;&lt;mark&gt;meet.example.org&lt;/mark&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For the SSL certificate, choose &lt;code&gt;I want to use my own certificate&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When it ask you for the certification key and cert files, input
&lt;code&gt;/etc/letsencrypt/live/&lt;mark&gt;meet.example.org&lt;/mark&gt;/privkey.pem&lt;/code&gt; and
&lt;code&gt;/etc/letsencrypt/live/&lt;mark&gt;meet.example.org&lt;/mark&gt;/fullchain.pem&lt;/code&gt; respectively.&lt;/p&gt;
&lt;h2 id=&#34;using-jitsi&#34;&gt;Using Jitsi&lt;/h2&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/jitsi-01.webp&#34; alt=&#34;Jitsi once installed&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Jitsi can be used in a browser by then just going to &lt;code&gt;&lt;mark&gt;meet.example.org&lt;/mark&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that there are also Jitsi clients for all major platforms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://desktop.jitsi.org/Main/Download.html&#34;&gt;Desktop&lt;/a&gt; (Windows,
MacOS, GNU/Linux)&lt;/li&gt;
&lt;li&gt;Android (&lt;a href=&#34;https://f-droid.org/en/packages/org.jitsi.meet/&#34;&gt;F-Droid&lt;/a&gt;
and &lt;a href=&#34;https://play.google.com/store/apps/details?id=org.jitsi.meet&#34;&gt;Google
Play&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://apps.apple.com/us/app/jitsi-meet/id1165103905&#34;&gt;iPhone/iOS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;When using a Jitsi app for the first time, remember to go to the
&amp;quot;Settings&amp;quot; menu and change your server name to the Jitsi site you just
created.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When you create a video chatroom, its address will appear as
&lt;code&gt;meet.example.org/yourvideochatname&lt;/code&gt; and can be shared as such.&lt;/p&gt;
&lt;h2 id=&#34;security&#34;&gt;Security&lt;/h2&gt;
&lt;p&gt;By default, anyone who has access to &lt;strong&gt;meet.example.org&lt;/strong&gt; will be able
to create a chatroom. You probably don&#39;t want that, so you&#39;ll need to
set up some authentication. The simplest option is to handle
authentication through the local &lt;a href=&#34;https://landchad.net/prosody&#34;&gt;Prosody&lt;/a&gt; user
database.&lt;/p&gt;
&lt;h3 id=&#34;prosody-configuration&#34;&gt;Prosody configuration&lt;/h3&gt;
&lt;p&gt;First, we need to enable password authentication in
&lt;a href=&#34;https://landchad.net/prosody&#34;&gt;Prosody&lt;/a&gt;. Edit
&lt;code&gt;/etc/prosody/conf.avail/&lt;mark&gt;meet.example.org&lt;/mark&gt;.cfg.lua&lt;/code&gt;, and locate this
block:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-lua&#34; data-lang=&#34;lua&#34;&gt;VirtualHost &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;meet.example.org&lt;/mark&gt;&amp;#34;&lt;/span&gt;
    authentication &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;anonymous&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And change the authentication mode from &lt;code&gt;&amp;quot;anonymous&amp;quot;&lt;/code&gt; to
&lt;code&gt;&amp;quot;internal_hashed&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then, to enable guests to login and join your chatrooms, add the
following block &lt;strong&gt;after&lt;/strong&gt; the one you just edited:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-lua&#34; data-lang=&#34;lua&#34;&gt;VirtualHost &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;guest.&lt;mark&gt;meet.example.org&lt;/mark&gt;&amp;#34;&lt;/span&gt;
    authentication &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;anonymous&amp;#34;&lt;/span&gt;
    c2s_require_encryption &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;jitsi-meet-configuration&#34;&gt;Jitsi Meet configuration&lt;/h3&gt;
&lt;p&gt;Next, in &lt;code&gt;/etc/jitsi/meet/&lt;mark&gt;meet.example.org&lt;/mark&gt;-config.js&lt;/code&gt;, uncomment the
following line:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;config&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {
    &lt;span style=&#34;color:#a6e22e&#34;&gt;hosts&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; {
        &lt;span style=&#34;color:#75715e&#34;&gt;// anonymousdomain: &amp;#39;guest.jitsi-meet.example.com&amp;#39;,
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    },
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And change &lt;code&gt;&#39;guest.jitsi-meet.example.com&#39;&lt;/code&gt; to
&lt;code&gt;&#39;&lt;mark&gt;guest.meet.example.org&lt;/mark&gt;&#39;&lt;/code&gt; (your Jitsi domain preceded by &lt;code&gt;meet.&lt;/code&gt;).&lt;/p&gt;
&lt;h3 id=&#34;jicofo-configuration&#34;&gt;Jicofo configuration&lt;/h3&gt;
&lt;p&gt;Finally, we configure Jicofo to only allow the creation of conferences
when the request is coming from an authenticated user. To do so, add the
following &lt;code&gt;authentication&lt;/code&gt; section to &lt;code&gt;/etc/jitsi/jicofo/jicofo.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;jicofo {&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;authentication&lt;/span&gt;: {
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;XMPP&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;login-url&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;meet.example.org&lt;/mark&gt;&lt;/span&gt;
 }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;create-users-in-prosody-and-restart-the-services&#34;&gt;Create users in Prosody and restart the services&lt;/h3&gt;
&lt;p&gt;You now need to register some users in &lt;a href=&#34;https://landchad.net/prosody&#34;&gt;Prosody&lt;/a&gt;, you
can do so manually using &lt;code&gt;prosodyctl&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;prosodyctl register &amp;lt;username&amp;gt; meet.example.org &amp;lt;password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, restart &lt;code&gt;prosody&lt;/code&gt;, &lt;code&gt;jicofo&lt;/code&gt;, and &lt;code&gt;jitsi-videobridge2&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart prosody
systemctl restart jicofo
systemctl restart jitsi-videobridge2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;more-info&#34;&gt;More info&lt;/h2&gt;
&lt;p&gt;This article is based on &lt;a href=&#34;https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart&#34;&gt;the original
documentation&lt;/a&gt;.
There you can find more details and configurations.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Written by &lt;a href=&#34;https://josefabio.com&#34;&gt;Jose Fabio.&lt;/a&gt;
Donate Monero:
&lt;code&gt;484RLdsXQCDGSthNatGApRPTyqcCbM3PkM97axXezEuPZppimXmwWegiF3Et4BHBgjWR7sVXuEUoAeVNpBiVznhoDLqLV7j&lt;/code&gt;
&lt;a href=&#34;https://josefabio.com/figures/monero.jpg&#34;&gt;[QR]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Edited and revised by &lt;a href=&#34;https://lukesmith.xyz&#34;&gt;Luke&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>PeerTube</title>
		<link>https://landchad.net/peertube/</link>
		<pubDate>Sat, 31 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/peertube/</guid>
		<description>&lt;p&gt;PeerTube is a self-hosted and (optionally) federated video sharing
platform that saves bandwith on videos the more people watch. PeerTube
instances can follow each other to share videos and grow the federated
network, but you can always keep your instance to yourself if you choose
to.&lt;/p&gt;
&lt;h2 id=&#34;note-on-bandwidth&#34;&gt;Note on Bandwidth&lt;/h2&gt;
&lt;p&gt;Video sharing is the most bandwidth intensive thing on the internet! If
you plan on just having a small personal site with a few viewers and
friends, that won&#39;t be a big concern, but most VPS providers like Vultr
have caps on how much bandwidth can be used within a month without being
throttled. This level is far beyond what most sites need, but it might
be an issue with a video site!&lt;/p&gt;
&lt;p&gt;So if you plan on having a big video-sharing PeerTube site, it&#39;s a good
idea to host it with a provider that offers infinite bandwidth. I
strongly recommend getting a separate VPS with
&lt;a href=&#34;https://my.frantech.ca/aff.php?aff=3886&#34;&gt;Frantech/BuyVM&lt;/a&gt;. They have
unmetered bandwidth, extremely cheap block storage for hosting many,
many videos and they even have a good record of being censorship
resistant.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Most&lt;/strong&gt; of PeerTube&#39;s dependencies can be installed with this command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install -y curl sudo unzip vim ffmpeg postgresql postgresql-contrib g++ make redis-server git python-dev cron wget
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&#39;s also important to start all associated daemons:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl start postgresql redis
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;PeerTube also requires &lt;strong&gt;NodeJS 14&lt;/strong&gt; and &lt;strong&gt;yarn&lt;/strong&gt; which cannot be
installed from the Debian repositories. This means they have to be
installed from separate, external repos:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
apt install -y nodejs
npm install --global yarn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we create a PeerTube user to run and handle PeerTube with the proper
permissions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;database&#34;&gt;Database&lt;/h2&gt;
&lt;p&gt;PeerTube requires a PostgreSQL database to function. To create it, first
make a new Postgres user named PeerTube:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;su -l postgres
createuser -P peertube
createdb -O peertube -E UTF8 -T template0 peertube_prod
psql -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;CREATE EXTENSION pg_trgm;&amp;#34;&lt;/span&gt; peertube_prod
psql -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;CREATE EXTENSION unaccent;&amp;#34;&lt;/span&gt; peertube_prod
exit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Be sure to &lt;strong&gt;make note of your Postgres user password,&lt;/strong&gt; as it will be
needed later when setting up PeerTube.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Using &lt;code&gt;su -l&lt;/code&gt;, we will become the PeerTube user to create the required
directories and download and install PeerTube itself with the proper
permissions. First, we create the required directories.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -l peertube
mkdir config storage versions
chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;750&lt;/span&gt; config
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;downloading-peertube&#34;&gt;Downloading PeerTube&lt;/h3&gt;
&lt;p&gt;Still as the PeerTube user, we can now check for the most recent
PeerTube versions number, download and install it in the newly created
&lt;code&gt;versiond&lt;/code&gt; directory.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;VERSION&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt; -f 4&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;
cd /var/www/peertube/versions
wget &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://github.com/Chocobozzz/PeerTube/releases/download/&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;VERSION&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/peertube-&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;VERSION&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.zip&amp;#34;&lt;/span&gt;
unzip peertube-&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;VERSION&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;.zip
rm peertube-&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;VERSION&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;installation-via-yarn&#34;&gt;Installation via Yarn&lt;/h3&gt;
&lt;p&gt;The downloaded release can then be symbolically linked to
&lt;code&gt;/var/www/peertube/peertube-latest&lt;/code&gt; and &lt;strong&gt;yarn&lt;/strong&gt; is used to install
PeerTube:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd /var/www/peertube
ln -s versions/peertube-&lt;span style=&#34;color:#e6db74&#34;&gt;${&lt;/span&gt;VERSION&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt; ./peertube-latest
cd ./peertube-latest
yarn install --production --pure-lockfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;PeerTube&#39;s default config file can be copied over to
&lt;code&gt;/var/www/peertube/config/production.yaml&lt;/code&gt; so it can actually be used:&lt;/p&gt;
&lt;p&gt;Note that we are still running these as the PeerTube user (having run
&lt;code&gt;su -l peertube&lt;/code&gt;).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd /var/www/peertube
cp peertube-latest/config/production.yaml.example config/production.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now the &lt;code&gt;production.yaml&lt;/code&gt; file must be edited in the following ways:&lt;/p&gt;
&lt;p&gt;First, add the hostname:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;webserver&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;https&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;hostname&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;example.org&amp;#39;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;port&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, the database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;database&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;hostname&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;port&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5432&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;ssl&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;suffix&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;_prod&amp;#39;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;username&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;peertube&amp;#39;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;password&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;your_password&amp;#39;&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;pool&lt;/span&gt;:
     &lt;span style=&#34;color:#f92672&#34;&gt;max&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;An email to generate the admin user:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;admin&lt;/span&gt;:
  &lt;span style=&#34;color:#75715e&#34;&gt;# Used to generate the root user at first startup&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;# And to receive emails from the contact form&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;email&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;chad@example.org&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And &lt;strong&gt;optionally,&lt;/strong&gt; email server information:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;smtp&lt;/span&gt;:
  &lt;span style=&#34;color:#75715e&#34;&gt;# smtp or sendmail&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;transport&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;smtp&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;# Path to sendmail command. Required if you use sendmail transport&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;sendmail&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;null&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;hostname&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;mail.example.org&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;port: 465 # If you use StartTLS&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;587&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;username&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;your_email_username&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;password&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;your_email_password&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;tls: true # If you use StartTLS&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;disable_starttls&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;ca_file&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;null&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;# Used for self signed certificates&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;from_address&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;admin@example.org&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, we have done all we need to do as the PeerTube user. Run
&lt;code&gt;exit&lt;/code&gt; or press &lt;kbd&gt;Ctrl-d&lt;/kbd&gt; to log out and return to the root prompt where
we will configure Nginx and other system settings.&lt;/p&gt;
&lt;h2 id=&#34;certbot&#34;&gt;Certbot&lt;/h2&gt;
&lt;p&gt;First, we will want a Certbot SSL certificate to encrypt connections to
our PeerTube instance. Just run the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx -d peertube.example.org certonly
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;nginx&#34;&gt;Nginx&lt;/h2&gt;
&lt;p&gt;PeerTube includes an Nginx configuration that can be copied over to
&lt;code&gt;/etc/nginx/sites-available:&lt;/code&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Because the PeerTube config is so long, it&#39;s recommended to use &lt;code&gt;sed&lt;/code&gt;
to modify the contents of the file, replacing &lt;code&gt;${WEBSERVER_HOST}&lt;/code&gt; with
your hostname, and &lt;code&gt;$(PEERTUBE_HOST)&lt;/code&gt; with your localhost and port,
which by default should be &lt;code&gt;127.0.0.1:9000&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;sed -i &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;s/${WEBSERVER_HOST}/example.org/g&amp;#39;&lt;/span&gt; /etc/nginx/sites-available/peertube
sed -i &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;s/${PEERTUBE_HOST}/127.0.0.1:9000/g&amp;#39;&lt;/span&gt; /etc/nginx/sites-available/peertube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you&#39;re happy with the Nginx config file, link it to
&lt;code&gt;sites-enabled&lt;/code&gt; to activate it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;running-peertube&#34;&gt;Running PeerTube&lt;/h2&gt;
&lt;p&gt;A config file for a systemd daemon is included in PeerTube and can be
setup and started like so:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
systemctl daemon-reload
systemctl start peertube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;PeerTube will take a minute or so to start, but after it does, you can check
its status with &lt;code&gt;systemctl status peertube&lt;/code&gt; and at this point, your
PeerTube site should be live!&lt;/p&gt;
&lt;h2 id=&#34;using-peertube&#34;&gt;Using PeerTube&lt;/h2&gt;
&lt;p&gt;To set a password for your admin user, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd /var/www/peertube/peertube-latest
NODE_CONFIG_DIR&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/var/www/peertube/config NODE_ENV&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;production npm run reset-password -- -u root
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Login to your PeerTube instance using the admin email specified in your
&lt;code&gt;production.yaml&lt;/code&gt; file and the admin password you just set.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/peertube-login.jpg&#34; alt=&#34;PeerTube login&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Once logged in, it&#39;s recommended to create a separate user without
admin privileges for uploading videos to PeerTube. This can be done
easily from the users tab in the administration section.&lt;/p&gt;
&lt;p&gt;Enjoy your PeerTube instance!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;updating-peertube&#34;&gt;Updating PeerTube&lt;/h2&gt;
&lt;p&gt;PeerTube is constantly adding new features, so it&#39;s a good idea to
&lt;a href=&#34;https://github.com/Chocobozzz/PeerTube/blob/develop/CHANGELOG.md&#34;&gt;check for new
updates&lt;/a&gt;
and add them if you wish. Just in the past year, they have added
livestreaming and more.&lt;/p&gt;
&lt;p&gt;Updating is fairly easy now since an &lt;code&gt;upgrade.sh&lt;/code&gt; script has been added.
Just run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd /var/www/peertube/peertube-latest/scripts &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo -H -u peertube ./upgrade.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Although check the
&lt;a href=&#34;https://github.com/Chocobozzz/PeerTube/blob/develop/CHANGELOG.md&#34;&gt;changelog&lt;/a&gt;
to see if there are additional manual requirements for particular
updates.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Written by &lt;a href=&#34;https://denshi.org&#34;&gt;Denshi.&lt;/a&gt; Donate Monero
&lt;a href=&#34;https://denshi.org/donate.html&#34;&gt;here&lt;/a&gt;
&lt;a href=&#34;https://denshi.org/images/monero.jpg&#34;&gt;[QR]&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Server-Side Scripting with CGI</title>
		<link>https://landchad.net/cgi/</link>
		<pubDate>Sun, 25 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/cgi/</guid>
		<description>&lt;p&gt;The basic website tutorial here describes how to set up a static website
&amp;mdash; one that just serves HTML files saved on your server, and until you
change something manually, the same content will be served each time a
given page is requested. This is perfectly enough for most personal
website needs. This is how blogs should be implemented, instead of
relying on bloatware like WordPress!&lt;/p&gt;
&lt;p&gt;But sometimes you genuinely &lt;em&gt;do&lt;/em&gt; need something more. You need your
website to serve different contents depending on the time, on who the
requester is, on the contents of a database, or maybe process user input
from a form.&lt;/p&gt;
&lt;h2 id=&#34;cgi&#34;&gt;CGI&lt;/h2&gt;
&lt;p&gt;CGI, or the Common Gateway Interface, is a specification to allow you,
the server owner, to program your web server using pretty much any
programming language you might know. The specification is almost as old
as the Internet itself and for a long time CGI scripting was the primary
method of creating dynamic websites.&lt;/p&gt;
&lt;p&gt;CGI is a very simple specification indeed. You write a script in your
favorite language, the script receives input about the request in
environment variables, and whatever you print to the standard output
will be the response. Most likely, though, you will want to use a
library for your language of choice that makes a lot of this
request/response handling simpler (e.g. parsing query parameters for
you, setting appropriate headers, etc.).&lt;/p&gt;
&lt;h3 id=&#34;limitations-of-cgi&#34;&gt;Limitations of CGI&lt;/h3&gt;
&lt;p&gt;While in theory you could implement any sort of functionality with CGI
scripts, it&#39;s going to get difficult managing a lot of separate scripts
if they&#39;re supposed to be working in tandem to implement a dynamic
website. If you want to build a full out web application, you&#39;d
probably be better off learning a web framework than gluing together
Perl scripts.&lt;/p&gt;
&lt;p&gt;That said, just as most of the web could be replaced with static
websites, much of the remaining non-static web could be replaced with a
few simple scripts, rather than bloated Ruby on Rails or Django
applications.&lt;/p&gt;
&lt;h2 id=&#34;lets-write-a-cgi-script&#34;&gt;Let&#39;s write a CGI script!&lt;/h2&gt;
&lt;p&gt;We&#39;ll implement a simple example CGI script. I&#39;ll use Ruby for this
tutorial, but you&#39;ll be able to follow along even if you don&#39;t know
Ruby, just treat it as pseudocode then find a CGI library for your
language.&lt;/p&gt;
&lt;h3 id=&#34;the-working-example&#34;&gt;The working example&lt;/h3&gt;
&lt;p&gt;Our working example will be the Lazy Calculator. Yeah, you&#39;re probably
tired of seeing calculator examples in every programming tutorial, but
have you ever implemented one that takes the weekends off?&lt;/p&gt;
&lt;p&gt;Here&#39;s how it will work. When in a browser you submit a request to your
website like&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;example.com/calculator.html?a=10&amp;amp;b=32
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;you will receive a page with the result of the addition of 10 and 32:
42.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Unless&lt;/em&gt; you send your request on a weekend. Then the website will
respond with&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;I don&amp;#39;t get paid to work on weekends! Come back Monday.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This example will show a few things that CGI scripts can do that you
wouldn&#39;t have been able to get using just file hosting in your web
server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;getting inputs from the user;&lt;/li&gt;
&lt;li&gt;getting external information (here just the system time, but you
could imagine instead connecting to a database);&lt;/li&gt;
&lt;li&gt;using the above to create dynamic output.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;the-code&#34;&gt;The code&lt;/h3&gt;
&lt;p&gt;Here&#39;s an implementation of the lazy calculator as a Ruby CGI script:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/env ruby&lt;/span&gt;

require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;cgi&amp;#39;&lt;/span&gt;
require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;date&amp;#39;&lt;/span&gt;

cgi &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;CGI&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;new
today &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Date&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;today

a &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; cgi&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;].&lt;/span&gt;to_i
b &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; cgi&lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;].&lt;/span&gt;to_i

&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; today&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;saturday? &lt;span style=&#34;color:#f92672&#34;&gt;||&lt;/span&gt; today&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;sunday?
  cgi&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;out &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;I don&amp;#39;t get paid to work on weekends! Come back Monday.&amp;#34;&lt;/span&gt;
  &lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt;
  cgi&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;out &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt;
    (a &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; b)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;to_s
  &lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&#39;s go through what&#39;s happening here.&lt;/p&gt;
&lt;h3 id=&#34;the-shebang-line&#34;&gt;The shebang line&lt;/h3&gt;
&lt;p&gt;CGI works by pointing your web server to an executable program. A Ruby
or Python script by itself is not immediately executable by a computer.
But on Unix-like systems you can specify the program that will be able
to execute your file in its first line if it starts with &lt;code&gt;#!&lt;/code&gt; (known as
the shebang; read more about it on
&lt;a href=&#34;https://en.wikipedia.org/wiki/Shebang_(Unix)&#34;&gt;Wikipedia&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;So if you&#39;re going to be using a scripting language, you&#39;ll probably
need the appropriate shebang line at the top of your script. If you use
a compiled language, you&#39;ll just point your web server to the compiled
executable binary.&lt;/p&gt;
&lt;h3 id=&#34;query-parameters&#34;&gt;Query parameters&lt;/h3&gt;
&lt;p&gt;The next interesting lines of code are where we set the variables &lt;code&gt;a&lt;/code&gt;
and &lt;code&gt;b&lt;/code&gt;. Here we are getting user inputs from the request.&lt;/p&gt;
&lt;p&gt;In the example request we mentioned above
(&lt;code&gt;example.com/calculator.html?a=10&amp;amp;b=32&lt;/code&gt;), the part starting from the
question mark, &lt;code&gt;?a=10&amp;amp;b=32&lt;/code&gt;, is the &lt;em&gt;query string&lt;/em&gt;. This is how users
can submit parameters with their web requests. Usually these parameters
are set by e.g. a form on your website, but in our simple example we&#39;ll
be just manually manipulating the URL.&lt;/p&gt;
&lt;p&gt;The query string contains key-value pairs. The Ruby CGI library makes
them available in the &lt;code&gt;CGI&lt;/code&gt; object it provides. We just need to index it
with the desired key, and we&#39;ll get the corresponding value.&lt;/p&gt;
&lt;h3 id=&#34;wrapping-it-up&#34;&gt;Wrapping it up&lt;/h3&gt;
&lt;p&gt;The remaining parts of the code should be pretty self-explanatory. We
get today&#39;s date, check if it&#39;s a Saturday or a Sunday, and depending
on that, we instruct the CGI library to output either the answer, or a
&amp;quot;come back later&amp;quot; message.&lt;/p&gt;
&lt;p&gt;The Ruby library by default returns an HTML response, so we really
should have wrapped our outputs in some &lt;code&gt;html&lt;/code&gt;, &lt;code&gt;body&lt;/code&gt;, etc. tags.
Alternatively, we could have specified that the response is just plain
text with&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;cgi.out &amp;#39;text/plain&amp;#39; do
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In general, your CGI library will probably have ways of specifying all
sorts of HTTP response headers, like status code, content type, etc.&lt;/p&gt;
&lt;h2 id=&#34;making-it-work&#34;&gt;Making it work&lt;/h2&gt;
&lt;p&gt;We have a CGI script, now let&#39;s point our web server to it.&lt;/p&gt;
&lt;h3 id=&#34;installing-fastcgi&#34;&gt;Installing FastCGI&lt;/h3&gt;
&lt;p&gt;If you&#39;re using Nginx, install &lt;code&gt;fcgiwrap&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install fcgiwrap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This installs the necessary packages for Nginx to use FastCGI &amp;mdash; a
layer between your web server and CGI script that allows for faster
handling of scripts than if the web server had to handle it all by
itself.&lt;/p&gt;
&lt;p&gt;Other web servers will probably have a similarly simple way of enabling
FastCGI, or you can look into other methods for launching CGI scripts.&lt;/p&gt;
&lt;h3 id=&#34;nginx-configuration&#34;&gt;Nginx configuration&lt;/h3&gt;
&lt;p&gt;In the configuration file for your website, add something like the
following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/calculator.html&lt;/span&gt; {
  &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;fastcgi_params&lt;/span&gt;;
  &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;SCRIPT_FILENAME&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/usr/local/bin/lazy-calculator.rb&lt;/span&gt;;
  &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;QUERY_STRING&lt;/span&gt; $query_string;
  &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/run/fcgiwrap.socket&lt;/span&gt;;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;fastcgi_param&lt;/code&gt; directives specify various parameters for FastCGI.
&lt;code&gt;SCRIPT_FILENAME&lt;/code&gt; should point to your executable. For &lt;code&gt;QUERY_STRING&lt;/code&gt;,
we just copy Nginx&#39;s &lt;code&gt;$query_string&lt;/code&gt; variable. You might want to pass
other information to your CGI script as well, see for example &lt;a href=&#34;https://wiki.debian.org/nginx/FastCGI&#34;&gt;the
Debian wiki&lt;/a&gt; for a more detailed
example, including pointing to an entire directory of CGI scripts,
rather than adding each one by hand to your web server config.&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Martin Chrzanowski -- &lt;a href=&#34;https://m-chrzan.xyz&#34;&gt;website&lt;/a&gt;,
&lt;a href=&#34;https://m-chrzan.xyz/donate.html&#34;&gt;donate&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Image compression</title>
		<link>https://landchad.net/imgcompress/</link>
		<pubDate>Sat, 17 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/imgcompress/</guid>
		<description>&lt;p&gt;Image files will usually have the most impact on the speed of your
websites (aside from Ad/tracker scripts). Learn to slim down your images
using the ubiquitous &lt;em&gt;ImageMagick&lt;/em&gt; to make your websites faster on slow
internet connections.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/imgcompress-network.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/imgcompress-network.png&#34; alt=&#34;Image network speed&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;For the examples, I decided to use
&lt;a href=&#34;https://commons.wikimedia.org/wiki/File:Tabby_cat_with_blue_eyes-3336579.jpg&#34;&gt;this&lt;/a&gt;
public domain image.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/imgcompress-cat.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/imgcompress-cat.png&#34; alt=&#34;Compressed image of a cat&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;There are many ways to decrease image size using ImageMagick, the
simplest is to use the &lt;code&gt;-quality&lt;/code&gt; option, which will compress the image
without changing the resolution. This option takes the value you want to
compress by (between 1 and 100, the lower the value, the lower the file
size). For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;convert in.jpg -quality 50 out.jpg
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Compressing the example image above results in the following file size
changes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  Quality    Size
  ---------- ------
  Original   2.1M
  90         1.7M
  80         844K
  70         588K
  60         448K
  50         368K
  40         308K
  30         248K
  20         184K
  10         116K
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Due to the images high resolution, it is usable in this website even
when highly compressed (30% quality, still looks decent in my opinion).&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://na20a.neocities.org/&#34;&gt;Musse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Monero:
&lt;code&gt;83is3y69Xv4fkFsTpZhw5c3bfxtimupfgTdpERHM1WtMNAwSqFjTCJm3VabyBKXKnL873dWPmqj4bRcgkm9oCktgQrzmhHd&lt;/code&gt;{.crypto}&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Matrix Synapse</title>
		<link>https://landchad.net/matrix/</link>
		<pubDate>Fri, 16 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/matrix/</guid>
		<description>&lt;p&gt;Matrix is easy-to-use, decentralized and encrypted private chat software. Matrix is federated, meaning that with a Matrix account on any server, including your own, you can talk to any other Matrix account on
the internet, similar to email. Matrix also allows fully end-to-end encrypted group chats.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Synapse&lt;/strong&gt; is the name of the default Matrix server. It is written in Python. While it is requires somewhat more system resources than &lt;a href=&#34;https://landchad.net/prosody&#34;&gt;an XMPP server&lt;/a&gt;, it makes up for that in being very accessible to non-technical users.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;The latest version of Synapse is not in the Debian package repositories by default, but we can easily add Matrix&amp;rsquo;s repository including it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install -y lsb-release wget apt-transport-https
wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;lsb_release -cs&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; main&amp;#34;&lt;/span&gt; &amp;gt; /etc/apt/sources.list.d/matrix-org.list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After we update our packages lists, we will be able to install Synapse with &lt;code&gt;apt&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update
apt install matrix-synapse-py3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When prompted, give your main domain name (not a subdomain). This will be the domain appended to your Matrix address, e.g. &lt;code&gt;@chad:&lt;mark&gt;landchad.net&lt;/mark&gt;&lt;/code&gt;. (&lt;em&gt;If you want to run Synapse under a different subdomain than the actual server name,&lt;/em&gt; then you must set up &lt;a href=&#34;https://matrix-org.github.io/synapse/latest/delegate.html&#34;&gt;delegation.&lt;/a&gt;)&lt;/p&gt;
&lt;h2 id=&#34;nginx-configuration&#34;&gt;Nginx configuration&lt;/h2&gt;
&lt;p&gt;Create an Nginx configuration file for Matrix, say &lt;code&gt;/etc/nginx/sites-available/matrix&lt;/code&gt; and add the content below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;matrix.example.org&lt;/mark&gt;&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt;;

        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;
       
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;8448&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:8448&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;default_server&lt;/span&gt;; 
    
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~&lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^(\/_matrix|\/_synapse|\/_client)&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:8008&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Forwarded-For&lt;/span&gt; $remote_addr;
                &lt;span style=&#34;color:#f92672&#34;&gt;client_max_body_size&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;50M&lt;/mark&gt;&lt;/span&gt;;
        }

        &lt;span style=&#34;color:#75715e&#34;&gt;# These sections are required for client and federation discovery
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# (AKA: Client Well-Known URI)
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/matrix/client&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;m.homeserver&amp;#34;:&lt;/span&gt; {&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;base_url&amp;#34;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://&lt;mark&gt;matrix.example.org&lt;/mark&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;}}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;default_type&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/json&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Access-Control-Allow-Origin&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt;;
        }

        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/matrix/server&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;m.server&amp;#34;:&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;matrix.example.org&lt;/mark&gt;:443&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;default_type&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/json&lt;/span&gt;;
                &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Access-Control-Allow-Origin&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt;;
        }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note the &lt;code&gt;client_max_body_size&lt;/code&gt; variable. By default, Nginx caps the size of files it can transfer. We increase that to 50M if needed by Matrix. (Note however that both Matrix and Nginx have seperate settings for this and to raise it to something much larger, you will have to increase the value in both configuration files.)&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s enable the Nginx Matrix site and run &lt;strong&gt;certbot&lt;/strong&gt; to get an encryption certificate and restart Nginx.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/matrix /etc/nginx/sites-enabled
certbot --nginx -d &lt;mark&gt;matrix.example.org&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;h3 id=&#34;read-the-config-file&#34;&gt;Read the config file&lt;/h3&gt;
&lt;p&gt;The configuration file for Matrix is in &lt;code&gt;/etc/matrix-synapse/homeserver.yaml&lt;/code&gt;. It is well documented and
commented, so you can read about the settings, but let&amp;rsquo;s change the essential ones here.&lt;/p&gt;
&lt;p&gt;Make what changes you want and run &lt;code&gt;systemctl reload matrix-synapse&lt;/code&gt; to make the system configuration active.&lt;/p&gt;
&lt;h3 id=&#34;database-setup&#34;&gt;Database Setup&lt;/h3&gt;
&lt;p&gt;Synapse, like &lt;a href=&#34;https://landchad.net/peertube&#34;&gt;PeerTube&lt;/a&gt; and &lt;a href=&#34;https://landchad.net/prosody&#34;&gt;Prosody&lt;/a&gt;, supports &lt;strong&gt;PostgreSQL&lt;/strong&gt; as a database backend. This can &lt;strong&gt;significantly increase performance,&lt;/strong&gt; epsecially if you&amp;rsquo;re already running PostgreSQL to run any other services.&lt;/p&gt;
&lt;p&gt;Begin by installing PostgreSQL:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then start the daemon:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now create a user named &lt;code&gt;synapse_user&lt;/code&gt; to manage your database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;createuser --pwprompt synapse_user&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And finally, create the actual database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;psql -c &amp;#39;CREATE DATABASE synapse ENCODING &amp;#39;UTF8&amp;#39; LC_COLLATE=&amp;#39;C&amp;#39; LC_CTYPE=&amp;#39;C&amp;#39; template=template0 OWNER synapse_user;&amp;#39;&amp;#34;&lt;/span&gt; postgres
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now edit the database configuration in &lt;code&gt;/etc/matrix-synapse/homeserver.yaml&lt;/code&gt; and comment out the following lines for the previous SQLite configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yml&#34; data-lang=&#34;yml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# database:&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;# name: sqlite3&lt;/span&gt;
  &lt;span style=&#34;color:#75715e&#34;&gt;# args:&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# database: DATADIR/homeserver.db&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Note: The example above is how yours should look like after it&amp;rsquo;s commented out.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then, uncomment the following configuration above, and set the appropriate entries:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;database&lt;/span&gt;:
  &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;psycopg2&lt;/span&gt;
  &lt;span style=&#34;color:#f92672&#34;&gt;args&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;user&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;synapse_user&lt;/mark&gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;password&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;secretpassword&lt;/mark&gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;database&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;synapse&lt;/mark&gt;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;host&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;localhost&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;cp_min&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;cp_max&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ensure that &lt;code&gt;synapse&lt;/code&gt; is set to your database name, &lt;code&gt;synapse_user&lt;/code&gt; is set to that database&amp;rsquo;s owner, and that &lt;code&gt;secretpassword&lt;/code&gt; is set to that user&amp;rsquo;s password.&lt;/p&gt;
&lt;h3 id=&#34;adding-users-and-admins&#34;&gt;Adding Users and Admins&lt;/h3&gt;
&lt;p&gt;If you allow open registration on your server in the configuration file, you can create an account through Element or another Matrix client, but you are probably going to want an official admin account to use. To make one, simply run the following command, which will then give you several choices for creating a user, among which will be the ability to make it an admin.&lt;/p&gt;
&lt;p&gt;Before setting up the admin user, make sure to set a &lt;code&gt;registration_shared_secret&lt;/code&gt; in &lt;code&gt;/etc/matrix-synapse/homserver.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;registration_shared_secret&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;???&lt;/mark&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, run the following command to register a user:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;register_new_matrix_user -c /etc/matrix-synapse/homeserver.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command will prompt you for a username, password and whether to make the user an admin or not.&lt;/p&gt;
&lt;h3 id=&#34;voice-and-video-calls&#34;&gt;Voice and Video Calls&lt;/h3&gt;
&lt;p&gt;For native voice and video call support, the Synapse homserver needs to interface with a working &lt;strong&gt;TURN and STUN Server.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First, follow the guide on installing and setting up &lt;a href=&#34;https://landchad.net/coturn&#34;&gt;coturn&lt;/a&gt;, setting either a shared secret or username-password pair for authentication.&lt;/p&gt;
&lt;p&gt;Then, in &lt;code&gt;/etc/matrix-synapse/homeserver.yaml&lt;/code&gt;, edit the configuration as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;turn_uris&lt;/span&gt;: [ &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;turn:&lt;mark&gt;turn.example.org&lt;/mark&gt;?transport=udp&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;turn:&lt;mark&gt;turn.example.org&lt;/mark&gt;?transport=tcp&amp;#34;&lt;/span&gt; ]

&lt;span style=&#34;color:#75715e&#34;&gt;## This is how long call credentials are valid. Lessen to prevent abuse.&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;turn_user_lifetime&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;86400000&lt;/span&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;## Keep this enabled unless for security reasons.&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;turn_allow_guests&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you&amp;rsquo;re using a shared secret, add the following config:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;turn_shared_secret&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;your secret here&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Otherwise, add this config if you&amp;rsquo;re using username-password pairs:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;turn_username&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;turnserver_username&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;turn_password&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;turnserver_password&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;url-previews&#34;&gt;URL Previews&lt;/h3&gt;
&lt;p&gt;To enable server-generated previews of webpages, change this line to true in &lt;code&gt;/etc/matrix-synapse/homeserver.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;url_preview_enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And &lt;strong&gt;make sure to uncomment&lt;/strong&gt; the &lt;code&gt;url_preview_ip_range_blacklist:&lt;/code&gt; section; Otherwise, Synapse will refuse to start up again!&lt;/p&gt;
&lt;h3 id=&#34;federation&#34;&gt;Federation&lt;/h3&gt;
&lt;p&gt;Using the Nginx configuration provided with this guide, federation should work out of the box with Synapse. You can test whether it&amp;rsquo;s working using the &lt;a href=&#34;https://federationtester.matrix.org/&#34;&gt;Matrix Federation Tester.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, some extra features can be enabled to increase the usability of your homeserver over federation. In &lt;code&gt;/etc/matrix-synapse/homeserver.yaml&lt;/code&gt;, the following lines can be edited:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;allow_public_rooms_over_federation&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This can be un-commented to allow users to add your homserver to their list of servers (in a client like Element) and see a list of all the public rooms.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;allow_public_rooms_without_auth&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This can be un-commented to enable guests to see public rooms without authenticating.&lt;/p&gt;
&lt;h2 id=&#34;using-matrix-with-element-matrix-logopixelementsvgelement&#34;&gt;Using Matrix with &lt;img src=&#34;https://landchad.net/pix/element.svg&#34; alt=&#34;Element Matrix logo&#34;&gt;Element&lt;/h2&gt;
&lt;p&gt;There are many different &lt;a href=&#34;https://matrix.org/clients/&#34;&gt;clients&lt;/a&gt; that can be used on desktops or phones to chat on your Matrix server, but the most popular and most widely vetted is &lt;img src=&#34;https://landchad.net/pix/element.svg&#34; alt=&#34;Element logo&#34;&gt;Element.&lt;/p&gt;
&lt;p&gt;Get Element to access your Matrix server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mobile:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://f-droid.org/packages/im.vector.app/&#34;&gt;F-droid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.google.com/store/apps/details?id=im.vector.app&#34;&gt;Google Play&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://apps.apple.com/app/vector/id1083446067&#34;&gt;Apple App Store&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Real computer:
&lt;ul&gt;
&lt;li&gt;GNU/Linux: You know how to install it.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://packages.riot.im/desktop/install/win32/x64/Element%20Setup.exe&#34;&gt;Windows&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://packages.riot.im/desktop/install/macos/Element.dmg&#34;&gt;Mac&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note also that Element has a web client (i.e. a version that can be accessed on your own website) that is also easy to install on an Nginx server, although that will be covered in another article.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Certbot and HTTPS</title>
		<link>https://landchad.net/basic/certbot/</link>
		<pubDate>Tue, 13 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/basic/certbot/</guid>
		<description>&lt;p&gt;Once you have a website, it is extremely important to enable encrypted
connections over HTTPS/SSL. You might have no idea what that means, but
it&#39;s easy to do now that we&#39;ve &lt;a href=&#34;https://landchad.net/basic/nginx/&#34;&gt;set our web server up&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Certbot is a program that automatically creates and deploys the
certificates that allow encrypted connections. It used to be painful
(and often expensive) to do this, but now it&#39;s all free and automatic.&lt;/p&gt;
&lt;h2 id=&#34;why-is-encryption-important&#34;&gt;Why is encryption important?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;With HTTPS, users&#39; ISPs cannot snoop on what they are looking at on
your website. They know that they have connected, but the particular
pages they visit are private as everything is encrypted. HTTPS
increases user privacy.&lt;/li&gt;
&lt;li&gt;If you later create usernames and passwords for any service on your
site, lack of encryption can compromise that private data! Most
well-designed software will automatically &lt;em&gt;prevent&lt;/em&gt; any unencrypted
connections over the internet.&lt;/li&gt;
&lt;li&gt;Search engines like Google favor pages with HTTPS over unencrypted
HTTP.&lt;/li&gt;
&lt;li&gt;You get the official-looking green 🔒 symbol in the URL bar in most
browsers which makes normies subtly trust your site more.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;lets-do-it&#34;&gt;Let&#39;s do it!&lt;/h2&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/nginx-website.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/nginx-website.png&#34; alt=&#34;website without https/ssl&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Note in this picture that a browser accessing your site will say &amp;quot;Not
secure&amp;quot; or something else to notify you that we are using an
unencrypted HTTP connection rather than an encrypted HTTPS one.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Just run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install python3-certbot-nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And this will install &lt;code&gt;certbot&lt;/code&gt; and its module for &lt;code&gt;nginx&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;run&#34;&gt;Run&lt;/h2&gt;
&lt;p&gt;As I mentioned in the previous article, firewalls might interfere with
certbot, so you will want to either disable your firewall or at least
ensure that it allows connections on ports 80 and 443:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let&#39;s run certbot:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot --nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command will ask you for your email. This is so when the
certificates need to be renewed in three months, you will get an email
about it. You can set the certificates to renew automatically, but it&#39;s
a good idea to check it the first time to ensure it renewed properly.
You can avoid giving your email by running the command with the
&lt;code&gt;--register-unsafely-without-email&lt;/code&gt; option as well.&lt;/p&gt;
&lt;p&gt;Agree to the terms, and optionally consent to give your email to the EFF
(I recommend against this obviously).&lt;/p&gt;
&lt;p&gt;Once all that is done, it will ask you what domains you want a
certificate for. You can just press enter to select all.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/certbot-01.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/certbot-01.png&#34; alt=&#34;activate HTTPS for a site with certbot&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;It will take a moment to create the certificate, but afterwards, you
will be asked if you want to automatically redirect all connections to
be encrypted. Since this is preferable, choose 2 to Redirect.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/certbot-02.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/certbot-02.png&#34; alt=&#34;redirecting http to encrypted https with certbot&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;h3 id=&#34;checking-for-success&#34;&gt;Checking for success&lt;/h3&gt;
&lt;p&gt;You should now be able to go to your website and see that there is a
🔒 lock icon or some other notification that you are now on an encrypted
connection.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/certbot-03.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/certbot-03.png&#34; alt=&#34;A 🔒 symbol symbolizing our new HTTPS layer for our website!&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;h2 id=&#34;setting-up-certificate-renewal&#34;&gt;Setting up certificate renewal&lt;/h2&gt;
&lt;p&gt;As I mentioned in passing, the Certbot certificates last for 3 months.
To renew certificates, you just have to run &lt;code&gt;certbot --nginx renew&lt;/code&gt; and
it will renew any certificates close to expiry.&lt;/p&gt;
&lt;p&gt;Of course, you don&#39;t want to have to remember to log in to renew them
every three months, so it&#39;s easy to tell the server to automatically
run this command. We will use a &lt;a href=&#34;https://landchad.net/cron&#34;&gt;cronjob&lt;/a&gt; for this. Run the
following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;crontab -e
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There might be a little menu that pops up asking what text editor you
prefer when you run this command. If you don&#39;t know how to use vim,
choose &lt;code&gt;nano&lt;/code&gt;, the first option.&lt;/p&gt;
&lt;p&gt;This &lt;code&gt;crontab&lt;/code&gt; command will open up a file for editing. A crontab is a
list of commands that your operating system will run automatically at
certain times. We are going to tell it to automatically try to renew our
certificates every month so we never have to.&lt;/p&gt;
&lt;p&gt;Create a new line at the end of the file and add this content:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;0 0 1 * * certbot --nginx renew
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Save the file and exit to activate this cronjob.&lt;/p&gt;
&lt;p&gt;For more on cron and crontabs please &lt;a href=&#34;https://landchad.net/cron&#34;&gt;click here!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You now have a live website on the internet. You can add to it what you
wish.&lt;/p&gt;
&lt;p&gt;As you add content to your site, there are many other things you can
also install linked on &lt;a href=&#34;https://landchad.net/&#34;&gt;the main page&lt;/a&gt;, and many more
improvements, tweaks and bonuses.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Setting Up an NginX Webserver</title>
		<link>https://landchad.net/basic/nginx/</link>
		<pubDate>Sat, 10 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/basic/nginx/</guid>
		<description>&lt;p&gt;At this point, we should have a domain name and a server and the domain
name should direct to the IP address of the server with DNS records. As
I said in previous articles, the instructions I will give will be for
&lt;strong&gt;Debian&lt;/strong&gt;. In this article, other distributions might work a little
differently.&lt;/p&gt;
&lt;h2 id=&#34;logging-in-to-the-server&#34;&gt;Logging in to the server&lt;/h2&gt;
&lt;p&gt;We first want to log into our VPS to get a command prompt where we can
set up the web server. I am assuming you are using either MacOS or
GNU/Linux and you know how to open a terminal. On Windows, you can also
use either PuTTY or the Windows Subsystem for Linux.&lt;/p&gt;
&lt;p&gt;Now on Vultr&#39;s site, you can click on your VPS and you will see that
there is an area that shows you the password for your server at the
bottom here.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/nginx-password.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/nginx-password.png&#34; alt=&#34;Find your password&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Now pull up a terminal and type:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh root@&lt;mark&gt;example.org&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command will attempt to log into your server. It should prompt you
for your password, and you can just copy or type in the password from
Vultr&#39;s site.&lt;/p&gt;
&lt;p&gt;If you get an error here, you might not have done your &lt;a href=&#34;https://landchad.net/basic/dns&#34;&gt;DNS
settings&lt;/a&gt; right. Double check those. Note you can also replace
the &lt;code&gt;example.org&lt;/code&gt; with your IP address, but you&#39;ll want to fix your DNS
settings soon.&lt;/p&gt;
&lt;h2 id=&#34;installing-the-webserver-nginx&#34;&gt;Installing the Webserver: Nginx&lt;/h2&gt;
&lt;p&gt;If the program runs without an error, &lt;code&gt;ssh&lt;/code&gt; has now logged you into your
server. Let&#39;s start by running the following commands.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update
apt upgrade
apt install nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first command checks for packages that can be updated and the second
command installs any updates.&lt;/p&gt;
&lt;p&gt;The third command installs &lt;code&gt;nginx&lt;/code&gt; (pronounced Engine-X), which is the
web server we&#39;ll be using, along with some other programs.&lt;/p&gt;
&lt;h3 id=&#34;our-nginx-configuration-file&#34;&gt;Our nginx configuration file&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;nginx&lt;/code&gt; is your webserver. You can make a little website or page, put it
on your VPS and then tell &lt;code&gt;nginx&lt;/code&gt; where it is and how to host it on the
internet. It&#39;s simple. Let&#39;s do it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nginx&lt;/code&gt; configuration files are in &lt;code&gt;/etc/nginx/&lt;/code&gt;. The two main
subdirectories in there (on Debian and similar OSes) are
&lt;code&gt;/etc/nginx/sites-available&lt;/code&gt; and &lt;code&gt;/etc/nginx/sites-enabled&lt;/code&gt;. The names
are descriptive. The idea is that you can make a site configuration file
in &lt;code&gt;sites-available&lt;/code&gt; and when it&#39;s all ready, you make a link/shortcut
to it in &lt;code&gt;sites-enabled&lt;/code&gt; which will activate it.&lt;/p&gt;
&lt;p&gt;First, let&#39;s create the settings for our website. You can copy and
paste (with required changes) but I will also explain what the lines do.&lt;/p&gt;
&lt;p&gt;Create a file in &lt;code&gt;/etc/nginx/sites-available&lt;/code&gt; by doing this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nano /etc/nginx/sites-available/&lt;mark&gt;mywebsite&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that &amp;quot;nano&amp;quot; is a command line text editor. You will now be able
to create and edit this file. By saving, this file will now appear. Note
also I name the file &lt;code&gt;mywebsite&lt;/code&gt;, but you can name it whatever you&#39;d
like.&lt;/p&gt;
&lt;p&gt;I&#39;m going to add the following content to the file. The content &lt;strong&gt;like
this&lt;/strong&gt; will be different depending on what you want to call your site.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/&lt;mark&gt;mysite&lt;/mark&gt;&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.html&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.htm&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.nginx-debian.html&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
                &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt; ;
        }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;explanation-of-those-settings&#34;&gt;Explanation of those settings&lt;/h4&gt;
&lt;p&gt;The &lt;code&gt;listen&lt;/code&gt; lines tell &lt;code&gt;nginx&lt;/code&gt; to listen for connections on both IPv4
and IPv6.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;server_name&lt;/code&gt; is the website that we are looking for. By putting
&lt;code&gt;landchad.net&lt;/code&gt; here, that means whenever someone connects to this server
and is looking for that address, they will be directed to the content in
this block.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;root&lt;/code&gt; specifies the directory we&#39;re going to put our website files in.
This can theoretically be wherever, but it is conventional to have them
in &lt;code&gt;/var/www/&lt;/code&gt;. Name the directory in that whatever you want.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;index&lt;/code&gt; determine what the &amp;quot;default&amp;quot; file is; normally when you go to
a website, say &lt;code&gt;landchad.net&lt;/code&gt;, you are actually going to a file at
&lt;code&gt;landchad.net/index.html&lt;/code&gt;. That&#39;s all that is. Note that that this in
concert with the line above mean that &lt;code&gt;/var/www/landchad/index.html&lt;/code&gt;, a
file on our computer that we&#39;ll create, will be the main page of our
website.&lt;/p&gt;
&lt;p&gt;Lastly, the &lt;code&gt;location&lt;/code&gt; block is really just telling the server how to
look up files, otherwise throw a 404 error. Location settings are very
powerful, but this is all we need them for now.&lt;/p&gt;
&lt;h3 id=&#34;create-the-directory-and-index-for-the-site&#34;&gt;Create the directory and index for the site&lt;/h3&gt;
&lt;p&gt;We&#39;ll actually start making a &amp;quot;real&amp;quot; website later, but let&#39;s go
ahead and create a little page that will appear when someone looks up
the domain.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir /var/www/&lt;mark&gt;mysite&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let&#39;s create an index file inside of that directory, which will
appear when the website is accessed:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nano /var/www/&lt;mark&gt;mysite&lt;/mark&gt;/index.html
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&#39;ll add the following basic content, but you can add whatever you
want. This will appear on your website.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;h1&lt;/span&gt;&amp;gt;My website!&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;h1&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;This is my website. Thanks for stopping by!&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;Now my website is live!&amp;lt;/&lt;span style=&#34;color:#f92672&#34;&gt;p&lt;/span&gt;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;enable&#34;&gt;Enable the site&lt;/h3&gt;
&lt;p&gt;Once you save that file, we can enable it making a link to it in the
&lt;code&gt;sites-enabled&lt;/code&gt; directory:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/&lt;mark&gt;mywebsite&lt;/mark&gt; /etc/nginx/sites-enabled
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we can just &lt;code&gt;reload&lt;/code&gt; or &lt;code&gt;restart&lt;/code&gt; to make &lt;code&gt;nginx&lt;/code&gt; service the new
configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;firewall&#34;&gt;The Firewall&lt;/h2&gt;
&lt;p&gt;Vultr and some other VPSes automatically install and enable &lt;code&gt;ufw&lt;/code&gt;, a
firewall program. This will block basically everything by default, so we
have to change that. If you don&#39;t have &lt;code&gt;ufw&lt;/code&gt; installed, you can skip
this section.&lt;/p&gt;
&lt;p&gt;We must open up at least ports 80 and 443 as below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Port 80 is the canonical webserver port, while 443 is the port used for
encrypted connections. We will certainly need that for the next page.&lt;/p&gt;
&lt;aside&gt;
&lt;p&gt;As you add more services to your website, they might need you to open more ports, but that will be mentioned on individual articles.
(It should be noted that some local services run only for other services on your machine, so you &lt;em&gt;don&amp;rsquo;t&lt;/em&gt; need to open ports for every process running locally, &lt;em&gt;only&lt;/em&gt; those that directly interact with the internet, although it&amp;rsquo;s common to run those through Nginx for simplicity and security.)&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&#34;nginx-security-hint&#34;&gt;Nginx security hint&lt;/h2&gt;
&lt;p&gt;By default, Nginx and most other webservers automatically show their
version number on error pages. It&#39;s a good idea to disable this from
happening because if an exploit comes out for your server software,
someone could exploit it. Open the main Nginx config file
&lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt; and find the line &lt;code&gt;# server_tokens off;&lt;/code&gt;.
Uncomment it, and reload Nginx.&lt;/p&gt;
&lt;p&gt;Remember to &lt;a href=&#34;https://landchad.net/../maintenance#update&#34;&gt;keep your server software up to
date&lt;/a&gt; to get the latest security fixes!&lt;/p&gt;
&lt;h2 id=&#34;we-now-have-a-running-website&#34;&gt;We now have a running website!&lt;/h2&gt;
&lt;p&gt;At this point you can now type in your website in your browser and this
webpage will appear!&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/nginx-website.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/nginx-website.png&#34; alt=&#34;The webpage as it appears.&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Note the &amp;quot;Not secure&amp;quot; notification. The next brief step is securing
encrypted connections to your website.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Connect Your Domain and Server with DNS Records</title>
		<link>https://landchad.net/basic/dns/</link>
		<pubDate>Wed, 07 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/basic/dns/</guid>
		<description>&lt;h2 id=&#34;the-gist&#34;&gt;The Gist&lt;/h2&gt;
&lt;p&gt;Now that we have a &lt;a href=&#34;https://landchad.net/basic/domain&#34;&gt;domain&lt;/a&gt; and a &lt;a href=&#34;https://landchad.net/basic/server&#34;&gt;server&lt;/a&gt;, we
can connect the two using DNS records. DNS (domain name system) records
are usually put into your registrar and direct people looking up your
website to the server where your website and other things will be.&lt;/p&gt;
&lt;p&gt;Get your IPv4/IPv6 addresses from your VPS provider and put them into A/AAAA
records on your registrar. Simple process, takes a minute, but here&#39;s a guide
with a million images just so you know.&lt;/p&gt;
&lt;h2 id=&#34;open-up-your-registrar&#34;&gt;Open up your Registrar&lt;/h2&gt;
&lt;p&gt;As before, we will be using any registrar of your choice and
&lt;a href=&#34;https://www.vultr.com/?ref=8384069-6G&#34;&gt;Vultr&lt;/a&gt; as a server host. Go ahead and
log into your accounts on both. Open up your registrar, or your registrar, and
click on your domain and then a choice for &amp;quot;DNS records.&amp;quot; You&amp;rsquo;ll want to see
something like this on your registrar&amp;rsquo;s site.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-epik.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-epik.png&#34; alt=&#34;Blank records&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Note that we are on the &amp;quot;External Hosts (A, AAAA)&amp;quot; tab by default. There may
be default settings set by your registrar. If there are, you can go ahead and
delete them so they look clean like the picture above.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;All we have to do now is get our IP addresses from Vultr and add new
DNS records that will send connections to our server.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Keep the registrar tab open and open Vultr and we will copy-and-paste our IP
addresses in.&lt;/p&gt;
&lt;h2 id=&#34;find-your-servers-ip-addresses&#34;&gt;Find your server&#39;s IP addresses&lt;/h2&gt;
&lt;p&gt;Looking at your server in the Vultr menu, you should see a number next
to it. Mine here is &lt;code&gt;104.238.126.105&lt;/code&gt; as you can see below the server
name (which I have named &lt;code&gt;landchad.net&lt;/code&gt; after the domain I will soon
attach to it). That is my &lt;strong&gt;IPv4&lt;/strong&gt; address.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-ipv4.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-ipv4.png&#34; alt=&#34;See the IPv4 address?&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Copy your IPv4 address and on your registrar&amp;rsquo;s site, click the &amp;quot;Add Record&amp;quot;
record button and add two A entries pasting in your IPv4 address like I&#39;ve
done for mine here.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-ipv4-done.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-ipv4-done.png&#34; alt=&#34;IPv4 complete&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;I add two entries. One has nothing written in the &amp;quot;Host&amp;quot; section. This
will direct connections to &lt;code&gt;landchad.net&lt;/code&gt; over IPv4 to our IP address.
The second has a &lt;code&gt;*&lt;/code&gt; in the &amp;quot;Host&amp;quot; section. This will direct
connections to all possible subdomains to the right place too, I mean
&lt;code&gt;mail.landchad.net&lt;/code&gt; or &lt;code&gt;blog.landchad.net&lt;/code&gt; and any other subdomain we
might want to add later.&lt;/p&gt;
&lt;p&gt;Now let&#39;s get our IPv6 address, which is a little more hidden for some
reason. IPv6 is important because we are running out of IPv4 addresses,
so it is highly important to allow connections via IPv6 as it will be
standard in the future. Anyway, now back on Vultr, click on the server
name.&lt;/p&gt;
&lt;p&gt;On the server settings, &lt;strong&gt;click on settings&lt;/strong&gt; and we will see we are on
a submenu labeled &amp;quot;IPv4&amp;quot; where we see our IPv4 address again.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-vultr.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-vultr.png&#34; alt=&#34;Looking for the IPv6&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Now just click on the &lt;strong&gt;IPv6&lt;/strong&gt; submenu to reveal your IPv6 address.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-ipv6.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-ipv6.png&#34; alt=&#34;The IPv6 address&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;That ugly looking sequence of numbers and letters with colons in between
(&lt;code&gt;2001:19f0:5:ccc:5400:03ff:fe58:324a&lt;/code&gt;) is my &lt;strong&gt;IPv6&lt;/strong&gt; address. Yours will look
something like it. Now let&#39;s put it into your registrar&amp;rsquo;s site. This time, be
sure to select to put in AAAA records as below:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-ipv6-done.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-ipv6-done.png&#34; alt=&#34;IPv6 complete&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Now just click &amp;quot;Save Changes.&amp;quot; It might take a minute for the DNS
settings to propagate across the internet.&lt;/p&gt;
&lt;h2 id=&#34;test-it-out&#34;&gt;Test it out!&lt;/h2&gt;
&lt;p&gt;Now we should have our domain name directing to our new server. We can
check by pinging our domain name, check this out:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/dns-ping.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/dns-ping.png&#34; alt=&#34;Pinging landchad.net&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;As you can see, our ping to &lt;code&gt;landchad.net&lt;/code&gt; is now being directed to
&lt;code&gt;104.238.128.105&lt;/code&gt;. That means we have successfully set up our DNS
records! You can also run the command &lt;code&gt;host&lt;/code&gt; if you have it, which will
list both IPv4 and IPv6 addresses for a domain name.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>RSS Bridge</title>
		<link>https://landchad.net/rss-bridge/</link>
		<pubDate>Mon, 05 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/rss-bridge/</guid>
		<description>&lt;p&gt;RSS Bridge is a useful utility you can use to help you avoid the big
tech sites, like Facebook and Twitter, which instead of the feed you
usually would see, will be a based and minimalist RSS feed.&lt;/p&gt;
&lt;p&gt;You&#39;ll need a server or VPS. Nearly any Operating system is supported
but for this tutorial I&#39;m gonna presume you&#39;re using a Debian-based
OS. You&#39;ll also need a domain name pointing to your server&#39;s IP
address &lt;a href=&#34;https://landchad.net/basic/dns&#34;&gt;which is explained in this tutorial.&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;h3 id=&#34;setting-up-and-configuring&#34;&gt;Setting Up and Configuring&lt;/h3&gt;
&lt;p&gt;First things first you&#39;ll need to make sure that you&#39;ve hardened you
SSH so that password authentication is disabled and you&#39;ll also want to
setup Fail2Ban. There&#39;s a great tutorial on how to do this &lt;a href=&#34;https://landchad.net/sshkeys&#34;&gt;which can be read here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Next we&#39;ll install the required packages:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install -y curl unzip nginx certbot php-fpm php-mysql php-cli php-mbstring php-curl php-xml php-sqlite3 php-json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We now have to create the website configuration file. Create/open the a
file below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nano /etc/nginx/sites-available/rss-bridge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And add the following content:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/rss-bridge&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.php&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.html&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.htm&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.nginx-debian.html&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;rss-bridge.example.org&lt;/span&gt;;

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.php$&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;snippets/fastcgi-php.conf&lt;/span&gt;;
            &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/var/run/php/php-fpm.sock&lt;/span&gt;;
    }

    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;/\.ht&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt;;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After you have saved the file, you need to create a symlink so the
server actually will read the file.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/rss-bridge /etc/nginx/sites-enabled/rss-bridge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we have to create the folder where the service will reside in.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir -p /var/www/rss-bridge
cd /var/www/rss-bridge
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Lets download the latest version of RSS-Bridge in the directory.&lt;/p&gt;
&lt;p&gt;The newest version can be found
&lt;a href=&#34;https://github.com/RSS-Bridge/rss-bridge/releases&#34;&gt;here&lt;/a&gt;, at the time of
writing that is &amp;quot;RSS-Bridge 2021-04-25.&amp;quot;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget https://github.com/RSS-Bridge/rss-bridge/archive/refs/tags/2021-04-25.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unzip the file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;unzip 2021-04-25.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will create a directory called rss-bridge-version-number, we now
want to move all the file contents of the newly created directory to the
one we are in&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mv rss-bridge-2021-04-25/* .
rm -rf rss-bridge-2021-04-25 2021-04-25.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now all we need to do is grant read/write permissions and reload the web
server.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chown -R www-data:www-data /var/www/rss-bridge
systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&#39;s it, you should now have a working rss-bridge installed. But you
should definately get an SSL certifcate installed &lt;a href=&#34;https://landchad.net/basic/certbot&#34;&gt;which is done briefly here&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://handskemager.xyz&#34;&gt;handskemager.xyz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Bitcoin: &lt;code&gt;bc1qhfjgwjzksf2auqjefwpvq20wvyugq3lhqgkxvu&lt;/code&gt;{.crypto}&lt;/li&gt;
&lt;li&gt;Monero:
&lt;code&gt;88cPx6Gzv5RWRRJLstUt6hACF1BRKPp1RMka1ukyu2iuHT7iqzkNfMogYq3YdDAC8AAYRqmqQMkCgBXiwdD5Dvqw3LsPGLU&lt;/code&gt;{.crypto}&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Certbot on Standalone Domains and Subdomains</title>
		<link>https://landchad.net/standalone/</link>
		<pubDate>Fri, 02 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/standalone/</guid>
		<description>&lt;p&gt;The command &lt;code&gt;certbot --nginx&lt;/code&gt; will take an unencrypted website on an
Nginx configuration file, get a certificate for it and change the
configuration to use that certificate and thus HTTPS.&lt;/p&gt;
&lt;p&gt;Sometimes, however, you are given an Nginx configuration template that
already has encryption/HTTPS, so running the automated &lt;code&gt;certbot --nginx&lt;/code&gt;
is not possible, as it will simply give an error saying that the
certicate that Nginx is looking for doesn&#39;t already exist and thus the
Nginx config is broken.&lt;/p&gt;
&lt;p&gt;So suppose you want to get a certificate for &lt;strong&gt;pleroma.example.org&lt;/strong&gt;
because you are installing Pleroma and the configuration file
presupposes a certificate. In this case you would want to run this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl stop nginx
certbot certonly --standalone -d pleroma.example.org
systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What we do here is temporarily turn off Nginx, then run a &lt;code&gt;certonly&lt;/code&gt;
subcommand that generates a certificate for the domain without changing
or caring about the Nginx configuration. Then we reactivate Nginx, thus
turning back on our webserver.&lt;/p&gt;
&lt;p&gt;The reason we deactivate Nginx is that it uses the ports that Certbot
will want to bind to, and thus we must temporarily turn Nginx off to let
Certbot use those ports. (What it actually does is spin up a dummy
webserver that doesn&#39;t need to think about the Nginx configuration.)&lt;/p&gt;
&lt;p&gt;This is just a little note of something that might confuse people, but
the three commands above should suffice. If your site is still managed
by Nginx, it should still be able to renew with simple
&lt;code&gt;certbot renew --nginx&lt;/code&gt; without a problem.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Gemini</title>
		<link>https://landchad.net/gemini/</link>
		<pubDate>Thu, 01 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/gemini/</guid>
		<description>&lt;h2 id=&#34;whatis&#34;&gt;What is Gemini?&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://gemini.circumlunar.space&#34;&gt;Gemini&lt;/a&gt; is a new
internet protocol which is different from the HTTP and Gopher. It&#39;s
much cleaner and has a growing community and audience of hackers.&lt;/p&gt;
&lt;h3 id=&#34;why-use-gemini-protocol&#34;&gt;Why use gemini protocol?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Gemini capsules (webpages of gemini) are lightweight, minimal, and
don&#39;t use many resources to operate.&lt;/li&gt;
&lt;li&gt;It can run along with your websites. Gemini capsules use port 1965
by default. Your webserver can run at port 80 or 443 along with
gemini server at port 1965.&lt;/li&gt;
&lt;li&gt;By exploring an alternative protocol, you can check different ways
to serve data and blogs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To access any gemini urls i.e. &lt;code&gt;gemini://example.org&lt;/code&gt;, you can use any
gemini client such as
&lt;a href=&#34;https://github.com/makeworld-the-better-one/amfora&#34;&gt;amfora&lt;/a&gt;,
&lt;a href=&#34;https://gmi.skyjake.fi/lagrange&#34;&gt;lagrange&lt;/a&gt;,
&lt;a href=&#34;https://thelambdalab.xyz/elpher/&#34;&gt;elpher&lt;/a&gt;, etc.&lt;/p&gt;
&lt;h2 id=&#34;instructions&#34;&gt;Instructions&lt;/h2&gt;
&lt;h3 id=&#34;create-a-gemini-user&#34;&gt;Create a gemini user&lt;/h3&gt;
&lt;p&gt;It is most secure and clean to have a separate &lt;code&gt;gemini&lt;/code&gt; user, so let&#39;s
create one:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd -m -s /bin/bash gemini
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now log in as &lt;code&gt;gemini&lt;/code&gt; with the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -l gemini
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To create and serve a gemini capsule, we need three basic steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Content &amp;ndash; the webpages in our capsule&lt;/li&gt;
&lt;li&gt;TLS certificate &amp;ndash; Gemini requires encrypted connection.&lt;/li&gt;
&lt;li&gt;Gemini server &amp;ndash; the program that makes our capsule available
(similar to Nginx for HTTP)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As the gemini user, we can create three different directories to
simplify the process:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir -p ~/gemini/&lt;span style=&#34;color:#f92672&#34;&gt;{&lt;/span&gt;content,certificate,server&lt;span style=&#34;color:#f92672&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;content&#34;&gt;Content&lt;/h3&gt;
&lt;p&gt;This will be the directory where your capsule files will be contained.
Gemini uses text/gemini markup (in place of HTTP&#39;s equivalent HTML). It
heavily borrows from Markdown. Similar to .html or .md, gemini uses .gmi
as its extension.&lt;/p&gt;
&lt;p&gt;To create one gemini file, go inside the &lt;code&gt;content&lt;/code&gt; directory and create
one &lt;code&gt;index.gmi&lt;/code&gt; file.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nano gemini/content/index.gmi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can add the content we want in our Gemini capsule here:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# This is Sample Gemini page&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;## With header 1 and header 2&lt;/span&gt;
&lt;span style=&#34;color:#ae81ff&#34;&gt;And a short paragraph like this.&lt;/span&gt;
&lt;span style=&#34;color:#ae81ff&#34;&gt;=&amp;gt; /index.gmi Link to the same page&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;tls-certificate&#34;&gt;TLS certificate&lt;/h3&gt;
&lt;p&gt;Go to the &lt;code&gt;certificate&lt;/code&gt; directory which we created earlier and generate
a TLS certificate using OpenSSL.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd ~/gemini/certificate/
openssl req -new -subj &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/CN=example.org&amp;#34;&lt;/span&gt; -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days &lt;span style=&#34;color:#ae81ff&#34;&gt;3650&lt;/span&gt; -nodes -out cert.pem -keyout key.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;gemini-server&#34;&gt;Gemini server&lt;/h3&gt;
&lt;h4 id=&#34;download-and-prepare-the-server&#34;&gt;Download and prepare the server&lt;/h4&gt;
&lt;p&gt;There are &lt;a href=&#34;https://gemini.circumlunar.space/software&#34;&gt;many gemini server software choices
available&lt;/a&gt;. We will use
&lt;code&gt;agate&lt;/code&gt; server for now. This is a simple gemini server written in Rust.&lt;/p&gt;
&lt;p&gt;It&#39;s a good idea to always get the most recent version, which you can
see &lt;a href=&#34;https://github.com/mbrubeck/agate/releases&#34;&gt;on the agate releases
page&lt;/a&gt;. At the time of this
writing, that is agate v3.1.0 which we will now download. We will
download it to the &lt;code&gt;server&lt;/code&gt; directory we made.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd ~/gemini/server
wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unzip the gz, then rename and make it executable:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;gunzip agate.x86_64-unknown-linux-gnu.gz
mv agate.x86_64-unknown-linux-gnu agate-server
chmod +x agate-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;create-a-system-service&#34;&gt;Create a system service&lt;/h4&gt;
&lt;p&gt;Now we need to create a systemd service to autostart and manage agate.
The gemini user does not have permission to do this, so press &lt;kbd&gt;ctrl-d&lt;/kbd&gt;
to log out of the gemini user and return to root. As root, create the
file below by opening it in your text editor (nano, vim, etc.):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;nano /etc/systemd/system/agate.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add the following content to the file &lt;strong&gt;customizing highlighted text&lt;/strong&gt;
to your use.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;agate&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;User&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;gemini&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;simple&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/home/gemini/gemini/server/agate-server --content /home/gemini/gemini/content --certs /home/gemini/gemini/certificate/ --hostname example.org --lang en-US&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;default.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we are ready to run server. Enable and run agate server.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl enable agate
systemctl start agate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;firewall&#34;&gt;Firewall&lt;/h4&gt;
&lt;p&gt;Lastly, if you have a firewall running, remember to open port 1965,
which is the port number used by gemini:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;1965&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;finalization&#34;&gt;Finalization&lt;/h2&gt;
&lt;p&gt;Now your server should be running. If everything went okay, you can
access your gemini capsule via any gemini client with a url like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;gemini://example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Sample gemini site for reference:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;gemini://gemini.circumlunar.space
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enjoy your first gemini capsule.&lt;/p&gt;
&lt;p&gt;For information about how to write in &amp;quot;gemtext&amp;quot; the markup language in
Gemini, see this site:
&lt;a href=&#34;https://gemini.circumlunar.space/docs/gemtext.gmi&#34;&gt;https://gemini.circumlunar.space/docs/gemtext.gmi&lt;/a&gt;. As you might guess,
it also has an analogous gemini capsule here:
gemini://gemini.circumlunar.space/docs/gemtext.gmi&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Written by &lt;a href=&#34;https://nihar.page&#34;&gt;nihar.page&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>i2p</title>
		<link>https://landchad.net/i2p/</link>
		<pubDate>Thu, 01 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/i2p/</guid>
		<description>&lt;p&gt;Now you have a website, why not offer it in a private alternative such as the Invisible Internet?&lt;/p&gt;
&lt;h2 id=&#34;setting-up-i2p&#34;&gt;Setting up I2P&lt;/h2&gt;
&lt;p&gt;There are 2 main I2P implementations, I2P and i2pd, we are using i2pd in this guide because it&amp;rsquo;s easier to use on servers.&lt;/p&gt;
&lt;h3 id=&#34;installing-i2p&#34;&gt;Installing I2P&lt;/h3&gt;
&lt;p&gt;We need to &lt;a href=&#34;https://repo.i2pd.xyz/&#34;&gt;add the i2pd repos to our system&lt;/a&gt; to get the latest version of i2pd:&lt;/p&gt;
&lt;p&gt;Install apt-transport-https and gpg package:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install apt-transport-https gpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Automatically add the repository with a script:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget -q -O - https://repo.i2pd.xyz/.help/add_repo | bash -s -
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After that you can install i2pd as any other software package:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update
apt install i2pd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;enabling-i2p&#34;&gt;Enabling I2P&lt;/h3&gt;
&lt;p&gt;Next we have to configure the i2pd daemon, the configuration is located at &lt;code&gt;/etc/i2pd/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Edit the &lt;code&gt;tunnels.conf&lt;/code&gt; file and add the following configuration to the file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[example]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;type &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; http&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;host &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 127.0.0.1&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;port &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 8080&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;keys &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; example.dat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can comment or remove the tunnels that are added by default in the configuration file.&lt;/p&gt;
&lt;h4 id=&#34;optional-generating-a-vanity-address&#34;&gt;Optional: Generating a Vanity Address&lt;/h4&gt;
&lt;p&gt;If you run &lt;code&gt;i2pd&lt;/code&gt; with the configuration above, it will generate a random private key (&lt;code&gt;example.dat&lt;/code&gt;) for your website at &lt;code&gt;/var/lib/i2pd/&lt;/code&gt; with a matching address made up of 52 random characters, derived from this same key.&lt;/p&gt;
&lt;p&gt;If you instead pre-generate a private key for your website, you can use brute-force computation to make a &amp;ldquo;vanity&amp;rdquo; address, such as the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;mark&gt;chad&lt;/mark&gt;aor3jc08ht340c30mg5cf340j395gj095kuazj5tokipr34f.32.i2p
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To accomplish this, a set of tools named &lt;code&gt;i2pd-tools&lt;/code&gt; can be installed.&lt;/p&gt;
&lt;p&gt;Begin by cloning their repository:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone --recursive https://github.com/purplei2p/i2pd-tools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The repository comes with a dependency installation script included. Run this to list the compilation dependencies you&amp;rsquo;ll need, and install them:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cd i2pd-tools
sh dependencies.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then compile using the &lt;code&gt;make&lt;/code&gt; command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will build a variety of useful tools for i2p, with &lt;code&gt;vain&lt;/code&gt; being the command of interest to generate an address:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./vain &lt;mark&gt;chad&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command will begin running and output a new set of private keys named &lt;code&gt;private.dat&lt;/code&gt; to the same directory it&amp;rsquo;s ran from. Copy this file to your i2p configuration and you&amp;rsquo;ll have your vanity address:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp private.dat /var/lib/i2pd/example.dat
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;optional-authentication-strings-for-registrars&#34;&gt;Optional: Authentication Strings for Registrars&lt;/h4&gt;
&lt;p&gt;I2P has various &lt;strong&gt;registrars&lt;/strong&gt; that let users link their long I2P addresses to shorter, more memorable ones, like &lt;code&gt;example.i2p&lt;/code&gt;. To actually register your site on one of these registrars, you will need an &lt;strong&gt;authentication string.&lt;/strong&gt; Luckily, &lt;code&gt;i2pd-tools&lt;/code&gt; includes such a tool in their repository:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./regaddr private.dat &lt;mark&gt;example.2ip&lt;/mark&gt; &amp;gt; &lt;mark&gt;auth_string.txt&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command above will save the string to a file named &lt;code&gt;auth_string.txt&lt;/code&gt;. You will have to place the text contained in that file on a registration page like &lt;a href=&#34;http://reg.i2p/add&#34;&gt;http://reg.i2p/add&lt;/a&gt; or &lt;a href=&#34;http://stats.i2p/i2p/addkey.html&#34;&gt;http://stats.i2p/i2p/addkey.html&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;getting-your-i2p-hostname&#34;&gt;Getting your I2P Hostname&lt;/h3&gt;
&lt;p&gt;Then, run the command &lt;code&gt;systemctl start i2pd&lt;/code&gt; to start i2pd and &lt;code&gt;systemctl enable i2pd&lt;/code&gt; to enable i2pd at startup, this will automatically generate our I2P hostname which we will now see.&lt;/p&gt;
&lt;p&gt;This can be done in lynx or a command-line browser by going to &lt;code&gt;http://127.0.0.1:7070/?page=i2p_tunnels&lt;/code&gt; to get your I2P hostname.&lt;/p&gt;
&lt;p&gt;You can also run these commands to find your hostname:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;printf &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;%s.b32.i2p
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;head -c &lt;span style=&#34;color:#ae81ff&#34;&gt;391&lt;/span&gt; /var/lib/i2pd/example.dat | sha256sum | xxd -r -p | base32 | sed s/&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;//g | tr A-Z a-z&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;(If you&amp;rsquo;ve generated your own keys to obtain a vanity address, now&amp;rsquo;s a good time to make sure i2pd is properly reading those keys by verifying the address is the same as the one generated with the &lt;code&gt;vain&lt;/code&gt; command.)&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&#34;adding-the-nginx-config&#34;&gt;Adding the Nginx Config&lt;/h2&gt;
&lt;p&gt;From here, the steps are almost identical to setting up a normal website configuration file. Follow the steps as if you were making a new website on the webserver &lt;a href=&#34;https://landchad.net/basic/nginx&#34;&gt;tutorial&lt;/a&gt; up until the server block of code. Instead, paste this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
	&lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; 127.0.0.1:&lt;span style=&#34;color:#ae81ff&#34;&gt;8080&lt;/span&gt; ;
	&lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/&lt;mark&gt;example&lt;/mark&gt;&lt;/span&gt; ;
	&lt;span style=&#34;color:#f92672&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.html&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;clarifications&#34;&gt;Clarifications&lt;/h4&gt;
&lt;p&gt;Nginx will listen on port 8080, but i2pd will forward your port 8080 to the i2p site port 80. This way you don&amp;rsquo;t have to deal with server names or anything like that.&lt;/p&gt;
&lt;p&gt;From here we are almost done, all we have to do is enable the site and reload nginx which is also covered in &lt;a href=&#34;https://landchad.net/basic/nginx#enable&#34;&gt;the webserver tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;update-regularly&#34;&gt;Update regularly!&lt;/h3&gt;
&lt;p&gt;Make sure to update I2P on a regular basis by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Contributors&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://qorg11.net&#34;&gt;qorg11&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/daviduhden&#34;&gt;David Uhden&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>OpenAlias</title>
		<link>https://landchad.net/openalias/</link>
		<pubDate>Thu, 01 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/openalias/</guid>
		<description>&lt;h2 id=&#34;the-problem&#34;&gt;The Problem&lt;/h2&gt;
&lt;p&gt;Cryptocurrency can be unintuitive. After all, look at this annoying
Monero address of ours:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;84RXmrsE7ffCe1ADprxLMHRpmyhZuWYScDR4YghE8pFRFSyLtiZFYwD6EPijVzD3aZiEpg57MfHEr1pGJNPXyJgENMnWrSh&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It breaks up pages and looks ugly. When you copy and paste it to send
money, you might be paranoid that you somehow added an extra character
in there. That&#39;s all around a bad user experience.&lt;/p&gt;
&lt;h3 id=&#34;it-would-be-nice&#34;&gt;It would be nice...&lt;/h3&gt;
&lt;p&gt;It would be nice if we could just input someone&#39;s email address or
maybe a website and send Bitcoin or Monero to that instead. So instead
of that long jumble, it would be easier to just type in someone&#39;s
website or email and sending them money that way.&lt;/p&gt;
&lt;h2 id=&#34;the-solution&#34;&gt;The Solution&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&#34;https://openalias.org/&#34;&gt;OpenAlias&lt;/a&gt; standards are just that. It uses
&lt;a href=&#34;https://landchad.net/basic/dns&#34;&gt;DNS&lt;/a&gt; settings, which you know something about, to link a
website or an email address with a cryptocurrency address. It allows
someone to simply put &lt;code&gt;landchad.net&lt;/code&gt; or &lt;code&gt;chad@landchad.net&lt;/code&gt; as a payment
recipient and that will direct to that long address above.&lt;/p&gt;
&lt;p&gt;The default Monero wallet and Bitcoin&#39;s Electrum are already compatible
with OpenAlias, as are a growing group of wallet software.&lt;/p&gt;
&lt;h2 id=&#34;lets-do-it&#34;&gt;Let&#39;s do it.&lt;/h2&gt;
&lt;p&gt;Open up your domain registar and open up your DNS settings for the
website you would like to add.&lt;/p&gt;
&lt;p&gt;Open the &lt;strong&gt;TXT record&lt;/strong&gt; section. Now, create an entry with text like
that below:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;oa1:xmr recipient_address=84RXmrsE7ffCe1ADprxLMHRpmyhZuWYScDR4YghE8pFRFSyLtiZFYwD6EPijVzD3aZiEpg57MfHEr1pGJNPXyJgENMnWrSh; recipient_name=LandChad.net;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Obviously change the address to your desired address and you may also
give a proper name for yourself (this may be multiple words). Note that
the entry above is &lt;strong&gt;all one line&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now create a new TXT entry and input this text into the &lt;strong&gt;TXT Value&lt;/strong&gt;
input box. Note here that I have create two entries:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/openalias-01.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/openalias-01.png&#34; alt=&#34;openalias&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;One entry&#39;s &amp;quot;Host&amp;quot; is left empty, this will allow people to send
Monero by merely typing &lt;code&gt;landchad.net&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The second entry has &amp;quot;chad&amp;quot; as the &amp;quot;Host&amp;quot;; this will allow people to
send money to &lt;code&gt;chad@landchad.net&lt;/code&gt;, i.e. this is how you allow people to
connect a Monero address with an email address.&lt;/p&gt;
&lt;h3 id=&#34;checking-to-see-if-it-works&#34;&gt;Checking to see if it works...&lt;/h3&gt;
&lt;p&gt;Let&#39;s check to see if it works. In the Monero wallet, we can now type
in &lt;code&gt;landchad.net&lt;/code&gt; as a recipient:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/openalias-02.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/openalias-02.png&#34; alt=&#34;checking&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;And once we press the &amp;quot;Resolve&amp;quot; button, it automatically turns into
that address we gave to the DNS!&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/openalias-03.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/openalias-03.png&#34; alt=&#34;It works!&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Now people can donate Monero to you without having to worry about QR
codes or copying-and-pasting super-long public addresses!&lt;/p&gt;
&lt;h3 id=&#34;now-with-bitcoin&#34;&gt;Now with Bitcoin!&lt;/h3&gt;
&lt;p&gt;OpenAlias was originally developed for Monero, but since it&#39;s such a
good idea, Bitcoin wallets have implemented it as well, so let&#39;s add
some TXT entries for Bitcoin. The OpenAlias TXT records have the same
format, except for the &lt;strong&gt;xmr&lt;/strong&gt; at the beginning is replaced with &lt;strong&gt;btc&lt;/strong&gt;
and obviously we use a Bitcoin address instead of Monero.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;oa1:btc recipient_address=bc1q9f3tmkhnxj8gduytdktlcw8yrnx3g028nzzsc5; recipient_name=LandChad.net;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add the TXT entries in and save:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/openalias-04.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/openalias-04.png&#34; alt=&#34;bitcoin openalias entries&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;And we can then check that it&#39;s working by trying to send money to
&lt;code&gt;landchad.net&lt;/code&gt; in Electrum. See that it automatically appends the
address!&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/openalias-05.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/openalias-05.png&#34; alt=&#34;electrum resolves an openalias&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;And that&#39;s it. Now users can easily send your website or email address
Bitcoin or Monero without having to worry about hard to read addresses
and QR codes.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Pleroma</title>
		<link>https://landchad.net/pleroma/</link>
		<pubDate>Thu, 01 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/pleroma/</guid>
		<description>&lt;p&gt;Hopefully by now you won&#39;t have to be sold on the invasive practices
that social media companies conduct. Websites such as Facebook and
Twitter aquire so much data on users that they often know more about you
than you know about yourself. The simple solution to this is to not use
social media. However, that just isn&#39;t an option for most people. So
the next best thing is to setup a self-hosted and federalised social
media site so that you have full control over your data. I&#39;ve
previously made &lt;a href=&#34;https://www.youtube.com/watch?v=l7mVsLSsotU&#34;&gt;a video showing all the steps in depth if you want to
check it out.&lt;/a&gt; If you run
into any issues I suggest you look at the video.&lt;/p&gt;
&lt;p&gt;You&#39;ll need a server or VPS. Nearly any Operating system is supported
but for this tutorial I&#39;m gonna presume you&#39;re using a Debian-based
OS. You&#39;ll also need a domain name pointing to your server&#39;s IP
address &lt;a href=&#34;https://landchad.net/basic/dns&#34;&gt;which is explained in this tutorial.&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;h3 id=&#34;setting-up-and-configuring&#34;&gt;Setting Up and Configuring&lt;/h3&gt;
&lt;p&gt;First things first you&#39;ll need to make sure that you&#39;ve hardened you
SSH so that password authentication is disabled and you&#39;ll also want to
setup Fail2Ban. There&#39;s a great tutorial on how to do this &lt;a href=&#34;https://landchad.net/sshkeys&#34;&gt;which can
be read here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Next we&#39;ll install the required packages:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install -y curl unzip libncurses5 postgresql postgresql-contrib nginx certbot libmagic-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can manually configure postgreSQL to suit your system better. &lt;a href=&#34;https://docs-develop.pleroma.social/backend/configuration/postgresql/&#34;&gt;Check
out the documentation
here&lt;/a&gt;
and then run the below command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart postgresql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;installing-the-pleroma-app&#34;&gt;Installing the Pleroma App&lt;/h3&gt;
&lt;h4 id=&#34;first-as-the-root-user&#34;&gt;First as the root user&lt;/h4&gt;
&lt;p&gt;Pleroma is not in the Debian app repositories, so we will install it
manually. First create the Pleroma user by running the below command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd -m -s /bin/bash -d /opt/pleroma pleroma
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, still as root, we will create the required directories and give
the Pleroma user ownership of them.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir -p /var/lib/pleroma/uploads
chown -R pleroma /var/lib/pleroma
mkdir -p /var/lib/pleroma/static
chown -R pleroma /var/lib/pleroma
mkdir -p /etc/pleroma
chown -R pleroma /etc/pleroma
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;now-as-the-new-pleroma-user&#34;&gt;Now, as the new Pleroma user&lt;/h4&gt;
&lt;p&gt;Now run &lt;code&gt;su -l pleroma&lt;/code&gt; to login as the Pleroma user. Now use the &lt;code&gt;curl&lt;/code&gt;
command below to download the Pleroma software and unzip it.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=amd64&amp;#39;&lt;/span&gt; -o /tmp/pleroma.zip
unzip /tmp/pleroma.zip -d /tmp/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that we are downloading the &lt;strong&gt;amd64&lt;/strong&gt; version here. If you know you
have a different CPU architecture, replace that with whatever your
architecture is.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mv /tmp/release/* /opt/pleroma
rmdir /tmp/release
rm /tmp/pleroma.zip
./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We need to briefly return to the root user so we can run the following
command (via the postgres user) to set up the database. Type &lt;kbd&gt;ctrl-d&lt;/kbd&gt; or
run &lt;code&gt;exit&lt;/code&gt; to return to the root user, then run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su postgres -s $SHELL -lc &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;psql -f /tmp/setup_db.psql&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then return to the pleroma user with &lt;code&gt;su -l pleroma&lt;/code&gt; and we will test to
see that Pleroma can run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./bin/pleroma_ctl migrate
./bin/pleroma daemon
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That will initialize Pleroma. It might take as long as a minute to get
started, so wait a bit, then run the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl http://localhost:4000/api/v1/instance
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If everything is working, this command will give you a long line of
messy output. If it is not, you will get a connection error message.
Once it is working successfully, stop the Pleroma daemon and we will
interface Pleroma with the web server.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./bin/pleroma stop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;setup-and-configure-nginx&#34;&gt;Setup and Configure Nginx&lt;/h3&gt;
&lt;p&gt;Return again to the root user. Let&#39;s copy Pleroma&#39;s Nginx
configuration file from the template given in the installation and
enable it:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.conf
ln -s /etc/nginx/sites-available/pleroma.conf /etc/nginx/sites-enabled/pleroma.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Edit the &lt;code&gt;etc/nginx/sites-available/pleroma.conf&lt;/code&gt; file and replace
&lt;strong&gt;example.tld&lt;/strong&gt; with your domain name.&lt;/p&gt;
&lt;p&gt;We now have to get a SSL certificate to enable encryption, since we have
a model configuration that already includes SSL information, just check
the brief &lt;a href=&#34;https://landchad.net/standalone&#34;&gt;the standalone certificate page&lt;/a&gt; to get the
needed certificate. Once you&#39;ve got your cert setup, copy over the
Nginx configuration with the below command:&lt;/p&gt;
&lt;p&gt;Once everything, including your Cerbot certificate is ready, simply
reload Nginx with this command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;setting-up-the-service&#34;&gt;Setting up the service&lt;/h3&gt;
&lt;p&gt;Pleroma itself runs on a SystemD service similar to other things running
on your server like Nginx. To start the service up run the below
commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
systemctl start pleroma
systemctl enable pleroma
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If everything worked then when you go to your domain in the web browser
you should see a bare-bones Pleroma instance.&lt;/p&gt;
&lt;h3 id=&#34;creating-an-admin-user&#34;&gt;Creating an Admin User&lt;/h3&gt;
&lt;p&gt;You&#39;ll be able to create new accounts on the Pleroma instance in the
login section on the website but the easiest way to setup an admin
account is with the CLI. Simply run the below command replaced with your
username:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -l pleroma
./bin/pleroma_ctl user new username username@example.org --admin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you run into any issues then &lt;a href=&#34;https://docs-develop.pleroma.social/backend/installation/otp_en/&#34;&gt;feel free to checkout the
documentation&lt;/a&gt;
or send me an email or message. My details are below.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://biasedriot.co&#34;&gt;biasedriot.co&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/channel/UCehh50T6qtDpt_kEUF33GJw&#34;&gt;youtube&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Bitcoin: &lt;code&gt;1Dmn9jEtWAhdLk1HHWkUVNeDdAaBCwNajm&lt;/code&gt;{.crypto}&lt;/li&gt;
&lt;li&gt;Monero:
&lt;code&gt;84Y4FZiTbLeR5qc1fBrBhB1yq5agKtEdoixq2w1ysXJv486MiBCz3czGT15bqeXDPpdLoNyF93inxY3BCk6g8mrDMNKoArS&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Rsync: Upload and Sync Files and Websites</title>
		<link>https://landchad.net/rsync/</link>
		<pubDate>Thu, 01 Jul 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/rsync/</guid>
		<description>&lt;p&gt;rsync is a simple way to copy files and folders between your local computer and
server. While you can install &lt;a href=&#34;https://landchad.net/nextcloud&#34;&gt;Nextcloud&lt;/a&gt; is a more normie-friendly
Dropbox/Google Drive-like way to share files, people familiar with the
command-line will find all they need in the simple &lt;code&gt;rsync&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;It not only makes file-transfer easy, but it allows you to build and
maintain your website offline, then easily upload it to the proper
directory on your server so you don&#39;t need to constantly be logged into
your server to modify your site.&lt;/p&gt;
&lt;h2 id=&#34;installing-rsync&#34;&gt;Installing rsync&lt;/h2&gt;
&lt;p&gt;Run the following on your server &lt;em&gt;and&lt;/em&gt; on your local machine.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install rsync
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;uploading-files-with-rsync&#34;&gt;Uploading files with rsync&lt;/h2&gt;
&lt;p&gt;From your local machine you can upload files to your server like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;rsync -rtvzP /path/to/file root@example.org:/path/on/the/server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will be prompted for the root password and then uploading will
commence.&lt;/p&gt;
&lt;p&gt;If you omit &lt;strong&gt;root@&lt;/strong&gt;, rsync will not attempt to log in as root, but
whatever your local username is.&lt;/p&gt;
&lt;h3 id=&#34;options-to-rsync&#34;&gt;Options to rsync&lt;/h3&gt;
&lt;p&gt;In this command, we give several options to rsync. You can remove some of these
or add to them based on your needs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-r&lt;/code&gt; &amp;ndash; run recurssively (include directories)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-t&lt;/code&gt; &amp;ndash; transfer modification times, which allows skipping files
that have not been modified on future uploads&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-v&lt;/code&gt; &amp;ndash; visual, show files uploaded&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-z&lt;/code&gt; &amp;ndash; compress files for upload&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-P&lt;/code&gt; &amp;ndash; if uploading a large file and upload breaks, pick up where
we left off rather than reuploading the entire file&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Avoid using the commonly used &lt;code&gt;-a&lt;/code&gt; option when uploading to a server. It can
transfer your local machine&#39;s user and group permissions to your
server, which might cause breakage.&lt;/p&gt;
&lt;p&gt;But &lt;code&gt;-a&lt;/code&gt; is useful for making back-ups of important directories. It&amp;rsquo;s an alias for many options at once (&lt;code&gt;-rlptgoD&lt;/code&gt;)&amp;mdash;read &lt;code&gt;man rsync&lt;/code&gt; for the details.&lt;/p&gt;
&lt;h3 id=&#34;scriptability&#34;&gt;Scriptability&lt;/h3&gt;
&lt;p&gt;It&#39;s a good idea to build your website offline, then make an rsync
script or bash alias like the one above to upload the edited files when
you have made updates.&lt;/p&gt;
&lt;h3 id=&#34;password-less-authentication&#34;&gt;Password-less authentication&lt;/h3&gt;
&lt;p&gt;To avoid having to manually input your password each upload, you can set
up &lt;a href=&#34;https://landchad.net/sshkeys&#34;&gt;SSH keys&lt;/a&gt; to securely idenitify yourself and computer
as a trusted.&lt;/p&gt;
&lt;h3 id=&#34;picky-trailing-slashes&#34;&gt;Picky trailing slashes&lt;/h3&gt;
&lt;p&gt;rsync is very particular about trailing slashes. This is useful, but can
be confusing to some new users. Suppose we run the following wanting to
mirror our offline copy of our website in the directory we use on our
server (&lt;code&gt;/var/www/websitefiles/&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;❌ rsync -rtvzP ~/websitefiles/ root@example.org:/var/www/websitefiles/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will &lt;em&gt;not actually do quite what we want&lt;/em&gt;. It will take our local
&lt;code&gt;websitefiles&lt;/code&gt; directory and put it &lt;em&gt;inside&lt;/em&gt; &lt;code&gt;websitefiles&lt;/code&gt; on the
remote machine, ending up with &lt;code&gt;/var/www/websitefiles/websitefiles&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Instead, remove the trailing slash from the remote server location:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;✅ rsync -rtvzP ~/websitefiles/ root@example.org:/var/www/websitefiles
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;websitefiles/&lt;/code&gt; has been replaced with &lt;code&gt;websitefiles&lt;/code&gt;, and this will do
what we want.&lt;/p&gt;
&lt;h2 id=&#34;downloading-file-with-rsync&#34;&gt;Downloading files with rsync&lt;/h2&gt;
&lt;p&gt;You may just as easily download files and directories from your server
with rsync:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;rsync -rtvzP root@example.org:/path/to/file /path/to/file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you don&amp;rsquo;t keep a local copy of your website or other things saved on a server🔒, it might be a good idea to set up a &lt;a href=&#34;https://landchad.net/cron&#34;&gt;cronjob&lt;/a&gt; or just a normal script on your local computer that takes back-ups of your website in case of server failure!&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Nextcloud</title>
		<link>https://landchad.net/nextcloud/</link>
		<pubDate>Wed, 30 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/nextcloud/</guid>
		<description>&lt;h2 id=&#34;whatis&#34;&gt;What is Nextcloud?&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://nextcloud.com&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/nextcloud.svg&#34; alt=&#34;&#34;&gt;Nextcloud&lt;/a&gt;
is a free and open source solution for cloud storage. However it can
also do other things, such as manage your email, notes, calender, tasks,
and can even connect to the Fediverse (think Mastodon and Pleroma).
Pretty much every service that Google has to offer has a much better
alternative as a Nextcloud app and this is a must-have for anyone
wanting to get away from Google services but still wants a traditional
cloud experience (in the likes of Google Services, anyways).&lt;/p&gt;
&lt;h2 id=&#34;dependencies&#34;&gt;Dependencies&lt;/h2&gt;
&lt;p&gt;First, we install the dependencies:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install -y nginx python3-certbot-nginx mariadb-server php php-&lt;span style=&#34;color:#f92672&#34;&gt;{&lt;/span&gt;fpm,bcmath,bz2,intl,gd,mbstring,mysql,zip,xml,curl&lt;span style=&#34;color:#f92672&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Optionally&lt;/em&gt;, you can improve the performance of your Nextcloud server by adjusting the child processes that are used to execute PHP scripts. That way, more PHP scripts can be executed at once. Make the following adjustments to &lt;code&gt;/etc/php/8.2/fpm/pool.d/www.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;pm &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; dynamic&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;pm.max_children &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 120&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;pm.start_servers &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 12&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;pm.min_spare_servers &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 6&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;pm.max_spare_servers &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 18&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Start the MariaDB server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl enable mariadb --now
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;setting-up-a-sql-database&#34;&gt;Setting up a SQL Database&lt;/h3&gt;
&lt;p&gt;Next, we need to set up our SQL database by running a Secure
Installation and creating the tables that will store data that Nextcloud
will need. Run the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can say &amp;ldquo;Yes&amp;rdquo; to the following questions, and can input a root password.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;Switch to unix_socket authentication &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Y/n&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;: Y
Change the root password? &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Y/n&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;: Y	&lt;span style=&#34;color:#75715e&#34;&gt;# Input a password.&lt;/span&gt;
Remove anonymous users? &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Y/n&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;: Y
Disallow root login remotely? &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Y/n&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;: Y
Remove test database and access to it? &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Y/n&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;: Y
Reload privilege tables now? &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;Y/n&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;: Y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, sign into the SQL database with the new and secure password you
chose before. Run the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mysql -u root -p
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We need to create a database for Nextcloud. Follow the instructions
below and change some of the placeholders as you wish:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-mysql&#34; data-lang=&#34;mysql&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;CREATE&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;DATABASE&lt;/span&gt; nextcloud;
&lt;span style=&#34;color:#66d9ef&#34;&gt;GRANT&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;ALL&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;ON&lt;/span&gt; nextcloud.&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;TO&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;lt;your_username&amp;gt;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;@&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;IDENTIFIED&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;BY&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;&amp;lt;your_password&amp;gt;&amp;#39;&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;FLUSH&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;PRIVILEGES&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;EXIT&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;https&#34;&gt;HTTPS&lt;/h3&gt;
&lt;p&gt;As with any subdomain, we need to obtain an SSL certificate.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;certbot certonly --nginx -d nextcloud.example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;nginx-configuration&#34;&gt;Nginx configuration&lt;/h3&gt;
&lt;p&gt;In &lt;code&gt;/etc/nginx/sites-available/&lt;/code&gt; we need to make a new configuration for
Nextcloud (example: &lt;code&gt;/etc/nginx/sites-available/nextcloud&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Add the following content &lt;a href=&#34;https://docs.nextcloud.com/server/25/admin_manual/installation/nginx.html&#34;&gt;based of Nextcloud&amp;rsquo;s recommendations&lt;/a&gt; to the file, &lt;strong&gt;remembering to replace &lt;code&gt;nextcloud.example.org&lt;/code&gt; with your Nextcloud domain&lt;/strong&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;upstream&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;php-handler&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;server&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;unix:/var/run/php/php-fpm.sock&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server&lt;/span&gt; 127.0.0.1:&lt;span style=&#34;color:#ae81ff&#34;&gt;9000&lt;/span&gt;;
}
&lt;span style=&#34;color:#66d9ef&#34;&gt;map&lt;/span&gt; $arg_v $asset_immutable {
    &lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;default&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;immutable&amp;#34;&lt;/span&gt;;
}
&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:80&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;nextcloud.example.org&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;https://&lt;/span&gt;$server_name$request_uri;
}
&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;      &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http2&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;nextcloud.example.org&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/nextcloud&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate&lt;/span&gt;     &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/letsencrypt/live/nextcloud.example.org/fullchain.pem&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/letsencrypt/live/nextcloud.example.org/privkey.pem&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;client_max_body_size&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;512M&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;client_body_timeout&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;300s&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_buffers&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;64&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;4K&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;gzip&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;gzip_vary&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;gzip_comp_level&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;gzip_min_length&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;256&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;gzip_proxied&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;expired&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;no-cache&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;no-store&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;private&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;no_last_modified&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;no_etag&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;auth&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;gzip_types&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/atom+xml&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/javascript&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/json&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/ld+json&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/manifest+json&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/rss+xml&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/vnd.geo+json&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/vnd.ms-fontobject&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/wasm&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/x-font-ttf&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/x-web-app-manifest+json&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/xhtml+xml&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/xml&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;font/opentype&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;image/bmp&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;image/svg+xml&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;image/x-icon&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/cache-manifest&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/css&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/plain&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/vcard&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/vnd.rim.location.xloc&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/vtt&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/x-component&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;text/x-cross-domain-policy&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;client_body_buffer_size&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;512k&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Referrer-Policy&lt;/span&gt;                      &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;no-referrer&amp;#34;&lt;/span&gt;        &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Content-Type-Options&lt;/span&gt;               &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;nosniff&amp;#34;&lt;/span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Download-Options&lt;/span&gt;                   &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;noopen&amp;#34;&lt;/span&gt;             &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Frame-Options&lt;/span&gt;                      &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;SAMEORIGIN&amp;#34;&lt;/span&gt;         &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Permitted-Cross-Domain-Policies&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;none&amp;#34;&lt;/span&gt;               &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Robots-Tag&lt;/span&gt;                         &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;noindex,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;nofollow&amp;#34;&lt;/span&gt;  &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-XSS-Protection&lt;/span&gt;                     &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;1&lt;/span&gt;; &lt;span style=&#34;color:#f92672&#34;&gt;mode=block&amp;#34;&lt;/span&gt;      &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_hide_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Powered-By&lt;/span&gt;;
    &lt;span style=&#34;color:#f92672&#34;&gt;index&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.php&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;index.html&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; = &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;(&lt;/span&gt; $http_user_agent ~ &lt;span style=&#34;color:#e6db74&#34;&gt;^DavClnt&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;)&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;302&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/remote.php/webdav/&lt;/span&gt;$is_args$args;
        }
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; = &lt;span style=&#34;color:#e6db74&#34;&gt;/robots.txt&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;allow&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;log_not_found&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^~&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; = &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/carddav&lt;/span&gt; { &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/remote.php/dav/&lt;/span&gt;; }
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; = &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/caldav&lt;/span&gt;  { &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/remote.php/dav/&lt;/span&gt;; }
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/acme-challenge&lt;/span&gt;    { &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;; }
        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known/pki-validation&lt;/span&gt;    { &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;; }
        &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)&lt;/span&gt;  { &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;; }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;^/(?:\.|autotest|occ|issue|indie|db_|console)&lt;/span&gt;                { &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;; }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.php(?:$|/)&lt;/span&gt; {
        &lt;span style=&#34;color:#75715e&#34;&gt;# Required for legacy support
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;rewrite&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy)&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_split_path_info&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^(.+?\.php)(/.*)&lt;/span&gt;$;
        &lt;span style=&#34;color:#f92672&#34;&gt;set&lt;/span&gt; $path_info $fastcgi_path_info;
        &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $fastcgi_script_name =&lt;span style=&#34;color:#ae81ff&#34;&gt;404&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;fastcgi_params&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;SCRIPT_FILENAME&lt;/span&gt; $document_root$fastcgi_script_name;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;PATH_INFO&lt;/span&gt; $path_info;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;HTTPS&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;modHeadersAvailable&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;true&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_param&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;front_controller_active&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;true&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;php-handler&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_intercept_errors&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;on&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_request_buffering&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;fastcgi_max_temp_file_size&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
        &lt;span style=&#34;color:#f92672&#34;&gt;add_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Cache-Control&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;public,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;max-age=15778463,&lt;/span&gt; $asset_immutable&amp;#34;;
        &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;     &lt;span style=&#34;color:#75715e&#34;&gt;# Optional: Don&amp;#39;t log access to assets
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.wasm$&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;default_type&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;application/wasm&lt;/span&gt;;
        }
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; ~ &lt;span style=&#34;color:#e6db74&#34;&gt;\.woff2?$&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
        &lt;span style=&#34;color:#f92672&#34;&gt;expires&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;7d&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/remote&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/remote.php&lt;/span&gt;$request_uri;
    }
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;try_files&lt;/span&gt; $uri $uri/ &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enable the site by running this command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;installing-nextcloud-itself&#34;&gt;Installing Nextcloud Itself&lt;/h2&gt;
&lt;p&gt;We should have all the moving pieces in place now, so we can download and
install Nextcloud itself. First, download the latest Nextcloud 25 version and we will extract into &lt;code&gt;/var/www/&lt;/code&gt; and ensure Nginx has the authority to use it.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget https://download.nextcloud.com/server/releases/latest-25.tar.bz2
tar -xjf latest-25.tar.bz2 -C /var/www
chown -R www-data:www-data /var/www/nextcloud
chmod -R &lt;span style=&#34;color:#ae81ff&#34;&gt;755&lt;/span&gt; /var/www/nextcloud
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Start and enable php-fpm and reload nginx:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl enable php8.2-fpm --now
systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we need to head to Nextcloud&#39;s web interface. In a web browser, go to the domain we have installed Nextcloud on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Choose an admin username and secure password.&lt;/li&gt;
&lt;li&gt;Leave Data folder at the default value unless it is incorrect.&lt;/li&gt;
&lt;li&gt;For Database user, enter the user you set for the SQL database.&lt;/li&gt;
&lt;li&gt;For Database password, enter the password you chose for the new user
in MariaDB.&lt;/li&gt;
&lt;li&gt;For Database name, enter: &lt;code&gt;nextcloud&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Leave &amp;quot;localhost&amp;quot; as &amp;quot;localhost&amp;quot;.&lt;/li&gt;
&lt;li&gt;Click Finish.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Congratulations, you have set up your own Nextcloud instance.&lt;/p&gt;
&lt;h2 id=&#34;whatsnext&#34;&gt;What&#39;s Next?&lt;/h2&gt;
&lt;p&gt;Now you may be wondering: What do I do now? Here are some suggestions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rice your Nextcloud instance by changing your themeing and
installing new themes and plugins in Settings in the Nextcloud Web
Interface.&lt;/li&gt;
&lt;li&gt;Install the Nextcloud Client on your personal computer and sync your
files to your instance.&lt;/li&gt;
&lt;li&gt;Install the Nextcloud App on your mobile device and sync your files
to your instance.&lt;/li&gt;
&lt;li&gt;Set up your email account on the Nextcloud Mail app on the web
interface to view and sync your email there (just like Gmail).&lt;/li&gt;
&lt;li&gt;Schedule events with Nextcloud Calender.&lt;/li&gt;
&lt;li&gt;Write notes in Markdown inside the Nextcloud Notes web and mobile
app.&lt;/li&gt;
&lt;li&gt;Set the Nextcloud Dashboard as your web browser&#39;s homepage (it is
pretty nice).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the event that anything goes wrong with the web interface of Nextcloud, Nextcloud has a commandline utility bundled with it called &lt;code&gt;occ&lt;/code&gt;. You can use it with the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;sudo -u www-data php /var/www/nextcloud/occ
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can make this an alias by putting it in your &lt;code&gt;~/.bashrc&lt;/code&gt; file for ease of use with the following alias:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;alias occ&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;sudo -u www-data php /var/www/nextcloud/occ&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enjoy your cloud services in freedom.&lt;/p&gt;
&lt;h2 id=&#34;contributors&#34;&gt;Contributor(s)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/MattMadness&#34;&gt;Matthew &amp;quot;Madness&amp;quot; Evan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Edits by Luke&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Tor</title>
		<link>https://landchad.net/tor/</link>
		<pubDate>Wed, 30 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/tor/</guid>
		<description>&lt;p&gt;Now that you have a website, why not offer it on a private alternative
such as the onion network?&lt;/p&gt;
&lt;h2 id=&#34;setting-up-tor&#34;&gt;Setting up Tor&lt;/h2&gt;
&lt;h3 id=&#34;installing-tor&#34;&gt;Installing Tor&lt;/h3&gt;
&lt;p&gt;First, we need to ensure that our CPU architecture is supported. Ensure
that it is either amd64, arm64, or i386:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dpkg --print-architecture
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We need to &lt;a href=&#34;https://support.torproject.org/apt/tor-deb-repo/&#34;&gt;add the Tor repos to our
system&lt;/a&gt; to get the
latest version of Tor:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt install -y apt-transport-https gpg
echo &amp;quot;deb     [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main
deb-src [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main&amp;quot; &amp;gt; /etc/apt/sources.list.d/tor.list
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then we need to add the GPG keys to our keyring:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -s https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor &amp;gt; /usr/share/keyrings/deb.torproject.org-keyring.gpg
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now install Tor:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt update
apt install tor deb.torproject.org-keyring
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&#34;enabling-tor&#34;&gt;Enabling Tor&lt;/h3&gt;
&lt;p&gt;Next edit the file &lt;code&gt;/etc/tor/torrc&lt;/code&gt;, uncommenting the following lines:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;optional-running-multiple-onion-services&#34;&gt;Optional: Running multiple onion services&lt;/h4&gt;
&lt;p&gt;If you want to forward multiple virtual ports for a single onion
service, just add more HiddenServicePort lines (replace the 80 with any
unoccupied port).&lt;/p&gt;
&lt;p&gt;If you want to run multiple onion services from the same Tor client,
just add another HiddenServiceDir line.&lt;/p&gt;
&lt;p&gt;Now start and enable Tor at boot:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; systemctl enable --now tor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the next command outputs &amp;ldquo;active&amp;rdquo; in green you&#39;re golden!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; systemctl status tor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now your server is on the dark web. The following command will give you
your onion address:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; cat /var/lib/tor/hidden_service/hostname
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;adding-the-nginx-config&#34;&gt;Adding the Nginx Config&lt;/h2&gt;
&lt;p&gt;From here, the steps are almost identical to setting up a normal website
configuration file. Follow the steps as if you were making a new website
in the webserver &lt;a href=&#34;https://landchad.net/basic/nginx&#34;&gt;tutorial&lt;/a&gt; up until the server block of
code. Instead, paste this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        server {
            listen 127.0.0.1:80 ;
            root /var/www/landchad ;
            index index.html ;
            server_name your-onion-address.onion ;
        }
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;clarification&#34;&gt;Clarification&lt;/h4&gt;
&lt;p&gt;Nginx will listen on port 80 for your &lt;em&gt;server&#39;s&lt;/em&gt; localhost.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;root&lt;/code&gt; line is the path to whichever website of yours you&#39;d like to
mirror.&lt;/p&gt;
&lt;p&gt;Now we are almost done, all we have to do is enable the site and reload
nginx which, is also covered in &lt;a href=&#34;https://landchad.net/basic/nginx#enable&#34;&gt;the webserver
tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;advertise-your-onion-service&#34;&gt;Advertise your onion service&lt;/h3&gt;
&lt;p&gt;You can add the Onion-Location header to your normal website to
advertise your onion service to Tor users. On your regular site&#39;s nginx
config, add the following line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;server {
    ...
    add_header Onion-Location http://your-onion-address.onion$request_uri;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After doing this and reloading nginx, when visiting your regular site
via Tor, you should see a &amp;quot;.onion available&amp;quot; button on the address
bar, which should take you to the onion service.&lt;/p&gt;
&lt;h3 id=&#34;update-regularly&#34;&gt;Update regularly!&lt;/h3&gt;
&lt;p&gt;Make sure to update Tor on a regular basis by running:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt update
apt install tor
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;note&#34;&gt;Note:&lt;/h4&gt;
&lt;p&gt;You do &lt;strong&gt;&lt;u&gt;not&lt;/u&gt;&lt;/strong&gt; need to run certbot for an ssl certificate.
HTTP over tor is plenty secure!&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Using UFW as a Firewall</title>
		<link>https://landchad.net/ufw/</link>
		<pubDate>Wed, 30 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/ufw/</guid>
		<description>&lt;p&gt;&lt;strong&gt;Uncomplicated Firewall&lt;/strong&gt; (UFW) is a front-facing program for the more
involved &lt;code&gt;iptables&lt;/code&gt; firewall program installed in most GNU/Linux
distributions. We can use &lt;code&gt;ufw&lt;/code&gt; to restrict machines on the internet to
only access the services (SSH, websites etc) you want them to, but it
can also be used to prevent programs on the computer itself from
accesing parts of the internet it shouldn&#39;t.&lt;/p&gt;
&lt;h2 id=&#34;how-to-get-it&#34;&gt;How to Get It&lt;/h2&gt;
&lt;p&gt;Log into your server by pulling up a terminal and typing:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh root@example.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command will attempt to log into your server and run a remote
shell. If you leave the settings default, it should prompt you for your
password, and you can just copy or type in the password from Vultr&#39;s
site.&lt;/p&gt;
&lt;p&gt;Some VPS providers automatically install &lt;code&gt;ufw&lt;/code&gt;, but if you do not have
it installed already, install it in the typical way:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install ufw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;first-time-setup&#34;&gt;First-Time Setup&lt;/h2&gt;
&lt;p&gt;You can check the status of &lt;code&gt;ufw&lt;/code&gt; right now by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw status
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Without any changes, it should report back &lt;code&gt;Status: inactive&lt;/code&gt;. Let&#39;s
set it up so that only connections to SSH (standardized at port 22) are
allowed in, and then enable the firewall:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Careful!&lt;/strong&gt; Enabling &lt;code&gt;ufw&lt;/code&gt; without allowing SSH will block you from
remoting to your server. Double-check that you have allowed SSH, and if
you have changed the default SSH port, put in &lt;em&gt;that&lt;/em&gt; number instead.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw default deny incoming &lt;span style=&#34;color:#75715e&#34;&gt;# block all incoming connections by default&lt;/span&gt;
ufw allow in ssh &lt;span style=&#34;color:#75715e&#34;&gt;# or: ufw allow in 22&lt;/span&gt;
ufw enable
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;ufw&lt;/code&gt; has an internal list of protocols applications, and the ports used
by them. In this case, it knows SSH is on port 22. We&#39;ll go more in
detail how to view all protocols &lt;code&gt;ufw&lt;/code&gt; knows about. By default, when you
allow an incoming port, it allows that port both on IPv4 and IPv6.&lt;/p&gt;
&lt;p&gt;With the firewall enabled and allowing only SSH in, all other ports are
protected from incoming requests. To view all your rules, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw status verbose
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A firewall that allows to connect to SSH and their website may look
like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                           Action      From
--                           ------      ----
22 (SSH)                     ALLOW IN    Anywhere
80,443/tcp (WWW Full)        ALLOW IN    Anywhere
22 (SSH (v6))                ALLOW IN    Anywhere (v6)
80,443/tcp (WWW Full (v6))   ALLOW IN    Anywhere (v6)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to delete e.g. the &#39;WWW Full&#39; rule, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw delete allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;WWW Full&amp;#39;&lt;/span&gt;
ufw reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;enabling-common-services&#34;&gt;Enabling Common Services&lt;/h2&gt;
&lt;p&gt;You have blocked all incoming ports but SSH, which means no outsiders
would be able to access other services, like an email server or your
website. You should look at the ports your services are open on and
enable them individually. Here is a list of a few common services:&lt;/p&gt;
&lt;h3 id=&#34;opening-port-numbers&#34;&gt;Opening Port Numbers&lt;/h3&gt;
&lt;p&gt;Suppose you install &lt;a href=&#34;https://landchad.net/gemini&#34;&gt;a Gemini server&lt;/a&gt;, which must broadcast
on port 1965. By default &lt;code&gt;ufw&lt;/code&gt; blocks all incoming connections on all
ports, so whenever you install a new service like this you will have to
tell &lt;code&gt;ufw&lt;/code&gt; to enable the desired port:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;1965&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;websites-http-and-https&#34;&gt;Websites: HTTP and HTTPS&lt;/h3&gt;
&lt;p&gt;HTTP uses port 80 and HTTPS uses port 443. We can enable them like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But &lt;code&gt;ufw&lt;/code&gt; additionally knows the typical ports of common serives, so you
can also run this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow http
ufw allow https
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And that will do the same thing. There are also other abbreviations for
common port lists:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;WWW Full&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To see these other &amp;quot;apps&amp;quot; that &lt;code&gt;ufw&lt;/code&gt; knows by default, run
&lt;code&gt;ufw app list&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;email-imap-pop3-and-smtp&#34;&gt;Email: IMAP, POP3, and SMTP&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow in IMAPS
ufw allow in POP3
ufw allow in SMTP
ufw allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Postfix SMTPS&amp;#39;&lt;/span&gt;
ufw allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Mail Submission&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;fine-tuning-rules&#34;&gt;Fine-Tuning Rules&lt;/h2&gt;
&lt;p&gt;Instead of denying all ports by default, you may want to deny (ignores
incoming requests) or reject (explicitly tells requests they&#39;re not
allowed):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw default allow in
ufw deny in PORT
ufw reject in PORT
ufw reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can add rules to comments to remember what they are there for:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw allow in PORT comment &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Secret SSH&amp;#39;&lt;/span&gt;
ufw reload
ufw status verbose
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Output:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;To                         Action      From
--                         ------      ----
PORT                       ALLOW IN    Anywhere                   # Secret SSH
PORT (v6)                  ALLOW IN    Anywhere (v6)              # Secret SSH
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To deny outgoing ports:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw deny out PORT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ratelimiting is useful to protect against brute-force login attacks,
like in SSH. Only IPv4 is supported for now. Enable it by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw limit PORT/tcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To blocklist IP addresses:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw deny from IP_ADDRESS
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To read more what you can do with &lt;code&gt;ufw&lt;/code&gt;, run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;man ufw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;recovering-from-losing-ssh&#34;&gt;Recovering SSH&lt;/h2&gt;
&lt;p&gt;If you have accidentally firewalled yourself from logging on your
computer, you can recover access by using your VPS&#39;s virtual console.
On Vultr, this is on your VPS&#39;s menu. To the right of the server name,
It is the leftmost icon that looks like a monitor.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/ssh-01.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/ssh-01.png&#34; alt=&#34;View Console&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Log in through there, and disable ufw by typing:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ufw disable
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;further-reading&#34;&gt;Further Reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;man ufw&lt;/code&gt; 👈&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://wiki.ubuntu.com/UncomplicatedFirewall&#34;&gt;Ubuntu Wiki:
UncomplicatedFirewall&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ubuntu.com/community/Gufw&#34;&gt;Gufw (Graphical UFW)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt; - &lt;a href=&#34;https://shunter.xyz&#34;&gt;shunter.xyz&lt;/a&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Log on with SSH Keys</title>
		<link>https://landchad.net/sshkeys/</link>
		<pubDate>Tue, 29 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/sshkeys/</guid>
		<description>&lt;p&gt;Let&#39;s generate and use SSH keys on our computer. This allows us to
ensure our identity better than a password ever could. This allows us to
do two main things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Password-less login&lt;/strong&gt;: With SSH keys, we can permanently designate
our profile on our local computer as safe for our server, allowing
us to bypass password verification when logging into our server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prevent hacking&lt;/strong&gt;: Since we no longer need a password to log in,
we can simply deactivate password logins on our server altogether,
which prevents hacking from people who may be so lucky as to guess
our password!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In other words, using an SSH key to login is &lt;strong&gt;both safer, faster and
easier&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is especially useful once you start making scripts on your computer
that interact with your server. You can upload files in the background,
edit your spam filters or anything else from your local computer without
having to input your password each time you touch the server.&lt;/p&gt;
&lt;h2 id=&#34;generate-an-ssh-key-pair&#34;&gt;Generate an SSH key pair&lt;/h2&gt;
&lt;p&gt;Generating an SSH key is simple. Just run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh-keygen
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will prompt you for several options and you can generally chose the
default options in each case. It will ask you to optionally include a
password on your SSH key. I generally recommend against this unless you
happen to be using a computer where you don&#39;t have root access but
someone else does (it does minimize the ease of using an SSH key in our
case).&lt;/p&gt;
&lt;h3 id=&#34;what-does-this-ssh-key-do&#34;&gt;What does this SSH key do?&lt;/h3&gt;
&lt;p&gt;Now whenever you use &lt;code&gt;ssh&lt;/code&gt; to log into a server, you have the public key
of this SSH key pair as your identifier. You can tell your server to
trust this key and it will automatically allow password-less logins from
this computer.&lt;/p&gt;
&lt;h3 id=&#34;backing-up-your-key&#34;&gt;Backing up your key&lt;/h3&gt;
&lt;p&gt;We will do that momentarily, but first, I recommend you backup your
newly generated key if you plan to use it. If we disable logins to this
one key and then lose the key, we might be locked out of our server.&lt;/p&gt;
&lt;p&gt;I suggest copying your entire &lt;code&gt;~/.ssh/&lt;/code&gt; directory (user-specific) to a
USB drive and storing it securely. You may also copy it to the same
place on another computer to use the key there.&lt;/p&gt;
&lt;h2 id=&#34;making-your-server-trust-your-key&#34;&gt;Making your server trust your key.&lt;/h2&gt;
&lt;p&gt;Now that you have generated an SSH key, just run the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh-copy-id root@yourdomain.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command will ask for your server&#39;s root password and log you in
briefly. What this does is that it puts your public SSH key fingerprint
on your server in a file &lt;code&gt;/root/.ssh/authorized_keys&lt;/code&gt;. This file in turn
allows approved SSH keys to log in without passwords.&lt;/p&gt;
&lt;p&gt;Note that you can also replace &lt;strong&gt;root&lt;/strong&gt; with a username of an account on
the server if you had made a non-root user that you&#39;d like to easily
log into as well. For the username &lt;strong&gt;user&lt;/strong&gt;, it will also store the key
in &lt;code&gt;/home/user/.ssh/authorized_keys&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To test if this has worked, now try logging in normally to your server
with ssh:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ssh root@yourdomain.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should now let you log in without a password prompt!&lt;/p&gt;
&lt;p&gt;If you find that this does not work try running the following, make sure
you are in the directory where the keys where created.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;700&lt;/span&gt; ~/.ssh/
chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;644&lt;/span&gt; ~/.ssh/id_rsa.pub
chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;600&lt;/span&gt; ~/.ssh/id_rsa
chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;644&lt;/span&gt; ~/.ssh/authorized_keys
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For whatever reason these files due not have the correct permissions
set, as ssh is very picky about correct file permissions this can cause
errors. The above will fix these.&lt;/p&gt;
&lt;h2 id=&#34;disabling-password-logins-for-security&#34;&gt;Disabling Password Logins for Security&lt;/h2&gt;
&lt;p&gt;Once we have authorized ssh keys for all the devices we need, we can
actually just disable password logins. If you&#39;ve ever looked at your
system logs (&lt;code&gt;journalctl -xe&lt;/code&gt;) you will find that there are always
hundreds of random Chinese computers trying to brute force every server
connected to the internet with random passwords. They are usually
unsuccessful, but let&#39;s make it &lt;strong&gt;impossible&lt;/strong&gt; for them.&lt;/p&gt;
&lt;p&gt;Log into your server and open the &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; file. Here we
can set settings for our SSH daemon that receives SSH requests.&lt;/p&gt;
&lt;p&gt;Now find, uncomment or create the following three lines and set them all
to &lt;strong&gt;no&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once we&#39;ve done that, we will reload our SSH daemon:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl reload sshd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;warning&#34;&gt;&lt;strong&gt;Warning:&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;It is possible that your ssh configuration
will be overridden by the default configuration added when creating
the VPS, which will leave you vulnerable to brute force attacks. To
prevent this, remove the configuration file using the following
command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;rm /etc/ssh/sshd_config/50-cloud-init.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Also verify that the &lt;code&gt;/etc/ssh/ssh_config.d/&lt;/code&gt; path is empty. If not,
make sure that the configuration files in that folder are not
overriding yours.&lt;/p&gt;
&lt;h3 id=&#34;were-done&#34;&gt;We&#39;re done!&lt;/h3&gt;
&lt;p&gt;Now you can log in quickly and password-less-ly to your server, despite
the fact that it is now more secure than ever!&lt;/p&gt;
&lt;p&gt;With these settings, even if a hacker steals or perfectly guesses an
account password, they still cannot log in without an approved SSH key!&lt;/p&gt;
&lt;h2 id=&#34;what-if-i-lose-my-ssh-key&#34;&gt;What if I lose my SSH key?!&lt;/h2&gt;
&lt;p&gt;Firstly, don&#39;t do this. Take every precaution that you have a backup.&lt;/p&gt;
&lt;p&gt;If this does happen, Vultr and most other VPS providers will have a way
out. Log onto their website and select the server you want to log into.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/ssh-01.png&#34; alt=&#34;vultr login&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;In the image above, to the right of your VPS name are a series of icons.
Click on the computer screen-like icon which is the leftmost one.&lt;/p&gt;
&lt;p&gt;This will open up a browser window emulating a terminal and you can
always login with your password here, since logins here count as being
local&amp;mdash;they do not use SSH and therefore can indeed validate with
your password even if you have disabled it over SSH.&lt;/p&gt;
&lt;p&gt;From here, simply reverse the settings we set above and you can log in
via SSH with a password and reapprove a newly created SSH key or
whatever you want to do.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Maintaining a Server</title>
		<link>https://landchad.net/maintenance/</link>
		<pubDate>Tue, 29 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/maintenance/</guid>
		<description>&lt;p&gt;Here are some important topics you should be familiar with whenever you
are managing a server.&lt;/p&gt;
&lt;h2 id=&#34;update&#34;&gt;Keep packages up to date.&lt;/h2&gt;
&lt;p&gt;All GNU/Linux distributions use package managers to easily be able to
install and update packages without manually downloading them. On
Debian, which we use here for these tutorial the package manager is
&lt;code&gt;apt-get&lt;/code&gt; or &lt;code&gt;apt&lt;/code&gt; for short.&lt;/p&gt;
&lt;p&gt;It&#39;s a good idea to use &lt;code&gt;apt&lt;/code&gt; to keep your software reasonably up to
date.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update
apt upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Not only do up-to-date packages often come with more features, but they
can also fix any possible security bugs.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting-general-problems&#34;&gt;Troubleshooting general problems&lt;/h2&gt;
&lt;p&gt;Often when you are installing something new, you might miss a step and
run into an error, so it&#39;s important to know how to check and see what
errors have happened on your computer.&lt;/p&gt;
&lt;p&gt;On Debian and other GNU/Linux distributions that use systemd (most of
them), you can use the command &lt;code&gt;journalctl&lt;/code&gt; to look at the system&#39;s
general log. You will probably want to run &lt;code&gt;journalctl -xe&lt;/code&gt; as the &lt;code&gt;-x&lt;/code&gt;
and &lt;code&gt;-e&lt;/code&gt; as that gives the most information and starts you at the bottom
of the log to see the most recent errors.&lt;/p&gt;
&lt;p&gt;Some programs do not use this system log, but have their own logs stored
in &lt;code&gt;/var/log/&lt;/code&gt;, or sometimes it&#39;s more convenient to look at a specific
program&#39;s log to see only its issues.&lt;/p&gt;
&lt;p&gt;For example, we can see that in &lt;code&gt;/var/log/nginx/&lt;/code&gt;, nginx produces both
&lt;code&gt;error&lt;/code&gt; and &lt;code&gt;access&lt;/code&gt; files. The &lt;code&gt;access&lt;/code&gt; files show you all the times
people connect to files on your server and much more. We can look at the
most recent errors by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;tail -n &lt;span style=&#34;color:#ae81ff&#34;&gt;25&lt;/span&gt; /var/log/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command &lt;code&gt;tail -n 25&lt;/code&gt; means &amp;quot;show me the last 25 lines of this
file.&amp;quot; You can replace that with &lt;code&gt;less&lt;/code&gt; to browse the whole file. In
&lt;code&gt;less&lt;/code&gt;, navigate with arrows or vim-keys and exit with &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;systemctl&#34;&gt;systemctl&lt;/h3&gt;
&lt;p&gt;Another tool on systemd distributions is &lt;code&gt;systemctl&lt;/code&gt;. At a basic level,
use &lt;code&gt;systemctl status put-service-name-here&lt;/code&gt; to see if a system service
is running and its most recent log. But there&#39;s much more to
&lt;code&gt;systemctl&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For example, you can run &lt;code&gt;systemctl stop nginx&lt;/code&gt; to stop NginX and
&lt;code&gt;systemctl start nginx&lt;/code&gt; to start it back up (or use &lt;code&gt;restart&lt;/code&gt; for both).
When you make changes to a program&#39;s configuration files, &lt;code&gt;reload&lt;/code&gt; well
make them reload them. If you no longer want a service to start when the
system is rebooted, use &lt;code&gt;disable&lt;/code&gt;, or conversely, to make a service
start on reboot use &lt;code&gt;enable&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;finding-files&#34;&gt;Finding Files&lt;/h2&gt;
&lt;p&gt;Especially if you&#39;re new to how a GNU/Linux system is arranged, you
might need help finding files. To find program-related files, you can
just use &lt;code&gt;whereis&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;$ whereis nginx
nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This command lists the directories related to that program. For example,
&lt;code&gt;/etc/nginx&lt;/code&gt; is where the configuration files are and &lt;code&gt;/usr/share/nginx&lt;/code&gt;
is where the library and module-like files are.&lt;/p&gt;
&lt;p&gt;But &lt;code&gt;whereis&lt;/code&gt; can be used only with installed programs. A more general
tool is the pair of &lt;code&gt;updatedb&lt;/code&gt; and &lt;code&gt;locate&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;updatedb&lt;/code&gt; is a command that quickly indexes every file and directory on
your computer. Then you can run &lt;code&gt;locate&lt;/code&gt; to find a file containing a
given name. After running &lt;code&gt;updatedb&lt;/code&gt;, try running &lt;code&gt;locate nginx&lt;/code&gt; to find
all files with &amp;quot;nginx&amp;quot; in their name.&lt;/p&gt;
&lt;p&gt;You can make your search more specific by chaining other Unix commands
through pipes. For example, &lt;code&gt;grep&lt;/code&gt; takes input and returns only lines
that match an extra argument. In the example below, we &lt;code&gt;locate&lt;/code&gt; all
files with &amp;quot;nginx&amp;quot; in the name, but we use &lt;code&gt;grep&lt;/code&gt; to only show us
those with the word &amp;quot;available&amp;quot; in them.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;root@landchad:~# locate nginx | grep available
/etc/nginx/modules-available
/etc/nginx/sites-available
/etc/nginx/sites-available/default
/etc/nginx/sites-available/landchad
/usr/share/nginx/modules-available
/usr/share/nginx/modules-available/mod-http-auth-pam.conf
/usr/share/nginx/modules-available/mod-http-dav-ext.conf
/usr/share/nginx/modules-available/mod-http-echo.conf
/usr/share/nginx/modules-available/mod-http-geoip.conf
/usr/share/nginx/modules-available/mod-http-image-filter.conf
/usr/share/nginx/modules-available/mod-http-subs-filter.conf
/usr/share/nginx/modules-available/mod-http-upstream-fair.conf
/usr/share/nginx/modules-available/mod-http-xslt-filter.conf
/usr/share/nginx/modules-available/mod-mail.conf
/usr/share/nginx/modules-available/mod-stream.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;updatedb&lt;/code&gt; is an ideal candidate for a &lt;a href=&#34;https://landchad.net/cron&#34;&gt;cronjob&lt;/a&gt; so you
don&#39;t have to worry about running each time. For example, adding the
following to your crontab will run &lt;code&gt;updatedb&lt;/code&gt; every 30 minutes:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;*/30 * * * * /usr/bin/updatedb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
	</item>
	
	<item>
		<title>Monero</title>
		<link>https://landchad.net/monero/</link>
		<pubDate>Tue, 29 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/monero/</guid>
		<description>&lt;p&gt;Monero (abbreviated XMR) is easily the cryptocurrency most actually used
as such. Unlike Bitcoin, Monero is actually private and has very low
transaction fees. That makes it a good idea to get a Monero wallet and
add an address on your website where you can receive donations.&lt;/p&gt;
&lt;h2 id=&#34;generate-a-monero-wallet&#34;&gt;Generate a Monero wallet&lt;/h2&gt;
&lt;p&gt;Go to &lt;a href=&#34;https://www.getmonero.org/downloads/&#34;&gt;Monero&#39;s official site&lt;/a&gt; and you can download either the GUI (graphical) or CLI (command-line
wallet). Some Linux distributions will have these packages in their
repositories (&lt;code&gt;monero&lt;/code&gt; and &lt;code&gt;monero-gui&lt;/code&gt; on Arch-based distributions).&lt;/p&gt;
&lt;aside&gt;
&lt;p&gt;If you are a Windows user, note that you will &lt;em&gt;probably&lt;/em&gt; get some kind
of warning that you are installing something malicious. This is because
many malicious pieces of software include crypto miners in them. This
wallet, obviously, does include one as well, because it has the ability
to mine if you want. You can disregard these messages and as that
official site mentions, you can follow their directions to check the
integrity of the download with SHA256.&lt;/p&gt;
&lt;/aside&gt;
&lt;p&gt;Once you install and run the wallet program, you will get a menu like
this:&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monero-01.png&#34; alt=&#34;simple mode&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Now if you want to start using Monero and using it as a pro, you can
choose to download the whole blockchain which will maximize your
transactional privacy, however for this tutorial or setting up a wallet,
we can just do the Simple Mode and save our bandwidth. &lt;strong&gt;In fact, if you
are paranoid, you can disconnect your computer from the internet while
generating a wallet.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now we choose to create a wallet.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monero-02.png&#34; alt=&#34;create wallet&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Now we get the most important and sensitive part, you private mneumonic
seed. &lt;strong&gt;These words are sacred! They are your money!&lt;/strong&gt; To be clear, they
are randomly generated words that seed the randomness required to unlock
whatever money you receive or hold. Never show these words to anyone,
don&#39;t even keep them on your computer, but write them down and store
them securely in real life in a safe or somewhere where only you have
access.&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monero-03.png&#34; alt=&#34;seed&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;It goes without saying that the seed above that we generated for this
tutorial should never be used by anyone since it is public on the
internet and anyone could easily take the funds from the wallet.&lt;/p&gt;
&lt;p&gt;Finally, we get to the main wallet screen. Now we see your public
sharable wallet receiving address. It is the thing that starts with &lt;code&gt;4&lt;/code&gt;
and is too long to be included in the image below labeled &amp;quot;Primary
address.&amp;quot;&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monero-04.png&#34; alt=&#34;address&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;Click the clipboard next to it to copy the whole sequence (which will be
more than 90 letters and numbers) to your clipboard. This is your
address. Put it on your website and you can receive donations!&lt;/p&gt;
&lt;p&gt;You can also click to save that QR code image and you can put it up on
your website and people will be able to scan it and send you Monero.
When scanned, that QR code will read as the public donation address.&lt;/p&gt;
&lt;h2 id=&#34;what-do-i-do-now&#34;&gt;What do I do now?&lt;/h2&gt;
&lt;p&gt;You can now receive Monero/XMR donations! All you need to do is put
either your full address or your QR code on your site and people can
send you tips in Monero.&lt;/p&gt;
&lt;p&gt;Here is the address we use for this site (i.e. not the compromised
wallet generated above):&lt;/p&gt;
&lt;p&gt;&lt;code class=crypto&gt;84RXmrsE7ffCe1ADprxLMHRpmyhZuWYScDR4YghE8pFRFSyLtiZFYwD6EPijVzD3aZiEpg57MfHEr1pGJNPXyJgENMnWrSh&lt;/code&gt;&lt;/p&gt;

&lt;figure class=&#34;qr&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/xmr.png&#34; alt=&#34;monero donation qr&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;It&#39;s now up to you how and where to display these on your site.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Monero Node</title>
		<link>https://landchad.net/monerod/</link>
		<pubDate>Tue, 29 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/monerod/</guid>
		<description>&lt;p&gt;The Monero cryptocurrency relies on a network of &lt;a href=&#34;https://www.getmonero.org/resources/moneropedia/node.html&#34;&gt;decentralized nodes&lt;/a&gt; to store the private transaction information and maintain consensus.&lt;/p&gt;
&lt;p&gt;Running your own node will let you relay transactions and contribute to the Monero network by dedicating storage and processing power to the task. You can then connect to your node from a wallet (if you enable rps).&lt;/p&gt;
&lt;p&gt;Some other benefits of a full node are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;More reliable and trusted as opposed to using a public node&lt;/li&gt;
&lt;li&gt;More secure for RPC calls for payment processors&lt;/li&gt;
&lt;li&gt;The ability to mine using &lt;a href=&#34;https://p2pool.io/#help&#34;&gt;p2pool&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The ability to run a mining pool or solo mine*&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;*&lt;em&gt;Note: Solo mining can be very unreliable and it is not recommended unless you have a very powerful computer.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Running a Monero node requires &lt;em&gt;a lot of storage&lt;/em&gt; (at least 100GB) and a reasonable amount of memory and processing power. If you are hosting at home, make sure to use an &lt;strong&gt;SSD&lt;/strong&gt; and not a hard disk drive, as advised by &lt;code&gt;monerod&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Because of the nature of Monero as an ever-evolving decentralized project, it is advised to download and keep an up-to-date version of it for your node. This can be accomplished by downloading the software manually:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget https://downloads.getmonero.org/linux64
tar -xvjf linux64
mv linux64/monero* /usr/bin/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the hardware you are using is not based on the amd64 architecture (like a Raspberry Pi), the monero project also &lt;a href=&#34;https://www.getmonero.org/downloads/&#34;&gt;offers binaries&lt;/a&gt; for other architectures on Linux, to download and install them simply change the last part of the link (linux64) and the archive name, e.g. for arm64 (linuxarm8). The fastest way to find out which one to use in Debian is with the &lt;code&gt;dpkg --print-architecture&lt;/code&gt; command.&lt;/p&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;By default, Monero comes with no sample configuration files. Create one in &lt;code&gt;/etc/monerod.conf&lt;/code&gt; using a text editor, and enter the following details:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Configuration for monerod&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# Syntax: any command line option may be specified as &amp;#39;clioptionname=value&amp;#39;.&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;#         Boolean options such as &amp;#39;no-igd&amp;#39; are specified as &amp;#39;no-igd=1&amp;#39;.&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# See &amp;#39;monerod --help&amp;#39; for all available options.&lt;/span&gt;

data-dir&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;/var/lib/monero&lt;/mark&gt;
log-file&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;/var/log/monero/monero.log&lt;/mark&gt;
log-level&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;# Slow but reliable db writes&lt;/span&gt;
db-sync-mode&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;safe

&lt;span style=&#34;color:#75715e&#34;&gt;# 1048576 kB/s == 1GB/s; a raise from default 2048 kB/s; contribute more to p2p network&lt;/span&gt;
limit-rate-up&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1048576&lt;/span&gt;
limit-rate-down&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1048576&lt;/span&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;# Be more generous to wallets connecting&lt;/span&gt;
disable-rpc-ban&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;log-files&#34;&gt;Log files&lt;/h3&gt;
&lt;p&gt;The logfile at &lt;code&gt;/var/log/monero/monerod.log&lt;/code&gt; will get &lt;strong&gt;very large, very soon&lt;/strong&gt; if you do not limit it&amp;rsquo;s size. Add these options to &lt;code&gt;/etc/monerod.conf&lt;/code&gt; to limit it&amp;rsquo;s size, and limit the creation of additional log
backups:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Limit log size to 10 MiB&lt;/span&gt;
max-log-file-size&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;10485760&lt;/span&gt;
max-log-files&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;making-a-public-node&#34;&gt;Making a Public Node&lt;/h3&gt;
&lt;p&gt;To advertise and let other users connect to your node, enable the following options:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;restricted-rpc&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;true
&lt;span style=&#34;color:#75715e&#34;&gt;# Bind to all addresses (useful if under NAT)&lt;/span&gt;
p2p-bind-ip&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;0.0.0.0
rpc-bind-ip&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;0.0.0.0
confirm-external-bind&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;

public-node&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;user-creation&#34;&gt;User creation&lt;/h3&gt;
&lt;p&gt;Create a dedicated user to run &lt;code&gt;monerod&lt;/code&gt; named &lt;code&gt;monero&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd -m -d /var/lib/monero monero
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create the directories, and ensure the user has the relevant permissions on them:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir /var/lib/monero &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; chown -R monero:monero /var/lib/monero
mkdir /var/log/monero &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; chown -R monero:monero /var/log/monero
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;pruning-the-blockchain&#34;&gt;Pruning the blockchain&lt;/h3&gt;
&lt;p&gt;When running a node, &lt;a href=&#34;https://www.getmonero.org/resources/moneropedia/pruning.html&#34;&gt;pruning&lt;/a&gt; allows the user to save data by only storing 1/8th of the ring signature information. Every &amp;ldquo;pruned&amp;rdquo; node contains a random 1/8th of the data, so the information is never lost. While this isn&amp;rsquo;t as helpful to the network as running a full node, it is a very reasonable option when storage space and bandwidth are limited. &lt;strong&gt;A pruned node will only use 1/3rd of storage compared to a full node.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To enable pruning, add the following options to &lt;code&gt;/etc/monerod.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;prune-blockchain&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;true
&lt;span style=&#34;color:#75715e&#34;&gt;# This option should speed up the syncing process&lt;/span&gt;
sync-pruned-blocks&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;tori2p-setup&#34;&gt;Tor/I2P Setup&lt;/h2&gt;
&lt;p&gt;from the Monero documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Only handshakes, peer timed syncs and transaction broadcast messages are supported over anonymity networks.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Monero nodes &lt;strong&gt;cannot sync the blockchain over Tor or I2P,&lt;/strong&gt; but the node can broadcast transactions and &lt;em&gt;let users connect&lt;/em&gt; over these anonymizing networks.&lt;/p&gt;
&lt;p&gt;To set this up, first install &lt;a href=&#34;https://landchad.net/tor&#34;&gt;Tor&lt;/a&gt; and/or &lt;a href=&#34;https://landchad.net/i2p&#34;&gt;I2P&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When creating a hidden service, create the following configuration:&lt;/p&gt;
&lt;h3 id=&#34;tor&#34;&gt;Tor&lt;/h3&gt;
&lt;p&gt;Edit &lt;code&gt;/etc/tor/torrc&lt;/code&gt; and add the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;HiddenServiceDir /var/lib/tor/monerod

&lt;span style=&#34;color:#75715e&#34;&gt;# For wallets connecting over RPC:&lt;/span&gt;
HiddenServicePort &lt;span style=&#34;color:#ae81ff&#34;&gt;18081&lt;/span&gt; 127.0.0.1:18181
&lt;span style=&#34;color:#75715e&#34;&gt;# For other nodes:&lt;/span&gt;
HiddenServicePort &lt;span style=&#34;color:#ae81ff&#34;&gt;18083&lt;/span&gt; 127.0.0.1:18183
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now restart Tor:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart tor
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can acquire the Tor address by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cat /var/lib/tor/monerod/hostname
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;i2p&#34;&gt;I2P&lt;/h3&gt;
&lt;p&gt;Edit &lt;code&gt;tunnels.conf&lt;/code&gt; (Which may be located in &lt;code&gt;/etc/i2pd/&lt;/code&gt; if you followed &lt;a href=&#34;https://landchad.net/i2p&#34;&gt;this&lt;/a&gt; guide) and add the following tunnels:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[monerod]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;type &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; http&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;host &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 127.0.0.1&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;port &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 18283&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;keys &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; monerod.dat&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[monerod-rpc]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;type &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; http&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;host &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 127.0.0.1&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;port &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; 18281&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;keys &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; monerod-rpc.dat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now restart &lt;code&gt;i2pd&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart i2pd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can acquire the I2P address by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;printf &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;%s.b32.i2p
&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;head -c &lt;span style=&#34;color:#ae81ff&#34;&gt;391&lt;/span&gt; /home/i2p/.i2pd/monerod.dat | sha256sum |xxd -r -p | base32 | sed s/&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;//g | tr A-Z a-z&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-monerod&#34;&gt;Configuring monerod&lt;/h3&gt;
&lt;p&gt;Then, in &lt;code&gt;/etc/monerod.conf&lt;/code&gt;, add the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Tor config&lt;/span&gt;
tx-proxy&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;tor,127.0.0.1:9050,10
anonymous-inbound&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;your-tor-address-here.onion&lt;/mark&gt;:18083,127.0.0.1:18183,16

&lt;span style=&#34;color:#75715e&#34;&gt;# I2P config&lt;/span&gt;
tx-proxy&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;i2p,127.0.0.1:4447
anonymous-inbound&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;your-i2p-address-here.b32.i2p&lt;/mark&gt;:80,127.0.0.1:18283,16 &lt;span style=&#34;color:#75715e&#34;&gt;# Maximum 16 simultaneous connections&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;running-the-node&#34;&gt;Running the Node&lt;/h2&gt;
&lt;p&gt;Then, run this command to download the systemd daemon configuration for &lt;code&gt;monerod&lt;/code&gt;. This will allow your node to run in the background and start automatically on boot as a service.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl https://raw.githubusercontent.com/monero-project/monero/master/utils/systemd/monerod.service &amp;gt; &lt;mark&gt;/etc/systemd/system/monerod.service&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Note: This configuration assumes that you&amp;rsquo;ve created a user named &lt;code&gt;monero&lt;/code&gt; which runs the program &lt;code&gt;monerod&lt;/code&gt; in it&amp;rsquo;s home directory, and which points to the configuration in &lt;code&gt;/etc/monerod.conf&lt;/code&gt;. Edit any of these details in &lt;code&gt;/etc/systemd/system/monerod.service&lt;/code&gt; if they don&amp;rsquo;t apply to your configuration.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Now reload the systemd service file:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To run the node, restart the systemd service:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl restart monerod
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To monitor the node&amp;rsquo;s status at any time (for example, to check sync progress) check the log file using &lt;code&gt;tail&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;tail -f /var/log/monero/monerod.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;connecting-to-your-node&#34;&gt;Connecting to your Node&lt;/h2&gt;
&lt;p&gt;To connect to your node using the GUI wallet, first open it:&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monerod/monerod-step-1.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;On the mode selection screen, make sure to pick &lt;strong&gt;Advanced mode:&lt;/strong&gt;&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monerod/monerod-step-2.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;When you reach daemon settings, select the &lt;strong&gt;Connect to a remote node&lt;/strong&gt; option, and then click &lt;strong&gt;add remote node.&lt;/strong&gt;&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monerod/monerod-step-3.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;A prompt will appear, asking for your node&amp;rsquo;s details. Add your &lt;strong&gt;address,&lt;/strong&gt; set the port to &lt;strong&gt;18081,&lt;/strong&gt; and make to click &lt;strong&gt;Mark as trusted daemon.&lt;/strong&gt;&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monerod/monerod-step-4.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

&lt;p&gt;When you reach the main wallet screen, you&amp;rsquo;ll see &lt;strong&gt;&amp;ldquo;Remote Node&amp;rdquo;&lt;/strong&gt; in the bottom-left corner. Now you can enjoy using your Monero node straight from your wallet!&lt;/p&gt;

&lt;figure &gt;&lt;img src=&#34;https://landchad.net/pix/monerod/monerod-step-5.webp&#34;loading=&#34;lazy&#34;
	&gt;&lt;/figure&gt;

</description>
	</item>
	
	<item>
		<title>Get a Server</title>
		<link>https://landchad.net/basic/server/</link>
		<pubDate>Fri, 04 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/basic/server/</guid>
		<description>&lt;p&gt;Once you have a &lt;a href=&#34;https://landchad.net/basic/domain&#34;&gt;domain name&lt;/a&gt;, you&#39;ll need a server to
host all your website files on. In general, a server is just a computer
that is constanly broadcasting some services on the internet.&lt;/p&gt;
&lt;p&gt;Servers connected to the internet can be extremely useful with or
without proper websites attached to them. You can be your own website,
email, file-sharing service and much more.&lt;/p&gt;
&lt;h2 id=&#34;getting-a-vps&#34;&gt;Getting a VPS&lt;/h2&gt;
&lt;p&gt;A Virtual Personal Server (VPS) is a very cheap and easy way to get a
web server. Without you having to buy expensive equipment. There are a
lot of online businesses that have massive server farms with great
internet connection and big power bills that allow you to rent a VPS in
that farm for pocket change.&lt;/p&gt;
&lt;p&gt;A VPS usually costs $5 a month. Sometimes slightly more, sometimes
slightly less. That&#39;s a good price for some internet real-estate, but
in truth, you can host a huge number of websites and services on a
single VPS, so you get a lot more. I might have a dozen websites, an
email server, a chat server and a file-sharing services on one VPS.&lt;/p&gt;
&lt;p&gt;The VPS provider that I&#39;ll be using for this guide is Vultr, since that
is what I use. Vultr provides a free one-month $100 credit to anyone
who starts an account through &lt;a href=&#34;https://www.vultr.com/?ref=8384069-6G&#34;&gt;this referral link of
mine&lt;/a&gt; so you can play around with
their services with impunity.&lt;/p&gt;
&lt;h2 id=&#34;starting-your-server-in-two-minutes-or-less&#34;&gt;Starting your server in two minutes or less&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://www.vultr.com/?ref=8384069-6G&#34;&gt;Start an account on Vultr&lt;/a&gt; and
let&#39;s get started.&lt;/p&gt;
&lt;p&gt;Vultr (and other VPS providers) usually give you a choice in where and
what exactly your VPS is.&lt;/p&gt;
&lt;h4 id=&#34;server-location&#34;&gt;Server Location&lt;/h4&gt;
&lt;p&gt;In general, it doesn&#39;t &lt;em&gt;hugely&lt;/em&gt; matter what physical location you have
your server in. You might theoretically want it close to where you or
your audience might be, but if you host a server in Singapore for an
American audience, they won&#39;t have to be waiting a perceptibly longer
time to load the site.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/server-location.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/server-location.png&#34; alt=&#34;Pick your servers&amp;#39;s location&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Some locations might have different abilities and plans than others.
For example, in Vultr, their New York location has optional DDOS
protection and also has some cheaper $3.50 servers.&lt;/strong&gt;&lt;/p&gt;
&lt;h4 id=&#34;operating-systemserver-type&#34;&gt;Operating System/Server Type&lt;/h4&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/server-type.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/server-type.png&#34; alt=&#34;server type&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;I especially recommend &lt;strong&gt;Debian 11&lt;/strong&gt; for an operating system for your
server. Debian is the &amp;quot;classic&amp;quot; server OS and as such, &lt;strong&gt;I make my
guides on this site for Debian 11&lt;/strong&gt;. If you use another OS, just know
that your millage may vary in terms of you might need to change some
instructions here minorly.&lt;/p&gt;
&lt;h4 id=&#34;server-size&#34;&gt;Server size&lt;/h4&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/server-size.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/server-size.png&#34; alt=&#34;server size&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;You finally have a choice in how beefy a server you want. On Vultr, I
recommend getting the cheapest option that is not IPv6 only.&lt;/p&gt;
&lt;p&gt;Web hosting and even moderately complicated sites do not use huge
amounts of RAM or CPU power. If you start doing more intensive stuff
than hosting some webpages and an email server and such, you can always
bump up your plan on Vultr without data loss (it&#39;s not so easy to bump
down).&lt;/p&gt;
&lt;h4 id=&#34;additional-features&#34;&gt;Additional features&lt;/h4&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/server-features.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/server-features.png&#34; alt=&#34;additional features&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;On Vultr, there are some final checkboxes you can select additional
options. &lt;strong&gt;You will want to check &lt;em&gt;Enable IPv6&lt;/em&gt; and also &lt;em&gt;Block Storage
Compatible&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We will be setting up IPv6 because it&#39;s important for future-proofing
your website as more of the web moves to the IPv6 protocol. Block
storage is the ability (if you want) to later rent large storage disks
to connect to your VPS if desired. You just might want that as an
option, so it&#39;s worth activating now.&lt;/p&gt;
&lt;h3 id=&#34;done&#34;&gt;Done!&lt;/h3&gt;
&lt;p&gt;Once you select those settings, your server will automatically be
deployed. Momentarily, you will be able to see your server&#39;s IP
addresses which will be used for the next brief step:&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Get a Domain Name</title>
		<link>https://landchad.net/basic/domain/</link>
		<pubDate>Tue, 01 Jun 2021 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/basic/domain/</guid>
		<description>&lt;h2 id=&#34;terms&#34;&gt;Terms&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Domain name&lt;/dt&gt;
&lt;dd&gt;The name of a website that you type in an address bar. This site&#39;s
domain name is &lt;code&gt;LandChad.net&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;Top-level domain (TLD)&lt;/dt&gt;
&lt;dd&gt;The extension of a domain name, like &lt;code&gt;.com&lt;/code&gt;, &lt;code&gt;.net&lt;/code&gt;, &lt;code&gt;.xyz&lt;/code&gt;, etc.&lt;/dd&gt;
&lt;dt&gt;Registrar&lt;/dt&gt;
&lt;dd&gt;A service authorized to reserve a domain name for you.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;When domain names first sell, they usually sell for very cheap, but once
someone buys one, they have the rights to it until they decide to sell
it, often for much, much more money. Therefore, it&#39;s a good idea to
reserve a domain name ASAP, even if you didn&#39;t intend on doing anything
big with it.&lt;/p&gt;
&lt;p&gt;So let&#39;s register your domain name!&lt;/p&gt;
&lt;h2 id=&#34;how&#34;&gt;How&lt;/h2&gt;
&lt;p&gt;Domains can be registered at any accredited &lt;dfn&gt;registrar&lt;/dfn&gt; and there are
&lt;a href=&#34;https://www.icann.org/en/accredited-registrars&#34;&gt;a lot to choose from&lt;/a&gt;. Some major names are
&lt;a href=&#34;https://www.hostgator.com/domains&#34;&gt;Host Gator&lt;/a&gt;,
&lt;a href=&#34;https://www.bluehost.com/domains&#34;&gt;Blue Host&lt;/a&gt;,
&lt;a href=&#34;https://www.namecheap.com/domains/&#34;&gt;Name Cheap&lt;/a&gt; or
&lt;a href=&#34;https://www.dreamhost.com/domains/&#34;&gt;Dream Host&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are also sites that are more private, like &lt;a href=&#34;https://njal.la/&#34;&gt;Njalla&lt;/a&gt; and
&lt;a href=&#34;https://cheapprivacy.ru/&#34;&gt;Cheap Privacy&lt;/a&gt;, which register a domain for you
under their name, but still allow you access to it. (Normally all websites must
be registered with the ICANN with a real name and address, but these sites
allow you to bypass that.)&lt;/p&gt;
&lt;p&gt;Choosing a registrar is not permanent, and you can transfer domains to a
different registrar if you get a better deal later, so in most cases, you can just
choose one and let&amp;rsquo;s head on&amp;hellip;&lt;/p&gt;
&lt;h3 id=&#34;basic-info-about-domain-names&#34;&gt;Basic info about domain names&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Domain names usually require a &lt;em&gt;very&lt;/em&gt; small yearly fee to keep
registered, usually around $12 for most generic TLDs. There are
some &amp;quot;specialty&amp;quot; TLDs that are more expensive, but &lt;code&gt;.com&lt;/code&gt;, &lt;code&gt;.xyz&lt;/code&gt;
and other basic TLDs are that cheap.&lt;/li&gt;
&lt;li&gt;Once you own a domain, it is yours as long as you pay the yearly
fee, but you can also sell it to someone for however much you want.&lt;/li&gt;
&lt;li&gt;Domain names do not hold your data or your website; instead, you add
&amp;quot;DNS settings&amp;quot; that direct people connecting to your domain to
your IP address. The purpose of a domain name is so that people
don&#39;t have to remember your IP address to find your website!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;looking-for-domain-names&#34;&gt;Looking for domain names&lt;/h3&gt;
&lt;p&gt;Let&#39;s go to our registrar&amp;rsquo;s site and you can search for domain names.&lt;/p&gt;
&lt;p&gt;You can look for whatever domain name you want. Domains that are already
bought and owned by someone else might have the option to &amp;quot;Backorder,&amp;quot;
but it&#39;s always best to get one that is unowned, like these:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/domain-search.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/domain-search.png&#34; alt=&#34;Searching for a domain name&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Note the differences in prices. Some &amp;quot;specialty&amp;quot; TLDs like &lt;code&gt;.game&lt;/code&gt; and
&lt;code&gt;.io&lt;/code&gt; charge a much larger fee, although you might want one. Some
domains above, like &lt;code&gt;.xyz&lt;/code&gt; and &lt;code&gt;.org&lt;/code&gt; have reduced prices for the first
year.&lt;/p&gt;
&lt;p&gt;Choose the domain you want and buy it. These &lt;code&gt;.xyz&lt;/code&gt; domains are a steal
now on sale.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/domain-cart.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/domain-cart.png&#34; alt=&#34;Buying a domain name&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;That&#39;s all you have to do to own a domain name! As you register a
domain, you can also setup an automatic payment to pay your fee yearly
to keep your domain. Easy as pie.&lt;/p&gt;
&lt;p&gt;Now we will get a server to host your website on.&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Self hosting</title>
		<link>https://landchad.net/selfhosting/</link>
		<pubDate>Wed, 19 Aug 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/selfhosting/</guid>
		<description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When you have a(n old) computer lying around, and you have cheap
electricity and a good internet connection, self hosting might be a good
option for you.&lt;/p&gt;
&lt;h3 id=&#34;why-would-you-choose-selfhosting&#34;&gt;Why would you choose selfhosting?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;You have control over the hardware, and you can upgrade your server
in the future. For example: if you host a file server and your hard
drive goes full, you can simply add another hard drive or upgrade
it.&lt;/li&gt;
&lt;li&gt;No bandwith limits, storage limits, etc. (some VPSes have this)&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;can&lt;/strong&gt; be cheaper than using a VPS. This only is the case if you
got the server for really cheap and your electricity is cheap.&lt;/li&gt;
&lt;li&gt;You can have a media server to consoom your content (for example
with &lt;code&gt;Jellyfin&lt;/code&gt;). You can technically do this on a VPS, but that
will be more expensive than self hosting. If you have a media
server, you can stream media from your server to more devices. (I
recommend just downloading it on your device, but if you have
multiple devices, this could be a good solution)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;downsides&#34;&gt;Downsides&lt;/h3&gt;
&lt;p&gt;Some possible downsides of choosing to host at home could be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your ISP not approving of what you&#39;re doing. Some ISP&#39;s do not
condone you hosting at home. Usually when this is the case, it could
be harder if you want to forward ports, or it could be impossible to
get a static IP address. Check your ISP&#39;s terms of service.
Sometimes, it will say that hosting a webserver, email server, and
more, is not allowed.&lt;/li&gt;
&lt;li&gt;This can also include blocked ports. ISPs can block certain ports to
the world. Sometimes ISPs only block 445/139 (which is for the
better as Samba, using these ports isn&#39;t really secure and it&#39;s
outdated). But some ISPs (sadly) block crucial ports like 80
and/or 443. You need to check this before trying anything. If this
is the case, a way to get around it is to get another ISP or use an
alternative port. A great website to check this is:
&lt;a href=&#34;https://canyouseeme.org/&#34;&gt;canyouseeme.org&lt;/a&gt;. You can also check if
you did the port forwaring correctly here.&lt;/li&gt;
&lt;li&gt;Security. Opening your network to the public could bring security
risks. For example, never open a Samba server to the public, because
it&#39;s a pretty old protocol, and it has some security
vulnerabilities. Be sure you are forwarding the right port, and
don&#39;t just forward random ports to the internet. Also, if you are
getting DDoSed, your ISP will temporarily shut down your whole
internet connection.&lt;/li&gt;
&lt;li&gt;When setting up an email server, it can be way harder to not have
your email show up as spam in other&#39;s people email. If you use a
VPS, this is way easier.&lt;/li&gt;
&lt;li&gt;Space, power consumption and noise. Of course, this differs per
server.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Your mileage may vary, go and check each of these points, and see if
selfhosting is the right choice for you. Try and calculate your power
consumption and see if your electricity cost is not too expensive.&lt;/p&gt;
&lt;p&gt;For me, the upsides outweighed the downsides, which is why I chose to
host at home. But, this differs with each person and scenario. Go and
research what your exact situation is, before trying anything. Otherwise
you&#39;ll have to face some bad surprises.&lt;/p&gt;
&lt;h2 id=&#34;hardware&#34;&gt;Hardware&lt;/h2&gt;
&lt;h3 id=&#34;what-kind-of-hardware-should-you-choose&#34;&gt;What kind of hardware should you choose?&lt;/h3&gt;
&lt;p&gt;If you pay your own electricity bill, power consumption is a big factor.
Most old laptop computers are ideal in the sense that they don&#39;t use a
lot of power, and if the battery still works, you have a built-in UPS!
The bad thing is, most old laptop computers aren&#39;t that powerful, and
they lack in upgradability. (you shouldn&#39;t really be using anything
older than 2006, and I recommend at least a performance equivalant of a
Core 2 CPU)&lt;/p&gt;
&lt;p&gt;If you can find an energy efficient desktop (under 100W), that is a
great option. They are pretty upgradable and they don&#39;t use a lot of
power. They can also be pretty cheap, but old laptops are usually
cheaper. If you can afford new hardware, and are willing to build a PC,
you can find really power effecient CPU/motherboard combos, and they can
be cheap, for example the Celeron J3060. I recommend a low wattage power
supply or an effecient one for these kinds of builds. Pico PSUs are
pretty tiny and efficient solutions in these builds.&lt;/p&gt;
&lt;p&gt;Of course, if you don&#39;t pay your electricity bill or cost is not a
problem for you, you can use just about any old desktop (as long as
it&#39;s not from the 90&#39;s, I recommend at least a Core 2 chip again, or
an Athlon 64 X2).&lt;/p&gt;
&lt;h3 id=&#34;usecases&#34;&gt;Usecases&lt;/h3&gt;
&lt;p&gt;Of course, hardware choices depend on the usecase. The above
recommendations I gave you work fine for e-mail server, webserver and
fileserver types of applications, but they will struggle to transcode
video if you are going to host a media server. You&#39;ll need a faster
CPU, but also a faster GPU. As an example, the Athlon 200GE or 3000G are
good and efficient choices for these builds. They are decent CPUs, but
also have a built in GPU that will transcode video just fine.&lt;/p&gt;
&lt;p&gt;If you need a lot of storage, go for a case with a lot of mounts for
hard drives, this way you can easily mount multiple hard drives. Pros of
multiple hard drives are redundancy and speed. Cons could be that they
create more heat and noise. You can&#39;t use a laptop if you want multiple
drives, except if you use a hard drive caddy for the CD/DVD drive bay.
Some business laptops even support RAID 1 (redundancy) and RAID 0 (speed
and more storage, but you lose your files if one hard drive breaks) this
way.&lt;/p&gt;
&lt;h2 id=&#34;getting-started&#34;&gt;Getting started&lt;/h2&gt;
&lt;h3 id=&#34;installing-debian&#34;&gt;Installing Debian&lt;/h3&gt;
&lt;p&gt;Once you have the machine, you can install the OS. I recommend Debian,
as all of the guides on this website are Debian specific. Debian just
werks as a server OS.&lt;/p&gt;
&lt;p&gt;You&#39;ll need to burn a Debian install image onto a USB flash drive or a
CD. You can download the image
&lt;a href=&#34;https://www.debian.org/CD/netinst/&#34;&gt;here&lt;/a&gt;, and you can also find
information on how to burn the image onto a USB flash drive or CD there.&lt;/p&gt;
&lt;p&gt;While installing Debian, do not install any desktop environment. But
install an SSH server when you get the chance. Also leave webserver
unchecked, even if you want to use it as a webserver. You&#39;ll have a
chance to install this later.&lt;/p&gt;
&lt;h3 id=&#34;port-forwaring&#34;&gt;Port forwaring&lt;/h3&gt;
&lt;p&gt;Every time you are going to set up a new server program, you need to
forward a port corresponding to that program. For example, HTTP is port
80, HTTPS is 443, etc. You need to set this up on your router&#39;s NAT
settings (sometimes just called port forwarding, this differs per
router). These steps differ for each router. Refer to your routers
manual. A simple command to see what your servers IP address is, is to
run &lt;code&gt;ifconfig&lt;/code&gt; on your server. This shows a lot of network info, but it
will also show your local IP address needed for port forwarding.&lt;/p&gt;
&lt;p&gt;Basic ports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SSH: port 22 (open this port if you want to admin your server
outside your network)&lt;/li&gt;
&lt;li&gt;HTTP: port 80 (open this port if you want basic webserver
functionality)&lt;/li&gt;
&lt;li&gt;HTTPS: port 443 (you should open this port if you are setting up a
webserver because encryption)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;static-or-dynamic-ip-address&#34;&gt;Static or dynamic IP address&lt;/h3&gt;
&lt;p&gt;If you want to host your server at home, make sure you have a static IP
address, or you can change your dynamic IP address to a static one.
Refer to your router settings, some ISPs will have options on this here.
If you can&#39;t find anything on this, get in touch with your ISP.&lt;/p&gt;
&lt;p&gt;Once you&#39;ve made sure you have a static IP address, you can find out
what the IP address is with various websites. You can use a search
engine to easily find this out. Write this down as you&#39;ll need it
later.&lt;/p&gt;
&lt;p&gt;Once you&#39;re done, you can pretty much follow every guide on this
website, the only difference is that you&#39;ll need to forward the ports
you&#39;ll be using for the server.&lt;/p&gt;
&lt;h3 id=&#34;finding-the-ports-youll-need-to-forward&#34;&gt;Finding the ports you&#39;ll need to forward&lt;/h3&gt;
&lt;p&gt;If you need to know what port you&#39;ll need to forward, there&#39;s a
command for that. Just type &lt;code&gt;netstat -tulpn&lt;/code&gt; in your servers command
line. If you want to see the name of the programs, you need to run it as
a root user. You can do this by putting &lt;code&gt;sudo&lt;/code&gt; before the command.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;Local Address                    State       PID/Program name
0.0.0.0:25                       LISTEN      887/master
0.0.0.0:1883                     LISTEN      22452/mosquitto
0.0.0.0:445                      LISTEN      798/smbd
0.0.0.0:993                      LISTEN      381/dovecot
127.0.0.1:3306                   LISTEN      560/mysqld
0.0.0.0:587                      LISTEN      887/master
0.0.0.0:139                      LISTEN      798/smbd
127.0.1.1:12301                  LISTEN      412/opendkim
0.0.0.0:143                      LISTEN      381/dovecot
0.0.0.0:465                      LISTEN      887/master
0.0.0.0:22                       LISTEN      472/sshd
:::25                            LISTEN      887/master
:::443                           LISTEN      1769/apache2
:::1883                          LISTEN      22452/mosquitto
:::445                           LISTEN      798/smbd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Example output&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In this example, if you need to find the port number from &lt;code&gt;dovecot&lt;/code&gt;, you
can look for it in the &lt;code&gt;Program name&lt;/code&gt; column. Then you can see in the
local address column that the reported local address is &lt;code&gt;0.0.0.0:993&lt;/code&gt;.
You need to look for the part after the semicolon. In this case it&#39;s
993. So you&#39;ll need to forward port 993.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Written by &lt;a href=&#34;https://github.com/hidde-j&#34;&gt;hiddej&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>IRC</title>
		<link>https://landchad.net/irc/</link>
		<pubDate>Fri, 03 Jul 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/irc/</guid>
		<description>&lt;p&gt;Creating your own chat server for you and your friends is easy, and you
don&#39;t have to rely on a complicated system to get started. IRC is an
old but gold protocol, and has clients for basically every operating
system made since the 80s, with many powerful modern ones on Linux, Mac,
and Windows.&lt;/p&gt;
&lt;p&gt;Having a chat server for you and your friends makes it impossible for a
group of arbitrarily appointed moderators to deplatform you for
wrong-think, and gives you greater freedom of communication.&lt;/p&gt;
&lt;h2 id=&#34;installing&#34;&gt;Installing an IRCd&lt;/h2&gt;
&lt;p&gt;An IRCd is short for &amp;quot;IRC daemon&amp;quot;, which just means an IRC server. The
most easy IRCd to set up is &lt;a href=&#34;https://ergo.chat/&#34;&gt;Ergo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The first thing you need to do is create a new user for the server to be
run by. This is good practice for installing software/servers manually,
as it give you more fine-grained control over which permissions the
application has.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd -m ergo -s /bin/bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, we want to switch to our newly created &lt;code&gt;ergo&lt;/code&gt; user and create the
server directory.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;sudo -i -u ergo
mkdir server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can find the latest release of Ergo on its GitHub &lt;a href=&#34;https://github.com/ergochat/ergo/releases/latest&#34;&gt;latest
release&lt;/a&gt; page.&lt;br&gt;
There are several platforms available, but you want to choose Linux,
most likely &lt;code&gt;linux-x86_64&lt;/code&gt;.&lt;br&gt;
Once you have selected the correct package, copy its URL and replace the
release url with the package URL (still as the &lt;code&gt;ergo&lt;/code&gt; user):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;wget &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://github.com/ergochat/ergo/releases/download/v2.10.0/ergo-2.10.0-linux-x86_64.tar.gz&amp;#34;&lt;/span&gt;
tar -xf ergo-2.10.0-linux-x86_64.tar.gz
mv ergo-2.10.0-linux-x86_64/*
rm -r ergo-2.10.0-linux-x86_64*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Executing &lt;code&gt;ls -l&lt;/code&gt; should now yield something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;-rw-r--r-- &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; ergo ergo  &lt;span style=&#34;color:#ae81ff&#34;&gt;118825&lt;/span&gt; Jun  &lt;span style=&#34;color:#ae81ff&#34;&gt;8&lt;/span&gt; 00:51 CHANGELOG.md
-rw-r--r-- &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; ergo ergo    &lt;span style=&#34;color:#ae81ff&#34;&gt;1983&lt;/span&gt; May &lt;span style=&#34;color:#ae81ff&#34;&gt;31&lt;/span&gt; 01:48 README
-rw-r--r-- &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; ergo ergo   &lt;span style=&#34;color:#ae81ff&#34;&gt;41440&lt;/span&gt; Jun  &lt;span style=&#34;color:#ae81ff&#34;&gt;8&lt;/span&gt; 00:42 default.yaml
drwxr-xr-x &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; ergo ergo    &lt;span style=&#34;color:#ae81ff&#34;&gt;4096&lt;/span&gt; Jul  &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; 09:01 docs
-rwxr-xr-x &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; ergo ergo &lt;span style=&#34;color:#ae81ff&#34;&gt;9654272&lt;/span&gt; Jun  &lt;span style=&#34;color:#ae81ff&#34;&gt;8&lt;/span&gt; 00:53 ergo
-rw-r--r-- &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; ergo ergo    &lt;span style=&#34;color:#ae81ff&#34;&gt;1753&lt;/span&gt; May &lt;span style=&#34;color:#ae81ff&#34;&gt;31&lt;/span&gt; 01:48 ergo.motd
drwxr-xr-x &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; ergo ergo   &lt;span style=&#34;color:#ae81ff&#34;&gt;12288&lt;/span&gt; Jul  &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; 09:01 languages
-rw-r--r-- &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; ergo ergo   &lt;span style=&#34;color:#ae81ff&#34;&gt;39722&lt;/span&gt; Jun  &lt;span style=&#34;color:#ae81ff&#34;&gt;8&lt;/span&gt; 00:42 traditional.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you see something similar to the above, that means Ergo is installed,
although not quite ready to run yet.&lt;/p&gt;
&lt;h2 id=&#34;configuring&#34;&gt;Configuring Ergo&lt;/h2&gt;
&lt;p&gt;Now that Ergo is installed, you want to configure it to fit the needs of
your group.&lt;br&gt;
The configuration in this section is tailored towards a small group of
people, and less for a possibly large network, but it should work for
any size of group.&lt;/p&gt;
&lt;p&gt;First thing, make sure you&#39;re still using the &lt;code&gt;ergo&lt;/code&gt; user, and are in
the &lt;code&gt;~/server&lt;/code&gt; directory.&lt;br&gt;
If you aren&#39;t, you can run the following to get back there:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;sudo -i -u ergo
cd ~/server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To start configuring, we need to copy some files:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;cp default.yaml ircd.yaml
cp ergo.motd ircd.motd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next, generate certificate files for TLS:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./ergo mkcerts
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ergo comes with a default configuration file with detailed documentation
that can be used to guide you through the configuration process. This
guide will help you setup the server for a typical use-case, but if you
see any settings that you would like to change along the way, go ahead
and change them, as long as you know what you&#39;re doing.&lt;/p&gt;
&lt;p&gt;The next steps involve editing the newly copied &lt;code&gt;ircd.yaml&lt;/code&gt; file. If you
do not know how to edit text files from the command line, you can use
&lt;code&gt;nano&lt;/code&gt;, which is very simple, using arrow keys to navigate, &lt;kbd&gt;CTRL+O&lt;/kbd&gt; to
save, and &lt;kbd&gt;CTRL+X&lt;/kbd&gt; to exit.&lt;br&gt;
Another option is &lt;code&gt;vim&lt;/code&gt;, which is a much more powerful text editor, but
has a learning curve. It is only recommended for this guide if you
already know how to use it.&lt;br&gt;
Lastly, you can copy the &lt;code&gt;ircd.yaml&lt;/code&gt; file to a text editor on your
computer and edit it with a GUI text editor of your choice. If that is
what you choose to do, you may want to just download the file from
&lt;a href=&#34;https://raw.githubusercontent.com/ergochat/ergo/master/default.yaml&#34;&gt;Ergo&#39;s
GitHub&lt;/a&gt;,
edit it on your computer, clear the &lt;code&gt;ircd.yaml&lt;/code&gt; file on the server, and
then paste the contents from your computer into the blank file.&lt;br&gt;
No matter how you do it, the next steps assume you can edit the
configuration file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;br&gt;
The options highlighted in this section are not a complete overview of
all options. Instead, the options shown are the ones which are most
relevant to a small network.&lt;br&gt;
You should read over the configuration file yourself if you are curious
about everything you can change.&lt;/p&gt;
&lt;h3 id=&#34;configuring-names&#34;&gt;Network and server names&lt;/h3&gt;
&lt;p&gt;One of the first properties in the config file is network name. You can
change this to whatever you like, as it will show up as the name when
you connect to the server.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# network configuration&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;network&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# name of the network&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Land-Chat&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Change the server name to your server&#39;s domain name.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# server configuration&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;server&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# server name&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;name&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;example.org&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-password&#34;&gt;Network password&lt;/h3&gt;
&lt;p&gt;The next step is optional, depending on if you want your network
password protected or not. The benefit of password protection is fairly
obvious; nobody can connect to your network unless you gave them the
password. If you&#39;re wanting to run a public network which anyone can
join and create a channel, you want to skip this, but for personal
setups, it is highly recommended.&lt;/p&gt;
&lt;p&gt;Generate a password to use by executing the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./ergo genpasswd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will ask you to enter a password and confirm it, then you will be
given a hashed password.&lt;br&gt;
Copy this password, and paste it into the following field (also removing
the &lt;code&gt;#&lt;/code&gt; before the &lt;code&gt;password:&lt;/code&gt; line):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# password to login to the server, generated using `ergo genpasswd`:&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;password&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;mark&gt;your hashed password&lt;/mark&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-motd&#34;&gt;Message of the day (MotD)&lt;/h3&gt;
&lt;p&gt;Change the MotD (&lt;strong&gt;M&lt;/strong&gt;essage &lt;strong&gt;o&lt;/strong&gt;f &lt;strong&gt;t&lt;/strong&gt;he &lt;strong&gt;D&lt;/strong&gt;ay) file to the one you
copied earlier:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# motd filename&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# if you change the motd, you should move it to ircd.motd&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;motd&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;ircd.motd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Feel free to edit &lt;code&gt;ircd.motd&lt;/code&gt; to your heart&#39;s content. Its contents
will be sent to clients when they connect to the network.&lt;/p&gt;
&lt;h3 id=&#34;configuring-ip-limits&#34;&gt;IP limits&lt;/h3&gt;
&lt;p&gt;For security purposes, you might want to limit the amount of client
connections per IP. For a private network, 4 is likely the maximum
amount of connections you will have per IP, so that is a safe value.&lt;br&gt;
If your network is password protected, this is less of an issue, since
the only people connecting will be people who have the password. The
following is the default, but you can change it to be whichever value
you like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# IP-based DoS protection&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;ip-limits&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# whether to limit the total number of concurrent connections per IP/CIDR&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;count&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# maximum concurrent connections per IP/CIDR&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;max-concurrent-connections&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;16&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-ip-cloaking&#34;&gt;IP cloaking&lt;/h3&gt;
&lt;p&gt;Traditionally, IRC networks expose users&#39; IP addresses to everyone.
This is not a good practice for privacy, however. With Ergo, IP cloaking
is enable by default. You can enable or disable it if you like, and
change how it looks to users.&lt;br&gt;
In this case, &lt;code&gt;netname&lt;/code&gt; was changed to &lt;code&gt;&amp;quot;chad&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# IP cloaking hides users&amp;#39; IP addresses from other users and from channel admins&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# (but not from server admins), while still allowing channel admins to ban&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# offending IP addresses or networks. In place of hostnames derived from reverse&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# DNS, users see fake domain names like pwbs2ui4377257x8.irc. These names are&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# generated deterministically from the underlying IP address, but if the underlying&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# IP is not already known, it is infeasible to recover it from the cloaked name.&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# If you disable this, you should probably enable lookup-hostnames in its place.&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;ip-cloaking&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# whether to enable IP cloaking&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# whether to use these cloak settings (specifically, `netname` and `num-bits`)&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# to produce unique hostnames for always-on clients. you can enable this even if&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# you disabled IP cloaking for normal clients above. if this is disabled,&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# always-on clients will all have an identical hostname (the server name).&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled-for-always-on&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# fake TLD at the end of the hostname, e.g., pwbs2ui4377257x8.irc&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# you may want to use your network name here&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;netname&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;chad&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-hexchat-password&#34;&gt;Password enforcement adjustments for HexChat (and possibly other clients)&lt;/h3&gt;
&lt;p&gt;Ergo offers account registration to allow users to do things like use
history and bouncer features, register channels, etc.&lt;br&gt;
In clients such as HexChat, server passwords may conflict with account
passwords, so the following setting should be enabled if you wish to use
accounts with clients such as HexChat.&lt;br&gt;
Note that this could under some circumstances be considered a security
hazard, as a user with an account does not need to know the server
password to connect, although that user would have needed to register an
account before the server had a password, and then a password would need
to have been set after the fact, so this can be considered a very small
concern if your setup has always had a password.&lt;br&gt;
Also keep in mind that this setting has no effect if your network does
not even have a password at all.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# some clients (notably Pidgin and Hexchat) offer only a single password field,&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# which makes it impossible to specify a separate server password (for the PASS&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# command) and SASL password. if this option is set to true, a client that&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# successfully authenticates with SASL will not be required to send&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# PASS as well, so it can be configured to authenticate with SASL only.&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;skip-server-password&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-multiclient&#34;&gt;Multiclient, always-on clients, history, etc&lt;/h3&gt;
&lt;p&gt;Traditionally, IRC servers have no message history, and once you close
your client, you cannot receive messages, and are not shown to be online
at all. Ergo includes functionality to allow users to both receive
history, and keep their clients &amp;quot;online&amp;quot; even after they have left. It
also allows multiple clients to connect to the same account.&lt;br&gt;
If you are running a private network for friends, you should set
&lt;code&gt;always-on&lt;/code&gt; and &lt;code&gt;auto-away&lt;/code&gt; to &lt;code&gt;opt-out&lt;/code&gt;, to have all users with
accounts to appear as if they are online at all times, and be able to
receive messages when they are offline.&lt;br&gt;
For a public network, keep everything as their default values, since you
probably do not want randoms having this by default.&lt;br&gt;
If for some reason you do not want any of these features at all, you can
set &lt;code&gt;enabled&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;, but this is not recommended. Below are the
recommended values for a private network (e.g. for friends) where users
with accounts will be able to receive messages and history while they
are offline.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# multiclient controls whether Ergo allows multiple connections to&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# attach to the same client/nickname identity; this is part of the&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# functionality traditionally provided by a bouncer like ZNC&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;multiclient&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# when disabled, each connection must use a separate nickname (as is the&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# typical behavior of IRC servers). when enabled, a new connection that&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# has authenticated with SASL can associate itself with an existing&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# client&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# if this is disabled, clients have to opt in to bouncer functionality&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# using nickserv or the cap system. if it&amp;#39;s enabled, they can opt out&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# via nickserv&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;allowed-by-default&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# whether to allow clients that remain on the server even&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# when they have no active connections. The possible values are:&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# &amp;#34;disabled&amp;#34;, &amp;#34;opt-in&amp;#34;, &amp;#34;opt-out&amp;#34;, or &amp;#34;mandatory&amp;#34;.&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;always-on&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;opt-out&amp;#34;&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# whether to mark always-on clients away when they have no active connections:&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;auto-away&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;opt-out&amp;#34;&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# QUIT always-on clients from the server if they go this long without connecting&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# (use 0 or omit for no expiration):&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;#always-on-expiration: 90d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-vhosts&#34;&gt;VHosts&lt;/h3&gt;
&lt;p&gt;IP cloaking was mentioned previously, and somewhat related to that, Ergo
includes &amp;quot;vhost&amp;quot; functionality, which allows users to set a custom
IP/host string. This is mostly for cosmetic value, and does not
interfere with operators being able to see actual IP addresses for
banning, but if you do not want it enable for some reason, you can
disable it.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# vhosts controls the assignment of vhosts (strings displayed in place of the user&amp;#39;s&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# hostname/IP) by the HostServ service&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;vhosts&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# are vhosts enabled at all?&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-channels&#34;&gt;Channels&lt;/h3&gt;
&lt;p&gt;Channels are where everyone on an IRC network talk. By default, anyone
can create a channel, and anyone with an account can register one. The
difference between a normal channel and a registered one is that the
registered one will preserve the operator status of the person who
created, whereas a normal channel&#39;s owner will lose operator status if
they leave the channel or disconnect from the network.&lt;br&gt;
There are various settings for channels available, but the defaults are
suitable for a private network with trust among users, or where you just
want anyone to have the ability to create a channel. Below are the
default values:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# channel options&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;channels&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# modes that are set when new channels are created&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# +n is no-external-messages and +t is op-only-topic&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# see  /QUOTE HELP cmodes  for more channel modes&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;default-modes&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;+nt&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# how many channels can a client be in at once?&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;max-channels-per-client&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# if this is true, new channels can only be created by operators with the&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# `chanreg` operator capability&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;operator-only-creation&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# channel registration - requires an account&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;registration&lt;/span&gt;:
        &lt;span style=&#34;color:#75715e&#34;&gt;# can users register new channels?&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# restrict new channel registrations to operators only?&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# (operators can then transfer channels to regular users using /CS TRANSFER)&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;operator-only&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# how many channels can each account register?&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;max-channels-per-account&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;15&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-operators&#34;&gt;Operators (administrators, etc)&lt;/h3&gt;
&lt;p&gt;The IRC term for an administrator or another privileged user is
&amp;quot;operator&amp;quot;, or &amp;quot;oper&amp;quot; for short.&lt;br&gt;
Ergo&#39;s opers have different permissions that can be granted to them,
and are defined in &amp;quot;classes&amp;quot;, basically groups of permissions under a
name. For example, &amp;quot;chat-moderator&amp;quot; and &amp;quot;server-admin&amp;quot; are defined
in the default configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# operator classes&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;oper-classes&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# chat moderator: can ban/unban users from the server, join channels,&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# fix mode issues and sort out vhosts.&lt;/span&gt;
    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;chat-moderator&amp;#34;&lt;/span&gt;:
        &lt;span style=&#34;color:#75715e&#34;&gt;# title shown in WHOIS&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;title&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Chat Moderator&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# capability names&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;capabilities&lt;/span&gt;:
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;kill&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ban&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;nofakelag&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;roleplay&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;relaymsg&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;vhosts&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;sajoin&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;samode&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;snomasks&amp;#34;&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# server admin: has full control of the ircd, including nickname and&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# channel registrations&lt;/span&gt;
    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;server-admin&amp;#34;&lt;/span&gt;:
        &lt;span style=&#34;color:#75715e&#34;&gt;# title shown in WHOIS&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;title&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;Server Admin&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# oper class this extends from&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;extends&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;chat-moderator&amp;#34;&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# capability names&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;capabilities&lt;/span&gt;:
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;rehash&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;accreg&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;chanreg&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;history&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;defcon&amp;#34;&lt;/span&gt;
            - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;massmessage&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above can be kept with their default values, but you are free to
modify them or create any new classes that are appropriate for your
setup.&lt;br&gt;
Next, let&#39;s actually create an operator account:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# ircd operators&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;opers&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# default operator named &amp;#39;gigachad&amp;#39;; log in with /OPER gigachad &amp;lt;password&amp;gt;&lt;/span&gt;
    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;gigachad&amp;#34;&lt;/span&gt;:
        &lt;span style=&#34;color:#75715e&#34;&gt;# which capabilities this oper has access to&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;class&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;server-admin&amp;#34;&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# custom whois line&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;whois-line&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;is the server administrator&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# custom hostname&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;vhost&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;gigachad&amp;#34;&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# normally, operator status is visible to unprivileged users in WHO and WHOIS&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# responses. this can be disabled with &amp;#39;hidden&amp;#39;. (&amp;#39;hidden&amp;#39; also causes the&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# &amp;#39;vhost&amp;#39; line above to be ignored.)&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;hidden&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# modes are modes to auto-set upon opering-up. uncomment this to automatically&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# enable snomasks (&amp;#34;server notification masks&amp;#34; that alert you to server events;&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# see `/quote help snomasks` while opered-up for more information):&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;#modes: +is acjknoqtuxv&lt;/span&gt;

        &lt;span style=&#34;color:#75715e&#34;&gt;# operators can be authenticated either by password (with the /OPER command),&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# or by certificate fingerprint, or both. if a password hash is set, then a&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# password is required to oper up (e.g., /OPER dan mypassword). to generate&lt;/span&gt;
        &lt;span style=&#34;color:#75715e&#34;&gt;# the hash, use `ergo genpasswd`.&lt;/span&gt;
        &lt;span style=&#34;color:#f92672&#34;&gt;password&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&amp;lt;your oper password&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is a modified version of the default oper entry. The account name
is &amp;quot;gigachad&amp;quot;, but you can change it to anything.&lt;br&gt;
Replace &lt;code&gt;&amp;lt;your oper password&amp;gt;&lt;/code&gt; with a password generated by
&lt;code&gt;./ergo genpasswd&lt;/code&gt;, and you will have a new oper account to use.&lt;br&gt;
Note that to log into an oper account, clients have to enter
&lt;code&gt;/OPER &amp;lt;oper name&amp;gt; &amp;lt;oper password&amp;gt;&lt;/code&gt; each time they log in. This can be
automated by most clients by setting the command to be executed when the
client logs in. In the case of HexChat, you can edit your network and
add the command to the &lt;code&gt;Connect commands&lt;/code&gt; tab of the menu.&lt;br&gt;
You can copy everything from &lt;code&gt;&amp;quot;gigachad&amp;quot;&lt;/code&gt; to the end of the line, paste
it again, and change the name to create another oper account. Another,
less privileged example of an oper is shown as a comment below the above
configuration snippet.&lt;/p&gt;
&lt;h3 id=&#34;configuring-history&#34;&gt;Chat history&lt;/h3&gt;
&lt;p&gt;Traditionally, IRC networks do not store, relay, or handle chat history
in any way.&lt;br&gt;
On a privacy standpoint, this is a good thing, since chats are entirely
ephemeral and handled by clients.&lt;br&gt;
On a practicality standpoint, this is a bad thing, since people have to
keep a client connected 24/7 to see message history.&lt;br&gt;
For normalfriends, this can be a big problem, not only because having to
stay online 24/7 is just annoying or infeasible, but also because they
are likely used to chat platforms that handle history for them.&lt;br&gt;
With this in mind, enabling history is a good idea if you want to move
friends over to IRC, and will make things a lot more pleasant for
private networks.&lt;/p&gt;
&lt;p&gt;Ergo&#39;s &lt;code&gt;history&lt;/code&gt; configuration group is very long, so it is encouraged
to read over it yourself. This section will go over the most important
pieces of that configuration group.&lt;/p&gt;
&lt;p&gt;History is not endless (unless you want it to be), and the amount that
can be stored for channels is configurable:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# how many channel-specific events (messages, joins, parts) should be tracked per channel?&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;channel-length&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;2048&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;History is already enabled by default, but that just means it is being
collected, not relayed by default. To relay history to clients when they
connect, change the following to the amount of messages that you think
is appropriate:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# number of messages to automatically play back on channel join (0 to disable):&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;autoreplay-on-join&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;250&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;History older than a certain time can be configured to be deleted or be
inaccessible. The default cutoff time is 1 week, but this is
configurable as well.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# options to delete old messages, or prevent them from being retrieved&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;restrictions&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# if this is set, messages older than this cannot be retrieved by anyone&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# (and will eventually be deleted from persistent storage, if that&amp;#39;s enabled)&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;expire-time&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1w&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By default, Ergo only stores chat history in memory, so when the server
restarts, all history is lost. If you wish to have chat history persist
beyond restarts, you must store it in a MySQL database:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# options to store history messages in a persistent database (currently only MySQL).&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# in order to enable any of this functionality, you must configure a MySQL server&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# in the `datastore.mysql` section.&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;persistent&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# store unregistered channel messages in the persistent database?&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;unregistered-channels&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

&lt;span style=&#34;color:#75715e&#34;&gt;# connection information for MySQL (currently only used for persistent history):&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;mysql&lt;/span&gt;:
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;host&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;localhost&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;port&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;3306&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# if socket-path is set, it will be used instead of host:port&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;#socket-path: &amp;#34;/var/run/mysqld/mysqld.sock&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;user&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ergo&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;password&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hunter2&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;history-database&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;ergo_history&amp;#34;&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;timeout&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;3s&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;max-conns&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# this may be necessary to prevent middleware from closing your connections:&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;#conn-max-lifetime: 180s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For privacy reasons, you may want to allow users to delete their own
messages in history, or export their messages to JSON:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# options to control how messages are stored and deleted:&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;retention&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# allow users to delete their own messages from history?&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;allow-individual-delete&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# if persistent history is enabled, create additional index tables,&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# allowing deletion of JSON export of an account&amp;#39;s messages. this&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# may be needed for compliance with data privacy regulations.&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;enable-account-indexing&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-spam&#34;&gt;Spam reduction&lt;/h3&gt;
&lt;p&gt;Most IRC networks have measures in place to reduce chat spam. By
default, &amp;quot;fakelag&amp;quot; is enabled in Ergo, and that can deal with most
aggregious chat spam.&lt;br&gt;
If you are running a private network where user trust is high, you can
disable it so that there are no limits on the speed that messages can be
sent.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# fakelag: prevents clients from spamming commands too rapidly&lt;/span&gt;
&lt;span style=&#34;color:#f92672&#34;&gt;fakelag&lt;/span&gt;:
    &lt;span style=&#34;color:#75715e&#34;&gt;# whether to enforce fakelag&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;enabled&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# time unit for counting command rates&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;window&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;1s&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# clients can send this many commands without fakelag being imposed&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;burst-limit&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# once clients have exceeded their burst allowance, they can send only&lt;/span&gt;
    &lt;span style=&#34;color:#75715e&#34;&gt;# this many commands per `window`:&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;messages-per-window&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;

    &lt;span style=&#34;color:#75715e&#34;&gt;# client status resets to the default state if they go this long without&lt;/span&gt;
      &lt;span style=&#34;color:#75715e&#34;&gt;# sending any commands:&lt;/span&gt;
    &lt;span style=&#34;color:#f92672&#34;&gt;cooldown&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;2s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;starting-and-using-your-server&#34;&gt;Starting and using your server&lt;/h2&gt;
&lt;p&gt;Now that Ergo is both installed and configured, you can actually start
using it!&lt;/p&gt;
&lt;h3 id=&#34;using-starting&#34;&gt;Starting the server&lt;/h3&gt;
&lt;p&gt;First thing, make sure you&#39;re still using the &lt;code&gt;ergo&lt;/code&gt; user, and are in
the &lt;code&gt;~/server&lt;/code&gt; directory.&lt;br&gt;
If you aren&#39;t, you can run the following to get back there:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;sudo -i -u ergo
cd server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Starting the server is done in one command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;./ergo run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will stay online until you close the terminal, or press &lt;kbd&gt;CTRL+C&lt;/kbd&gt;.
Don&#39;t worry, the next section goes over how to make it run like a
normal server with a SystemD service.&lt;br&gt;
If you have not already, make sure the port &lt;code&gt;6697&lt;/code&gt; is not blocked on
your server. If you are using UFW as your firewall, you need to run
&lt;code&gt;ufw enable 6697&lt;/code&gt; (not as the &lt;code&gt;ergo&lt;/code&gt; user, of course).&lt;br&gt;
If you make and configuration changes while the server is running, you
can apply them without restarting by typing &lt;code&gt;/rehash&lt;/code&gt; as an operator.&lt;/p&gt;
&lt;h3 id=&#34;using-connecting&#34;&gt;Connecting to the server&lt;/h3&gt;
&lt;p&gt;To use IRC, you of course need an IRC client. There are many choices
available, but the most widely used for Windows and Linux is
&lt;a href=&#34;https://hexchat.github.io/&#34;&gt;HexChat&lt;/a&gt;. On Mac, you have a slightly nicer
option with &lt;a href=&#34;https://www.codeux.com/textual/&#34;&gt;Textual&lt;/a&gt;, although you
have to &lt;a href=&#34;https://github.com/Codeux-Software/Textual/#building-textual&#34;&gt;compile it from
source&lt;/a&gt; if
you want to use it for free.&lt;br&gt;
A more user-friendly and modern client choice is TheLounge, which is
explained in the last section of this guide, if you want to look into
it.&lt;/p&gt;
&lt;p&gt;Connecting with HexChat is very easy. When you start it, you will see
something like this:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/irc/hexchat-network-select.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/irc/hexchat-network-select.png&#34; alt=&#34;HexChat network select&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;From there, you should click &lt;code&gt;+ Add&lt;/code&gt; and name the server whatever you
like (so you can find it on the server list).&lt;br&gt;
Once you have created a new server and named it, select it and click
&lt;code&gt;Edit...&lt;/code&gt;. A menu will show up like the one below. Change the domain to
whatever domain your server is running on, and make sure to put in your
server password if you set one.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/irc/hexchat-network-edit.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/irc/hexchat-network-edit.png&#34; alt=&#34;HexChat network edit menu&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Once you&#39;re done editing the network, click &lt;code&gt;(X) Close&lt;/code&gt;, select your
network from the network list, and click &lt;code&gt;Connect&lt;/code&gt;.&lt;br&gt;
If all is well, you should be connected!&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/irc/hexchat-connection-complete.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/irc/hexchat-connection-complete.png&#34; alt=&#34;HexChat connection complete&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;The process is very similar on Textual.&lt;br&gt;
Create a new network and connect to it. Note that it will ask if you
want to connect even though the certificate is unsigned. This is due to
the self-signed certificates generated for the server, and is not a
problem or security vulnerability, it is just a little annoying.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/irc/textual-network-edit.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/irc/textual-network-edit.png&#34; alt=&#34;Textual network edit menu&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Surviving restarts with a SystemD service&lt;/p&gt;
&lt;p&gt;In the beginning of the last section, Ergo was started by simply running
&lt;code&gt;./ergo run&lt;/code&gt;, but this is only suitable for testing. To have a proper
server setup, you need to run it as a service. This can be achieved via
a SystemD service.&lt;/p&gt;
&lt;p&gt;Before creating your service file, make sure you are in &lt;code&gt;~/server&lt;/code&gt; as
the &lt;code&gt;ergo&lt;/code&gt; user.&lt;br&gt;
Once you have done that, create a file called &lt;code&gt;start.sh&lt;/code&gt; with the
following content:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;./ergo run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Save the file, then mark it as executable:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;chmod +x start.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, create a file called &lt;code&gt;ergo.service&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Description&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;Ergo IRC server&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;After&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;network.target&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# If you are using MySQL for history storage, comment out the above line&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# and uncomment these two instead (you must independently install and configure&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# MySQL for your system):&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# Wants=mysql.service&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# After=network.target mysql.service&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Type&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;simple&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;User&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;ergo&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WorkingDirectory&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/home/ergo/server&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecStart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/home/ergo/server/start.sh&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ExecReload&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;/bin/kill -HUP $MAINPID&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;Restart&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;on-failure&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;LimitNOFILE&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;1048576&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# Uncomment this for a hidden service:&lt;/span&gt;
&lt;span style=&#34;color:#75715e&#34;&gt;# PrivateNetwork=true&lt;/span&gt;

&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;WantedBy&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You now have your service file, but it is not installed yet. To install
it, switch to your normal user, and execute the following lines to
install, enable, and start the SystemD service:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;ln -s /home/ergo/server/ergo.service /etc/systemd/system/ergo.service
systemctl enable ergo
systemctl start ergo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Ergo is now installed and running as a service, and will automatically
start when the system boots.&lt;/p&gt;
&lt;h2 id=&#34;registering&#34;&gt;Registering accounts and channels&lt;/h2&gt;
&lt;p&gt;Account and channel registration were mentioned multiple times in this
guide, and are indeed very important parts of the modern IRC ecosystem.
You can connect to most IRC networks and talk without creating an
account, but you will not be able to reserve your nickname or register
channels, so it is important to register an account.&lt;/p&gt;
&lt;h3 id=&#34;registering-accounts&#34;&gt;Registering an account with NickServ&lt;/h3&gt;
&lt;p&gt;First, make sure you are connected to your IRC network. Once you are,
type &lt;code&gt;/nickserv help&lt;/code&gt; to make sure NickServ (the registration system) is
working propertly.&lt;br&gt;
If all is well, type the following, replacing &lt;code&gt;&amp;lt;your password&amp;gt;&lt;/code&gt; with the
password you want to use:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/nickserv register &amp;lt;your password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At this point, you are now registered!&lt;br&gt;
The final step is to configure authentication with your client.&lt;/p&gt;
&lt;p&gt;In HexChat, all that needs to be done is changing &lt;code&gt;Login method&lt;/code&gt; to
&lt;code&gt;SASL (username + password)&lt;/code&gt;, and entering your NickServ password that
you used earlier into the password field:&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/irc/hexchat-sasl.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/irc/hexchat-sasl.png&#34; alt=&#34;HexChat SASL in network edit menu&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;In Textual, open up your network in the menu, and click &lt;code&gt;Identity&lt;/code&gt; under
&lt;code&gt;Server Properties&lt;/code&gt;. Enter your password in &lt;code&gt;Personal Password&lt;/code&gt;, and
check &lt;code&gt;Wait for identification before joining channels&lt;/code&gt;.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/irc/textual-identity.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/irc/textual-identity.png&#34; alt=&#34;Textual identity menu&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;You will now be logged into your account when you connect to your
network.&lt;/p&gt;
&lt;h3 id=&#34;registering-channels&#34;&gt;Registering channels with ChanServ&lt;/h3&gt;
&lt;p&gt;Once you have an account registered, you can register channels with
ChanServ.&lt;br&gt;
To do so, join the channel you want to register, then type the
following, replacing &lt;code&gt;&amp;lt;your channel&amp;gt;&lt;/code&gt; with the name of the channel you
want to register:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/chanserv register #&amp;lt;your channel&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You are now the channel owner, and are free to appoint operators,
administrators, etc for it. When you go offline, you won&#39;t lose
ownership, and you cannot be removed as the owner unless you unregister
the channel later.&lt;/p&gt;
&lt;h2 id=&#34;moderation&#34;&gt;Moderation&lt;/h2&gt;
&lt;p&gt;Like any chat, there will come a point where you need to use moderation
tools to keep things under control. Many IRC setup guides do not go over
moderation, so it can be stressful when operators need to actually use
moderation tools.&lt;br&gt;
The main difference between IRC and other chat systems in terms of
moderation is the difference between channel bans and network bans.
Channel ban keeps a person out of channel a channel, whereas a network
ban keeps a person out of the entire network.&lt;/p&gt;
&lt;h3 id=&#34;moderation-masks&#34;&gt;Understanding masks&lt;/h3&gt;
&lt;p&gt;Bans are applied &amp;quot;masks&amp;quot;, which are formatted pieces of text that
contain a user&#39;s nick (username), their realname value, and their IP
address or host.&lt;br&gt;
This is what a mask looks like: &lt;code&gt;nick!~nick-dude@127.0.0.1&lt;/code&gt;.&lt;br&gt;
In bans, asterisks can be used as wildcards, which is useful for banning
IP address ranges, patterns of nicknames, or whatever else you can think
of.&lt;br&gt;
A ban on the nick &lt;code&gt;person&lt;/code&gt;, for example, would look like this:
&lt;code&gt;person!*@*&lt;/code&gt;.&lt;br&gt;
A ban on anyone with the IP address &lt;code&gt;127.0.0.1&lt;/code&gt; would look like this:
&lt;code&gt;*!*@127.0.0.1&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;moderation-real-ips&#34;&gt;Discovering real IPs&lt;/h3&gt;
&lt;p&gt;Even if IP cloaking is enabled on your network, you can still obtain
real IP addresses/hosts if you are an operator. See the &lt;strong&gt;Operators&lt;/strong&gt;
part of the configuration section of this guide on how to become an
operator.&lt;br&gt;
To find out a user&#39;s real IP, simply type &lt;code&gt;/whois&lt;/code&gt; along with the
user&#39;s nick, and you will see information about the user, along with
their real IP address/host.&lt;br&gt;
&lt;code&gt;/whois&lt;/code&gt; is not a command that is exclusive to operators, but it does
not reveal as much information to non-operators.&lt;/p&gt;
&lt;h3 id=&#34;moderation-network-ban&#34;&gt;Banning someone from the network&lt;/h3&gt;
&lt;p&gt;Any netword-wide moderation action requires being an operator. See the
&lt;strong&gt;Operators&lt;/strong&gt; part of the configuration section of this guide on how to
become an operator.&lt;br&gt;
Banning someone from the network is achieved with the &lt;code&gt;/kline&lt;/code&gt; command.
To see more info on the command, type &lt;code&gt;/helpop kline&lt;/code&gt;.\&lt;/p&gt;
&lt;p&gt;To ban a nick from the network:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/kline andkill &amp;lt;nick&amp;gt;!*@*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To ban an IP address or host from the network:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/kline andkill *!*@&amp;lt;IP or mask&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To unban a mask, you can use the &lt;code&gt;/unkline&lt;/code&gt; command with the mask you
want to unban.&lt;/p&gt;
&lt;h3 id=&#34;moderation-channel-ban&#34;&gt;Banning someone from a channel&lt;/h3&gt;
&lt;p&gt;Channel owners, administrators, and operators can ban people from
channels. This is not the same as banning someone from the network,
since it only has an effect on one channel. Additionally, a channel
operator is not the same as a network operator.&lt;/p&gt;
&lt;p&gt;To ban someone in a channel, type the following in that channel,
replacing &lt;code&gt;&amp;lt;mask&amp;gt;&lt;/code&gt; with the user&#39;s mask:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/mode +b &amp;lt;mask&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that this will only ban the user, not kick them immediately. You
will want to run &lt;code&gt;/kick&lt;/code&gt; along with the user&#39;s nick to also kick them.&lt;br&gt;
To unban a user, run the command above, but replace the &lt;code&gt;+&lt;/code&gt; with a &lt;code&gt;-&lt;/code&gt;.&lt;br&gt;
You can see who is banned in a channel by typing &lt;code&gt;/banlist&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;moderation-muting&#34;&gt;Muting people in a channel&lt;/h3&gt;
&lt;p&gt;By default, anyone can speak in an IRC channel. To change this, you must
be a channel owner, administrator, or operator.&lt;br&gt;
Channels, along with users, have modes, which modify their behavior.
There is a special mode for channels called &lt;code&gt;m&lt;/code&gt; (moderated) which
requires users to be privileged in some way to talk.&lt;br&gt;
To set a channel as moderated, type the following in the channel:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/mode +m
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, users must be an owner, administrator, operator, or be voiced to
talk in the channel This be reversed by typing the command above, but
changing the &lt;code&gt;+&lt;/code&gt; to a &lt;code&gt;-&lt;/code&gt;.&lt;br&gt;
To voice a user, run the following, replacing &lt;em&gt;&amp;lt;nick&amp;gt;&lt;/em&gt; with the
user&#39;s nick:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/mode +v &amp;lt;nick&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unvoice the user by typing the above command, but replacing the &lt;code&gt;+&lt;/code&gt; with
a &lt;code&gt;-&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;moderation-appointing&#34;&gt;Appointing channel administrators and operators&lt;/h3&gt;
&lt;p&gt;Assuming you a channel owner, you can appoint both administrators and
operators. If you are only an operator, you may only appoint operators.&lt;br&gt;
The difference between administrator and operator is mainly that
administrators cannot have their privileges taken away by operators,
only owners. To appoint an administrator, type the following, replacing
&lt;em&gt;&amp;lt;nick&amp;gt;&lt;/em&gt; with the user&#39;s nick:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/mode +a &amp;lt;nick&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To appoint an operator, type the following, replacing &lt;em&gt;&amp;lt;nick&amp;gt;&lt;/em&gt; with
the user&#39;s nick:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;/mode +o &amp;lt;nick&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also use &lt;code&gt;/op&lt;/code&gt; and &lt;code&gt;/deop&lt;/code&gt; on most clients to appoint and remove
an operator.&lt;br&gt;
To remove administrator or operator status, run either of the above
commands, but replace the &lt;code&gt;+&lt;/code&gt; with a &lt;code&gt;-&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Bringing modern-day features to IRC with TheLounge&lt;/p&gt;
&lt;p&gt;A large downside to IRC as a protocol is just how old it is, and the
limitations that exist because of it. Other old protocols such as HTTP
were built to be content-agnostic and versitile, but IRC was built with
a very specific set of features, so it has not held up so well to
contemporary chat systems.&lt;br&gt;
A notable thing that IRC as a protocol is missing is file uploads, and
other fancy features that many other chats have.&lt;br&gt;
With that said, these problems can be fixed by clients, although many
clients are still very primitive.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://thelounge.chat/&#34;&gt;TheLounge&lt;/a&gt; is a modern self-hosted IRC web
client that tries to make IRC as user-friendly as possible. It can be
the answer to many of the complaints that normalfriends may have about
IRC. It runs on anything with a web browser, can be &amp;quot;installed&amp;quot; since
it is a PWA (Progressive Web App), and is optimized for both desktops
and mobile devices. It keeps you logged in even when you are gone, and
even supports file uploads and embeds.&lt;br&gt;
Effectively, it brings IRC up to the standard of most other chat
systems.&lt;/p&gt;
&lt;p&gt;If you would like to setup an instance of TheLounge for you and your
friends, you can take a look at their &lt;a href=&#34;https://thelounge.chat/docs/install-and-upgrade&#34;&gt;installation
guide&lt;/a&gt;.&lt;br&gt;
It is a self-hosted web app, so you can run it for multiple people, not
just yourself.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Written by &lt;a href=&#34;https://termer.net/&#34;&gt;Termer&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Gitea</title>
		<link>https://landchad.net/gitea/</link>
		<pubDate>Thu, 02 Jul 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/gitea/</guid>
		<description>&lt;p&gt;Gitea allows you to self-host your git repositories similar to &lt;a href=&#34;https://landchad.net/git&#34;&gt;bare
repositories&lt;/a&gt;, but comes with additional features that you might know
from GitHub, such as issues, pull requests or multiple users. Its advantage
over GitLab&amp;mdash;another Free Software GitHub clone&amp;mdash;is that it is much more
lightweight and easier to setup.&lt;/p&gt;
&lt;p&gt;Head over to &lt;a href=&#34;https://gitea.com&#34;&gt;gitea.com&lt;/a&gt; to see what it looks like in
practice.&lt;/p&gt;
&lt;p&gt;Although Gitea is lighter than Gitlab, if you have a VPS with only 512MB of
RAM, you will probably have to upgrade. Gitea is more memory-intensive than
having just a bare git repository. If you just want a minimalist browseable git
server without  issue tracking and pull requests, install &lt;a href=&#34;https://landchad.net/cgit&#34;&gt;cgit&lt;/a&gt;
instead.&lt;/p&gt;
&lt;h2 id=&#34;installing-gitea&#34;&gt;Installing Gitea&lt;/h2&gt;
&lt;p&gt;First install a few dependencies:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install curl sqlite3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unfortunately, Gitea itself is not in the official Debian repos, so we
will add a third-party repository for it.&lt;/p&gt;
&lt;p&gt;Add the repo&#39;s gpg key to apt&#39;s trusted keys:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;curl -sL -o /etc/apt/trusted.gpg.d/morph027-gitea.asc https://packaging.gitlab.io/gitea/gpg.key
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then add the actual repository to apt:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;deb [arch=&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;$(&lt;/span&gt;dpkg --print-architecture&lt;span style=&#34;color:#66d9ef&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;] https://packaging.gitlab.io/gitea gitea main&amp;#34;&lt;/span&gt; &amp;gt; /etc/apt/sources.list.d/morph027-gitea.list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we can install Gitea:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt update
apt install gitea
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since apt automatically enables and starts the Gitea service, it should
already be running on port &lt;code&gt;3000&lt;/code&gt; on your server!&lt;/p&gt;
&lt;h2 id=&#34;setting-up-a-nginx-reverse-proxy&#34;&gt;Setting up a Nginx reverse proxy&lt;/h2&gt;
&lt;p&gt;You should know how to generate SSL certificates and use Nginx by now.
Add this to your Nginx config to proxy requests made to your git
subdomain to Gitea running on port 3000:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
	&lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
	&lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
	&lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/ssl/nginx/&lt;mark&gt;git.example.org&lt;/mark&gt;.crt&lt;/span&gt;;
	&lt;span style=&#34;color:#f92672&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/ssl/nginx/&lt;mark&gt;git.example.org&lt;/mark&gt;.key&lt;/span&gt;;
	&lt;span style=&#34;color:#f92672&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&lt;mark&gt;git.example.org&lt;/mark&gt;&lt;/span&gt;;
	&lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/&lt;/span&gt; {
		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;http://localhost:3000/&lt;/span&gt;; &lt;span style=&#34;color:#75715e&#34;&gt;# The / is important!
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_redirect&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt;;
		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Host&lt;/span&gt; $host;
		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Real-IP&lt;/span&gt; $remote_addr;
		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Forwarded-For&lt;/span&gt; $proxy_add_x_forwarded_for;
		&lt;span style=&#34;color:#f92672&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;X-Forwarded-Proto&lt;/span&gt; $scheme;
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And reload Nginx:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;setting-up-gitea&#34;&gt;Setting up Gitea&lt;/h2&gt;
&lt;p&gt;If everything worked fine you should now see a setup screen when you go
to your configured domain in the browser. The options should be pretty
self-explanatory, it is only important to select SQLite3 and to replace
the base url and SSH server domain with your own.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Database Type:&lt;/dt&gt;
&lt;dd&gt;SQLite3&lt;/dd&gt;
&lt;dt&gt;SSH Server Domain:&lt;/dt&gt;
&lt;dd&gt;&lt;strong&gt;git.example.org&lt;/strong&gt;&lt;/dd&gt;
&lt;dt&gt;Gitea Base URL:&lt;/dt&gt;
&lt;dd&gt;&lt;strong&gt;git.example.org&lt;/strong&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;These and other settings can be changed in a configuration file later so
don&#39;t worry about making wrong decisions right now.&lt;/p&gt;
&lt;p&gt;After clicking the install button you should now be able to log into
your Gitea instance with the account you just created! Explore the
settings for more things to do, such as setting up your SSH keys.&lt;/p&gt;
&lt;p&gt;If Gitea does not load fully and has random errors, it is possible that
you need to increase your available memory on your VPS. This can usually
be done on your VPS-provider&#39;s website without too much trouble.&lt;/p&gt;
&lt;h2 id=&#34;a-few-extras&#34;&gt;A few extras&lt;/h2&gt;
&lt;h3 id=&#34;automatically-create-a-new-repo-on-push&#34;&gt;Automatically create a new repo on push&lt;/h3&gt;
&lt;p&gt;This is an incredibly useful feature for me. Open up
&lt;code&gt;/etc/gitea/app.ini&lt;/code&gt; and add &lt;code&gt;DEFAULT_PUSH_CREATE_PRIVATE = true&lt;/code&gt; to the
&lt;code&gt;repository&lt;/code&gt; section like so:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-systemd&#34; data-lang=&#34;systemd&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[repository]&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;ROOT &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; /var/lib/gitea/data/gitea-repositories&lt;/span&gt;
&lt;span style=&#34;color:#a6e22e&#34;&gt;DEFAULT_PUSH_CREATE_PRIVATE &lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you now add a remote to a repository like this&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git remote add origin &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ssh://gitea@&lt;mark&gt;git.example.org&lt;/mark&gt;/username/coolproject.git&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and push, Gitea will automatically create a private &lt;code&gt;coolproject&lt;/code&gt;
repository in your account!&lt;/p&gt;
&lt;h3 id=&#34;change-tab-width&#34;&gt;Change tab-width&lt;/h3&gt;
&lt;p&gt;By default Gitea displays tabs 8 spaces wide, however I prefer 4 spaces.
We can change this!&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir -p /var/lib/gitea/custom/templates/custom/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And write this into
&lt;code&gt;/var/lib/gitea/custom/templates/custom/header.tmpl&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;style&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
.&lt;span style=&#34;color:#a6e22e&#34;&gt;tab-size-8&lt;/span&gt; {
&lt;span style=&#34;color:#66d9ef&#34;&gt;tab-size&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;!important&lt;/span&gt;;
&lt;span style=&#34;color:#66d9ef&#34;&gt;-moz-&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;tab-size&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt; &lt;span style=&#34;color:#75715e&#34;&gt;!important&lt;/span&gt;;
}
&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;style&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://phire.cc&#34;&gt;phire&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Cronjobs</title>
		<link>https://landchad.net/cron/</link>
		<pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/cron/</guid>
		<description>&lt;p&gt;Cron is a service that lets you run scheduled tasks on a computer. These tasks
are called &lt;strong&gt;cronjobs.&lt;/strong&gt; If you have already followed the initial course you
will have already used cron when you set up Certbot, but we&amp;rsquo;ll explain how they work generally here.&lt;/p&gt;
&lt;h2 id=&#34;what-tasks-would-i-want-to-schedule&#34;&gt;What tasks would I want to schedule?&lt;/h2&gt;
&lt;p&gt;You can schedule anything! Some examples of what you might have done
already include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;updatedb&lt;/code&gt; to update your &lt;code&gt;locate&lt;/code&gt; database to let you quickly search for files&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbot&lt;/code&gt; to update renewing of your https certs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some tasks that you might &lt;em&gt;want&lt;/em&gt; to schedule may include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Package updates - if you really just want to leave your server alone
you can automate updating packages on your server&lt;/li&gt;
&lt;li&gt;Backups - you may want to backup certain files every day and some
every week, this is possible with cron&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And many more, anything you can do can be turned into a cronjob.&lt;/p&gt;
&lt;h2 id=&#34;basic-cronjobs&#34;&gt;Basic Cronjobs&lt;/h2&gt;
&lt;p&gt;This the preferred method for personal tasks and scripts; it&#39;s also the
easiest to get started with. Run the command &lt;code&gt;crontab -e&lt;/code&gt; to access your
user&#39;s crontab&lt;/p&gt;
&lt;p&gt;Once you have figured out the command you want to run you need to figure
out how often you want to run it and when. I am going to schedule my
system updates once a week at 3:30 AM on Mondays.&lt;/p&gt;
&lt;p&gt;We now have to convert this time (Every Monday at 3:30 AM) into a cron
time. Cron uses a simple but effective way of scheduling when to run
things.&lt;/p&gt;
&lt;p&gt;Crontab expressions look like this &lt;code&gt;* * * * * command-to-run&lt;/code&gt; The five
elements before the command tell when the command is supposed to be run
automatically.&lt;/p&gt;
&lt;p&gt;So for our Monday at 3:30 AM job we would do the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt; .---------------- minute (0 - 59)
 | .------------- hour (0 - 23)
 | | .---------- day of month (1 - 31)
 | | | .------- month (1 - 12)
 | | | | .---- day of week (0 - 6)
 | | | | |
 * * * * *
30 3 * * 1 apt -y update &amp;amp;&amp;amp; apt -y upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;some-notes&#34;&gt;Some notes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;On the day of the week option, Sunday is 0 and counting up from
there, Saturday will be 6.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;*&lt;/code&gt; designates &amp;quot;everything&amp;quot;. Our command above has a &lt;code&gt;*&lt;/code&gt; in the
day of month and month columns. This means it will run regardless of
the day of the month or month.&lt;/li&gt;
&lt;li&gt;The hour option uses 24 hour time. 3 = 3AM, while we&amp;rsquo;d use 15 for 3PM.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;more-examples&#34;&gt;More examples&lt;/h3&gt;
&lt;p&gt;Let&#39;s add another job, our backup job (for the purpose of this our
backup command is just called &lt;code&gt;backup&lt;/code&gt;). We want to run &lt;code&gt;backup&lt;/code&gt; every
evening at 11PM. Once we work out the timings for this we can add this new job to
the same file as the above by running &lt;code&gt;crontab -e&lt;/code&gt; This would mean our
full crontab would look like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;0 23 * * * backup
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;consecutive-times&#34;&gt;Consecutive times&lt;/h3&gt;
&lt;p&gt;Suppose we want a command to run every weekday. We know we can put &lt;code&gt;1&lt;/code&gt;
(Monday), but we can also use &lt;code&gt;1-5&lt;/code&gt; to signify from day 1 (Monday) to
day 5 (Friday).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;0 6 * * 1-5 echo &amp;#34;Wakey, wakey, wagie!&amp;#34; &amp;gt;&amp;gt; /home/wagie/alarm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above &lt;code&gt;echo&lt;/code&gt; command runs every Monday through Friday at 6:00AM.&lt;/p&gt;
&lt;h3 id=&#34;non-consecutive-times&#34;&gt;Non-consecutive times&lt;/h3&gt;
&lt;p&gt;We can also randomly specify non-consecutive arguments with a comma.
Suppose you have a script you want to run at the midday of the 1st,
15th, and 20th day of every month. You can specify that by putting
&lt;code&gt;1,15,20&lt;/code&gt; for the day of the month argument:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;0 12 1,15,20 * * /usr/bin/pay_bills_script
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;every-x-minutesdaysmonths&#34;&gt;&amp;quot;Every X minutes/days/months&amp;quot;&lt;/h3&gt;
&lt;p&gt;We can also easily run a command every several minutes or months,
without specifying the specific times:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;*/15 * * * * updatedb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This cronjob will run the &lt;code&gt;updatedb&lt;/code&gt; command every 15 minutes.&lt;/p&gt;
&lt;h3 id=&#34;beware-of-this-rookie-mistake-though&#34;&gt;Beware of this Rookie Mistake Though...&lt;/h3&gt;
&lt;p&gt;Suppose you want to run a script once every other month. You might be
&lt;em&gt;tempted&lt;/em&gt; write this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;* * * */2 *
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That might &lt;em&gt;feel right&lt;/em&gt;, but this script &lt;em&gt;will be running once every
minute during that every other month&lt;/em&gt;. You should specify the first two
arguments, because with &lt;code&gt;*&lt;/code&gt; it will be running every minute and hour!&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;0 0 1 */2 *
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This makes the command run &lt;em&gt;only&lt;/em&gt; at 0:00 (12:00AM) on the first day of
every two months, which is what we really want.&lt;/p&gt;
&lt;p&gt;Consult the website &lt;a href=&#34;https://crontab.guru&#34;&gt;crontab.guru&lt;/a&gt; for an
intuitive and interactive tester of cronjobs.&lt;/p&gt;
&lt;h2 id=&#34;user-vs-root-cronjobs&#34;&gt;User vs. Root Cronjobs&lt;/h2&gt;
&lt;p&gt;It is important to note that user accounts all have different cronjobs.
If you have a user account &lt;code&gt;chad&lt;/code&gt; and edit his crontab with
&lt;code&gt;crontab -e&lt;/code&gt;, the commands you add will be run as the &lt;code&gt;chad&lt;/code&gt; user, not
&lt;code&gt;root&lt;/code&gt; or anyone else.&lt;/p&gt;
&lt;p&gt;Bear in mind that if you need root access to run a particular command,
you will usually want to add it as root.&lt;/p&gt;
&lt;h2 id=&#34;system-wide-cron-directories&#34;&gt;System-wide cron directories&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;crontab -e&lt;/code&gt; is the typical interface for adding cronjobs, but it&#39;s
important to at least know that system-wide jobs are often stored in the
file directory. Some programs which need cronjobs will automatically
install them in the following way.&lt;/p&gt;
&lt;p&gt;Run the command &lt;code&gt;ls /etc/cron*&lt;/code&gt; and you should see a list of directories and
their contents. The list of directories should look something like below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;/etc/cron.d &lt;em&gt;This is a crontab like the ones that you create with&lt;/em&gt;
&lt;code&gt;crontab -e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;/etc/cron.hourly&lt;/li&gt;
&lt;li&gt;/etc/cron.daily&lt;/li&gt;
&lt;li&gt;/etc/cron.weekly&lt;/li&gt;
&lt;li&gt;/etc/cron.monthly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The directories cron.{hourly,daily,weekly,monthly} are where you can put
&lt;strong&gt;scripts&lt;/strong&gt; to run at those times. You don&#39;t put normal cron entries
here. I prefer to use these directories for system wide jobs that don&#39;t
relate to an individual user.&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Mark McNally -- &lt;a href=&#34;https://mark.mcnally.je&#34;&gt;website&lt;/a&gt;,
&lt;a href=&#34;https://www.youtube.com/channel/UCMiInY8BhSUtCarO6uu6i_g&#34;&gt;Youtube&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Edits and examples by Luke&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Git Server</title>
		<link>https://landchad.net/git/</link>
		<pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/git/</guid>
		<description>&lt;p&gt;Once you have your own VPS or other Internet-available server, you can
start hosting your own git repositories. The goal of this tutorial is
for you to go from&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone github.com/...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;to&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git clone YourLandChadDomainName.xyz/...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;so you can cultivate your own homegrown, grass-fed code, rather than
relying on a centralized proprietary service like GitHub.&lt;/p&gt;
&lt;h2 id=&#34;installing-git&#34;&gt;Installing git&lt;/h2&gt;
&lt;p&gt;You most likely already have it installed on your server, but if not,
run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We don&#39;t need any additional software, &lt;code&gt;git&lt;/code&gt; itself ships with
everything needed to host a remote repository!&lt;/p&gt;
&lt;h2 id=&#34;creating-a-git-user&#34;&gt;Creating a git user&lt;/h2&gt;
&lt;p&gt;To prevent exploiting your system, services should usually be run under another
user that can only affect the relevant parts of the server. Let&amp;rsquo;s create a user
for git.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;useradd -m git -d /var/git -s /bin/bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;git&lt;/code&gt; user&amp;rsquo;s home directory will be &lt;code&gt;/var/git&lt;/code&gt; and we also set the default
user shell as bash instead of sh for ease when on the command line.&lt;/p&gt;
&lt;h3 id=&#34;become-the-git-user-and-create-the-directory&#34;&gt;Become the git user and create the directory&lt;/h3&gt;
&lt;p&gt;If you&#39;re logged in to your server as root and have &lt;code&gt;git&lt;/code&gt; installed,
you can become the &lt;code&gt;git&lt;/code&gt; user by executing&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;su -l git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;-l&lt;/code&gt; option should put us in &lt;code&gt;git&lt;/code&gt;&amp;rsquo;s home directory, but you can &lt;code&gt;cd /var/git&lt;/code&gt; otherwise.&lt;/p&gt;
&lt;h3 id=&#34;create-the-repo&#34;&gt;Create the repo&lt;/h3&gt;
&lt;p&gt;Now you can create the bare repository with&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git init --bare &lt;mark&gt;my-repo.git&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By convention, bare repository names end with &amp;quot;.git&amp;quot;. (A bare repository is
just one without the file index, (i.e. the familiar browseable file structure).)&lt;/p&gt;
&lt;p&gt;Repeat the above command for any other repositories you want to host.&lt;/p&gt;
&lt;h2 id=&#34;syncing-local-repositories-with-your-server&#34;&gt;Syncing local repositories with your server&lt;/h2&gt;
&lt;h3 id=&#34;set-up-ssh-login-for-the-git-user&#34;&gt;Set up SSH login for the git user&lt;/h3&gt;
&lt;p&gt;Git uses SSH to connect to a server, and we will definitely want to use an SSH
key pair that we authorized. This is not only most secure, but also easiest
since we don&amp;rsquo;t need to put in our password whenever we pull or push.&lt;/p&gt;
&lt;p&gt;There is a brief article &lt;a href=&#34;https://landchad.net/sshkeys&#34;&gt;on setting up SSH keys&lt;/a&gt;. We need to do
exactly that, but for the &lt;code&gt;git&lt;/code&gt; user, instead of the default &lt;code&gt;root&lt;/code&gt; user. Note
that if you want to upload your SSH key directly to the git user as in that
tutorial, remember to run &lt;code&gt;passwd git&lt;/code&gt; to give the git user a password so you
can log in.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve already set up password-less SSH log-ins for root (and disabled SSH
password authentication), you can run the following commands as root, which
will copy over your authorized key to the git user as well.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;mkdir /var/git/.ssh	&lt;span style=&#34;color:#75715e&#34;&gt;# Create the required directory.&lt;/span&gt;
cp ~/.ssh/authorized_keys /var/git/.ssh/	&lt;span style=&#34;color:#75715e&#34;&gt;# Copy over the authorized key.&lt;/span&gt;
chown git:git -R /var/git/.ssh	&lt;span style=&#34;color:#75715e&#34;&gt;# Make the created directory and contents to be owned by the git user.&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;syncing-a-new-repository-with-your-server&#34;&gt;Syncing a new repository with your server&lt;/h3&gt;
&lt;p&gt;Now that we&amp;rsquo;ve set that up, we can push a repository we have on our computer to
that newly created bare repo. First, on our local computer, we run a command like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git remote add origin git@&lt;mark&gt;example.org&lt;/mark&gt;:&lt;mark&gt;my-repo.git&lt;/mark&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note some of the things you will change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;example.org&lt;/code&gt;, obviously is a stand-in for your domain name.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;my-repo.git&lt;/code&gt; is the name of the repository, but it is also the relative location of it. Since it is in the &lt;code&gt;git&lt;/code&gt; user&amp;rsquo;s home directory, we don&amp;rsquo;t need anything else, but if you decide to put a git repository elsewhere&amp;mdash;like in &lt;code&gt;/var/www/git/stuff.git&lt;/code&gt;, you can provide that absolute file location instead.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;origin&lt;/code&gt; is a unique name for your remote repository. Since &amp;ldquo;origin&amp;rdquo; is probably already used if you are using Github or another service, you&amp;rsquo;ll want to change this to whatever you want. Could be &lt;code&gt;myserver&lt;/code&gt; or &lt;code&gt;vps&lt;/code&gt; or &lt;code&gt;own&lt;/code&gt;, as long as it is unique.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you run that command successfully to add a new remote repository, and also assuming you change &lt;code&gt;origin&lt;/code&gt; to let&amp;rsquo;s say the more unique &lt;code&gt;personal&lt;/code&gt;, you can push your local git server as expected:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;git push &lt;mark&gt;personal&lt;/mark&gt; master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s all a git server is! Very simple.&lt;/p&gt;
&lt;p&gt;If you want a minimalist front-end to a git server, follow our guide on &lt;a href=&#34;https://landchad.net/cgit&#34;&gt;cgit&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;If you want a large and user-friendly Github-like site for your git projects, follow our guide on &lt;a href=&#34;https://landchad.net/gitea&#34;&gt;Gitea&lt;/a&gt;!&lt;/p&gt;
&lt;h2 id=&#34;contribution&#34;&gt;Contribution&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Martin Chrzanowski -- &lt;a href=&#34;https://m-chrzan.xyz&#34;&gt;website&lt;/a&gt;, &lt;a href=&#34;https://m-chrzan.xyz/donate.html&#34;&gt;donate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Edits and fixes by Luke.&lt;/li&gt;
&lt;/ul&gt;
</description>
	</item>
	
	<item>
		<title>Requiring Passwords for Webpages (HTTP Authentication)</title>
		<link>https://landchad.net/auth/</link>
		<pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/auth/</guid>
		<description>&lt;p&gt;HTTP basic authentication will allow you to secure parts (or all) of
your website with a username and password without the trouble of PHP or
Javascript. This will work with any Nginx server.&lt;/p&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;p&gt;We will be using the command &lt;code&gt;htpasswd&lt;/code&gt; to make username and password
pairs.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;apt install apache2-utils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The apache utils include a small username-password pair encryption tool.&lt;/p&gt;
&lt;p&gt;Like the other tutorials on this site, this tutorial is for Nginx,
&lt;strong&gt;not&lt;/strong&gt; for Apache servers.&lt;/p&gt;
&lt;p&gt;Now think of a username and password and remember them.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;htpasswd -c /etc/nginx/myusers username
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;-c&lt;/code&gt; flag creates a file. You can make the path of this file
anywhere outside of your webroot.&lt;/p&gt;
&lt;p&gt;Obviously the username is up to you as well.&lt;/p&gt;
&lt;p&gt;Type out your password twice to confirm. You can do this as many times
as you&#39;d like.&lt;/p&gt;
&lt;p&gt;Check out user name password pairs (the password will be securely
hashed):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cat /etc/nginx/myusers
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;nginx-config-and-auth-basic&#34;&gt;Nginx Config and Auth Basic&lt;/h2&gt;
&lt;p&gt;From here, we are going to edit our websites config file in
&lt;code&gt;/etc/nginx/sites-enabled&lt;/code&gt;. Have in mind which folder you&#39;d like to
secure. Add something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/secret-folder&lt;/span&gt;  {
        &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;What&amp;#39;s&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;the&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Password?&amp;#34;&lt;/span&gt; ;
        &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic_user_file&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/nginx/myusers&lt;/span&gt; ;
    }
    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;huh&#34;&gt;Huh?&lt;/h4&gt;
&lt;p&gt;If you&#39;re stuck, try finding the line &lt;code&gt;location / {&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Just below this block is where you should add the custom location block&lt;/p&gt;
&lt;p&gt;If you&#39;d like to do the opposite, such as making the entire site
private except for a public section, do this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;What&amp;#39;s&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;the&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Password?&amp;#34;&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic_user_file&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/nginx/myusers&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/public/&lt;/span&gt; {
        &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;off&lt;/span&gt; ;
    }
    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;ip-addresses&#34;&gt;IP Addresses&lt;/h3&gt;
&lt;p&gt;If passwords aren&#39;t enough we can ban an ip or accept one.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/api&lt;/span&gt; {
    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;allow&lt;/span&gt; 192.168.1.23:&lt;span style=&#34;color:#ae81ff&#34;&gt;8080&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;127&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.0.0.1&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to check both a username and password with an ip address,
use the &lt;code&gt;satisfy&lt;/code&gt; directive.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/api&lt;/span&gt; {
    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;satisfy&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt; ;

    &lt;span style=&#34;color:#f92672&#34;&gt;allow&lt;/span&gt; 192.168.1.23:&lt;span style=&#34;color:#ae81ff&#34;&gt;8080&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;127&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.0.0.1&lt;/span&gt; ;

    &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;What&amp;#39;s&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;the&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Password?&amp;#34;&lt;/span&gt; ;
    &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic_user_file&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/nginx/myusers&lt;/span&gt; ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;complete-example&#34;&gt;Complete Example&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-nginx&#34; data-lang=&#34;nginx&#34;&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;http&lt;/span&gt; {
    &lt;span style=&#34;color:#f92672&#34;&gt;server&lt;/span&gt; {
        &lt;span style=&#34;color:#f92672&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;;
        &lt;span style=&#34;color:#f92672&#34;&gt;root&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/var/www/website&lt;/span&gt; ;

        &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/secret-folder&lt;/span&gt; {
            &lt;span style=&#34;color:#f92672&#34;&gt;satisfy&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;all&lt;/span&gt; ;

            &lt;span style=&#34;color:#f92672&#34;&gt;allow&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;192&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.168.1.3/24&lt;/span&gt;;
            &lt;span style=&#34;color:#f92672&#34;&gt;deny&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;127&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.0.0.1&lt;/span&gt; ;

            &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;What&amp;#39;s&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;the&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;Password?&amp;#34;&lt;/span&gt; ;
            &lt;span style=&#34;color:#f92672&#34;&gt;auth_basic_user_file&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/etc/nginx/myusers&lt;/span&gt; ;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now check your configuration with &lt;code&gt;nginx -t&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Reload nginx and you&#39;re good to go!&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>Getting a Bitcoin Wallet</title>
		<link>https://landchad.net/bitcoin/</link>
		<pubDate>Sun, 28 Jun 2020 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/bitcoin/</guid>
		<description>&lt;p&gt;Let&#39;s now get a Bitcoin wallet and become able to receive Bitcoin funds
or donations.&lt;/p&gt;
&lt;h2 id=&#34;wallets&#34;&gt;Wallets&lt;/h2&gt;
&lt;p&gt;One of the classical choices for a Bitcoin wallet is Electrum. Go to
&lt;a href=&#34;https://electrum.org/#home&#34;&gt;https://electrum.org&lt;/a&gt; to download and
install it, or if you are a Linux user, it is probably included in your
distribution&#39;s package repository.&lt;/p&gt;
&lt;h3 id=&#34;mobile-version&#34;&gt;Mobile version?&lt;/h3&gt;
&lt;p&gt;Note also that there are mobile/cell phone versions of Electrum for
Android and iOS. I generally advise against using a wallet on a cell
phone for security reasons, but if you would like, you can.&lt;/p&gt;
&lt;p&gt;If you are okay with a mobile wallet, I recommend getting &lt;a href=&#34;https://cakewallet.com/&#34;&gt;Cake
Wallet&lt;/a&gt;, which can use Electrum-style Bitcoin
wallets, but also Monero and Litecoin.&lt;/p&gt;
&lt;h2 id=&#34;generating-a-wallet&#34;&gt;Generating a Wallet&lt;/h2&gt;
&lt;p&gt;Once you open Electrum (or Cake Wallet), you can choose to create a new
wallet. Name it whatever you want and choose the &amp;quot;Standard Wallet&amp;quot;
option.&lt;/p&gt;
&lt;p&gt;I will also note that if you are paranoid, it is perfectly possible to
generate a wallet without connection to the internet.&lt;/p&gt;
&lt;h3 id=&#34;your-seed-is-your-money&#34;&gt;Your Seed is your money.&lt;/h3&gt;
&lt;p&gt;Now choose the &amp;quot;Create a new seed&amp;quot; option when creating the wallet.
That will randomly produce a &amp;quot;seed&amp;quot; of 12 words.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/bitcoin-01.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/bitcoin-01.png&#34; alt=&#34;bitcoin seed&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;These words are your money.&lt;/strong&gt; Once you are shown them, &lt;strong&gt;immediately&lt;/strong&gt;
write them down on physical paper, and you will be storing this
somewhere it will not be lost or found. You can memorize these twelve
words if you trust your memory.&lt;/p&gt;
&lt;p&gt;These twelve words unlock all of the funds/addresses you will have on
this wallet. Whoever has your seed has the ability to spend your money.&lt;/p&gt;
&lt;p&gt;Note obviously that I have included a picture of a seed phrase above in
this tutorial. I or anyone else would be stupid to ever send Bitcoin to
the following addresses since the seed phrases are now public.&lt;/p&gt;
&lt;p&gt;Once you have written down your seed, click &amp;quot;Next&amp;quot; and Electrum will
have you input that seed again to ensure you&#39;ve written it down.&lt;/p&gt;
&lt;p&gt;You will also be asked to supply a password. This password merely
encrypts your wallet file on this computer so you don&#39;t have to retype
your seed phrase each time you open Electrum. Note that anyone with your
seed phrase can still obtain your funds. This password is only
protection on your computer here.&lt;/p&gt;
&lt;h2 id=&#34;managing-your-wallet&#34;&gt;Managing your Wallet&lt;/h2&gt;
&lt;p&gt;Once your wallet is generated and opened you will be at the wallet page.
First, I recommend opening the &amp;quot;View&amp;quot; menu and unhiding all the
different tabs.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/bitcoin-02.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/bitcoin-02.png&#34; alt=&#34;electrum options&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;h3 id=&#34;addresses&#34;&gt;Addresses&lt;/h3&gt;
&lt;p&gt;The address tab contains all the many Bitcoin addresses generated by
your seed phrase. In fact, as you use these up, the wallet will
automatically add more.&lt;/p&gt;
&lt;p&gt;These addresses (which will all be generated with &lt;code&gt;bc1&lt;/code&gt; at the
beginning) can be used by others to send you Bitcoins. Someone can just
copy-and-paste the address into their wallet to send you funds.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/bitcoin-03.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/bitcoin-03.png&#34; alt=&#34;bitcoin addresses&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;h3 id=&#34;receive&#34;&gt;Receive&lt;/h3&gt;
&lt;p&gt;Click on the &amp;quot;Receive&amp;quot; tab and then click &amp;quot;New Address.&amp;quot; That will
pick your first unused address which will appear on the right side. You
could copy this from the &amp;quot;Addresses&amp;quot; tab, but this tab also generates
a QR code which will appear to the right as well if you click on the
&amp;quot;QR Code&amp;quot; subtab.&lt;/p&gt;

&lt;figure &gt;&lt;a href=&#34;https://landchad.net/pix/bitcoin-04.png&#34;&gt;&lt;img src=&#34;https://landchad.net/pix/bitcoin-04.png&#34; alt=&#34;receive qr code&#34;loading=&#34;lazy&#34;
	&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;h4 id=&#34;what-is-the-qr-code-for&#34;&gt;What is the QR code for?&lt;/h4&gt;
&lt;p&gt;In case you don&#39;t know, a QR code is a way of storing text information
in a format that can be scanned by a phone. If someone has a wallet
program on a phone, they can easily scan the QR code on another screen
to avoid having to copy your address over or even worse, write it
manually.&lt;/p&gt;
&lt;h3 id=&#34;lets-receive-donations-on-our-website&#34;&gt;Let&#39;s receive donations on our website.&lt;/h3&gt;
&lt;p&gt;Save the QR code and the wallet address it corresponds to (starting in
&lt;code&gt;bc1&lt;/code&gt;). Now simply put these on your website and anyone can send Bitcoin
to them. Bitcoin users will know how to scan and use them.&lt;/p&gt;
</description>
	</item>
	
	</channel>
</rss>
