diff options
| -rw-r--r-- | cgit.html | 28 | ||||
| -rw-r--r-- | nextcloud.html | 2 | ||||
| -rw-r--r-- | rsync.html | 2 | ||||
| -rw-r--r-- | tor.html | 27 | ||||
| -rw-r--r-- | xmpp.html | 49 |
5 files changed, 73 insertions, 35 deletions
@@ -42,13 +42,12 @@ 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:</p> - <pre><code> -server { + <pre><code>server { listen 443 ssl; listen [::]:443 ssl; - ssl_certificate /etc/ssl/nginx/<strong>git.example.org</strong>.crt; - ssl_certificate_key /etc/ssl/nginx/<strong>git.example.org</strong>.key; - server_name <strong>git.example.org</strong>; + ssl_certificate /etc/ssl/nginx/<strong>git.example.org</strong>.crt; + ssl_certificate_key /etc/ssl/nginx/<strong>git.example.org</strong>.key; + server_name <strong>git.example.org</strong>; root /usr/share/cgit ; try_files $uri @cgit ; @@ -60,8 +59,7 @@ server { fastcgi_param QUERY_STRING $query_string; fastcgi_pass unix:/run/fcgiwrap.socket; } -} - </code></pre> +}</code></pre> <p>Then get NGINX to reload your configuration.</p> @@ -70,8 +68,7 @@ server { To change this, we need to configure Cgit to our liking, by editing <code>/etc/cgitrc</code>. </p> - <pre><code> -css=/cgit.css + <pre><code>css=/cgit.css logo=/cgit.svg virtual-root=/ @@ -80,8 +77,7 @@ root-title=<strong>Chad's git server</strong> root-desc=<strong>A web interface to LandChad's git repositories, powered by Cgit</strong> # The location where git repos are stored on the server -scan-path=/srv/git/ - </code></pre> +scan-path=/srv/git/</code></pre> <p>This configuration assumes you followed the <a href="/git">git hosting guide</a> and store your repositories on the <code>/srv/git/</code> directory.</p> @@ -96,9 +92,7 @@ scan-path=/srv/git/ user to give it your name:</p> - <pre><code> -usermod -c "<strong>Your Name</strong>" git - </code></pre> + <pre><code>usermod -c "<strong>Your Name</strong>" git</code></pre> <h3>Changing the repository description</h3> @@ -110,8 +104,7 @@ usermod -c "<strong>Your Name</strong>" git to determine the idle time. Inside your repository, create a file <code>hooks/post-receive</code> and add the following contents:</p> - <pre><code> -#!/bin/sh + <pre><code>#!/bin/sh agefile="$(git rev-parse --git-dir)"/info/web/last-modified @@ -119,8 +112,7 @@ mkdir -p "$(dirname "$agefile")" && git for-each-ref \ --sort=-authordate --count=1 \ --format='%(authordate:iso8601)' \ - >"$agefile" - </code></pre> + >"$agefile"</code></pre> <p>And give it execution permissions with:</p> diff --git a/nextcloud.html b/nextcloud.html index 6ce665c..274d854 100644 --- a/nextcloud.html +++ b/nextcloud.html @@ -57,7 +57,7 @@ server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name <strong>example.org</strong>; - ssl_certificate /etc/letsencrypt/live/<strong>example.org</strong>/cert.pem ; + ssl_certificate /etc/letsencrypt/live/<strong>example.org</strong>/fullchain.pem ; ssl_certificate_key /etc/letsencrypt/live/<strong>example.org</strong>/privkey.pem ; root /var/www; @@ -48,7 +48,7 @@ <p>You may just as easily download files and directories from your server with rsync:</p> <pre><code>rsync -rtvzP <strong>root@example.org:/path/to/file</strong> <strong>/path/to/file</strong></code></pre> <h2 id="contribution">Contribution</h2> -<ul><li>el3ctr0lyte: <a href="https://github.com/el3ctr0lyte">github</a>, XMR: <code class=crypto>86DBJdiG83ZDea6kJgsbVN5tMae5ScfuhJ3PihEMTHatCrGEw2gctyUB92V2fz4R4YhwRaQeAGL5M4gPRXvVvtkULJi4ayk</code></li><li>Substantial revisions by <a href="https://lukesmith.xyz">Luke</a></li></ul> +<a href="https://lukesmith.xyz">Luke</a> </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="donate-bitcoin.html"><li><img src="pix/btc.svg" alt="BTC"></li></a><a href="donate-monero.html"><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> @@ -22,19 +22,21 @@ <h3>Installing Tor</h3> - <p>Firstly we need to add the Tor repos to our system to get the latest version of Tor:</p> + <p>First, we need to ensure that our CPU architecture is supported. Ensure that it is either amd64, arm64, or i386:</p> + <pre><code>dpkg --print-architecture</code></pre> + + <p>We need to <a href="https://support.torproject.org/apt/tor-deb-repo/">add the Tor repos to our system</a> to get the latest version of Tor:</p> <pre><code>apt install -y apt-transport-https gpg -echo "deb https://deb.torproject.org/torproject.org buster main -deb-src https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/tor.list</code></pre> +echo "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" > /etc/apt/sources.list.d/tor.list</code></pre> - <p>Then we need to add the gpg keys to our keyring:</p> + <p>Then we need to add the GPG keys to our keyring:</p> - <pre><code>curl -s https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import -gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -</code></pre> + <pre><code>curl -s https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor > /usr/share/keyrings/tor-archive-keyring.gpg</code></pre> - <p>Now update and install Tor:</p> + <p>Now install Tor:</p> - <pre><code>apt update + <pre><code>apt update apt install tor deb.torproject.org-keyring</code></pre> <h3>Enabling Tor</h3> @@ -56,11 +58,8 @@ HiddenServicePort 80 127.0.0.1:80</code></pre> <p>If the next command outputs <q>active</q> in green you're golden!</p> <pre><code> systemctl status tor</code></pre> - - <p>Finally, if you have a firewall running, remember to open port 9050:</p> - <pre><code>ufw allow 9050</code></pre> - - <p>Now your server is on the dark web. The following command will give you your onion address:</p> + + <p>Now your server is on the dark web. The following command will give you your onion address:</p> <pre><code> cat /var/lib/tor/hidden_service/hostname</code></pre> <h2>Adding the Nginx Config</h2> @@ -107,6 +106,6 @@ apt install tor</code></pre> <p><strong>Contributor</strong> - <a href="https://tomfasano.co" target="_blank">tomfasano.co</a></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="donate-bitcoin.html"><li><img src="pix/btc.svg" alt="BTC"></li></a><a href="donate-monero.html"><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> + <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="donate-bitcoin.html"><li><img src="pix/btc.svg" alt="BTC"></li></a><a href="donate-monero.html"><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> @@ -114,12 +114,52 @@ You can see other settings for this module <a href="https://prosody.im/doc/modul Note also that Prosody comes with the <code>carbons</code> activated module by default, which is related. This will send received messages to <em>all</em> active clients (your phone and desktop), although it will not save messages like MAM for clients not online or to be added later. </p> +<h3>File sharing</h3> + +<p>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.</p> + +<p>First we need to install extra prosody modules. Run the following command: </p> +<pre><code>apt install prosody-modules</code></pre> + +<p>Then we can add the following line to you prosody config file to enable file uploads: </p> +<pre><code>Component "<strong>uploads.example.org</strong>" "http_upload"</code></pre> + +<p>As you will notice, you need another subdomain for this. We will add an ssl certficate for this later.</p> + +<p>You will also need to go back to <code>modules_enabled</code> and uncomment the <code>http_files</code> module. This is used to actually serve the files to users.</p> + +<p>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: </p> + +<pre><code>Component "<strong>proxy.example.org</strong>" "proxy65"</code></pre> + +<p>As you can see, another subdomain is needed. We will add ssl certificates for this later.</p> + +<p>At this point, file sharing is now setup and ready to be used. Although there are some concerns that should be addressed.</p> + +<p>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:</p> +<pre><code>http_upload_file_size_limit = 20971520</code></pre> + +<p>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:</p> +<pre><code>http_upload_expire_after = 60 * 60 * 24 * 7</code></pre> + +<p>The value is specified in seconds. The above line will make prosody delete files after a week.</p> + +<p>If it is for some reason neccessary, you can also manually invoke expiry with the following command:</p> + +<pre><code>prosodyctl mod_http_upload expire</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> +<p>Another thing you can do is enable the <code>csi_simple</code> module, which will add some optimizations for mobile devices.</p> + +<p>Another thing worth noting is the <code>archive_expires_after = "1w"</code> line. This specifies after how long message archives will be deleted.</p> + +<p>Also the <code>smacks</code> module helps a lot with slow internet connections.</p> + <h2>Certificates</h2> <p> @@ -135,6 +175,13 @@ Include the <code>--nginx</code> option assuming you have an Nginx server runnin <pre><code>certbot -d <strong>chat.example.org</strong> --nginx</code></pre> <p> +<strong>If you have file sharing enabled, be sure to get a certificate for those subdomains as well.</strong> +</p> +<pre><code>certbot -d <strong>uploads.example.org</strong> --nginx +certbot -d <strong>proxy.example.org</strong> --nginx +</code></pre> + +<p> Once you have the certificates for encryption, run the following to import them into Prosody. </p> @@ -179,7 +226,7 @@ Once your server is set up, you just need an XMPP client to use your new and sec <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>Android: <a href="https://conversations.im/">Conversations.im</a> or <a href="https://snikket.org/">snikket</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> |
