cronyakatsuki.xyz/public/blog/index.xml

839 lines
118 KiB
XML
Raw Normal View History

2023-10-05 21:05:32 +02:00
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Blog on Crony Akatsuki&#39;s Website</title>
<link>https://cronyakatsuki.xyz/blog/</link>
<description>Recent content in Blog on Crony Akatsuki&#39;s Website</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
2024-04-04 21:30:00 +02:00
<lastBuildDate>Thu, 04 Apr 2024 20:44:10 +0200</lastBuildDate>
2023-10-05 21:05:32 +02:00
<atom:link href="https://cronyakatsuki.xyz/blog/index.xml" rel="self" type="application/rss+xml" />
2024-04-04 21:30:00 +02:00
<item>
2024-04-04 21:35:06 +02:00
<title>Securing SSH</title>
2024-04-04 21:30:00 +02:00
<link>https://cronyakatsuki.xyz/blog/securing-ssh/</link>
<pubDate>04-04-2024</pubDate>
<guid>https://cronyakatsuki.xyz/blog/securing-ssh/</guid>
<description>&lt;p&gt;As someone who has a couple of servers out in the open web, one of the main things I had to learn was how to secure it so people can&amp;rsquo;t touch them. One of the main ways to do that is by hardening ssh.&lt;/p&gt;
&lt;p&gt;Here I will name a couple of settings and best practices to make sure your ssh is as secure as possible.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;use-key-pairs&#34;&gt;Use key pairs&lt;/h2&gt;
&lt;p&gt;One of the main practice to secure ssh is by using public/private ssh key pair and making ssh only allow connection with them, disabling password login.&lt;/p&gt;
&lt;p&gt;First you need to generate a key pair by running the commmand &lt;code&gt;ssh-keygen&lt;/code&gt;.&lt;/p&gt;
2024-04-04 21:35:06 +02:00
&lt;p&gt;After generating the key run the command &lt;code&gt;ssh-copy-id ~/.ssh/key_name user@host&lt;/code&gt; to copy the key to the server.&lt;/p&gt;
&lt;p&gt;Connecting to the server now it will ask you for the ssh key password if you set one, if you didn&amp;rsquo;t then it will just directly connect it.&lt;/p&gt;
&lt;p&gt;While you are connected to the server now, I would change next settings to the values I recommend to make sure you can only connect to the server with ssh key pairs already on the server. Make sure to uncomment the values in your config, and change like I did in my examples.&lt;/p&gt;
2024-04-04 21:30:00 +02:00
&lt;blockquote&gt;
&lt;p&gt;/etc/ssh/sshd_config&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Restart your sshd service, with &lt;code&gt;systemctl restart sshd.service&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;disable-root-user-logins&#34;&gt;Disable root user logins&lt;/h2&gt;
&lt;p&gt;Next most common way to secure ssh is by not using a root account to connect, so even if somebody manages to connect they don&amp;rsquo;t get root user access.&lt;/p&gt;
&lt;p&gt;After creating a new user ( make sure to add it to sudo/wheel group also ), make sure to copy the file located in &lt;code&gt;/root/.ssh/authorized_keys&lt;/code&gt; to your new users directory in path &lt;code&gt;/home/user/.ssh/authorized_keys&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I would reccommend at this point to try and connecting to the different user on the server to make sure the ssh keys were copied correctly. ( example &lt;code&gt;ssh new-user@host&lt;/code&gt; )&lt;/p&gt;
&lt;p&gt;After that, disable root user login and only allow connecting to ssh with the new user.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;/etc/ssh/sshd_config&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;PermitRootLogin no
AllowUsers new-user
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Restart your sshd service.&lt;/p&gt;
&lt;h2 id=&#34;only-allow-connection-from-specific-ip&#34;&gt;Only allow connection from specific ip&lt;/h2&gt;
&lt;p&gt;Next best way to secure ssh is to only allow connection from specific ip, preferably vpn.&lt;/p&gt;
&lt;p&gt;Main way I do it is using wireguard. I set it up using the landchad &lt;a href=&#34;https://landchad.net/wireguard&#34;&gt;guide&lt;/a&gt;.&lt;/p&gt;
2024-04-04 21:35:06 +02:00
&lt;p&gt;Then in your sshd config you can make it so that ssh will only accept connection to the user with only the specific up using this syntax.&lt;/p&gt;
2024-04-04 21:30:00 +02:00
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;AllowUsers new-user@172.16.0.2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can use the ip for the connection you use to setup the peer in the wireguard setup guide, which in landchad&amp;rsquo;s guide is &lt;code&gt;172.16.0.2&lt;/code&gt;. Or from another server by using the ip of the server you connect with wireguard to.&lt;/p&gt;
&lt;p&gt;Make sure to restart sshd and test out in another terminal window whether you can only connect with the wireguard connection to the server ( Don&amp;rsquo;t close or exit the current ssh connection before making sure it all work&amp;rsquo;s ).&lt;/p&gt;
&lt;h2 id=&#34;general-settings&#34;&gt;General settings&lt;/h2&gt;
&lt;p&gt;There are some more settings that can be changed and I will name them now.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;# Port change to allow connection from only that port, to connect use &amp;#34;ssh new-user@host -p port&amp;#34;
Port 4893
# Allow connection only from ipv4
AddressFamily inet
# Limit to only 3 connection tries
MaxAuthTries 3
# Disable pam
UsePAM no
# Disable tcp and x11 forwarding
AllowTcpForwarding no
X11Forwarding no
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you by chance need tcp or x11 forwarding, enable it only for your user using this syntax:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;Match User new-user
AllowTcpForwarding yes
X11Forwarding yes
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;
&lt;p&gt;With this I have covered the most basic, but at the same best practices to secure your server ssh to not get uninvited people connecting to your servers.&lt;/p&gt;</description>
</item>
2024-01-19 10:19:57 +01:00
<item>
2024-01-19 17:37:23 +01:00
<title>Setup Traefik</title>
2024-01-19 17:38:05 +01:00
<link>https://cronyakatsuki.xyz/blog/setup-traefik/</link>
2024-01-19 10:19:57 +01:00
<pubDate>19-01-2024</pubDate>
2024-01-19 17:38:05 +01:00
<guid>https://cronyakatsuki.xyz/blog/setup-traefik/</guid>
2024-01-19 10:19:57 +01:00
<description>&lt;p&gt;Do you use docker? Do you use nginx or apachi to proxy the container? Fear not you won&amp;rsquo;t be needing them anymore once you are done with this tutorial.&lt;/p&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;Traefik is a simple docker centric proxy manager that is amazing and allows you to easilly proxy you docker containers with just a couple of labels.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;!-- raw HTML omitted --&gt;
&lt;h1 id=&#34;setting-up-traefik&#34;&gt;Setting up Traefik&lt;/h1&gt;
&lt;p&gt;In this part we will setup traefik, with the dashboard enabled and secured with https and a password.&lt;/p&gt;
&lt;p&gt;Create a directory where you will keep traefik configuration files and the docker compose. Inside it we will save all the configuration files.&lt;/p&gt;
&lt;h2 id=&#34;docker-composeyml&#34;&gt;docker-compose.yml&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ca9ee6&#34;&gt;version&lt;/span&gt;: &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;3&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;&lt;span style=&#34;color:#ca9ee6&#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 style=&#34;color:#ca9ee6&#34;&gt;traefik&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;image&lt;/span&gt;: traefik:v2.5
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;container_name&lt;/span&gt;: traefik
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;ports&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - &lt;span style=&#34;color:#ef9f76&#34;&gt;80&lt;/span&gt;:&lt;span style=&#34;color:#ef9f76&#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:#ef9f76&#34;&gt;443&lt;/span&gt;:&lt;span style=&#34;color:#ef9f76&#34;&gt;443&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;volumes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - ./traefik.toml:/traefik.toml
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - ./traefik_dynamic.toml:/traefik_dynamic.toml
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - /var/run/docker.sock:/var/run/docker.sock:ro
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - ./acme.json:/acme.json
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - web
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.enable=false
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;restart&lt;/span&gt;: unless-stopped
&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:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;web&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;external&lt;/span&gt;: &lt;span style=&#34;color:#ef9f76&#34;&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;What we are doing here is binding the needed configuration files, the docker socket so traefik can listen to it and automatically proxy the services, and the acme.json which will keep our ssl certificates.&lt;/p&gt;
&lt;p&gt;We are also forcing it to use the latest available stable image to make sure there are no bugs, and disabling proxying the traefik image itself io the lables to make sure it isn&amp;rsquo;t exposed by any means.&lt;/p&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;We are also making it so it can restart itself unless we specifically stop it, and binding it to port 80 and 443 because those are the default http and https ports that every browser uses when connecting.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;h2 id=&#34;traefiktoml&#34;&gt;traefik.toml&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[entryPoints]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; [entryPoints.web]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; address = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;:80&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; [entryPoints.web.http.redirections.entryPoint]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; to = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;websecure&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; scheme = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;https&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; [entryPoints.websecure]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; address = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;:443&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;[api]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; dashboard = &lt;span style=&#34;color:#ef9f76&#34;&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; insecure = &lt;span style=&#34;color:#ef9f76&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[certificatesResolvers.lets-encrypt.acme]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; email = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;name@domain.tld&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; storage = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;acme.json&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; [certificatesResolvers.lets-encrypt.acme.tlsChallenge]
&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;[providers.docker]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; watch = &lt;span style=&#34;color:#ef9f76&#34;&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; network = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;web&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;[providers.file]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; filename = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;traefik_dynamic.toml&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; watch = &lt;span style=&#34;color:#ef9f76&#34;&gt;true&lt;/span&gt;
2024-01-19 17:36:45 +01:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the entryPoints we are defining the http and https ports and forcing http to redirect to https.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;p&gt;In the api section we are enabling the dashboard, but disallowing insecure access to it.&lt;/p&gt;
&lt;p&gt;In the rest of the config we are defining the mail and storage for tls certificates, and enabled docker provider binded to a web network, and enabled the file provider for the dashboard setup.&lt;/p&gt;
&lt;h2 id=&#34;traefik_dynamictoml&#34;&gt;traefik_dynamic.toml&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;[http.middlewares.simpleAuth.basicAuth]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; users = [
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;somebody:$apr1$whatever&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;[http.routers.api]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; rule = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;Host(`monitor.domain.tld`)&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; entrypoints = [&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;websecure&amp;#34;&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; middlewares = [&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;simpleAuth&amp;#34;&lt;/span&gt;]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; service = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;api@internal&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; [http.routers.api.tls]
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; certResolver = &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;lets-encrypt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we are defining the basic auth credentials and routing the monitor domain to the dashboard with basic auth credentials and https.&lt;/p&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;Make sure to subsitute the string in qutes for users with what you get generated with httpasswd command: &lt;code&gt;htpasswd -n somebody&lt;/code&gt;.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;h2 id=&#34;acmetoml&#34;&gt;acme.toml&lt;/h2&gt;
&lt;p&gt;To create &lt;code&gt;acme.toml&lt;/code&gt; run this command &lt;code&gt;touch acme.toml &amp;amp;&amp;amp; chmod 600 acme.toml&lt;/code&gt; and we are done.&lt;/p&gt;
&lt;h2 id=&#34;docker-web-network&#34;&gt;docker web network&lt;/h2&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;You might have seen the networks part in the docker compose, we need to create it to make other docker containers in different docker compose files be accessible to traefik so it can proxy to them.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;p&gt;To create it we just need to run &lt;code&gt;docker network create web&lt;/code&gt; and we are done.&lt;/p&gt;
&lt;hr&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;After all this is done, we can just run &lt;code&gt;docker compose up -d&lt;/code&gt; and if everyting was setup correctly, running &lt;code&gt;docker compose logs -f&lt;/code&gt; shouldn&amp;rsquo;t show any errors.&lt;/p&gt;
&lt;h1 id=&#34;using-trafik-to-proxy-to-docker-containers&#34;&gt;Using trafik to proxy to docker containers&lt;/h1&gt;
&lt;p&gt;Now I&amp;rsquo;m going to explain to you how to use traefik to proxy to docker containers by using labels. For that I will be using ntfy docker image as an example.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;blockquote&gt;
&lt;p&gt;docker-compose.yml&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ca9ee6&#34;&gt;version&lt;/span&gt;: &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;2.3&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:#ca9ee6&#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 style=&#34;color:#ca9ee6&#34;&gt;ntfy&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;image&lt;/span&gt;: binwiederhier/ntfy
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;container_name&lt;/span&gt;: ntfy
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;command&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - serve
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;volumes&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - ./cache:/var/cache/ntfy
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - ./ntfy:/etc/ntfy
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - ./users:/var/lib/ntfy
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;healthcheck&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;test&lt;/span&gt;: [&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;CMD-SHELL&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo &amp;#39;\&amp;#34;healthy\&amp;#34;\\s*:\\s*true&amp;#39; || exit 1&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:#ca9ee6&#34;&gt;interval&lt;/span&gt;: 60s
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;timeout&lt;/span&gt;: 10s
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;retries&lt;/span&gt;: &lt;span style=&#34;color:#ef9f76&#34;&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;start_period&lt;/span&gt;: 40s
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;restart&lt;/span&gt;: unless-stopped
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - web
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.ntfy.rule=Host(`ntfy.domain.tld`)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.ntfy.tls=true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.ntfy.entrypoints=websecure
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.ntfy.tls.certresolver=lets-encrypt
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.port=80
&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:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;web&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;external&lt;/span&gt;: &lt;span style=&#34;color:#ef9f76&#34;&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The important part&amp;rsquo;s of this docker compose are the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
2024-01-19 17:36:45 +01:00
&lt;h2 id=&#34;no-exposing-ports&#34;&gt;No exposing ports&lt;/h2&gt;
2024-01-19 10:19:57 +01:00
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, with traefik you don&amp;rsquo;t need to expose port&amp;rsquo;s from the container making it a lot more secure as it can directly proxy to them from itself using the web network.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h2 id=&#34;labels&#34;&gt;labels&lt;/h2&gt;
&lt;/li&gt;
&lt;/ul&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;In labels we are defining the host domain we wan&amp;rsquo;t to proxy to our container, we are also enabled tls and with entrypoints making the container only acessible from https, making it impossible to be accessible with http no matter what.&lt;/p&gt;
&lt;p&gt;We are also defining the certresolver to be lets-encrypt and setting the port from the container that traefik needs to proxy to 80, this port can be different depending on what you want to proxy.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;ul&gt;
&lt;li&gt;
&lt;h2 id=&#34;networks&#34;&gt;networks&lt;/h2&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We are also defining the web external network that is ussed so traefik can access to the container and proxy to it.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;After you have accustomed the config to what you need, you can just &lt;code&gt;docker compose up -d&lt;/code&gt;, go to your traefik monitor and after some time you will see ntfy addedd to reverse proxying with tls certficate and only accessible from https.&lt;/p&gt;
&lt;h1 id=&#34;disabling-traefik&#34;&gt;Disabling traefik&lt;/h1&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;Next I will be talkling about how to disable traefik for containers because you don&amp;rsquo;t want it to work for containers you dont want accessible over the network.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;h2 id=&#34;disabling-for-one-service-docker-compose&#34;&gt;Disabling for one service docker-compose&lt;/h2&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;As the main example, I have a watchtower instance that I dont wan&amp;rsquo;t proxied to the outside world. To do that we just add &lt;code&gt;traefik.enable=false&lt;/code&gt; to the labels and trafik will stop being naughty.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;blockquote&gt;
&lt;p&gt;example&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ef9f76&#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:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.enable=false
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ef9f76&#34;&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Take note that for this kind of docker-compose files, networks part IS NOT NEEDED, just create the docker compose file as you would usually without having the networks part.&lt;/p&gt;
&lt;h2 id=&#34;disabling-for-more-complex-docker-compose&#34;&gt;Disabling for more complex docker-compose&lt;/h2&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;Now here comes the more tricky part, disabling it for only specific docker containers, and making it so traefik cant access them from its network. To accomplish that we will use the &lt;code&gt;traefik.enable=false&lt;/code&gt; label once again, and make use of multiple networks to make sure traefik can only access the web interfaces and keep other containers secure like databases and only accessible to the web interfaces.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;blockquote&gt;
&lt;p&gt;example docker-compose.yml&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ca9ee6&#34;&gt;version&lt;/span&gt;: &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;3&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:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;web&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;external&lt;/span&gt;: &lt;span style=&#34;color:#ef9f76&#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:#ca9ee6&#34;&gt;internal&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;external&lt;/span&gt;: &lt;span style=&#34;color:#ef9f76&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#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 style=&#34;color:#ca9ee6&#34;&gt;blog&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;image&lt;/span&gt;: wordpress:4.9.8-apache
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;environment&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;WORDPRESS_DB_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:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.blog.rule=Host(`blog.domain.tld`)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.blog.tls=true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.blog.tls.certresolver=lets-encrypt
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.port=80
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - internal
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - web
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;depends_on&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - mysql
&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:#ca9ee6&#34;&gt;mysql&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;image&lt;/span&gt;: mysql:5.7
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;environment&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;MYSQL_ROOT_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:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - internal
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.enable=false
&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:#ca9ee6&#34;&gt;adminer&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;image&lt;/span&gt;: adminer:4.6.3-standalone
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;labels&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.adminer.rule=Host(`db-admin.domain.tld`)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.adminer.tls=true
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.http.routers.adminer.tls.certresolver=lets-encrypt
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - traefik.port=8080
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;networks&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - internal
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - web
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;depends_on&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; - mysql
2024-01-19 17:36:45 +01:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here we can see what I was talking about in action, take note I took this docker compose file from this digital ocean &lt;a href=&#34;https://www.digitalocean.com/community/tutorials/how-to-use-traefik-v2-as-a-reverse-proxy-for-docker-containers-on-ubuntu-20-04#step-3-registering-containers-with-traefik&#34;&gt;blog post&lt;/a&gt; that explains it a lot better I could which you can use as a reference if you didnt understand something about what I was talking about.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
&lt;h1 id=&#34;conclusing&#34;&gt;Conclusing&lt;/h1&gt;
2024-01-19 17:36:45 +01:00
&lt;p&gt;I hope that you were able to setup traefik, or if not and were just reading to see what its all about I hope you had a good read and might have decided to try out traefik in the future.&lt;/p&gt;
2024-01-19 10:19:57 +01:00
</description>
</item>
2024-01-07 14:46:55 +01:00
<item>
<title>Using Mblaze</title>
<link>https://cronyakatsuki.xyz/blog/using-mblaze/</link>
<pubDate>07-01-2024</pubDate>
<guid>https://cronyakatsuki.xyz/blog/using-mblaze/</guid>
<description>&lt;p&gt;So you followed my last tutorial on setting up mblaze and friend&amp;rsquo;s for you mail management, but now you are left just looking at it not understanding how to use the power you have been given now. So now I&amp;rsquo;m going to teach you some basic usage that you can have with it.&lt;/p&gt;
&lt;h1 id=&#34;helper-functions&#34;&gt;Helper function&amp;rsquo;s&lt;/h1&gt;
&lt;p&gt;I guess you haven&amp;rsquo;t read my other blog on setting up mblaze and friend&amp;rsquo;s if you need me to type them out here again, so go read it now! Here is the &lt;a href=&#34;https://cronyakatsuki.xyz/blog/virgin-mutt-user-meet-mblaze/&#34;&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id=&#34;getting-mail-and-reading-it&#34;&gt;Getting mail and reading it&lt;/h1&gt;
&lt;p&gt;Now after you have actually read my last blog and got the two function&amp;rsquo;s and the script installed and made them usefull, we can start getting and reading our mail.&lt;/p&gt;
&lt;p&gt;First you will choose what mail you wanna manage, or how I call it profile with my script.&lt;/p&gt;
&lt;p&gt;After choosing it you will now have to choose if you wan&amp;rsquo;t to see all mail available on the server, or you will be just reading the new mail and based on that run either &lt;code&gt;mall&lt;/code&gt; or &lt;code&gt;mnew&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now we have a couple way&amp;rsquo;s of listing and reading mail.&lt;/p&gt;
&lt;p&gt;We can use the command &lt;code&gt;mscan&lt;/code&gt; that will show you simple one line summaries of your mail. The mail with &lt;code&gt;.&lt;/code&gt; mean their status is undread.&lt;/p&gt;
&lt;p&gt;To read a single specific message we can use &lt;code&gt;mshow&lt;/code&gt;. By default it will use the mail that when using &lt;code&gt;mscan&lt;/code&gt; show&amp;rsquo;s &amp;gt; as &lt;strong&gt;currently choosen&lt;/strong&gt; mail. To read another mail you can choose the number of the mail from &lt;code&gt;mscan&lt;/code&gt; and use mshow like this &lt;code&gt;mshow N&lt;/code&gt; ( N being the number of the mail you wan&amp;rsquo;t to read ).&lt;/p&gt;
&lt;p&gt;Now onto my favourite way of reading mail with mblaze, it&amp;rsquo;s &lt;code&gt;mless&lt;/code&gt;. You just run it and it will run a less instance showing all your mail, and have the ability to change between them with keybindings &lt;code&gt;:p&lt;/code&gt; and &lt;code&gt;:n&lt;/code&gt; with p going to preview and n going to next message.&lt;/p&gt;
&lt;h1 id=&#34;settings-read-status&#34;&gt;Settings read status&lt;/h1&gt;
&lt;p&gt;To flag mail as read we can use the mflag utiity. We do it by choosing what mail we wanna mark as read and running the command &lt;code&gt;mflag -S N&lt;/code&gt;, but after that we need to fix our list because the filename changed because of the fact that we changed the flag to read. To fix that we will run &lt;code&gt;mseq -f : | mseq -S&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can easily alias this sequence of command&amp;rsquo;s into a function to streamline this.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#ca9ee6&#34;&gt;function&lt;/span&gt; mread&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mflag -S &lt;span style=&#34;color:#f2d5cf&#34;&gt;$1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mseq -f : | mseq -S
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#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 place this function anywhere in your shell configuration.&lt;/p&gt;
&lt;h1 id=&#34;sending-mail&#34;&gt;Sending mail&lt;/h1&gt;
&lt;p&gt;To write mail with mblaze we use command called &lt;code&gt;mcom&lt;/code&gt;. After running it, it will a file in your editor of choice that looks like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-devbox&#34; data-lang=&#34;devbox&#34;&gt;To:
Cc:
Bcc:
Subject:
From: John Doe &amp;lt;john@doe.com&amp;gt;
Message-Id: &amp;lt;random-id&amp;gt;
User-Agent: mblaze/...
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the &lt;code&gt;To:&lt;/code&gt; file you write the name of mail you wan&amp;rsquo;t to send to for example &lt;code&gt;Shit Shittington &amp;lt;shit@shittington.com&amp;gt;&lt;/code&gt; and subject to name of the subject like regular mail.&lt;/p&gt;
&lt;p&gt;After that you type the message in the last empty line at the bottom, of course you can make it as long as you wan&amp;rsquo;t to.&lt;/p&gt;
&lt;p&gt;If you save the message as draft just run &lt;code&gt;mcom -r&lt;/code&gt;. To reply to a message use &lt;code&gt;mrep N&lt;/code&gt; to reply to a specific message.&lt;/p&gt;
&lt;h1 id=&#34;extending-mless-functionalitty&#34;&gt;Extending mless functionalitty&lt;/h1&gt;
&lt;p&gt;We can extend the functionality of mless a bit by creating a file with custom keybindings that will go ahead and a few more function&amp;rsquo;s to mless.&lt;/p&gt;
&lt;p&gt;Save this file to &lt;code&gt;~/.mblaze/mlesskey&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-lesskey&#34; data-lang=&#34;lesskey&#34;&gt;Q quit \1
:cq quit \1
[ prev-file
] next-file
{ noaction E1\n
} quit $
$ quit $
S noaction E//scan\n
` noaction E\#\n
H quit H
N quit N
R quit R
K quit k
d quit d
\^ quit \^
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will add keybindings like &lt;code&gt;]&lt;/code&gt; and &lt;code&gt;[&lt;/code&gt; for previous and next mail and &lt;code&gt;d&lt;/code&gt; for setting read status on mail. Rest you can checkout yourself by looking at this part of mless script on github, &lt;a href=&#34;https://github.com/leahneukirchen/mblaze/blob/master/mless#L92&#34;&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I guess this is it now, hope this help&amp;rsquo;s you on making your own mail be even more amazing.&lt;/p&gt;
</description>
</item>
2023-11-10 20:13:49 +01:00
<item>
<title>Hardening Level Pro: Notify on SSH Login</title>
<link>https://cronyakatsuki.xyz/blog/hardening-level-pro-notify-on-ssh-login/</link>
<pubDate>10-11-2023</pubDate>
<guid>https://cronyakatsuki.xyz/blog/hardening-level-pro-notify-on-ssh-login/</guid>
<description>&lt;p&gt;You ever anxious about somebody possibly gaining access to your machine? Fret not, you can just make it so that on any kind of login to your system directly you can get a notification on your phone.&lt;/p&gt;
&lt;p&gt;For this you will need a way to receive the messaggess. I personally use a selfhosted &lt;a href=&#34;https://ntfy.sh/&#34;&gt;ntfy.sh&lt;/a&gt; server.&lt;/p&gt;
&lt;p&gt;The most important way of managing your linux vps or in general any machine for most of us is ssh. So why not just get a notification whenever somebody logins!? Even you!&lt;/p&gt;
&lt;p&gt;To achieve this you will need to make a shell script and use a pam module, yes you will need to enable UsePAM in your sshd config, but don&amp;rsquo;t worry it&amp;rsquo;s secure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;/usr/bin/ntfy-ssh-login.sh&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;[&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;PAM_TYPE&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;open_session&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;]&lt;/span&gt;; &lt;span style=&#34;color:#ca9ee6&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; curl &lt;span style=&#34;color:#8caaee&#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:#8caaee&#34;&gt;&lt;/span&gt; -H prio:high &lt;span style=&#34;color:#8caaee&#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:#8caaee&#34;&gt;&lt;/span&gt; -H tags:warning &lt;span style=&#34;color:#8caaee&#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:#8caaee&#34;&gt;&lt;/span&gt; -d &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;SSH login: &lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;PAM_USER&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt; from &lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;PAM_RHOST&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#8caaee&#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:#8caaee&#34;&gt;&lt;/span&gt; ntfy.sh/&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;YourTopic&lt;span style=&#34;color:#99d1db;font-weight:bold&#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:#ca9ee6&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;/etc/pam.d/sshd&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;# at the end of the file
session optional pam_exec.so /usr/bin/ntfy-ssh-login.sh
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Also make sure that pam is realoaded using this command &lt;code&gt;pam-auth-update --force --package&lt;/code&gt;.&lt;/p&gt;
2023-11-10 20:31:25 +01:00
&lt;p&gt;You can modify the script to do email or anything else, but I prefer ntfy since the notification are instant.&lt;/p&gt;
2023-11-10 20:29:40 +01:00
&lt;p&gt;Hope this was of help and let&amp;rsquo;s see you in another post.&lt;/p&gt;</description>
2023-11-10 20:13:49 +01:00
</item>
2023-10-24 19:16:22 +02:00
<item>
<title>Virgin (Neo)Mutt User Meet Mblaze</title>
<link>https://cronyakatsuki.xyz/blog/virgin-mutt-user-meet-mblaze/</link>
<pubDate>24-10-2023</pubDate>
<guid>https://cronyakatsuki.xyz/blog/virgin-mutt-user-meet-mblaze/</guid>
<description>&lt;p&gt;We have all heard of (Neo)Mutt when it comes to managing e-mail in the terminal right? What would you do if I told you there is an even better and more UNIX way to manage mail on the terminal? Well there is and it&amp;rsquo;s called &lt;a href=&#34;https://github.com/leahneukirchen/mblaze&#34;&gt;mblaze&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this post I will explain to you how to setup mblaze for managing your email, but for that we will 2 more additional software to manage our mail with mblaze. &lt;a href=&#34;https://www.opensmtpd.org/&#34;&gt;OpenSMTPD&lt;/a&gt; the openbsd fast mail server for getting local mail from services like crontab and sending mail with, and &lt;a href=&#34;https://isync.sourceforge.io/&#34;&gt;isync&lt;/a&gt; for downloading our mail from our remote server&amp;rsquo;s either selfhosted or gmail.&lt;/p&gt;
&lt;h1 id=&#34;1-opensmtpd&#34;&gt;1. OpenSMTPD&lt;/h1&gt;
&lt;p&gt;First we will setup OpenSMTP for local mail, and we will also relay&amp;rsquo;s that allow us to send e-mail from our selfhosted or gmail mail server&amp;rsquo;s for example. Make sure to install opensmtpd from your package maanager.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Edit &lt;code&gt;/etc/smtpd/smtpd.conf&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;table aliases file:/etc/mail/aliases
table credentials file:/etc/mail/credentials
listen on 127.0.0.1
action &amp;#34;local_mail&amp;#34; maildir &amp;#34;/home/%{user.username}/.local/share/Maildir/local&amp;#34; alias &amp;lt;aliases&amp;gt;
action outbound_selfhost relay host smtp+tls://selfhost@subdomain.domain.com:587 auth &amp;lt;credentials&amp;gt;
action outbound_gmail relay host smtp+tls://gmail@smtp.gmail.com:587 auth &amp;lt;credentials&amp;gt;
match for local action &amp;#34;local_mail&amp;#34;
match mail-from &amp;#34;selfhost@domain.com&amp;#34; for any action outbound_selfhost
match mail-from &amp;#34;username@gmail.com&amp;#34; for any action outbound_gmail
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next you will need to update aliases in file /etc/mail/aliases under the comment &lt;code&gt;# Well-known aliases -- these should be filled in!&lt;/code&gt; to your main user account on your system.&lt;/p&gt;
&lt;p&gt;Now we will also setup the passwords in the &lt;code&gt;/etc/mail/credentials&lt;/code&gt;, Note for gmail you will need to setup app password for it to be usable with this method and enable smtp in gmail.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;selfhost selfhost:selfhost_password
gmail gmail:gmail_password
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Also make sure to run &lt;code&gt;sudo chmod 600 /etc/mail/credentials&lt;/code&gt; to make sure the password&amp;rsquo;s aren&amp;rsquo;t readable if you aren&amp;rsquo;t running as sudo.&lt;/p&gt;
&lt;h1 id=&#34;2-isync&#34;&gt;2. isync&lt;/h1&gt;
&lt;p&gt;Now we will setup isync to get our e-mail from our server&amp;rsquo;s. In this example there is both settings for a selfhosted server and a gmail one.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Edit &lt;code&gt;$HOME/.mbsyncrc&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-rc&#34; data-lang=&#34;rc&#34;&gt;IMAPStore selfhost-remote
Host subdomain.domain.com
Port 993
User selfhost@domain.com
PassCmd &amp;#34;Command for password&amp;#34; or Pass password
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore selfhost-local
Path ~/.local/share/Maildir/selfhost/
Inbox ~/.local/share/Maildir/selfhost/INBOX
SubFolders Verbatim
Channel selfhost
Far :selfhost-remote:
Near :selfhost-local:
Create Both
Expunge Both
Patterns * !&amp;#34;[Gmail]/All Mail&amp;#34; !&amp;#34;*fts-flatcurve*&amp;#34; !&amp;#34;*virtual*&amp;#34;
SyncState *
Create Both
IMAPStore gmail-remote
Host imap.gmail.com
Port 993
User gmail@gmail.com
PassCmd &amp;#34;Command for password&amp;#34; or Pass password
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore gmail-local
Path ~/.local/share/Maildir/gmail/
Inbox ~/.local/share/Maildir/gmail/INBOX
SubFolders Verbatim
Channel gmail
Far :gmail-remote:
Near :gmail-local:
Create Both
Expunge Both
Patterns * !&amp;#34;[Gmail]/All Mail&amp;#34; !&amp;#34;*fts-flatcurve*&amp;#34; !&amp;#34;*virtual*&amp;#34;
SyncState *
Create Both
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then you can run &lt;code&gt;mbsync -V gmail/selfhost&lt;/code&gt; to sync a specific account or you can run &lt;code&gt;mbsync -a&lt;/code&gt; to sync all your account&amp;rsquo;s.&lt;/p&gt;
&lt;h1 id=&#34;3-mblaze&#34;&gt;3. mblaze&lt;/h1&gt;
&lt;p&gt;Now we will start working on the most juicy part, setting up mblaze for basic usage. First we will setup a basic mblaze profile for our local account.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Edit &lt;code&gt;$HOME/.mblaze/profile&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;Local-Mailbox: user
FQDN: &amp;#34;Generate using command mgenmid&amp;#34;
2023-10-24 19:26:18 +02:00
Maildir: /home/USER/.local/share/Maildir/local
Outbox: /home/USER/.local/share/Maildir/local/Sent/
Drafts: /home/USER/.local/share/Maildir/local/Drafts/
2023-10-24 19:16:22 +02:00
Reply-From: user
# You don&amp;#39;t need this, it just makes it easier to see date
Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And now we are ready for using mblaze for managing our local mail with mblaze. Now for the rest of this blog I will show how I manage multiple account&amp;rsquo;s using a scipt and a couple function&amp;rsquo;s. I will also link a video that will show you in more detail things for using mblaze for managing your mail which was my inspiration for making this post.&lt;/p&gt;
&lt;h1 id=&#34;4-multiple-profiles-management&#34;&gt;4. Multiple profiles management&lt;/h1&gt;
&lt;p&gt;You can do this in a lot of ways with mblaze since it is very easily scriptable, but I do it with a script that copies over a preconfigure profile from &lt;code&gt;$HOME/.config/mblaze&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;example selfhost mblaze config &lt;code&gt;$HOME/.config/mblaze/selfhost&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;Local-Mailbox: User Name &amp;lt;user@domain.com&amp;gt;
FQDN: &amp;#34;Generate using command mgenmid&amp;#34;
2023-10-24 19:23:55 +02:00
Maildir: /home/USER/.local/share/Maildir/selfhost
Outbox: /home/USER/.local/share/Maildir/selfhost/Sent/
Drafts: /home/USER/.local/share/Maildir/selfhost/Drafts/
2023-10-24 19:16:22 +02:00
Reply-From: User Name &amp;lt;user@domain.com&amp;gt;
Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;
&lt;p&gt;example gmail mblaze config &lt;code&gt;$HOME/.config/mblaze/gmail&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;Local-Mailbox: user &amp;lt;user@gmail.com&amp;gt;
FQDN: &amp;#34;Generate using command mgenmid&amp;#34;
2023-10-24 19:23:55 +02:00
Maildir: /home/USER/.local/share/Maildir/gmail
Outbox: /home/USER/.local/share/Maildir/gmail/[Gmail]/Sent Mail
Drafts: /home/USER/.local/share/Maildir/gmail/[Gmail]/Drafts
2023-10-24 19:16:22 +02:00
Reply-From: user &amp;lt;user@gmail.com&amp;gt;
Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For the local profile, just copy the config saved to &lt;code&gt;$HOME/.mblaze/profile&lt;/code&gt; to &lt;code&gt;$HOME/.config/mblaze/local&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now onto the script and functions I use with my zsh.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;mprofile&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#737994;font-style:italic&#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:#737994;font-style:italic&#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:#f2d5cf&#34;&gt;profiles&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;find &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/.config/mblaze -type f -exec basename &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;{}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#8caaee&#34;&gt;\;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#f2d5cf&#34;&gt;currentMaildir&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Maildir:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#99d1db;font-weight:bold&#34;&gt;[&lt;/span&gt; -z &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$1&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; basename &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep -w &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$currentMaildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; -l -R &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/.config/mblaze&lt;span style=&#34;color:#ca9ee6&#34;&gt;)&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#99d1db&#34;&gt;exit&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#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 style=&#34;color:#99d1db;font-weight:bold&#34;&gt;[&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$1&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;-l&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#99d1db&#34;&gt;printf&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;%s\n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profiles&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#99d1db&#34;&gt;exit&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#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:#f2d5cf&#34;&gt;profile&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$1&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#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:#ca9ee6&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#99d1db&#34;&gt;printf&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;%s\n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profiles&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; | grep -qw &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;; &lt;span style=&#34;color:#ca9ee6&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; cp &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/.config/mblaze/&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/.mblaze/profile
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#99d1db&#34;&gt;printf&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;%s\n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;This profile doesn&amp;#39;t exist&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:#ca9ee6&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The script is able to print the current profile when run without argument, listing all available profiles using -l and setting the profile by providing it&amp;rsquo;s name.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;functions&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# mblaze functions&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:#737994;font-style:italic&#34;&gt;# Get new mail for current profile&lt;/span&gt;
2024-01-07 14:46:55 +01:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;function&lt;/span&gt; mnew &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;maildir&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Maildir:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#f2d5cf&#34;&gt;profile&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;basename &lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#ca9ee6&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;[&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;local&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;]&lt;/span&gt;; &lt;span style=&#34;color:#ca9ee6&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mlist -s &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;| msort -dr | mseq -S
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mbsync -V &lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mlist -s &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/INBOX | msort -dr | mseq -S
2024-01-07 14:46:55 +01:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; minc &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;/INBOX&amp;#34;&lt;/span&gt; &amp;gt; /dev/null
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#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:#737994;font-style:italic&#34;&gt;# Get full mail for current profile including threads&lt;/span&gt;
2024-01-07 14:46:55 +01:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;function&lt;/span&gt; mall &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;maildir&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Maildir:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#f2d5cf&#34;&gt;sent&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Outbox:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#f2d5cf&#34;&gt;profile&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;basename &lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#ca9ee6&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;[&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;local&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;]&lt;/span&gt;; &lt;span style=&#34;color:#ca9ee6&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mlist &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; | mthread -r -S &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; | mseq -S
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mbsync -V &lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mlist &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/INBOX | mthread -r -S &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$sent&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; | mseq -S
2024-01-07 14:46:55 +01:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; minc &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;/INBOX&amp;#34;&lt;/span&gt; &amp;gt; /dev/null
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the rest of usage of mblaze, I really recommend to use &lt;code&gt;man mblaze&lt;/code&gt; since the software is really well documented, or you can also watch this &lt;a href=&#34;https://piped.cronyakatsuki.xyz/watch?v=5YS8RPC4zwc&#34;&gt;video&lt;/a&gt; I took the inspiration from for this setup.&lt;/p&gt;
&lt;h1 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Hope you have had a good read, and I hope you will maybe try out this mail setup, or create your own even better setup for your self.&lt;/p&gt;</description>
</item>
2023-10-05 21:05:32 +02:00
<item>
<title>Setup dns with adblock and dot/doh with pi-hole and unbound</title>
<link>https://cronyakatsuki.xyz/blog/setup-dns-pihole-unbound/</link>
2023-10-06 19:04:36 +02:00
<pubDate>27-09-2023</pubDate>
2023-10-05 21:05:32 +02:00
<guid>https://cronyakatsuki.xyz/blog/setup-dns-pihole-unbound/</guid>
<description>&lt;p&gt;Just another day I seted up my own private dns server that has adblocking ( and other stuff ) using pihole and uses unbound as a resolver. To safelly connect to the dns server I&amp;rsquo;m using DNS over HTTPS for my browser&amp;rsquo;s and HTTPS over TLS for stuffy for my whole desktop and private dns in android ( Android has DoH support but only for google and cloudflare right now). Let&amp;rsquo;s get on to setting everything up&lt;/p&gt;
&lt;!-- raw HTML omitted --&gt;
&lt;h2 id=&#34;1-pihole&#34;&gt;1. Pihole&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s start with setting up pihole. I will be installing it with their script on a debian system for easier unbound integration ( unbound doesn&amp;rsquo;t have an official docker container ).&lt;/p&gt;
&lt;p&gt;I recommend to read up on the pihole&amp;rsquo;s docs on exactly how to install it since pihole get&amp;rsquo;s frequent updates. &lt;a href=&#34;https://docs.pi-hole.net/main/basic-install/&#34;&gt;DOCS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I recommend you to install the admin page for easier managmenet and ability to change the upstream dns server ( needed for changing it to unbound later on ). To be able to access the admin page I use an nginx configuration like this one.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ca9ee6&#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:#81c8be&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;example.com&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:#81c8be&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;403&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:#81c8be&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;http://127.0.0.1:8185/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:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;Host&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$host&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:#737994;font-style:italic&#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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;error_log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;[::]:443&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;ssl&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;ssl&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_certificate&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/live/example.com/fullchain.pem&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/live/example.com/privkey.pem&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;include&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/options-ssl-nginx.conf&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_dhparam&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/ssl-dhparams.pem&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#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:#ca9ee6&#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:#81c8be&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$host&lt;/span&gt; = &lt;span style=&#34;color:#a6d189&#34;&gt;example.com)&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;https://&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$host$request_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:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#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:#81c8be&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;example.com&lt;/span&gt; ;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#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:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;404&lt;/span&gt;; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# managed by 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt;}
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The main point of this config is the &lt;code&gt;/admin&lt;/code&gt; location that you need to pass the lighttpd port to acces the website, you can just do it on your main website also.
Also to make lighttpd work with nginx listening on port 80 you need to edit the &lt;code&gt;server.port&lt;/code&gt; to port you wan&amp;rsquo;t to use in lighttpd config file located at &lt;code&gt;/etc/lighttpd/lighttpd.conf&lt;/code&gt; and then just restart lighttpd&lt;/p&gt;
&lt;h2 id=&#34;2-unbound&#34;&gt;2. Unbound&lt;/h2&gt;
&lt;p&gt;For this part I will just link the pi-hole&amp;rsquo;s unbound documentation because it is the most correct one and updated as things change regulary.
&lt;a href=&#34;https://docs.pi-hole.net/guides/dns/unbound/&#34;&gt;Pi-hole unbound docs&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;3-dns-over-tls&#34;&gt;3. DNS over TLS&lt;/h2&gt;
&lt;p&gt;For dns over tls you need to first have a ssl certificate. I recommend on using certbot to generate one with this command &lt;code&gt;certbot --nginx -d dot.example.com&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Next you will need a reverse proxy, in my case I use nginx. You will need to add this configuration to your main nginx config located at &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt;. &lt;strong&gt;Make sure to add this outside of the http block and change example.com to your domain&lt;/strong&gt;&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ca9ee6&#34;&gt;stream&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;log_format&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;basic&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$remote_addr&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$time_local]&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$protocol&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$status&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$bytes_sent&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$bytes_received&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$session_time&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$upstream_addr&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; &lt;span style=&#34;color:#81c8be&#34;&gt;upstream&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;dns&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:#81c8be&#34;&gt;zone&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;dns&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;64k&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;server&lt;/span&gt; 127.0.0.1:&lt;span style=&#34;color:#ef9f76&#34;&gt;53&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:#81c8be&#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:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;853&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/var/log/nginx/dot-access.log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;basic&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;error_log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/var/log/nginx/dot-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:#81c8be&#34;&gt;ssl_certificate&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/live/dot.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:#81c8be&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/live/dot.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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_protocols&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;TLSv1.2&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;TLSv1.3&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_ciphers&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;HIGH:!aNULL:!MD5&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:#81c8be&#34;&gt;ssl_handshake_timeout&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;10s&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_session_cache&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;shared:SSL:20m&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;ssl_session_timeout&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;4h&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;dns&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_responses&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#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:#81c8be&#34;&gt;proxy_timeout&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;1s&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;}
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Also make sure to enable port 853, example ufw command is &lt;code&gt;ufw allow 853/tcp&lt;/code&gt;. Then restart nginx, to test if this configuration is working you can use your android phone by setting the private dns address to &lt;code&gt;dot.example.com&lt;/code&gt; and then visit the website&lt;a href=&#34;https://dnsleaktest.com&#34;&gt;dnsleaktest&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;4-dns-over-https&#34;&gt;4. DNS over HTTPS&lt;/h2&gt;
&lt;p&gt;For using dns over https we will be installing additional package called dnsdinst. On debian systems just run &lt;code&gt;apt install dnsdinst&lt;/code&gt;. Next you will need to setup dnsdinst config and restart it. Make sure to change example.com.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-conf&#34; data-lang=&#34;conf&#34;&gt;-- dnsdist configuration file, an example can be found in /usr/share/doc/dnsdist/examples/
-- disable security status polling via DNS
setSecurityPollSuffix(&amp;#34;&amp;#34;)
-- fix up possibly badly truncated answers from pdns 2.9.22
-- truncateTC(true)
-- Answer to only clients from this subnet
setACL(&amp;#34;127.0.0.1/8&amp;#34;)
-- Define upstream DNS server (Pi-hole)
newServer({address=&amp;#34;127.0.0.1&amp;#34;, name=&amp;#34;Pi-hole&amp;#34;, checkName=&amp;#34;example.com&amp;#34;, checkInterval=60, mustResolve=true})
-- Create local DOH server listener in DNS over HTTP mode, otherwise the information coming from nginx won&amp;#39;t be processed well
addDOHLocal(&amp;#34;127.0.0.1:5300&amp;#34;, nil, nil, &amp;#34;/dns-query&amp;#34;, { reusePort=true })
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next we will need another ssl certificate for the doh domain, for that we will once again using certbot with this command &lt;code&gt;certbot --nginx -d doh.example.com&lt;/code&gt;after that add this configuratin to nginx either in sites-available and linking it to sites enabled or in http block in main nginx configuration.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#737994;font-style:italic&#34;&gt;# Proxy Cache storage - so we can cache the DoH response from the upstream
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;proxy_cache_path&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/var/run/doh_cache&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;levels=1:2&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;keys_zone=doh_cache:10m&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:#ca9ee6&#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:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#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:#81c8be&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;doh.example.com&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;301&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;https://doh.example.com/&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$request_uri&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:#737994;font-style:italic&#34;&gt;# This virtual server accepts HTTP/2 over HTTPS
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#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:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;ssl&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;doh.example.com&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:#81c8be&#34;&gt;access_log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/var/log/nginx/doh.access&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;error_log&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/var/log/nginx/doh.error&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;error&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:#81c8be&#34;&gt;ssl_certificate&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/live/doh.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:#81c8be&#34;&gt;ssl_certificate_key&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/etc/letsencrypt/live/doh.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;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:#737994;font-style:italic&#34;&gt;# DoH may use GET or POST requests, Cache both
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_cache_methods&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;GET&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;POST&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:#737994;font-style:italic&#34;&gt;# Return 404 to all responses, except for those using our published DoH 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;try_files&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$uri&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$uri/&lt;/span&gt; =&lt;span style=&#34;color:#ef9f76&#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:#81c8be&#34;&gt;ssl_protocols&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;TLSv1.2&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;TLSv1.3&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_ssl_ciphers&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;HIGH:!aNULL:!MD5&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:#737994;font-style:italic&#34;&gt;# This is our published DoH 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:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;/dns-query&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Proxy HTTP/1.1, clear the connection header to enable Keep-Alive
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_http_version&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;Connection&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Enable Cache, and set the cache_key to include the request_body
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_cache&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;doh_cache&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_cache_key&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$scheme$proxy_host$uri$is_args$args$request_body&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:#737994;font-style:italic&#34;&gt;# proxy pass to dnsdist
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;http://127.0.0.1:5300&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:#737994;font-style:italic&#34;&gt;# proxy pass address
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;&lt;/span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;X-Forwarded-For&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$proxy_add_x_forwarded_for&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;}
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After restarting nginx with this configuration you can it to your web browser as a DNS over HTTPS resolver and once again checkout &lt;a href=&#34;https://dnsleaktest.com&#34;&gt;dnsleaktest&lt;/a&gt; website and check if it is all working.&lt;/p&gt;
&lt;p&gt;Hope this has been helpfull and if anybody has any way on how to make this guied better you can open a pull request or make an issue on the website&amp;rsquo;s &lt;a href=&#34;https://code.cronyakatsuki.xyz/crony/website&#34;&gt;repo&lt;/a&gt;.&lt;/p&gt;
</description>
</item>
<item>
<title>Piped videos not loading</title>
<link>https://cronyakatsuki.xyz/blog/piped-video-not-loading/</link>
2023-10-06 19:04:36 +02:00
<pubDate>26-02-2023</pubDate>
2023-10-05 21:05:32 +02:00
<guid>https://cronyakatsuki.xyz/blog/piped-video-not-loading/</guid>
<description>&lt;p&gt;Recently I have received and experienced an issue of videos not loading on my personal &lt;a href=&#34;https://piped.cronyakatsuki.xyz&#34;&gt;piped&lt;/a&gt; instance and on the official instance. But I have found a fix and a way to watch the videos even without the fix.&lt;/p&gt;
&lt;!-- raw HTML omitted --&gt;
&lt;h2 id=&#34;what-creates-the-issue&#34;&gt;What creates the issue?&lt;/h2&gt;
&lt;p&gt;From what I have been able to find on the issues over on the &lt;a href=&#34;https://github.com/TeamPiped/Piped&#34;&gt;piped github&lt;/a&gt; it seems to be an lbry issue of the videos not loading mostly on firefox, the issue seems to not happen on the chromium browsers.&lt;/p&gt;
&lt;h3 id=&#34;how-to-fix-the-issue&#34;&gt;How to fix the issue&lt;/h3&gt;
&lt;p&gt;To fix the issue you just have to enable an option in the instance settings called &lt;code&gt;disable lbry for streaming&lt;/code&gt;. This will disable loading of lbry for videos and the issue will mostly just be bypassed.&lt;/p&gt;
&lt;h3 id=&#34;fun-way-to-also-watch-the-videos&#34;&gt;Fun way to also watch the videos&lt;/h3&gt;
&lt;p&gt;If you are like me and bored you can also watch the videos without using the fix by opening the firefox debug console, and in the errors you will see the link of the video that the frontend wasn&amp;rsquo;t able to embed. Just click the link and you will be able to watch the video or it will say that the content isn&amp;rsquo;t reachable and then you will need to do the fix otherwise it&amp;rsquo;s a no no to watch that video otherwise.&lt;/p&gt;
</description>
</item>
<item>
<title>miniflux setup on debian</title>
<link>https://cronyakatsuki.xyz/blog/miniflux-setup/</link>
2023-10-06 19:04:36 +02:00
<pubDate>30-11-2022</pubDate>
2023-10-05 21:05:32 +02:00
<guid>https://cronyakatsuki.xyz/blog/miniflux-setup/</guid>
<description>&lt;p&gt;Looking for a minimal self-hosted feed reader I found &lt;a href=&#34;https://miniflux.app/&#34;&gt;miniflux&lt;/a&gt;. But trying to set it up I found my self trying to set it up for 3 freaking hours since I only recently started to self-host things. So here I will try to explaing it in the most easy way how to set it up on a debian server with https using certbot and nginx.&lt;/p&gt;
&lt;!-- raw HTML omitted --&gt;
&lt;p&gt;For this tutorial I expect that you already have a server seted up with nginx and certbot. To set up this things check out &lt;a href=&#34;https://landchad.net&#34;&gt;landchad&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;installing-needed-packages&#34;&gt;Installing needed packages&lt;/h2&gt;
&lt;p&gt;You will first need to setup miniflux apt repository to install it on your system.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#99d1db&#34;&gt;echo&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;deb [trusted=yes] https://repo.miniflux.app/apt/ /&amp;#34;&lt;/span&gt; | sudo tee /etc/apt/sources.list.d/miniflux.list &amp;gt; /dev/null
2023-10-05 21:05:32 +02:00
&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 just install the needed packages.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;apt install miniflux postgresql
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;setting-up-postgres-database-and-miniflux&#34;&gt;Setting up postgres database and miniflux&lt;/h2&gt;
&lt;p&gt;Here I will detail steps to create the postgres database.&lt;/p&gt;
&lt;h3 id=&#34;initial-postgres-setup&#34;&gt;Initial postgres setup&lt;/h3&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Switch to the postgres user&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&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;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Creating a miniflux user, enter a safe and secure password&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ createuser -P miniflux
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Create a database for miniflux that belongs to our user&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ createdb -O miniflux miniflux
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Create a database for miniflux that belongs to our user&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ createdb -O miniflux miniflux
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Creating extension hstore as superuser&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ psql miniflux -c &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;create extension hstore&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Managing the miniflux database&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ psql &lt;span style=&#34;color:#f2d5cf&#34;&gt;$MINIFLUX_DATABASE&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Giving miniflux user all privileges&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;gt; alter user miniflux with superuser;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Exit the postgres database&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;gt; &lt;span style=&#34;color:#8caaee&#34;&gt;\q&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Exit postgres user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ &lt;span style=&#34;color:#99d1db&#34;&gt;exit&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;miniflux-configuration-file&#34;&gt;Miniflux configuration file&lt;/h3&gt;
&lt;p&gt;Open the miniflux configuration file in path &lt;code&gt;/etc/miniflux.conf&lt;/code&gt; and edit it like this.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# See https://miniflux.app/docs/configuration.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:#f2d5cf&#34;&gt;LISTEN_ADDR&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;127.0.0.1:8080
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;DATABASE_URL&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;user&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;miniflux &lt;span style=&#34;color:#f2d5cf&#34;&gt;password&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;PASSWORD_HERE &lt;span style=&#34;color:#f2d5cf&#34;&gt;dbname&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;miniflux &lt;span style=&#34;color:#f2d5cf&#34;&gt;sslmode&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;disable
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;RUN_MIGRATIONS&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ef9f76&#34;&gt;1&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;migrating-the-database-and-removing-superuser-privileges-in-postgres&#34;&gt;Migrating the database and removing superuser privileges in postgres&lt;/h3&gt;
&lt;p&gt;Now we will migrate the database and remove unneded superuser privileges, since it is reccomended in the miniflux documentation.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Migrating the database&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ miniflux -c /etc/miniflux.conf -migrate
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Creating miniflux admin user&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ miniflux -c /etc/miniflux.conf -create-admin
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Restarting the systemctl service&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ systemctl restart miniflux
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Entering postgres database user&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&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;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Entering miniflux database&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ psql &lt;span style=&#34;color:#f2d5cf&#34;&gt;$MINIFLUX_DATABASE&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Removing unneded superuser privileges from miniflux user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;gt; alter user miniflux with nosuperuser;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Exit the postgres database&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;gt; &lt;span style=&#34;color:#8caaee&#34;&gt;\q&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
2023-10-24 19:16:22 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Exit postgres user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ &lt;span style=&#34;color:#99d1db&#34;&gt;exit&lt;/span&gt;
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;nginx-and-certbot-setup&#34;&gt;Nginx and certbot setup&lt;/h2&gt;
&lt;p&gt;Make sure to have a domain to use for your miniflux setup.&lt;/p&gt;
&lt;p&gt;Create and open a nginx config with path &lt;code&gt;/etc/nginx/sites-available/miniflux.conf&lt;/code&gt; and add this&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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:#ca9ee6&#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:#81c8be&#34;&gt;server_name&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;your.domain.ext&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#ef9f76&#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:#81c8be&#34;&gt;listen&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;location&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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:#81c8be&#34;&gt;proxy_pass&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#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 style=&#34;color:#81c8be&#34;&gt;proxy_redirect&lt;/span&gt; &lt;span style=&#34;color:#e5c890&#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:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;Host&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$host&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;X-Real-IP&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$remote_addr&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;X-Forwarded-For&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$proxy_add_x_forwarded_for&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#81c8be&#34;&gt;proxy_set_header&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;X-Forwarded-Proto&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$scheme&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;}
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now just link the config to enabled sites and restart nginx service.&lt;/p&gt;
2023-10-24 19:16:22 +02:00
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-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;$ ln -s /etc/nginx/sites-available/miniflux.conf /etc/nginx/sites-enabled/miniflux.conf
2023-10-05 21:05:32 +02:00
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;$ systemctl restart nginx
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To get https on your domain you just need to run &lt;code&gt;certbot --nginx&lt;/code&gt; same as in this &lt;a href=&#34;https://landchad.net/basic/certbot/&#34;&gt;tutorial&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;finishing-words&#34;&gt;Finishing words&lt;/h2&gt;
&lt;p&gt;I hope that this wasn&amp;rsquo;t hard to follow and shouldn&amp;rsquo;t take hours like it took me first time I tried to set this all up.&lt;/p&gt;
</description>
</item>
</channel>
</rss>