<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 in MeinTest.net on LandChad.net</description>
	<generator>Hugo -- gohugo.io</generator>
	<language>en-us</language>
	<lastBuildDate>Mon, 30 Jan 2023 00:00:00 +0000</lastBuildDate>
    
        <atom:link href="https://landchad.net/index.xml" rel="self" type="application/rss+xml" />
	
	
	<item>
		<title>CartaAchamentoBrasil</title>
		<link>https://landchad.net/carta-brasil/</link>
		<pubDate>Mon, 30 Jan 2023 00:00:00 +0000</pubDate>
		
		<guid>https://landchad.net/carta-brasil/</guid>
		<description>&lt;h1 id=&#34;homeworkhttpsslimtuxgithubiofireshipio-brazillllllllllllllll&#34;&gt;&lt;a href=&#34;https://SlimTux.github.io/Fireship.io&#34;&gt;Homework&lt;/a&gt; Brazillllllllllllllll&lt;/h1&gt;
&lt;h1 id=&#34;sobre-a-carta-de-achamento-do-brasil&#34;&gt;Sobre a carta de Achamento do Brasil&lt;/h1&gt;
&lt;h2 id=&#34;questões&#34;&gt;Questões&lt;/h2&gt;
&lt;h3 id=&#34;1-como-são-descritos-os-ameríndios&#34;&gt;1. Como são descritos os Ameríndios?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Pardos&lt;/li&gt;
&lt;li&gt;Bons rostos, bons narizes; Bem feitos.&lt;/li&gt;
&lt;li&gt;Sem-vergonhas(literalmente)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;2-que-presentes-lhe-são-dados&#34;&gt;2. Que presentes lhe são dados&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Galinha(s)&lt;/li&gt;
&lt;li&gt;Ramal&lt;/li&gt;
&lt;li&gt;Sombreiro&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;3-como-se-chamava-o-piloto&#34;&gt;3. Como se chamava o piloto?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Afonso Lopes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;4-qual-a-importância-dos-pilotos-neste-texto&#34;&gt;4. Qual a importância dos pilotos neste texto?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Eram o primeiro à tomar iniciativa nas expedições.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;5-ø&#34;&gt;5. ø&lt;/h3&gt;
&lt;h3 id=&#34;6que-costumes-distintos-surpreendem-os-portugues&#34;&gt;6.Que costumes distintos surpreendem os portugues?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Nudez &amp;amp; inocência.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;7-como-é-descrito-o-capitão&#34;&gt;7. Como é descrito o capitão&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Bem vestido, usava joias « &amp;ldquo;(&amp;hellip;), com um colar de ouro &lt;em&gt;mui&lt;/em&gt; grande ao pescoço(&amp;hellip;) &amp;quot; »&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;8-o-que-acham-os-nativos-da-comida-europeia&#34;&gt;8. O que acham os nativos da comida europeia?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Terrivel
&lt;ul&gt;
&lt;li&gt;Tiveram espanto&lt;/li&gt;
&lt;li&gt;Recusaram&lt;/li&gt;
&lt;li&gt;Foram comer a própria comida ao invés da [comida] dos convidados (Portugues).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;9como-intervêm-aqui-nicolau-coelho-e-bartolomeu-dias&#34;&gt;9.Como intervêm aqui Nicolau Coelho e Bartolomeu Dias&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;À mando do Capitão-mor, Nicolau Coelho foi o primeiro (Como era o piloto) à contactar os nativos. Ao mais tardar, Nicolau Coelho e Bartolomeu Dias acompanharam o degradado (Prisioneiro) à densa selva para o dar como presente aos nativos. (In)Felizmente nem os nativos quiseram.     &lt;strong&gt;o_o&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;10-como-é-descrito-o-momento-da-missa&#34;&gt;10. Como é descrito o momento da missa?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Fora feito um altar em um &amp;ldquo;esperavel&amp;rdquo; (no ilhéu) para que pudessemdar louvar ao Senhor; Por mais que os amerindios não tivessem conhecimento sobre o Cristianismo (Nunca lhes havia sido apresentado, até o momento em questão), a missa do padre Frei Henrique fpo espectada por todos com muito prazer e devoção. No cenário da missa esteve lá presente estava lá presente a bandeira de Cristo, sempre levantada, para dar sustância ao evangélio.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;11&#34;&gt;11.&lt;/h3&gt;
&lt;h3 id=&#34;12-existem-alguns-pormenores-cómicos-nesete-texto&#34;&gt;12. Existem alguns pormenores cómicos nesete texto?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Sim;
&lt;ul&gt;
&lt;li&gt;A reção portuguesa à falta de vergonha (Cuja qual não existia) dos nativos e suas [caréncia] de vestes.&lt;/li&gt;
&lt;li&gt;Houve gozo (Na minha opinião) ao darem suas incomprensões (Os portugueses e os nativos não percebiam o que ambos diziam(Também por sua &amp;ldquo;hospedagem doce&amp;rdquo; e cultura &amp;ldquo;selvagem&amp;rdquo;)) como barbária.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&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;h1 id=&#34;abandoned-projecthttpsslimtuxgithubioschool-_you-were-the-chosen-one_&#34;&gt;&lt;a href=&#34;https://SlimTux.github.io/School&#34;&gt;Abandoned project&lt;/a&gt; &lt;em&gt;You were the chosen one&lt;/em&gt;&lt;/h1&gt;
&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;
&lt;h3&gt;git clone https://github.com/SlimTux/School&lt;/h3&gt;
&lt;h4&gt;
    **Contributor** - [Adachi](https://github.com/AdachiWasRight)
&lt;/h4&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  = /var/log/mail.log


[sasl]

enabled  = true
port     = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter   = postfix-sasl
# 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  = /var/log/mail.warn
maxretry = 1
bantime  = 21600

[dovecot]

enabled = true
port    = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter  = dovecot
logpath = /var/log/mail.log
&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/docevot.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 tabindex=&#34;0&#34;&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&amp;#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&amp;#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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install opendkim opendkim-tools
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir -p /etc/postfix/dkim
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;opendkim-genkey -D /etc/postfix/dkim/ -d example.org -s mail
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chgrp opendkim /etc/postfix/dkim/*
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod g+r /etc/postfix/dkim/*
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;127.0.0.1
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;10.1.0.0/16
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;KeyTable file:/etc/postfix/dkim/keytable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;SigningTable refile:/etc/postfix/dkim/signingtable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;InternalHosts refile:/etc/postfix/dkim/trustedhosts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;Canonicalization        relaxed/simple&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;Socket                  inet:12301@localhost&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;milter_default_action = accept&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;postconf -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;milter_protocol = 6&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart opendkim
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl enable opendkim
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl reload postfix
&lt;/span&gt;&lt;/span&gt;&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 &lt;a href=&#34;https://www.epik.com/?affid=we2ro7sa6&#34;&gt;your registrar&#39;s site&lt;/a&gt; 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;echo -e &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&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;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;On my registrar, Epik, 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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mail._domainkey.example.org TXT v=DKIM1; k=rsa; p=ThatLongRandomSequenceOfLettersAndNumbersOfYours
&lt;/span&gt;&lt;/span&gt;&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.html&#34;&gt;the SMTP
article&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Hi there.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/span&gt;&lt;/span&gt;&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
echo &amp;quot;v=spf1 mx a:mail.$(cat /etc/mailname) -all&amp;quot;
&lt;/code&gt;&lt;/pre&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;
</description>
	</item>
	
	<item>
		<title>Informatics</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;h1 id=&#34;informatics-first-draft&#34;&gt;[Informatics] First draft&lt;/h1&gt;
&lt;p&gt;:::info
💡I cannot garantee that this project will turn out as i expect. This will be my first time in this type of activity.
:::&lt;/p&gt;
&lt;h2 id=&#34;red-piling-classes&#34;&gt;😎Red-Piling classes&lt;/h2&gt;
&lt;p&gt;:::success
Raise awareness over how people are being exploited ( without their knowlodge).
:::
This classes will be for general software and privacy knowlodge.&lt;/p&gt;
&lt;h2 id=&#34;roadmap&#34;&gt;🐾Roadmap&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Ask class-mates what are they think about the project.&lt;/li&gt;
&lt;li&gt;Ask permission to be granted ( Ask the CAS&amp;rsquo;s counceilour)&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ol&gt;
&lt;li&gt;Linux installation&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;1,1. PopOS or Artix (with larbs)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Vim&amp;rsquo;s lecture&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;2,1. touch&lt;/li&gt;
&lt;li&gt;2,2 make directories&lt;/li&gt;
&lt;li&gt;2,3 Basic VIM commands&lt;/li&gt;
&lt;li&gt;2,4 Write and save Documents&lt;/li&gt;
&lt;li&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;Microsoft is a Craphole&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;ol start=&#34;4&#34;&gt;
&lt;li&gt;Why Whatsapp is crap and Signal is way supperior&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;ol start=&#34;5&#34;&gt;
&lt;li&gt;Goals
&lt;ul&gt;
&lt;li&gt;I&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t&lt;/li&gt;
&lt;li&gt;Know&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&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;ufw.html&#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;&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;&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 tabindex=&#34;0&#34;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;dig @localhost example.org
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#interface=&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;interface&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;eth0&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart dnsmasq
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;dig @&lt;mark&gt;your_servers_public_ip&lt;/mark&gt; example.org
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Quad9 DNS Server&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;nameserver  &lt;mark&gt;9.9.9.9&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;nameserver  &lt;mark&gt;149.112.112.112&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0     www.youtube.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0     www.reddit.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;addn-hosts&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/etc/hosts.2
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart dnsmasq
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;nameserver  &lt;mark&gt;your_servers_public_ip&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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&amp;rsquo; 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://codeberg.org/onasaft/sbx/raw/branch/main/vpn/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;
&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt; - &lt;a href=&#34;https://tomfasano.net&#34;&gt;tomfasano.net&lt;/a&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip a
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34;&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 tabindex=&#34;0&#34;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip r
&lt;/span&gt;&lt;/span&gt;&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;&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;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip addr add 192.168.50.1/24 dev eth0
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip addr add 192.168.50.2/24 dev eth1
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip link set eth0 up
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip link set eth1 up
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip route add 192.168.50.0/24 dev eth0
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ip route add 192.168.50.0/24 dev eth1
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host server1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  HostName very.long.hostname.example1.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  User admin
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  IdentityFile ~/.ssh/id_rsa
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host server2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  HostName example2.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  Port 2222
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  User billthemaster
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  IdentityFile ~/.ssh/example2_ecdsa
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host server3
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  HostName 192.168.133.7
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  User management
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  IdentityFile ~/.ssh/id_rsa
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host *
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  IdentityFile /path/to/some/other/key
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -F ~/Documents/projects/someproject/config/ssh production
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -F /dev/null username@hostname
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -L 3000:localhost:3306 username@example.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -L localhost:8080:192.168.178.25:80 username@example.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -L 8000:localhost:8000 -L 8001:localhost:8001 username@example.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;GatewayPorts yes # to allow all remote devices
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;GatewayPorts clientspecified # to allow only specific remote devices
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -R 2100:localhost:21 username@example.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -R 111.111.111.111:2100:localhost:21 username@example.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -J username1@example1.com username2@example2.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh -J username1@example2.com,username2@example.com username3@example3.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host intermediary1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  HostName target.intermediary-example.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  User john
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host target1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  HostName target.example.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ProxyJump intermediary1
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Host target2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  HostName target2.example.com
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ProxyJump username@example1.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;wget https://github.com/nkanaev/yarr/releases/download/v2.3/yarr-v2.3-linux64.zip
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;unzip -x yarr-v2.3-linux64.zip
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mv yarr /usr/local/bin/yarr
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir ~/.config/yarr
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;on-failure&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl daemon-reload
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl enable --now yarr
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;rss.example.org&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/yarr /etc/nginx/sites-enabled
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx -d rss.example.org
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install git python3-venv python3-dev postgresql libpq-dev
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git clone https://git.sr.ht/~sircmpwn/fosspay /var/www/fosspay
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;python3 -m venv /var/www/fosspay
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;source /var/www/fosspay/bin/activate
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd /var/www/fosspay
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pip install -r requirements.txt
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;make
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cp config.ini.example config.ini
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su postgres
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;psql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#960050;background-color:#1e0010&#34;&gt;\&lt;/span&gt;q
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;donate.example.org&lt;/mark&gt;&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/var/www/fosspay&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/var/www/fosspay/bin/gunicorn app:app -b 127.0.0.1:5000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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>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 tabindex=&#34;0&#34; style=&#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;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install git nginx nginx-extras -y
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;iptables -I INPUT -m state --state NEW -p tcp --dport &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt; -j ACCEPT
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;netfilter-persistent save
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34;&gt;&lt;code&gt;useradd -mr -d &amp;#34;/usr/local/searxng&amp;#34; -c &amp;#39;Privacy-respecting metasearch engine&amp;#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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git clone https://github.com/searxng/searxng /usr/local/searxng/searxng-src
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd /usr/local/searxng/searxng-src
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;./utils/searxng.sh install all
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Listens on http
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Your server name
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# X-Frame-Options (XFO) header set to DENY
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# HTTP Strict Transport Security (HSTS) header
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Content Security Policy (CSP)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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_HOST&lt;/span&gt;             $host;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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_CONNECTION&lt;/span&gt;       $http_connection;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# see flaskfix.py
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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_SCRIPT_NAME&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;/searxng&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# see limiter.py
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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_FORWARDED_FOR&lt;/span&gt;  $proxy_add_x_forwarded_for;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/searxng.conf /etc/nginx/sites-enabled/searxng.conf
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart nginx
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;service uwsgi restart searxng
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install python3-certbot-nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Install extrepo if you already haven&amp;#39;t&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt install extrepo
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;extrepo enable prosody
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt update
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install prosody
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# To add one admin:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    restrict_room_creation = &amp;#34;admin&amp;#34;&lt;/span&gt;
&lt;/span&gt;&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;First we need to install extra prosody modules. Run the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install prosody-modules
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we can add the following line to you prosody config file to enable file uploads:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Component &amp;#34;uploads.example.org&amp;#34; &amp;#34;http_upload&amp;#34;&lt;/span&gt;
&lt;/span&gt;&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;p&gt;You will also need to go back to &lt;code&gt;modules_enabled&lt;/code&gt; and uncomment the &lt;code&gt;http_files&lt;/code&gt; module.
This is used to actually serve the files to users.&lt;/p&gt;
&lt;p&gt;And the last part of the setup is to enable the built in proxy server.
This helps with file transfers for devices behind a NAT, and unless you are using XMPP in a LAN, you probably need this.
Enable the proxy by adding the following line to the config:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;Component &amp;#34;proxy.example.org&amp;#34; &amp;#34;proxy65&amp;#34;&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;http_upload_file_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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;http_upload_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;/span&gt;&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;p&gt;If it is for some reason neccessary, you can also manually invoke expiry with the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;prosodyctl mod_http_upload expire&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&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, edit the following lines:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    driver = &amp;#34;PostgreSQL&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;    host = &amp;#34;localhost&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(This is assuming you&amp;rsquo;ve installed the &lt;code&gt;postgresql&lt;/code&gt; package, and setup a database named &lt;code&gt;prosody&lt;/code&gt; with a user named &lt;code&gt;prosody&lt;/code&gt; as the owner.)&lt;/p&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot -d chat.example.org --nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot -d uploads.example.org --nginx
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;certbot -d proxy.example.org --nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;prosodyctl --root cert import /etc/letsencrypt/live/
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;prosodyctl adduser chad@example.org
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart prosody
&lt;/span&gt;&lt;/span&gt;&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/&#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 addressed 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_upload&lt;/code&gt; module for file sharing.&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install coturn
&lt;/span&gt;&lt;/span&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;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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;server-name=&lt;mark&gt;turn.example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;realm=&lt;mark&gt;turn.example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;listening-ip=your_public_ip
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;listening-port=3478
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;min-port=10000
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;max-port=20000
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;## The &amp;#34;verbose&amp;#34; option is useful for debugging issues
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;verbose
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;lt-cred-mech
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;user=username:password
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;use-auth-secret
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;static-auth-secret=&lt;mark&gt;your_auth_secret&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cert=/etc/letsencrypt/live/&lt;mark&gt;turn.example.org&lt;/mark&gt;/fullchain.pem
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pkey=/etc/letsencrypt/live/&lt;mark&gt;turn.example.org&lt;/mark&gt;/privkey.pem
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart coturn
&lt;/span&gt;&lt;/span&gt;&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;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 Multi User Chats (MUCs)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;upload.example.org&lt;/strong&gt; - For file upload support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;proxy.example.org&lt;/strong&gt; - For SOCKS5 proxy support&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pubsub.example.org&lt;/strong&gt; - For publish-subscribe support (A fancier RSS)&lt;/li&gt;
&lt;/ul&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_muc&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;curl -o /etc/apt/sources.list.d/ejabberd.list https://repo.process-one.net/ejabberd.list
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;curl -o /etc/apt/trusted.gpg.d/ejabberd.gpg https://repo.process-one.net/ejabberd.gpg
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt update
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt install ejabberd
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart ejabberd
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;hosts&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  - &lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;mark&gt;example.org&lt;/mark&gt;&lt;/span&gt;
&lt;/span&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;DOMAIN&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;mark&gt;example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Set the domain names you want here&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    certbot --nginx -d $i$DOMAIN certonly
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    mkdir -p /etc/ejabberd/certs/$i$DOMAIN
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cp /etc/letsencrypt/live/$i$DOMAIN/fullchain.pem /etc/ejabberd/certs/$i$DOMAIN
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cp /etc/letsencrypt/live/$i$DOMAIN/privkey.pem /etc/ejabberd/certs/$i$DOMAIN
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;chown -R ejabberd:ejabberd /etc/ejabberd/certs
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;certfiles&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  - &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/etc/ejabberd/certs/*/*.pem&amp;#34;&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;acl&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;admin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_http_upload&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;custom_headers&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;chown -R ejabberd:ejabberd /var/www/upload
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_mam&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_mam&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;## db_type: sql&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install postgresql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl start postgresql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;createuser --pwprompt ejabberd&amp;#34;&lt;/span&gt; postgres
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you&amp;rsquo;ve ensured your database name, username and password are all correct, enable SQL storage for &lt;code&gt;mod_mam&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;mod_mam&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;## (Other parameters above)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;db_type&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;sql&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart ejabberd
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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;&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;&gt;&lt;/figure&gt;

&lt;h2 id=&#34;turn--stun-for-calls&#34;&gt;TURN &amp;amp; STUN for Calls&lt;/h2&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;h3 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;/h3&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;mod_stun_disco&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;services&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      -
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      -
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&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&amp;rsquo; 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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Media: images, icons, video, audio, HTC
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# max-age must be in seconds
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# CSS and Javascript
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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=31556952,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;public&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install webp
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cwebp -q &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt; your-photo.png -o your-photo.webp
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ls -lh your-photo*
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!--- Instructions for web scrapers ---&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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: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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!--- below is for twitter sharing previews
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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: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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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: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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;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;/span&gt;&lt;/span&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/3.0.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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install radicale apache2-utils
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[server]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Bind all addresses&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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:#e6db74&#34;&gt; 0.0.0.0:5232, [::]:5232&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[auth]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[storage]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;htpasswd -B -c /etc/radicale/users username
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;cal.example.org&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/usr/bin/env python3 -m radicale&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;on-failure&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl daemon-reload
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl enable --now radicale
&lt;/span&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;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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install fcgiwrap
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install cgit
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/&lt;mark&gt;git.example.org&lt;/mark&gt;.crt&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;git.example.org&lt;/mark&gt;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/.+/(info/refs|git-upload-pack)&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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_HTTP_EXPORT_ALL&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/srv/git&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/srv/git&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;@cgit&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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; $args;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;css=/cgit.css
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;logo=/cgit.svg
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;virtual-root=/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;clone-prefix=https://&lt;mark&gt;git.example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# Title and description shown on top of each page
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;root-title=&lt;mark&gt;Chad&#39;s git server&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;root-desc=&lt;mark&gt;A web interface to LandChad&#39;s git repositories, powered by Cgit&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# The location where git repos are stored on the server
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;scan-path=/srv/git/
&lt;/span&gt;&lt;/span&gt;&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;/srv/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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;chmod +x hooks/post-receive
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install -y calibre rsync
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir /opt/calibre
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd ~/Documents
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rsync -avuP your-library-dir root@&lt;mark&gt;example.org&lt;/mark&gt;:/opt/calibre/
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd /opt/calibre
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;calibredb add book.epub --with-library your-library
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;calibre-server --manage-users
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;root&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/usr/bin/calibre-server --enable-auth --enable-local-write /opt/calibre/your_library --listen-on 127.0.0.1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl enable calibre-server
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl start calibre-server
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;64M&lt;/span&gt;; &lt;span style=&#34;color:#75715e&#34;&gt;# to upload large books
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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/certbot&#34;&gt;Detailed instructions and additional information&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx
&lt;/span&gt;&lt;/span&gt;&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;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install gpg apt-transport-https nginx python3-certbot-nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;curl https://download.jitsi.org/jitsi-key.gpg.key | gpg --dearmor &amp;gt; /usr/share/keyrings/jitsi-keyring.gpg
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt update -y
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow 80/tcp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow 443/tcp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow 10000/udp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow 3478/udp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow 5349/tcp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw enable
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx certonly -d &lt;mark&gt;meet.example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install jitsi-meet
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;    },
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;jicofo {&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;authentication&lt;/span&gt;: {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; }
&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;prosodyctl register &amp;amp;ltusername&amp;gt; meet.example.org &amp;amp;ltpassword&amp;gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart prosody
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl restart jicofo
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl restart jitsi-videobridge2
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install -y curl sudo unzip vim ffmpeg postgresql postgresql-contrib g++ make redis-server git python-dev cron wget
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl start postgresql redis
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt install -y nodejs
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;npm install --global yarn
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;useradd -m -d /var/www/peertube -s /bin/bash -p peertube peertube
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;su -l postgres
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;createuser -P peertube
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;createdb -O peertube -E UTF8 -T template0 peertube_prod
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;psql -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;CREATE EXTENSION pg_trgm;&amp;#34;&lt;/span&gt; peertube_prod
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;psql -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;CREATE EXTENSION unaccent;&amp;#34;&lt;/span&gt; peertube_prod
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;exit
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su -l peertube
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir config storage versions
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;750&lt;/span&gt; config
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd /var/www/peertube/versions
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd /var/www/peertube
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd ./peertube-latest
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;yarn install --production --pure-lockfile
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd /var/www/peertube
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cp peertube-latest/config/production.yaml.example config/production.yaml
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;webserver&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;database&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;pool&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;admin&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# And to receive emails from the contact form&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;smtp&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# smtp or sendmail&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx -d peertube.example.org certonly
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl daemon-reload
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl start peertube
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd /var/www/peertube/peertube-latest
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;example.com/calculator.html?a=10&amp;amp;b=32
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;I don&amp;#39;t get paid to work on weekends! Come back Monday.
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;#!/bin/env ruby&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;cgi&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;date&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&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?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cgi.out &amp;#39;text/plain&amp;#39; do
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install fcgiwrap
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#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;/calculator.html&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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;&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;&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 tabindex=&#34;0&#34;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install -y lsb-release wget apt-transport-https
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt update
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt install matrix-synapse-py3
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;matrix.example.org&lt;/mark&gt;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;*&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;^(\/_matrix|\/_synapse|\/_client)&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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:8008&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;&lt;mark&gt;50M&lt;/mark&gt;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/.well-known/matrix/client&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;Access-Control-Allow-Origin&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;Access-Control-Allow-Origin&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;*&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/matrix /etc/nginx/sites-enabled
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx -d &lt;mark&gt;matrix.example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install postgresql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart postgresql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su -c &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;createuser --pwprompt synapse_user&amp;#34;&lt;/span&gt; postgres
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# database:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# name: sqlite3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# args:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# database: DATADIR/homeserver.db&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;database&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#f92672&#34;&gt;args&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd /etc/matrix-synapse
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;register_new_matrix_user -c homeserver.yaml http://localhost:8008
&lt;/span&gt;&lt;/span&gt;&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;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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And make sure to uncomment 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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install python3-certbot-nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx
&lt;/span&gt;&lt;/span&gt;&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;&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;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;crontab -e
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 0 1 * * certbot --nginx renew
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh root@&lt;mark&gt;example.org&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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;dns.html&#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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt update
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt upgrade
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt install nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;nano /etc/nginx/sites-available/&lt;mark&gt;mywebsite&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;example.org&lt;/mark&gt;&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 on when someone looks up
the domain.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir /var/www/&lt;mark&gt;mysite&lt;/mark&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let&#39;s create and 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;nano /var/www/&lt;mark&gt;mysite&lt;/mark&gt;/index.html
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/&lt;mark&gt;mywebsite&lt;/mark&gt; /etc/nginx/sites-enabled
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 VPS 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/span&gt;&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 only running 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;maintenance.html#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-running-website&#34;&gt;We now have 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;&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 Vultr and put them into A/AAAA records
on Epik. 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
&lt;a href=&#34;https://www.epik.com/?affid=we2ro7sa6&#34;&gt;Epik&lt;/a&gt; as a registrar 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 Epik, or your
registrar, and click on your domain and then a choice for &amp;quot;DNS
records.&amp;quot; This is the screen you&#39;ll want to see on Epik.&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 Epik DNS records&#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.
Epik sometimes adds records to this page once you buy a domain. If they
did, 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 Epik 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;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Copy your IPv4 address and on Epik, 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;&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;&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;&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 Epik. 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;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install -y curl unzip nginx certbot php-fpm php-mysql php-cli php7.4-mbstring php7.4-curl php7.4-xml php7.4-sqlite3 php7.4-json
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;nano /etc/nginx/sites-available/rss-bridge
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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/rss-bridge&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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.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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;rss-bridge.example.org&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;\.php$&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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/php7.4-fpm.sock&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/\.ht&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/rss-bridge /etc/nginx/sites-enabled/rss-bridge
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir -p /var/www/rss-bridge
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd /var/www/rss-bridge
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;wget https://github.com/RSS-Bridge/rss-bridge/archive/refs/tags/2021-04-25.zip
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;unzip 2021-04-25.zip
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mv rss-bridge-2021-04-25/* .
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rm -rf rss-bridge-2021-04-25 2021-04-25.zip
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;chown -R www-data:www-data /var/www/rss-bridge
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl stop nginx
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;certbot certonly --standalone -d pleroma.example.org
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl start nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;useradd -m -s /bin/bash gemini
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su -l gemini
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;nano gemini/content/index.gmi
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# This is Sample Gemini page&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;## With header 1 and header 2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;And a short paragraph like this.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;=&amp;gt; /index.gmi Link to the same page&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd ~/gemini/certificate/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cd ~/gemini/server
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;gunzip agate.x86_64-unknown-linux-gnu.gz
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mv agate.x86_64-unknown-linux-gnu agate-server
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod +x agate-server
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;nano /etc/systemd/system/agate.service
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Service]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;/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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl enable agate
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl start agate
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;1965&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gemini://example.org
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gemini://gemini.circumlunar.space
&lt;/span&gt;&lt;/span&gt;&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&#39;s easier to use in servers.&lt;/p&gt;
&lt;h3 id=&#34;installing-i2p&#34;&gt;Installing I2P&lt;/h3&gt;
&lt;p&gt;i2pd is in most repos, in debian/ubuntu you can install it simply with&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install i2pd
&lt;/span&gt;&lt;/span&gt;&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;We are going to create a user for i2pd, because i2pd finds the
configuration files in its home directory. And it&#39;s easier (and more
tidy) to have it in a separate user:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;useradd -m i2p -s /bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;su -l i2p
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir ~/.i2pd
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;cd ~/.i2pd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now that you&#39;re in ~/.i2pd, you have to create a file named
&amp;quot;tunnels.conf&amp;quot;. Which is the config file for every hidden service
you&#39;re offering over I2P, the content should be like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[example]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;getting-your-i2p-hostname&#34;&gt;Getting your I2P Hostname&lt;/h3&gt;
&lt;p&gt;Then, run &lt;code&gt;/usr/sbin/i2pd --daemon&lt;/code&gt; to start i2pd and we can retreive
our I2P hostname.&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;printf &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;%s.b32.i2p
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;head -c &lt;span style=&#34;color:#ae81ff&#34;&gt;391&lt;/span&gt; /home/i2p/.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;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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;example&lt;/mark&gt;&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;clarifications&#34;&gt;Clarifications&lt;/h4&gt;
&lt;h4 id=&#34;heading&#34;&gt;&lt;/h4&gt;
&lt;p&gt;Nginx will listen in port 8080, but i2pd will forward your port 8080 to
the i2p site port 80. This way you don&#39;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;nginx.html#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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt update &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt install i2pd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt; - &lt;a href=&#34;https://qorg11.net&#34;&gt;qorg11&lt;/a&gt;&lt;/p&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;oa1:xmr recipient_address=84RXmrsE7ffCe1ADprxLMHRpmyhZuWYScDR4YghE8pFRFSyLtiZFYwD6EPijVzD3aZiEpg57MfHEr1pGJNPXyJgENMnWrSh; recipient_name=LandChad.net;
&lt;/span&gt;&lt;/span&gt;&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;&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;&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;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;oa1:btc recipient_address=bc1q9f3tmkhnxj8gduytdktlcw8yrnx3g028nzzsc5; recipient_name=LandChad.net;
&lt;/span&gt;&lt;/span&gt;&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;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install -y curl unzip libncurses5 postgresql postgresql-contrib nginx certbot libmagic-dev
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl restart postgresql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;useradd -m -s /bin/bash -d /opt/pleroma pleroma
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir -p /var/lib/pleroma/uploads
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chown -R pleroma /var/lib/pleroma
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir -p /var/lib/pleroma/static
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chown -R pleroma /var/lib/pleroma
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir -p /etc/pleroma
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chown -R pleroma /etc/pleroma
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;unzip /tmp/pleroma.zip -d /tmp/
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mv /tmp/release/* /opt/pleroma
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rmdir /tmp/release
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rm /tmp/pleroma.zip
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;./bin/pleroma_ctl migrate
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;./bin/pleroma daemon
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;curl http://localhost:4000/api/v1/instance
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;./bin/pleroma stop
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/pleroma.conf /etc/nginx/sites-enabled/pleroma.conf
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl start pleroma
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl enable pleroma
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su -l pleroma
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;./bin/pleroma_ctl user new username username@example.org --admin
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install rsync
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;rsync -rtvzP /path/to/file root@example.org:/path/on/the/server
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;❌ rsync -rtvzP ~/websitefiles/ root@example.org:/var/www/websitefiles/
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;✅ rsync -rtvzP ~/websitefiles/ root@example.org:/var/www/websitefiles
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;rsync -rtvzP root@example.org:/path/to/file /path/to/file
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install -y nginx python3-certbot-nginx mariadb-server php7.4 php7.4-&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;/span&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/7.4/fpm/pool.d/www.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl enable mariadb --now
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mysql_secure_installation
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mysql -u root -p
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;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;username&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;password&amp;#39;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;EXIT&lt;/span&gt;;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot certonly --nginx -d nextcloud.example.org
&lt;/span&gt;&lt;/span&gt;&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/latest/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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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/php7.4-fpm.sock&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;map&lt;/span&gt; $arg_v $asset_immutable {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;nextcloud.example.org&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;https://&lt;/span&gt;$server_name$request_uri;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;nextcloud.example.org&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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/nextcloud&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/letsencrypt/live/nextcloud.example.org/fullchain.pem&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;512M&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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-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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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-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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;SAMEORIGIN&amp;#34;&lt;/span&gt;    &lt;span style=&#34;color:#e6db74&#34;&gt;always&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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-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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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-Robots-Tag&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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-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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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.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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/robots.txt&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;^~&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/.well-known&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/index.php&lt;/span&gt;$request_uri;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;^/(?: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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;^/(?:\.|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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;\.php(?:$|/)&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;# Required for legacy support
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#f92672&#34;&gt;set&lt;/span&gt; $path_info $fastcgi_path_info;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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; $path_info;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;\.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;public,&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;max-age=15778463,&lt;/span&gt; $asset_immutable&amp;#34;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;# Optional: Don&amp;#39;t log access to assets
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;\.wasm$&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;\.woff2?$&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/remote&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;301&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/remote.php&lt;/span&gt;$request_uri;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/
&lt;/span&gt;&lt;/span&gt;&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 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;wget https://download.nextcloud.com/server/releases/latest.tar.bz2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;tar -xjf latest.tar.bz2 -C /var/www
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chown -R www-data:www-data /var/www/nextcloud
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod -R &lt;span style=&#34;color:#ae81ff&#34;&gt;755&lt;/span&gt; /var/www/nextcloud
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl enable php7.4-fpm --now
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;sudo -u www-data php /var/www/nextcloud/occ
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&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/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main
deb-src [signed-by=/usr/share/keyrings/tor-archive-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/tor-archive-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;nginx.html#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;
&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt; - &lt;a href=&#34;https://tomfasano.net&#34;&gt;tomfasano.net&lt;/a&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh root@example.org
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install ufw
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw status
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw default deny incoming &lt;span style=&#34;color:#75715e&#34;&gt;# block all incoming connections by default&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow in ssh &lt;span style=&#34;color:#75715e&#34;&gt;# or: ufw allow in 22&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw enable
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw status verbose
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Status: active
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Logging: on (low)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Default: deny (incoming), allow (outgoing), deny (routed)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;New profiles: skip
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;To                           Action      From
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;--                           ------      ----
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;22 (SSH)                     ALLOW IN    Anywhere
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;80,443/tcp (WWW Full)        ALLOW IN    Anywhere
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;22 (SSH (v6))                ALLOW IN    Anywhere (v6)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;80,443/tcp (WWW Full (v6))   ALLOW IN    Anywhere (v6)
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw delete allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;WWW Full&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw reload
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;1965&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;80&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow &lt;span style=&#34;color:#ae81ff&#34;&gt;443&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow http
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow https
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;WWW Full&amp;#39;&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow in IMAPS
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow in POP3
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow in SMTP
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Postfix SMTPS&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw allow in &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Mail Submission&amp;#39;&lt;/span&gt;
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw default allow in
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw deny in PORT
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw reject in PORT
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw reload
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw allow in PORT comment &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Secret SSH&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw reload
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ufw status verbose
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;To                         Action      From
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;--                         ------      ----
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;PORT                       ALLOW IN    Anywhere                   # Secret SSH
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;PORT (v6)                  ALLOW IN    Anywhere (v6)              # Secret SSH
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw deny out PORT
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw limit PORT/tcp
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw deny from IP_ADDRESS
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;man ufw
&lt;/span&gt;&lt;/span&gt;&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ufw disable
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh-keygen
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh-copy-id root@yourdomain.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ssh root@yourdomain.com
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;700&lt;/span&gt; ~/.ssh/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;644&lt;/span&gt; ~/.ssh/id_rsa.pub
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;600&lt;/span&gt; ~/.ssh/id_rsa
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chmod &lt;span style=&#34;color:#ae81ff&#34;&gt;644&lt;/span&gt; ~/.ssh/authorized_keys
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;PasswordAuthentication no
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ChallengeResponseAuthentication no
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;UsePAM no
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl reload sshd
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&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;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt update
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt upgrade
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;tail -n &lt;span style=&#34;color:#ae81ff&#34;&gt;25&lt;/span&gt; /var/log/nginx/error.log
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;$ whereis nginx
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;root@landchad:~# locate nginx | grep available
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/etc/nginx/modules-available
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/etc/nginx/sites-available
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/etc/nginx/sites-available/default
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/etc/nginx/sites-available/landchad
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-auth-pam.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-dav-ext.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-echo.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-geoip.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-image-filter.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-subs-filter.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-upstream-fair.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-http-xslt-filter.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-mail.conf
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;/usr/share/nginx/modules-available/mod-stream.conf
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;*/30 * * * * /usr/bin/updatedb
&lt;/span&gt;&lt;/span&gt;&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;&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;&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;&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;&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;&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>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;&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;&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;&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;&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;. In this
guide, I will use the registrar
&lt;a href=&#34;https://www.epik.com/?affid=we2ro7sa6&#34;&gt;Epik&lt;/a&gt; because it is one of the
more high quality and easy to use. The guides on this site will use
Epik, but if you choose to register your domain with one of the &lt;a href=&#34;https://www.icann.org/en/accredited-registrars&#34;&gt;many,
many other registrars&lt;/a&gt;,
you can still do most of what Epik does, albeit options and settings
might appear in different menus.&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 year 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 &lt;a href=&#34;https://www.epik.com/?affid=we2ro7sa6&#34;&gt;Epik&#39;s site&lt;/a&gt; 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;&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;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Local Address                    State       PID/Program name
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:25                       LISTEN      887/master
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:1883                     LISTEN      22452/mosquitto
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:445                      LISTEN      798/smbd
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:993                      LISTEN      381/dovecot
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;127.0.0.1:3306                   LISTEN      560/mysqld
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:587                      LISTEN      887/master
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:139                      LISTEN      798/smbd
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;127.0.1.1:12301                  LISTEN      412/opendkim
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:143                      LISTEN      381/dovecot
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:465                      LISTEN      887/master
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0.0.0.0:22                       LISTEN      472/sshd
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:::25                            LISTEN      887/master
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:::443                           LISTEN      1769/apache2
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:::1883                          LISTEN      22452/mosquitto
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;:::445                           LISTEN      798/smbd
&lt;/span&gt;&lt;/span&gt;&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>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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install curl sqlite3
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;curl -sL -o /etc/apt/trusted.gpg.d/morph027-gitea.asc https://packaging.gitlab.io/gitea/gpg.key
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt update
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;apt install gitea
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;443&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;ssl&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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/&lt;mark&gt;git.example.org&lt;/mark&gt;.crt&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;git.example.org&lt;/mark&gt;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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-Real-IP&lt;/span&gt; $remote_addr;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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; $proxy_add_x_forwarded_for;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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-Proto&lt;/span&gt; $scheme;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;	}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;[repository]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir -p /var/lib/gitea/custom/templates/custom/
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&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;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;tab-size-8&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&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 quicking 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 automated 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 on 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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; .---------------- minute (0 - 59)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; | .------------- hour (0 - 23)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; | | .---------- day of month (1 - 31)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; | | | .------- month (1 - 12)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; | | | | .---- day of week (0 - 6)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; | | | | |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; * * * * *
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;30 3 * * 1 apt -y update &amp;amp;&amp;amp; apt -y upgrade
&lt;/span&gt;&lt;/span&gt;&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 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 purposes 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 the 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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 23 * * * backup
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 6 * * 1-5 echo &amp;#34;Wakey, wakey, wagie!&amp;#34; &amp;gt;&amp;gt; /home/wagie/alarm
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 12 1,15,20 * * /usr/bin/pay_bills_script
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;*/15 * * * * updatedb
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;* * * */2 *
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 0 1 */2 *
&lt;/span&gt;&lt;/span&gt;&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; you should see a list of directories and
there contents. The directories should be something like the 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git clone github.com/...
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git clone YourLandChadDomainName.xyz/...
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install git
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;useradd -m git -d /var/git -s /bin/bash
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;su -l git
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git init --bare &lt;mark&gt;my-repo.git&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;mkdir /var/git/.ssh	&lt;span style=&#34;color:#75715e&#34;&gt;# Create the required directory.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;/span&gt;&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;How 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git remote add origin git@&lt;mark&gt;example.org&lt;/mark&gt;:&lt;mark&gt;my-repo.git&lt;/mark&gt;
&lt;/span&gt;&lt;/span&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;git push &lt;mark&gt;personal&lt;/mark&gt; master
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt install apache2-utils
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}
&lt;/span&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/public/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;&lt;/span&gt;}
&lt;/span&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#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;/api&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#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;/api&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;http&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#f92672&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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/website&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#75715e&#34;&gt;#...
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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;
&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt; - &lt;a href=&#34;https://tomfasano.net&#34;&gt;tomfasano.net&lt;/a&gt;&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;&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;&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;&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;&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>
	
	<item>
		<title>Rainloop</title>
		<link>https://landchad.net/rainloop/</link>
		<pubDate>Mon, 01 Jan 0001 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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;apt-get install php7.4 php7.4-common php7.4-curl php7.4-xml php7.4-fpm php7.4-json php7.4-dev php7.4-mysql unzip -y
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;unzip rainloop.zip -d /var/www/mail
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;chown -R www-data: /var/www/mail
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;server&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;mail.example.org&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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/mail&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&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.php&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/var/log/nginx/rainloop_access.log&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;\.php$&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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/php7.4-fpm.sock&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;/\.ht&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;^~&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;/data&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}
&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;ln -s /etc/nginx/sites-available/mail /etc/nginx/sites-enabled/
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;systemctl reload nginx
&lt;/span&gt;&lt;/span&gt;&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 tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-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;display:flex;&#34;&gt;&lt;span&gt;certbot --nginx
&lt;/span&gt;&lt;/span&gt;&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;&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;&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>
	
	</channel>
</rss>
