summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html3
-rw-r--r--matrix.html87
-rw-r--r--rss.xml155
-rw-r--r--xmpp.html69
4 files changed, 291 insertions, 23 deletions
diff --git a/index.html b/index.html
index f20be26..0568e63 100644
--- a/index.html
+++ b/index.html
@@ -61,6 +61,7 @@
<h3 id=platform>"Build your own platform!"</h3>
<ul class=ll>
<li><a href="git.html">Host your own <img src="pix/git.svg"><code>git</code> repositories</a></li>
+ <li><a href="xmpp.html">Private and Encrypted Chat with <img src="pix/xmpp.svg" alt="xmpp logo">XMPP</a></li>
<li><a href="pleroma.html">Pleroma, a federated Twitter-like Microblogging Site</a></li>
<li><a href="nextcloud.html">Setting up a <img src="pix/nextcloud.svg">Nextcloud Instance (file hosting and more)</a></li>
<li><a href="gitea.html">Setting up <img src="pix/gitea.svg">Gitea</a></li>
@@ -91,7 +92,6 @@
<li>Full CSS tutorial</li>
<li>Setting up an Email server</li>
<li>RSS feeds</li>
- <li>XMPP Prosody (federated chat)</li>
<li>Matrix (federated chat)</li>
<li>SearX (search engine)</li>
</ul>
@@ -107,6 +107,7 @@
</p>
<ul>
+ <li><a href="https://btcpayserver.org/">BTCPay</a></li>
<li>Email webclients</li>
<li>Simple static site generators</li>
<li>Calibre (library server)</li>
diff --git a/matrix.html b/matrix.html
new file mode 100644
index 0000000..47898f8
--- /dev/null
+++ b/matrix.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html lang=en>
+ <head>
+ <title>Matrix Synapse Server &ndash; LandChad.net</title>
+ <meta charset="utf-8"/>
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel='alternate' type='application/rss+xml' title='Land Chad RSS' href='/rss.xml'>
+ </head>
+<body>
+ <header><h1>Matrix Synapse Server</h1></header>
+ <nav></nav>
+ <main>
+ <p>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.
+ </p>
+
+ <p><strong>Synapse</strong> is the name of the default Matrix server. It is written in Python.</p>
+
+ <h2>Installation</h2>
+
+ <p>Synapse is not in the Debian package repositories by default, but we can easily add Matrix's repository including it:</p>
+
+<pre><code>apt install -y lsb-release wget apt-transport-https
+wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
+echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" &gt; /etc/apt/sources.list.d/matrix-org.list</code></pre>
+ <p>After we update our packages lists, we will be able to install Synapse with <code>apt</code>.</p>
+
+<pre><code>apt update
+apt install matrix-synapse-py3</code></pre>
+
+<p>When prompted, give your main domain name (not a subdomain). This will be the domain appended to your Matrix address, e.g. <code>@chad:landchad.net</code>.</p>
+
+ <h2>Nginx configuration</h2>
+
+ <p>Create an Nginx configuration file for Matrix, say <code>/etc/nginx/sites-available/matrix</code> and add the content below:
+ </p>
+
+ <pre><code>server {
+ server_name matrix.<strong>example.org</strong> ;
+ listen 80;
+ listen [::]:80;
+ location / {
+ proxy_pass http://localhost:8008;
+ }
+ location ~* ^(\/_matrix|\/_synapse\/client) {
+ proxy_pass http://localhost:8008;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ client_max_body_size <strong>50M</strong> ;
+ }
+ location /.well-known/matrix/client {
+ return 200 '{"m.homeserver": {"base_url": "https://matrix.<strong>example.org</strong>"}}';
+ default_type application/json;
+ add_header Access-Control-Allow-Origin *;
+ }
+}</code></pre>
+
+ <aside>
+ <p>Note the <code>client_max_body_size</code> 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 congfiguration files.)
+ </p>
+ </aside>
+
+ <p>Now let's enable the Nginx Matrix site and reload Nginx to make it active.</p>
+
+ <pre><code>ln -s /etc/nginx/sites-available/matrix /etc/nginx/sites-enabled
+systemctl reload nginx</code></pre>
+
+ <h3>Encryption</h3>
+
+ <p>Obviously, we need to encrypt our <code>matrix</code> subdomain as well. Let's do that with certbot:</p>
+
+<pre><code>certbot --nginx -d matrix.<strong>example.org</strong></code></pre>
+
+ <h2>Configuration</h2>
+
+ <p>
+ The configuration file for Matrix is in <code>/etc/matrix-synapse/homeserver.yaml</code>.
+ It is well documented and commented, so you can read about the settings, but let's change the essential ones here.
+ </p>
+
+ <p><strong>This article isn't finished. Deal with basic settings and registering accounts.</strong></p>
+ </main>
+ <footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><a href="index.html"><li><img src="pix/chad.gif" alt="chad"></li></a><a href="rss.xml"><li><img src="pix/rss.svg" alt="RSS"></li></a><a href="pix/btc.png"><li><img src="pix/btc.svg" alt="BTC"></li></a><a href="pix/xmr.png"><li><img src="pix/xmr.svg" alt="XMR"></li></a><a href="https://github.com/lukesmithxyz/landchad"><li><img src="pix/git.svg" alt="Github"></li></a></footer>
+</body>
+</html>
diff --git a/rss.xml b/rss.xml
index 73d1048..7e00287 100644
--- a/rss.xml
+++ b/rss.xml
@@ -16,6 +16,161 @@
<!-- LB -->
<item>
+<title>XMPP Server (Prosody)</title>
+<guid>https://landchad.net/xmpp.html</guid>
+<link>https://landchad.net/xmpp.html</link>
+<pubDate>Wed, 21 Jul 2021 22:58:21 -0400</pubDate>
+<description><![CDATA[
+ <header><h1>XMPP Server (Prosody)</h1></header>
+
+ <main>
+ <img class=titleimg src="pix/xmpp.svg" alt="XMPP Logo and Icon">
+ <p>XMPP is a fantastically simple protocol that's usually used as a messenger.
+ It's highly extensible,
+ better than IRC,
+ lighter and more decentralized and Matrix
+ and Telegram and normie social media can't hold a candle to it.
+ </p>
+ <p>
+ XMPP is so decentralized and extensible that there are many <em>different</em> XMPP servers.
+ Here, let's set up an <a href="https://prosody.im/">Prosody</a> XMPP server.
+ </p>
+ <h2>Installation</h2>
+ <p>
+ Prosody is in the Debian repositories, so we can easily install it on our server with the following command:
+ </p>
+ <pre><code>apt install prosody</code></pre>
+<h2>Configuration</h2>
+<p>
+The Prosody configuration file is in <code>/etc/prosody/prosody.cfg.lua</code>.
+To set it all up, we will be changing several things.
+</p>
+<h3>Setting Admins</h3>
+<p>
+Let's go ahead and set who our admin(s) will be.
+Find the line that says <code>admins = { }</code> and to this we can specify one or more server admins.
+</p>
+<pre><code># To add one admin:
+admins = { "chad@example.org" }
+# We can add more than one by separating them by commas. (This file is written in Lua.)
+admins = { "chad@example.org", "chadmin@example.org" }</code></pre>
+<p>
+Note that we have not created these accounts yet, we will do this <a href=#user>below</a>.
+</p>
+<h3>Set the Server URL</h3>
+<p>
+Find the line <code>VirtualHost "localhost"</code> and replace <code>localhost</code> with your domain.
+In our case, we will have <code>VirtualHost "example.org"</code>
+</p>
+<h3>Multi-User Chats</h3>
+<p>
+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:
+</p>
+<pre><code>Component "<strong>chat.example.org</strong>" "muc"
+ modules_enabled = { "muc_mam" }
+ restrict_room_creation = "admin"</code></pre>
+<p>
+On the first line, you must have a separate subdomain for your multi-user chats.
+I use the <code>chat.</code> subdomain, but some use <code>muc.</code>.
+Anything if possible.
+</p>
+<p>
+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't know.
+</p>
+<aside>
+<p>
+Read more about the <code>muc</code> plugin on the Prosody documentation page <a href="https://prosody.im/doc/modules/mod_muc">here</a>.
+</p>
+</aside>
+<h3>End-to-end Encryption</h3>
+<p>
+Importantly, we'll want end-to-end encryption enabled for user privacy.
+</p>
+<p>
+Find the array beginning with <code>modules_enabled</code>.
+This includes a list of modules to be used.
+Add
+<code>"omemo_all_access";</code> to that list.
+Additionally, be sure to change the module <code>pep</code> to <code>pep_simple</code> or this will cause a conflict.</p>
+<p>
+This module is not installed by default,
+but you can easily download it by running the following command on the command prompt
+to download and install the module to the correct directory.
+</p>
+<pre class=wide><code>curl -sL https://hg.prosody.im/prosody-modules/raw-file/785389a2d2b3/mod_omemo_all_access/mod_omemo_all_access.lua &gt; /usr/lib/prosody/modules/mod_omemo_all_access.lua</code></pre>
+<h3>Other things to check</h3>
+<p>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 <code>allow_registration</code> to <code>true</code>.
+</p>
+<h2>Certificates</h2>
+<p>
+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 <code>prosodyctl</code> to import them.
+</p>
+<p>
+<strong>If you have multi-user chat enabled, be sure to get a certificate for that subdomain as well.</strong>
+Include the <code>--nginx</code> option assuming you have an Nginx server running.
+</p>
+<pre><code>certbot -d <strong>chat.example.org</strong> --nginx</code></pre>
+<p>
+Once you have the certificates for encryption, run the following to import them into Prosody.
+</p>
+<pre><code>prosodyctl --root cert import /etc/letsencrypt/live/</code></pre>
+<p>
+Note that you might get an error that a certificate has not been found if your <code>muc</code> subdomain and your main domain share a certificate.
+It should still work, this is just notifying you that no specific
+</p>
+<p>
+For user privacy, we will definitely want to install and enable encryption with OMEMO.
+</p>
+<h2 id=user>Creating users/admins manually</h2>
+<p>
+Let'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:
+</p>
+<pre><code>prosodyctl adduser <strong>chad@example.org</strong></code></pre>
+<p>This will prompt you to create a password as well.</p>
+<h2>Make changes active</h2>
+<p>
+With any system service, use <code>systemctl reload</code> or <code>systemctl restart</code> to make the new settings active:
+</p>
+<pre><code>systemctl restart prosody</code></pre>
+<h2>Using your Server!</h2>
+<p>
+Once your server is set up, you just need an XMPP client to use your new and secure chat system.
+</p>
+<ul>
+ <li>GNU/Linux: <a href="https://dino.im/">Dino</a> or <a href="https://gajim.org/">Gajim</a></li>
+ <li>Windows: <a href="https://gajim.org/">Gajim</a> also runs on Windows.</li>
+ <li>Android: <a href="https://conversations.im/">Conversations.im</a></li>
+ <li>Mac/iOS: <a href="https://monal.im/">Monal IM</a> or <a href="https://siskin.im/">Siskin</a> for iOS alone</li>
+ <li>command-line (GNU/Linux, MacOS, Windows): <a href="https://profanity-im.github.io/">Profanity</a></li>
+ <li><a href="https://xmpp.org/software/clients.html">See a more complete list kept by XMPP</a></li>
+</ul>
+<p>
+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.
+</p>
+<h3>Account addresses</h3>
+<p>
+XMPP account addressed look just like email addresses: <code><strong>username@example.org</strong></code>.
+You can message any account on any XMPP server on the internet with that format.
+</p>
+<h3>Note on MUCs (multi-user chats)</h3>
+<p>
+Remember that MUCs are kept on a separate subdomain that we created and should've gotten a certificate for above, for example, <code><strong>muc.example.org</strong></code>.
+Chatrooms are created and referred to in the following format: <code><strong>#chatroomname@muc.example.org</strong></code>.
+</p>
+ </main>
+
+]]></description>
+</item>
+
+
+<item>
<title>Setting up RSS Bridge</title>
<guid>https://landchad.net/rss-bridge.html</guid>
<link>https://landchad.net/rss-bridge.html</link>
diff --git a/xmpp.html b/xmpp.html
index f548948..64238b0 100644
--- a/xmpp.html
+++ b/xmpp.html
@@ -13,6 +13,8 @@
<nav></nav>
<main>
+ <img class=titleimg src="pix/xmpp.svg" alt="XMPP Logo and Icon">
+
<p>XMPP is a fantastically simple protocol that's usually used as a messenger.
It's highly extensible,
better than IRC,
@@ -49,10 +51,10 @@ Find the line that says <code>admins = { }</code> and to this we can specify one
</p>
<pre><code># To add one admin:
-admins = { "chad@landchad.net" }
+admins = { "chad@example.org" }
# We can add more than one by separating them by commas. (This file is written in Lua.)
-admins = { "chad@landchad.net", "chadmin@landchad.net" }</code></pre>
+admins = { "chad@example.org", "chadmin@example.org" }</code></pre>
<p>
Note that we have not created these accounts yet, we will do this <a href=#user>below</a>.
@@ -62,7 +64,7 @@ Note that we have not created these accounts yet, we will do this <a href=#user>
<p>
Find the line <code>VirtualHost "localhost"</code> and replace <code>localhost</code> with your domain.
-In our case, we will have <code>VirtualHost "landchad.net"</code>
+In our case, we will have <code>VirtualHost "example.org"</code>
</p>
<h3>Multi-User Chats</h3>
@@ -73,7 +75,8 @@ This is easily enough to enable.
In the config file, add the following:
</p>
-<pre><code>Component "<strong>chat.landchad.xyz</strong>" "muc"
+<pre><code>Component "<strong>chat.example.org</strong>" "muc"
+ modules_enabled = { "muc_mam" }
restrict_room_creation = "admin"</code></pre>
<p>
@@ -105,7 +108,7 @@ Find the array beginning with <code>modules_enabled</code>.
This includes a list of modules to be used.
Add
<code>"omemo_all_access";</code> to that list.
-</p>
+Additionally, be sure to change the module <code>pep</code> to <code>pep_simple</code> or this will cause a conflict.</p>
<p>
This module is not installed by default,
@@ -113,7 +116,7 @@ but you can easily download it by running the following command on the command p
to download and install the module to the correct directory.
</p>
-<pre><code style=font-size:x-small>curl -sL https://hg.prosody.im/prosody-modules/raw-file/785389a2d2b3/mod_omemo_all_access/mod_omemo_all_access.lua &gt; /usr/lib/prosody/modules/mod_omemo_all_access.lua</code></pre>
+<pre class=wide><code>curl -sL https://hg.prosody.im/prosody-modules/raw-file/785389a2d2b3/mod_omemo_all_access/mod_omemo_all_access.lua &gt; /usr/lib/prosody/modules/mod_omemo_all_access.lua</code></pre>
<h3>Other things to check</h3>
@@ -130,22 +133,10 @@ Nowadays, use can use Certbot to generate certificates and use a convenient comm
<p>
<strong>If you have multi-user chat enabled, be sure to get a certificate for that subdomain as well.</strong>
-I usually just create a dummy nginx site for each and run it with the <code>--nginx</code> option.
-This makes auto-renewal a little easier.
+Include the <code>--nginx</code> option assuming you have an Nginx server running.
</p>
-<!-- <pre><code>server { -->
-<!-- listen 80 ; -->
-<!-- listen [::]:80 ; -->
-<!-- root /var/www/html; -->
-<!-- index index.html index.htm index.nginx-debian.html; -->
-<!-- server_name <strong>muc.landchad.net</strong> ; -->
-<!-- location / { -->
-<!-- try_files $uri $uri/ =404; -->
-<!-- } -->
-<!-- }</code></pre> -->
-
-<pre><code>certbot --nginx</code></pre>
+<pre><code>certbot -d <strong>chat.example.org</strong> --nginx</code></pre>
<p>
Once you have the certificates for encryption, run the following to import them into Prosody.
@@ -170,7 +161,7 @@ Let'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:
</p>
-<pre><code>prosodyctl adduser chad@landchad.net</code></pre>
+<pre><code>prosodyctl adduser <strong>chad@example.org</strong></code></pre>
<p>This will prompt you to create a password as well.</p>
@@ -181,7 +172,41 @@ Note that you can indeed do this in your XMPP client if you have not disabled re
With any system service, use <code>systemctl reload</code> or <code>systemctl restart</code> to make the new settings active:
</p>
-<pre><code>systemctl reload prosody</code></pre>
+<pre><code>systemctl restart prosody</code></pre>
+
+<h2>Using your Server!</h2>
+
+<p>
+Once your server is set up, you just need an XMPP client to use your new and secure chat system.
+</p>
+
+<ul>
+ <li>GNU/Linux: <a href="https://dino.im/">Dino</a> or <a href="https://gajim.org/">Gajim</a></li>
+ <li>Windows: <a href="https://gajim.org/">Gajim</a> also runs on Windows.</li>
+ <li>Android: <a href="https://conversations.im/">Conversations.im</a></li>
+ <li>Mac/iOS: <a href="https://monal.im/">Monal IM</a> or <a href="https://siskin.im/">Siskin</a> for iOS alone</li>
+ <li>command-line (GNU/Linux, MacOS, Windows): <a href="https://profanity-im.github.io/">Profanity</a></li>
+ <li><a href="https://xmpp.org/software/clients.html">See a more complete list kept by XMPP</a></li>
+</ul>
+
+<p>
+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.
+</p>
+
+<h3>Account addresses</h3>
+
+<p>
+XMPP account addressed look just like email addresses: <code><strong>username@example.org</strong></code>.
+You can message any account on any XMPP server on the internet with that format.
+</p>
+
+<h3>Note on MUCs (multi-user chats)</h3>
+
+<p>
+Remember that MUCs are kept on a separate subdomain that we created and should've gotten a certificate for above, for example, <code><strong>chat.example.org</strong></code>.
+Chatrooms are created and referred to in the following format: <code><strong>#chatroomname@chat.example.org</strong></code>.
+</p>
</main>
<footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><a href="index.html"><li><img src="pix/chad.gif" alt="chad"></li></a><a href="rss.xml"><li><img src="pix/rss.svg" alt="RSS"></li></a><a href="pix/btc.png"><li><img src="pix/btc.svg" alt="BTC"></li></a><a href="pix/xmr.png"><li><img src="pix/xmr.svg" alt="XMR"></li></a><a href="https://github.com/lukesmithxyz/landchad"><li><img src="pix/git.svg" alt="Github"></li></a></footer>