The other day I showed this blog to a friend, and he looked abound as if something was missing, and he was correct: the option to subscribe to receive notifications of new posts.
So with the help of Claude it is now possible by putting your email and hitting the subscribe button. I have done testing and seems to work, but sometimes the confirmation email is ending up in the SPAM folder so if you do not recieve it look there first and if you have any other problems reach out to me to let me know! Read on for the details if that is your fancy!
Implementation details
I asked Claude for options on setting a subscription system and he gave me two options:
- Option A: hosted (easiest)
- Buttondown: a simple newsletter tool with an RSS-to-email feature. It handles subscriptions, confirmation emails, unsubscribe links and delivery.
- MailerLite or Kit (ConvertKit): bigger newsletter platforms. Both have RSS-triggered campaigns and embeddable signup forms.
- follow.it: built for exactly this (“follow this blog by email”) and the least setup, but you get less control over how the emails look.
- Option B: self-hosted
- Listmonk: an open-source newsletter manager that runs in one Docker container with Postgres. It manages your subscriber list and signup forms.
- It doesn’t watch RSS feeds by itself. You’d add a small script, run on a schedule, that checks atom.xml for new posts and creates a campaign through Listmonk’s API.
- You’ll also need an outgoing mail service (Amazon SES, Brevo, Postmark, etc.). Sending bulk email straight from a home server usually lands in spam.
I checked out a few of the hosted options but just felt they were an over kill and I would be dependent on another service. Another thing I did not like is that I would be asking followers to hand over their email to another 3rd party. So I decided let’s go with the hard option!
Listmonk Docker Container Deployment
Pre Claude I was unable to get docker compose to work on my Raspberry Pi so it complicated things with solutions that had multiple containers, but Claude solved that problem for me long ago so the installation of the Listmonk + Listmonk database containers was really a cake walk:
first we downloaded the official composer file:
curl -LO https://github.com/knadh/listmonk/raw/master/docker-compose.yml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 3396 100 3396 0 0 5433 0 --:--:-- --:--:-- --:--:-- 127k
Then I reviewed the file, and only needed to change the database (postgres) user and password and then let it rip:
pi@ersa:~/docker-listmonk $ sudo docker compose up -d
[+] up 22/22
✔ Image postgres:17-alpine Pulled 27.0s
✔ Image listmonk/listmonk:latest Pulled 12.8s
✔ Network docker-listmonk_listmonk Created 0.2s
✔ Volume docker-listmonk_listmonk-data Created 0.0s
✔ Container listmonk_db Started 2.6s
✔ Container listmonk_app Started 1.9s
ok let’s see if they are happy:
docker ps | grep listmonk
44f947783cea listmonk/listmonk:latest "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:9000->9000/tcp listmonk_app
83de423568be postgres:17-alpine "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 127.0.0.1:5432->5432/tcp listmonk_db
I then pointed my browser to it and it even worked:
Listmonk configuration
Fortunately Liskmonk is made for one thing (mailing lists) and it is really easy to config.
First I needed setup SMTP so that it could send emails, and for that I needed to create a new “blog@jupiterstation.net“ email account with Google that the only tricky part was generating an app password which if you do not have 2-Step verification configured gives you this concerning and not helpful to resolve error message:
But fortunately Claude had this under control and calmly directed me to setup 2-Step verification and then I was able to setup an app password for Listmonk:
Once I had a password I only had to point Listmonk to Gmail and supply the app password:
We then setup a subscription list for the blog:
And then we did some basic configurations like site name, logo, favicon etcetera which were all simple and straight forward.
Public URL
In order for users to get to Listmonk for the subscription process I had to create a new DNS entry for which I created a CNAME (canonical name that points to an existing entry (jupiterstation.net) as they are all hosted on the same IP):
I then had to setup NGINX to handle the traffic for lists.jupiterstation.net:
First we setup port 80 to redirrect to port 443 to ensure all communications are with SSL:
# Listmonk on port 80
server {
server_name "lists.jupiterstation.net";
server_tokens off;
location / {
return 301 https://lists.jupiterstation.net$request_uri;
}
}
Then setup the 443 instance:
# Listmonk
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_tokens off;
server_name "lists.jupiterstation.net";
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_certificate /etc/nginx/conf/lists_fullchain.pem;
ssl_certificate_key /etc/nginx/conf/lists_privkey.pem;
client_max_body_size 10m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Public subscription API used by signup forms: open to everyone
location /api/public/ {
proxy_pass http://10.0.0.5:9000;
}
# Admin UI and private API: home network only
location ~ ^/(admin|api)(/|$) {
allow 10.0.0.0/8;
# allow <your WireGuard subnet>; # e.g. 10.8.0.0/24 if it's outside 10.x, add it here
deny all;
proxy_pass http://10.0.0.5:9000;
}
# Root page -> straight to the signup form
location = / {
return 302 /subscription/form;
}
# Everything else (subscribe, confirm, unsubscribe, view in browser, static files)
location / {
proxy_pass http://10.0.0.5:9000;
}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy "no-referrer";
}
and then made sure that I could get to the subscription form, but not the admin page from the internet:
I then had Claude help me tune the subscription page a bit:
Detecting new blog posts
So the ideal is an automatic system that will detect when there is a new post and will send out an email to all the subscribers.
For that Claude wrote a python script that reads the blogs Atom feed and if a new post is detected creates a Listmonk campaign to send the emails.
As the python script is a bit long I will not include it here.
I then setup a crontab entry to run this script every 15 minutes.
Adding the subscription to the blog
And now we have all the ingredients and just need to add a way to sign up from the blog!
For that I setup a new widget in hexo ‘themes/landscape/layout/_widget/subscribe.ejs’:
<div class="widget-wrap">
<h3 class="widget-title">Subscribe</h3>
<div class="widget">
<p>Get notification of new posts by email.</p>
<form method="post" action="https://lists.jupiterstation.net/subscription/form" class="listmonk-form">
<div>
<input type="hidden" name="nonce" />
<input type="hidden" name="l" value="aa9ff6e8-1d5e-4ba4-8575-e54fc9546c47" />
<p><input type="email" name="email" required placeholder="E-mail" /></p>
<p><input type="text" name="name" placeholder="Name (optional)" /></p>
<input type="submit" value="Subscribe" />
</div>
</form>
</div>
</div>
and then added subscribe to the widget panel in themes/landscape/_config.yml and did a hexo generate and we had a widget on the side bar:
nice! We should be up and running! I will post this blog entry and hopefully will be recieving a notification via email within the next 15 minutes!
Links, References and things that helped with this
Thanks for reading and feel free to give feedback or comments via email (andrew@jupiterstation.net).