{"version":"https:\/\/jsonfeed.org\/version\/1","title":"MidnightReign.Org","home_page_url":"https:\/\/midnightreign.org\/","feed_url":"https:\/\/midnightreign.org\/blog.json","description":"So much cringe...","author":{"name":"Teejo"},"items":[{"title":"Load Balancing DNS at home","date_published":"2023-05-05T14:32:00+10:00","id":"https:\/\/midnightreign.org\/load-balancing-dns","url":"https:\/\/midnightreign.org\/load-balancing-dns","content_html":"
I've had a pihole<\/a> on my home network for years. I set it up on a pi3b natively and it ticked along doing its thing, until it didn't.\nThe sd card wore out and became read-only. It took me a while to discover that that was the issue, as it still worked, but you couldn't make any changes. Well, you could - everything seemed to work, but nothing was actually being written. Fortunately I had a teleporter backup of the pihole. I quickly spun up a vm with a pihole docker instance and loaded the data from backup. I then pointed all the machines at the new IP 1<\/a><\/sup>. In the mean time, I ordered m2 sata SSDs and USB enclosures, and worked out how to get my two raspberry pi's to boot off a USB attached SSD.2<\/a><\/sup><\/p>\n When I re-setup the pi on the new SSD, I decided that the convenience and ease of the docker setup was ideal. I ran both instances of pihole but kept them separate initially. I eventually found a script to sync the piholes via git. At a later date, I found gravity-sync<\/a>, which is just brilliant. <\/p>\n I configured all my hosts to use the pi as primary dns, and the pihole vm as secondary. This worked brilliantly until a few months later, I noticed a weird issue where internet access seemed a bit slow. It took a short while to open up an initial connection to a site, but after that things were fine. Investigating, I discovered the pi wasn't responding to ping. The SSD had died. I RMA'd the SSD and ordered a replacement. They're fairly cheap and the RMA process will take a while. In the mean time, I configured everything in the network to point to the pihole vm as primary.<\/p>\n While waiting for the new SSD to arrive, I was thinking about load balancing. Previously, the pi was answering queries from most of the user devices, while the vm was answering queries mostly for my internal servers\/services. NGINX<\/a> could do the load balancing and I was already using a few instances for various things, and I am also using Nginx Proxy Manager<\/a> to handle just about everything. I figured I could probably use it to do the balancing as well.<\/p>\n You can't use Nginx Proxy Manager to do load balancing. Yet<\/a>3<\/a><\/sup>. Their interface doesn't allow for it.4<\/a><\/sup><\/p>\n I set up a new nginx docker instance using the official alpine slim container, as I'm only going to use it for load balancing, I don't need bells and whistles. The image is ~11mb.\nI created a file called I also made sure to pass port 53 tcp & udp to docker.<\/p>\n I've now configured the load balancer as primary...<\/p>","tags":["technical"],"image":"\/user\/pages\/01.blog\/227.load-balancing-dns\/christophe-hautier-902vnYeoWS4-unsplash.jpg"},{"title":"Moonraker Tuya Generic HTTP Server","date_published":"2023-04-22T21:49:00+10:00","id":"https:\/\/midnightreign.org\/mtghs","url":"https:\/\/midnightreign.org\/mtghs","content_html":" My current hobby is 3D printing. I've spent quite a bit of time and money upgrading my printer and getting it working well. My latest foray was to convert it to use Klipper<\/a> via running Mainsail<\/a> on one of my raspberry pi computers. I discovered that the Moonraker API<\/a> can control smart plugs, so you can do things like remotely power on your printer and other devices. I bought two cheap wifi smart plugs from Amazon that turned out to be Tuya\/Smart Life based - which Moonraker doesn't support. Boo.<\/p>\n Moonraker does provide a generic http plugin interface for controlling smart devices, so Moonraker Tuya Generic HTTP Server<\/a> was born!<\/p>\n Photo by Markus Spiske<\/a> on Unsplash<\/a><\/p>","tags":["software"],"image":"\/user\/pages\/01.blog\/226.mtghs\/markus-spiske-iar-afB0QQw-unsplash.jpg"},{"title":"Pi4b SSD Troubles","date_published":"2023-04-02T18:52:00+10:00","id":"https:\/\/midnightreign.org\/pi4b-ssd-troubles","url":"https:\/\/midnightreign.org\/pi4b-ssd-troubles","content_html":" I had a Pi4B 8Gb running Home Assistant OS on an m1 sata SSD in a USB enclosure, which I had no issues with whatsoever, however all my intentions for Home Assistant haven't materialized, so I figured I'd get more use out of it if I switched to running Klipper<\/a> on it. Ultimately I decided on using Mainsail<\/a> via their MainSailOS raspberry pi image.<\/p>\n Considering that the Home Assistant OS installation on the SSD was easy enough via Raspberry Pi Imager when I decided to convert from using an SD Card to using an SSD, and since Mainsail OS is available via RPI Imager, I figured it would be easy to just write the image to the SSD and off I go.<\/p>\nstream.conf<\/code> and included it in
nginx.conf<\/code>.<\/p>\n
stream.conf<\/code>:<\/p>\n
stream {\n upstream dns_servers {\n random;\n server 192.168.0.2:53;\n server 192.168.0.3:53;\n }\n server {\n listen 53;\n proxy_pass dns_servers;\n }\n server {\n listen 53 udp;\n proxy_pass dns_servers;\n }\n}<\/code><\/pre>\n
Ultimately this is related to setting up MainsailOS for use with my modified 3D printer (Creality CR6-SE).1<\/a><\/sup><\/h6>\n