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' s Website</title>
<link > https://cronyakatsuki.xyz/blog/</link>
<description > Recent content in Blog on Crony Akatsuki' s Website</description>
<generator > Hugo -- gohugo.io</generator>
<language > en-us</language>
2023-11-10 20:13:49 +01:00
<lastBuildDate > Fri, 10 Nov 2023 19:27:27 +0100</lastBuildDate>
2023-10-05 21:05:32 +02:00
<atom:link href= "https://cronyakatsuki.xyz/blog/index.xml" rel= "self" type= "application/rss+xml" />
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 > < p> 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.< /p>
< p> For this you will need a way to receive the messaggess. I personally use a selfhosted < a href=" https://ntfy.sh/" > ntfy.sh< /a> server.< /p>
< p> 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!< /p>
< p> 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& rsquo;t worry it& rsquo;s secure.< /p>
< blockquote>
< p> /usr/bin/ntfy-ssh-login.sh< /p>
< /blockquote>
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > #!/bin/bash
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#ca9ee6" > if< /span> < span style=" color:#99d1db;font-weight:bold" > [< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#a6d189" > ${< /span> < span style=" color:#f2d5cf" > PAM_TYPE< /span> < span style=" color:#a6d189" > }< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#a6d189" > & #34;open_session& #34;< /span> < span style=" color:#99d1db;font-weight:bold" > ]< /span> ; < span style=" color:#ca9ee6" > then< /span>
< /span> < /span> < span style=" display:flex;" > < span> curl < span style=" color:#8caaee" > \
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#8caaee" > < /span> -H prio:high < span style=" color:#8caaee" > \
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#8caaee" > < /span> -H tags:warning < span style=" color:#8caaee" > \
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#8caaee" > < /span> -d < span style=" color:#a6d189" > & #34;SSH login: < /span> < span style=" color:#a6d189" > ${< /span> < span style=" color:#f2d5cf" > PAM_USER< /span> < span style=" color:#a6d189" > }< /span> < span style=" color:#a6d189" > from < /span> < span style=" color:#a6d189" > ${< /span> < span style=" color:#f2d5cf" > PAM_RHOST< /span> < span style=" color:#a6d189" > }< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#8caaee" > \
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#8caaee" > < /span> ntfy.sh/< span style=" color:#99d1db;font-weight:bold" > {< /span> YourTopic< span style=" color:#99d1db;font-weight:bold" > }< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > fi< /span>
< /span> < /span> < /code> < /pre> < /div> < blockquote>
< p> /etc/pam.d/sshd< /p>
< /blockquote>
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > # at the end of the file
session optional pam_exec.so /usr/bin/ntfy-ssh-login.sh
< /code> < /pre> < p> Also make sure that pam is realoaded using this command < code> pam-auth-update --force --package< /code> .< /p>
2023-11-10 20:31:25 +01:00
< p> You can modify the script to do email or anything else, but I prefer ntfy since the notification are instant.< /p>
2023-11-10 20:29:40 +01:00
< p> Hope this was of help and let& rsquo;s see you in another post.< /p> </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 > < p> 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& rsquo;s called < a href=" https://github.com/leahneukirchen/mblaze" > mblaze< /a> .< /p>
< p> 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. < a href=" https://www.opensmtpd.org/" > OpenSMTPD< /a> the openbsd fast mail server for getting local mail from services like crontab and sending mail with, and < a href=" https://isync.sourceforge.io/" > isync< /a> for downloading our mail from our remote server& rsquo;s either selfhosted or gmail.< /p>
< h1 id=" 1-opensmtpd" > 1. OpenSMTPD< /h1>
< p> First we will setup OpenSMTP for local mail, and we will also relay& rsquo;s that allow us to send e-mail from our selfhosted or gmail mail server& rsquo;s for example. Make sure to install opensmtpd from your package maanager.< /p>
< blockquote>
< p> Edit < code> /etc/smtpd/smtpd.conf< /code> < /p>
< /blockquote>
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > table aliases file:/etc/mail/aliases
table credentials file:/etc/mail/credentials
listen on 127.0.0.1
action & #34;local_mail& #34; maildir & #34;/home/%{user.username}/.local/share/Maildir/local& #34; alias & lt;aliases& gt;
action outbound_selfhost relay host smtp+tls://selfhost@subdomain.domain.com:587 auth & lt;credentials& gt;
action outbound_gmail relay host smtp+tls://gmail@smtp.gmail.com:587 auth & lt;credentials& gt;
match for local action & #34;local_mail& #34;
match mail-from & #34;selfhost@domain.com& #34; for any action outbound_selfhost
match mail-from & #34;username@gmail.com& #34; for any action outbound_gmail
< /code> < /pre> < p> Next you will need to update aliases in file /etc/mail/aliases under the comment < code> # Well-known aliases -- these should be filled in!< /code> to your main user account on your system.< /p>
< p> Now we will also setup the passwords in the < code> /etc/mail/credentials< /code> , Note for gmail you will need to setup app password for it to be usable with this method and enable smtp in gmail.< /p>
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > selfhost selfhost:selfhost_password
gmail gmail:gmail_password
< /code> < /pre> < p> Also make sure to run < code> sudo chmod 600 /etc/mail/credentials< /code> to make sure the password& rsquo;s aren& rsquo;t readable if you aren& rsquo;t running as sudo.< /p>
< h1 id=" 2-isync" > 2. isync< /h1>
< p> Now we will setup isync to get our e-mail from our server& rsquo;s. In this example there is both settings for a selfhosted server and a gmail one.< /p>
< blockquote>
< p> Edit < code> $HOME/.mbsyncrc< /code> < /p>
< /blockquote>
< pre tabindex=" 0" > < code class=" language-rc" data-lang=" rc" > IMAPStore selfhost-remote
Host subdomain.domain.com
Port 993
User selfhost@domain.com
PassCmd & #34;Command for password& #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 * !& #34;[Gmail]/All Mail& #34; !& #34;*fts-flatcurve*& #34; !& #34;*virtual*& #34;
SyncState *
Create Both
IMAPStore gmail-remote
Host imap.gmail.com
Port 993
User gmail@gmail.com
PassCmd & #34;Command for password& #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 * !& #34;[Gmail]/All Mail& #34; !& #34;*fts-flatcurve*& #34; !& #34;*virtual*& #34;
SyncState *
Create Both
< /code> < /pre> < p> Then you can run < code> mbsync -V gmail/selfhost< /code> to sync a specific account or you can run < code> mbsync -a< /code> to sync all your account& rsquo;s.< /p>
< h1 id=" 3-mblaze" > 3. mblaze< /h1>
< p> 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.< /p>
< blockquote>
< p> Edit < code> $HOME/.mblaze/profile< /code> < /p>
< /blockquote>
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > Local-Mailbox: user
FQDN: & #34;Generate using command mgenmid& #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& #39;t need this, it just makes it easier to see date
Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
< /code> < /pre> < p> 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& rsquo;s using a scipt and a couple function& 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.< /p>
< h1 id=" 4-multiple-profiles-management" > 4. Multiple profiles management< /h1>
< p> 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 < code> $HOME/.config/mblaze< /code> < /p>
< blockquote>
< p> example selfhost mblaze config < code> $HOME/.config/mblaze/selfhost< /code> < /p>
< /blockquote>
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > Local-Mailbox: User Name & lt;user@domain.com& gt;
FQDN: & #34;Generate using command mgenmid& #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 & lt;user@domain.com& gt;
Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
< /code> < /pre> < blockquote>
< p> example gmail mblaze config < code> $HOME/.config/mblaze/gmail< /code> < /p>
< /blockquote>
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > Local-Mailbox: user & lt;user@gmail.com& gt;
FQDN: & #34;Generate using command mgenmid& #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 & lt;user@gmail.com& gt;
Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
< /code> < /pre> < p> For the local profile, just copy the config saved to < code> $HOME/.mblaze/profile< /code> to < code> $HOME/.config/mblaze/local< /code> .< /p>
< p> Now onto the script and functions I use with my zsh.< /p>
< blockquote>
< p> mprofile< /p>
< /blockquote>
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > #!/bin/sh
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > profiles< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> find < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> < span style=" color:#a6d189" > & #34;< /span> /.config/mblaze -type f -exec basename < span style=" color:#a6d189" > & #34;{}& #34;< /span> < span style=" color:#8caaee" > \;< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > currentMaildir< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> grep < span style=" color:#a6d189" > & #34;^Maildir:& #34;< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> < span style=" color:#a6d189" > & #34;< /span> /.mblaze/profile | cut -d: -f < span style=" color:#ef9f76" > 2< /span> | sed < span style=" color:#a6d189" > & #39;s/ //g& #39;< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#99d1db;font-weight:bold" > [< /span> -z < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $1< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > ]< /span> < span style=" color:#99d1db;font-weight:bold" > & amp;& amp;< /span> basename < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#ca9ee6" > $(< /span> grep -w < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $currentMaildir< /span> < span style=" color:#a6d189" > & #34;< /span> -l -R < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> < span style=" color:#a6d189" > & #34;< /span> /.config/mblaze< span style=" color:#ca9ee6" > )< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > & amp;& amp;< /span> < span style=" color:#99d1db" > exit< /span> < span style=" color:#ef9f76" > 0< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#99d1db;font-weight:bold" > [< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $1< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#a6d189" > & #34;-l& #34;< /span> < span style=" color:#99d1db;font-weight:bold" > ]< /span> < span style=" color:#99d1db;font-weight:bold" > & amp;& amp;< /span> < span style=" color:#99d1db" > printf< /span> < span style=" color:#a6d189" > & #39;%s\n& #39;< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $profiles< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > & amp;& amp;< /span> < span style=" color:#99d1db" > exit< /span> < span style=" color:#ef9f76" > 0< /span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > profile< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $1< /span> < span style=" color:#a6d189" > & #34;< /span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > if< /span> < span style=" color:#99d1db" > printf< /span> < span style=" color:#a6d189" > & #39;%s\n& #39;< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $profiles< /span> < span style=" color:#a6d189" > & #34;< /span> | grep -qw < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $profile< /span> < span style=" color:#a6d189" > & #34;< /span> ; < span style=" color:#ca9ee6" > then< /span>
< /span> < /span> < span style=" display:flex;" > < span> cp < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> < span style=" color:#a6d189" > & #34;< /span> /.config/mblaze/< span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $profile< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> < span style=" color:#a6d189" > & #34;< /span> /.mblaze/profile
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > else< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#99d1db" > printf< /span> < span style=" color:#a6d189" > & #39;%s\n& #39;< /span> < span style=" color:#a6d189" > & #34;This profile doesn& #39;t exist& #34;< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > fi< /span>
< /span> < /span> < /code> < /pre> < /div> < p> 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& rsquo;s name.< /p>
< blockquote>
< p> functions< /p>
< /blockquote>
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # mblaze functions< /span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Get new mail for current profile< /span>
< /span> < /span> < span style=" display:flex;" > < span> mnew < span style=" color:#99d1db;font-weight:bold" > ()< /span> < span style=" color:#99d1db;font-weight:bold" > {< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > maildir< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> grep < span style=" color:#a6d189" > & #34;^Maildir:& #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> /.mblaze/profile | cut -d: -f < span style=" color:#ef9f76" > 2< /span> | sed < span style=" color:#a6d189" > & #39;s/ //g& #39;< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > profile< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> basename < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > if< /span> < span style=" color:#99d1db;font-weight:bold" > [< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $profile< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#a6d189" > & #34;local& #34;< /span> < span style=" color:#99d1db;font-weight:bold" > ]< /span> ; < span style=" color:#ca9ee6" > then< /span>
< /span> < /span> < span style=" display:flex;" > < span> mlist -s < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#a6d189" > & #34;< /span> | msort -dr | mseq -S
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > else< /span>
< /span> < /span> < span style=" display:flex;" > < span> mbsync -V < span style=" color:#f2d5cf" > $profile< /span>
< /span> < /span> < span style=" display:flex;" > < span> mlist -s < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#a6d189" > & #34;< /span> /INBOX | msort -dr | mseq -S
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > fi< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#99d1db;font-weight:bold" > }< /span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Get full mail for current profile including threads< /span>
< /span> < /span> < span style=" display:flex;" > < span> mall < span style=" color:#99d1db;font-weight:bold" > ()< /span> < span style=" color:#99d1db;font-weight:bold" > {< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > maildir< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> grep < span style=" color:#a6d189" > & #34;^Maildir:& #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> /.mblaze/profile | cut -d: -f < span style=" color:#ef9f76" > 2< /span> | sed < span style=" color:#a6d189" > & #39;s/ //g& #39;< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > sent< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> grep < span style=" color:#a6d189" > & #34;^Outbox:& #34;< /span> < span style=" color:#f2d5cf" > $HOME< /span> /.mblaze/profile | cut -d: -f < span style=" color:#ef9f76" > 2< /span> | sed < span style=" color:#a6d189" > & #39;s/ //g& #39;< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > profile< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ca9ee6" > $(< /span> basename < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#ca9ee6" > )< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > if< /span> < span style=" color:#99d1db;font-weight:bold" > [< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $profile< /span> < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#a6d189" > & #34;local& #34;< /span> < span style=" color:#99d1db;font-weight:bold" > ]< /span> ; < span style=" color:#ca9ee6" > then< /span>
< /span> < /span> < span style=" display:flex;" > < span> mlist < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#a6d189" > & #34;< /span> | mthread -r -S < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#a6d189" > & #34;< /span> | mseq -S
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > else< /span>
< /span> < /span> < span style=" display:flex;" > < span> mbsync -V < span style=" color:#f2d5cf" > $profile< /span>
< /span> < /span> < span style=" display:flex;" > < span> mlist < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $maildir< /span> < span style=" color:#a6d189" > & #34;< /span> /INBOX | mthread -r -S < span style=" color:#a6d189" > & #34;< /span> < span style=" color:#f2d5cf" > $sent< /span> < span style=" color:#a6d189" > & #34;< /span> | mseq -S
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > fi< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#99d1db;font-weight:bold" > }< /span>
< /span> < /span> < /code> < /pre> < /div> < p> For the rest of usage of mblaze, I really recommend to use < code> man mblaze< /code> since the software is really well documented, or you can also watch this < a href=" https://piped.cronyakatsuki.xyz/watch?v=5YS8RPC4zwc" > video< /a> I took the inspiration from for this setup.< /p>
< h1 id=" conclusion" > Conclusion< /h1>
< p> 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.< /p> </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 > < p> 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& rsquo;m using DNS over HTTPS for my browser& 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& rsquo;s get on to setting everything up< /p>
< !-- raw HTML omitted -->
< h2 id=" 1-pihole" > 1. Pihole< /h2>
< p> Let& 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& rsquo;t have an official docker container ).< /p>
< p> I recommend to read up on the pihole& rsquo;s docs on exactly how to install it since pihole get& rsquo;s frequent updates. < a href=" https://docs.pi-hole.net/main/basic-install/" > DOCS< /a> < /p>
< p> 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.< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-nginx" data-lang=" nginx" > < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > server< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server_name< /span> < span style=" color:#a6d189" > example.com< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > location< /span> < span style=" color:#a6d189" > /< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > return< /span> < span style=" color:#ef9f76" > 403< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > location< /span> < span style=" color:#a6d189" > /admin< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_pass< /span> < span style=" color:#a6d189" > http://127.0.0.1:8185/admin< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > Host< /span> < span style=" color:#f2d5cf" > $host< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # If you want to log user activity, comment these
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > access_log< /span> < span style=" color:#a6d189" > /dev/null< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > error_log< /span> < span style=" color:#a6d189" > /dev/null< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#a6d189" > [::]:443< /span> < span style=" color:#a6d189" > ssl< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#ef9f76" > 443< /span> < span style=" color:#a6d189" > ssl< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > ssl_certificate< /span> < span style=" color:#a6d189" > /etc/letsencrypt/live/example.com/fullchain.pem< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > ssl_certificate_key< /span> < span style=" color:#a6d189" > /etc/letsencrypt/live/example.com/privkey.pem< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > include< /span> < span style=" color:#a6d189" > /etc/letsencrypt/options-ssl-nginx.conf< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > ssl_dhparam< /span> < span style=" color:#a6d189" > /etc/letsencrypt/ssl-dhparams.pem< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> }
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > server< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > if< /span> < span style=" color:#a6d189" > (< /span> < span style=" color:#f2d5cf" > $host< /span> = < span style=" color:#a6d189" > example.com)< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > return< /span> < span style=" color:#ef9f76" > 301< /span> < span style=" color:#a6d189" > https://< /span> < span style=" color:#f2d5cf" > $host$request_uri< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> } < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server_name< /span> < span style=" color:#a6d189" > example.com< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#ef9f76" > 80< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#a6d189" > [::]:80< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > return< /span> < span style=" color:#ef9f76" > 404< /span> ; < span style=" color:#737994;font-style:italic" > # managed by Certbot
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> }
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < p> The main point of this config is the < code> /admin< /code> 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 < code> server.port< /code> to port you wan& rsquo;t to use in lighttpd config file located at < code> /etc/lighttpd/lighttpd.conf< /code> and then just restart lighttpd< /p>
< h2 id=" 2-unbound" > 2. Unbound< /h2>
< p> For this part I will just link the pi-hole& rsquo;s unbound documentation because it is the most correct one and updated as things change regulary.
< a href=" https://docs.pi-hole.net/guides/dns/unbound/" > Pi-hole unbound docs< /a> < /p>
< h2 id=" 3-dns-over-tls" > 3. DNS over TLS< /h2>
< p> For dns over tls you need to first have a ssl certificate. I recommend on using certbot to generate one with this command < code> certbot --nginx -d dot.example.com< /code> .< /p>
< p> 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 < code> /etc/nginx/nginx.conf< /code> . < strong> Make sure to add this outside of the http block and change example.com to your domain< /strong> < /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-nginx" data-lang=" nginx" > < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > stream< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > log_format< /span> < span style=" color:#a6d189" > basic< /span> < span style=" color:#a6d189" > & #39;< /span> < span style=" color:#f2d5cf" > $remote_addr< /span> < span style=" color:#a6d189" > [< /span> < span style=" color:#f2d5cf" > $time_local]< /span> < span style=" color:#f2d5cf" > $protocol< /span> < span style=" color:#f2d5cf" > $status< /span> < span style=" color:#f2d5cf" > $bytes_sent< /span> < span style=" color:#f2d5cf" > $bytes_received< /span> < span style=" color:#f2d5cf" > $session_time< /span> < span style=" color:#f2d5cf" > $upstream_addr& #39;< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > upstream< /span> < span style=" color:#a6d189" > dns< /span>
< /span> < /span> < span style=" display:flex;" > < span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > zone< /span> < span style=" color:#a6d189" > dns< /span> < span style=" color:#ef9f76" > 64k< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server< /span> 127.0.0.1:< span style=" color:#ef9f76" > 53< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#ef9f76" > 853< /span> < span style=" color:#a6d189" > ssl< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > access_log< /span> < span style=" color:#a6d189" > /var/log/nginx/dot-access.log< /span> < span style=" color:#a6d189" > basic< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > error_log< /span> < span style=" color:#a6d189" > /var/log/nginx/dot-error.log< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_certificate< /span> < span style=" color:#a6d189" > /etc/letsencrypt/live/dot.example.com/fullchain.pem< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_certificate_key< /span> < span style=" color:#a6d189" > /etc/letsencrypt/live/dot.example.com/privkey.pem< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_protocols< /span> < span style=" color:#a6d189" > TLSv1.2< /span> < span style=" color:#a6d189" > TLSv1.3< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_ciphers< /span> < span style=" color:#a6d189" > HIGH:!aNULL:!MD5< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_handshake_timeout< /span> < span style=" color:#a6d189" > 10s< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_session_cache< /span> < span style=" color:#a6d189" > shared:SSL:20m< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_session_timeout< /span> < span style=" color:#a6d189" > 4h< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_pass< /span> < span style=" color:#a6d189" > dns< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_responses< /span> < span style=" color:#ef9f76" > 1< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_timeout< /span> < span style=" color:#a6d189" > 1s< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span> }
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < p> Also make sure to enable port 853, example ufw command is < code> ufw allow 853/tcp< /code> . Then restart nginx, to test if this configuration is working you can use your android phone by setting the private dns address to < code> dot.example.com< /code> and then visit the website< a href=" https://dnsleaktest.com" > dnsleaktest< /a> < /p>
< h2 id=" 4-dns-over-https" > 4. DNS over HTTPS< /h2>
< p> For using dns over https we will be installing additional package called dnsdinst. On debian systems just run < code> apt install dnsdinst< /code> . Next you will need to setup dnsdinst config and restart it. Make sure to change example.com.< /p>
2023-10-24 19:16:22 +02:00
< pre tabindex=" 0" > < code class=" language-conf" data-lang=" conf" > -- dnsdist configuration file, an example can be found in /usr/share/doc/dnsdist/examples/
-- disable security status polling via DNS
setSecurityPollSuffix(& #34;& #34;)
-- fix up possibly badly truncated answers from pdns 2.9.22
-- truncateTC(true)
-- Answer to only clients from this subnet
setACL(& #34;127.0.0.1/8& #34;)
-- Define upstream DNS server (Pi-hole)
newServer({address=& #34;127.0.0.1& #34;, name=& #34;Pi-hole& #34;, checkName=& #34;example.com& #34;, checkInterval=60, mustResolve=true})
-- Create local DOH server listener in DNS over HTTP mode, otherwise the information coming from nginx won& #39;t be processed well
addDOHLocal(& #34;127.0.0.1:5300& #34;, nil, nil, & #34;/dns-query& #34;, { reusePort=true })
< /code> < /pre> < p> Next we will need another ssl certificate for the doh domain, for that we will once again using certbot with this command < code> certbot --nginx -d doh.example.com< /code> 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.< /p>
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-nginx" data-lang=" nginx" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Proxy Cache storage - so we can cache the DoH response from the upstream
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#ca9ee6" > proxy_cache_path< /span> < span style=" color:#a6d189" > /var/run/doh_cache< /span> < span style=" color:#a6d189" > levels=1:2< /span> < span style=" color:#a6d189" > keys_zone=doh_cache:10m< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > server< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#ef9f76" > 80< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server_name< /span> < span style=" color:#a6d189" > doh.example.com< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > return< /span> < span style=" color:#ef9f76" > 301< /span> < span style=" color:#a6d189" > https://doh.example.com/< /span> < span style=" color:#f2d5cf" > $request_uri< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # This virtual server accepts HTTP/2 over HTTPS
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#ca9ee6" > server< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#ef9f76" > 443< /span> < span style=" color:#a6d189" > ssl< /span> < span style=" color:#a6d189" > http2< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server_name< /span> < span style=" color:#a6d189" > doh.example.com< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > access_log< /span> < span style=" color:#a6d189" > /var/log/nginx/doh.access< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > error_log< /span> < span style=" color:#a6d189" > /var/log/nginx/doh.error< /span> < span style=" color:#a6d189" > error< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_certificate< /span> < span style=" color:#a6d189" > /etc/letsencrypt/live/doh.example.com/fullchain.pem< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_certificate_key< /span> < span style=" color:#a6d189" > /etc/letsencrypt/live/doh.example.com/privkey.pem< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # DoH may use GET or POST requests, Cache both
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > proxy_cache_methods< /span> < span style=" color:#a6d189" > GET< /span> < span style=" color:#a6d189" > POST< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Return 404 to all responses, except for those using our published DoH URI
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > location< /span> < span style=" color:#a6d189" > /< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > try_files< /span> < span style=" color:#f2d5cf" > $uri< /span> < span style=" color:#f2d5cf" > $uri/< /span> =< span style=" color:#ef9f76" > 404< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > ssl_protocols< /span> < span style=" color:#a6d189" > TLSv1.2< /span> < span style=" color:#a6d189" > TLSv1.3< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_ssl_ciphers< /span> < span style=" color:#a6d189" > HIGH:!aNULL:!MD5< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # This is our published DoH URI
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > location< /span> < span style=" color:#a6d189" > /dns-query< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Proxy HTTP/1.1, clear the connection header to enable Keep-Alive
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > proxy_http_version< /span> < span style=" color:#ef9f76" > 1< /span> < span style=" color:#a6d189" > .1< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > Connection< /span> < span style=" color:#a6d189" > & #34;& #34;< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Enable Cache, and set the cache_key to include the request_body
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > proxy_cache< /span> < span style=" color:#a6d189" > doh_cache< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_cache_key< /span> < span style=" color:#f2d5cf" > $scheme$proxy_host$uri$is_args$args$request_body< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # proxy pass to dnsdist
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > proxy_pass< /span> < span style=" color:#a6d189" > http://127.0.0.1:5300< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # proxy pass address
< /span> < /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > < /span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > X-Forwarded-For< /span> < span style=" color:#f2d5cf" > $proxy_add_x_forwarded_for< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span> }
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < p> After restarting nginx with this configuration you can it to your web browser as a DNS over HTTPS resolver and once again checkout < a href=" https://dnsleaktest.com" > dnsleaktest< /a> website and check if it is all working.< /p>
< p> 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& rsquo;s < a href=" https://code.cronyakatsuki.xyz/crony/website" > repo< /a> .< /p>
</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 > < p> Recently I have received and experienced an issue of videos not loading on my personal < a href=" https://piped.cronyakatsuki.xyz" > piped< /a> instance and on the official instance. But I have found a fix and a way to watch the videos even without the fix.< /p>
< !-- raw HTML omitted -->
< h2 id=" what-creates-the-issue" > What creates the issue?< /h2>
< p> From what I have been able to find on the issues over on the < a href=" https://github.com/TeamPiped/Piped" > piped github< /a> 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.< /p>
< h3 id=" how-to-fix-the-issue" > How to fix the issue< /h3>
< p> To fix the issue you just have to enable an option in the instance settings called < code> disable lbry for streaming< /code> . This will disable loading of lbry for videos and the issue will mostly just be bypassed.< /p>
< h3 id=" fun-way-to-also-watch-the-videos" > Fun way to also watch the videos< /h3>
< p> 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& 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& rsquo;t reachable and then you will need to do the fix otherwise it& rsquo;s a no no to watch that video otherwise.< /p>
</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 > < p> Looking for a minimal self-hosted feed reader I found < a href=" https://miniflux.app/" > miniflux< /a> . 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.< /p>
< !-- raw HTML omitted -->
< p> For this tutorial I expect that you already have a server seted up with nginx and certbot. To set up this things check out < a href=" https://landchad.net" > landchad< /a> < /p>
< h2 id=" installing-needed-packages" > Installing needed packages< /h2>
< p> You will first need to setup miniflux apt repository to install it on your system.< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#99d1db" > echo< /span> < span style=" color:#a6d189" > & #34;deb [trusted=yes] https://repo.miniflux.app/apt/ /& #34;< /span> | sudo tee /etc/apt/sources.list.d/miniflux.list & gt; /dev/null
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> apt update
< /span> < /span> < /code> < /pre> < /div> < p> Then just install the needed packages.< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> apt install miniflux postgresql
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < h2 id=" setting-up-postgres-database-and-miniflux" > Setting up postgres database and miniflux< /h2>
< p> Here I will detail steps to create the postgres database.< /p>
< h3 id=" initial-postgres-setup" > Initial postgres setup< /h3>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Switch to the postgres user< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ su - postgres
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Creating a miniflux user, enter a safe and secure password< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ createuser -P miniflux
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Create a database for miniflux that belongs to our user< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ createdb -O miniflux miniflux
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Create a database for miniflux that belongs to our user< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ createdb -O miniflux miniflux
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Creating extension hstore as superuser< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ psql miniflux -c < span style=" color:#a6d189" > & #39;create extension hstore& #39;< /span>
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Managing the miniflux database< /span>
< /span> < /span> < span style=" display:flex;" > < span> $ psql < span style=" color:#f2d5cf" > $MINIFLUX_DATABASE< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Giving miniflux user all privileges< /span>
< /span> < /span> < span style=" display:flex;" > < span> & gt; alter user miniflux with superuser;
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Exit the postgres database< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> & gt; < span style=" color:#8caaee" > \q< /span>
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Exit postgres user< /span>
< /span> < /span> < span style=" display:flex;" > < span> $ < span style=" color:#99d1db" > exit< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < h3 id=" miniflux-configuration-file" > Miniflux configuration file< /h3>
< p> Open the miniflux configuration file in path < code> /etc/miniflux.conf< /code> and edit it like this.< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # See https://miniflux.app/docs/configuration.html< /span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > LISTEN_ADDR< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> 127.0.0.1:8080
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > DATABASE_URL< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#f2d5cf" > user< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> miniflux < span style=" color:#f2d5cf" > password< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> PASSWORD_HERE < span style=" color:#f2d5cf" > dbname< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> miniflux < span style=" color:#f2d5cf" > sslmode< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> disable
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#f2d5cf" > RUN_MIGRATIONS< /span> < span style=" color:#99d1db;font-weight:bold" > =< /span> < span style=" color:#ef9f76" > 1< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < h3 id=" migrating-the-database-and-removing-superuser-privileges-in-postgres" > Migrating the database and removing superuser privileges in postgres< /h3>
< p> Now we will migrate the database and remove unneded superuser privileges, since it is reccomended in the miniflux documentation.< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Migrating the database< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ miniflux -c /etc/miniflux.conf -migrate
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Creating miniflux admin user< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ miniflux -c /etc/miniflux.conf -create-admin
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Restarting the systemctl service< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ systemctl restart miniflux
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Entering postgres database user< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ su - postgres
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Entering miniflux database< /span>
< /span> < /span> < span style=" display:flex;" > < span> $ psql < span style=" color:#f2d5cf" > $MINIFLUX_DATABASE< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Removing unneded superuser privileges from miniflux user< /span>
< /span> < /span> < span style=" display:flex;" > < span> & gt; alter user miniflux with nosuperuser;
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Exit the postgres database< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> & gt; < span style=" color:#8caaee" > \q< /span>
< /span> < /span> < span style=" display:flex;" > < span>
2023-10-24 19:16:22 +02:00
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#737994;font-style:italic" > # Exit postgres user< /span>
< /span> < /span> < span style=" display:flex;" > < span> $ < span style=" color:#99d1db" > exit< /span>
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < h2 id=" nginx-and-certbot-setup" > Nginx and certbot setup< /h2>
< p> Make sure to have a domain to use for your miniflux setup.< /p>
< p> Create and open a nginx config with path < code> /etc/nginx/sites-available/miniflux.conf< /code> and add this< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-nginx" data-lang=" nginx" > < span style=" display:flex;" > < span> < span style=" color:#ca9ee6" > server< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > server_name< /span> < span style=" color:#a6d189" > your.domain.ext< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#ef9f76" > 80< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > listen< /span> < span style=" color:#a6d189" > [::]:80< /span> ;
< /span> < /span> < span style=" display:flex;" > < span>
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > location< /span> < span style=" color:#a6d189" > /< /span> {
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_pass< /span> < span style=" color:#a6d189" > http://127.0.0.1:8080< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_redirect< /span> < span style=" color:#e5c890" > off< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > Host< /span> < span style=" color:#f2d5cf" > $host< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > X-Real-IP< /span> < span style=" color:#f2d5cf" > $remote_addr< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > X-Forwarded-For< /span> < span style=" color:#f2d5cf" > $proxy_add_x_forwarded_for< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> < span style=" color:#81c8be" > proxy_set_header< /span> < span style=" color:#a6d189" > X-Forwarded-Proto< /span> < span style=" color:#f2d5cf" > $scheme< /span> ;
< /span> < /span> < span style=" display:flex;" > < span> }
< /span> < /span> < span style=" display:flex;" > < span> }
2023-10-05 21:05:32 +02:00
< /span> < /span> < /code> < /pre> < /div> < p> Now just link the config to enabled sites and restart nginx service.< /p>
2023-10-24 19:16:22 +02:00
< div class=" highlight" > < pre tabindex=" 0" style=" color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;" > < code class=" language-bash" data-lang=" bash" > < span style=" display:flex;" > < span> $ ln -s /etc/nginx/sites-available/miniflux.conf /etc/nginx/sites-enabled/miniflux.conf
2023-10-05 21:05:32 +02:00
< /span> < /span> < span style=" display:flex;" > < span> $ systemctl restart nginx
< /span> < /span> < /code> < /pre> < /div> < p> To get https on your domain you just need to run < code> certbot --nginx< /code> same as in this < a href=" https://landchad.net/basic/certbot/" > tutorial< /a> < /p>
< h2 id=" finishing-words" > Finishing words< /h2>
< p> I hope that this wasn& rsquo;t hard to follow and shouldn& rsquo;t take hours like it took me first time I tried to set this all up.< /p>
</description>
</item>
</channel>
</rss>