Enchanted Code

Now Self Hosted - #4

5 minutes read
Cover image for: 'Now Self Hosted - #4'

Intro

Welcome to the 4th issue of Now Self Hosted, where I take a look at a selection of apps which can be self hosted. In this issue I will be taking a look at: Blocky, Scrutiny, Dufs and Code Server.

Blocky

The first app we will be taking a look at is Blocky. It describes itself as:

a DNS proxy and ad-blocker for the local network

This may not be a known app to many, since Pi-Hole and AdGuard Home seem to dominate the DNS ad-blocking space. I myself was running Pi-Hole for many years (spoken about in issue #2).

The main reason why I use a local DNS server is so I can create custom records for my machines, the DNS blocking aspect is a nice bonus.

I switched away from using Pi-Hole as I have a love for lightweight applications and Blocky is just that. Consuming around 30MB of ram with DNS caching and large block lists (~700K). It is a perfect replacement. But the greatness does not stop there. Unlike Pi-Hole it natively supports DoH and DoT, meaning I can hide and secure my DNS queries from everyone on the internet (obviously the upstream DNS servers still see the queries).

I also recently moved away from a single Pi and bought a collection of mini-pcs which are now clustered for high availability. This allows me to run a DNS server globally meaning I should never have DNS problems when a single server goes down. I could of still done this with Pi-Hole however the config is handled via the web UI; making multiple nodes almost impossible to manage. This is where blocky comes to the rescue again, it is fully stateless and loads all configuration from a single yaml file. This means that I can easily replicate the config on every server so they match (I’m using GlusterFS). It even has a feature where a redis server can be used for a shared cache, meaning that memory is not wasted because of duplicated cached entries. This is something I have setup since I have multiple instances running.

Blocky also features prometheus metrics exporting and a REST API, meaning I can display the data in Grafana and display the metrics just how I want. They also provide a pre-built dashboard, however it does not work very well with Docker Swarm with multiple containers, so I built my own (shown below).

grafana showing some dns stats

Scrutiny

Scrutiny is a fairly new app (and still in development), which describes itself as a:

WebUI for smartd S.M.A.R.T monitoring

Most likely you have used smartctl before, if you haven’t; it is a tool to allow the collection of S.M.A.R.T data, which is very useful to see if there are any problems with your drives. Scrutiny provides a way of logging the data and displaying it on a very nice looking web page. It can even alert you (via webhooks) of detected issues. They provide a “omni-bus” docker image which features the program plus InfluxDB. Since I have multiple machines I installed the “omni-bus” image on one and the “master-collector” image on all the others, allowing all my drives from multiple servers to show up on a single dashboard.

Scrutiny dashboard

I have been running it for about a month at the time of writing and it seems to be running well. It has a nice graph of the drive temperatures and displays the collected S.M.A.R.T data. I luckily haven’t had any drive issues so I can’t comment on the alerting aspect, however I am sure it works as intended.

Dufs

Dufs describes itself as:

a distinctive utility file server…

It has quite a few features, here are some of the main ones:

  • Can serve static files
  • Download files
  • Upload files

Dufs page, showing a directories contents

I mostly spin up a container of Dufs; when I need to transfer files between development machines. It is very lightweight and features a very minimal and uncluttered interface, making it very easy to navigate. Although I haven’t personally tried it, it supports access control where you can adjust access permissions like making all files readonly. Very useful if you want to serve some files publicly. It’s also written in Rust making it a single static binary for anyone not wanting to host it in a container, having it not require any external libraries makes it easy to transfer to a different machine and just simply run it.

Code Server

Lastly we are looking at Code Server, which is a self-hostable VSCode web frontend and is maintained by Coder. If you haven’t heard of VSCode it is a highly customisable text-editor/IDE, supporting many different languages.

I use VSCode daily as it is my editor of choice. Code Server, allows me to host a VSCode on a development machine to easily make adjustments to code and config, without having to SSH in and use VSCode’s remote access feature. It also allows me to use it from any device with a web browser, this even includes my iPad.

It has been very useful to me however, I would only use it locally and not expose it to the web, since it has no proper authentication features. I will try out Coder in another article which is a tool to allow self-hosting of something similar to Codespaces or GitPod.

Conclusion

I hope you have enjoyed reading this month’s issue of Now Self Hosted. Maybe you too will switch to Blocky or try out any of the other apps I have spoken about, while you’re waiting for the next issue check of my other issues. Thanks for reading.

This post was not endorsed or sponsored by any of the mentioned parties. My views are my own.

Join The Community

Looking for more self-hosted, tech or programming content. Well this site is a good place to find all of that!

Stay informed about new posts or announcements about my apps join the community:

Want to help out? A great way of doing that is supporting me at: Buy Me A Coffee.

Comments

See Also

Buy Me A Coffee