For the last few years I had been using DigitalOcean to host this website & a few others, file sync and my git repos. Fairly low traffic stuff on a single VPS instance. It was nice and cheap. But still… the recent 20% price increase got me thinking…
Can I build my own server?
Turns out I could! And it was a lot of fun.
I used a 10th generation Intel NUC with a 6-core i7 CPU, 32GB RAM and a 1TB NVMe SSD. Yes, overkill. But the key parameter is power usage. The whole system draws ~7W at idle. What a wonderful little machine!
For the OS I decided to install Ubuntu (22.04 LTS). I’m familiar with it and it was useful having the same OS on both systems. Then, some housekeeping on the old server:
When I had everything ready, I brought the NUC to the new Prague data center and turned it on. It went online and the migration could begin. I started moving websites and services one by one. A few days later, the old VPS instance was empty and I turned it off.
50GB + $extra
6x CPU / 12 threads
There’s plenty of headroom for no extra money and I feel like I’m more self-reliant.
To elaborate a little bit on the backup procedure:
daily rsync (soon → rsnapshot)
daily mysql dumps
/etc and apt package list versioned in git
secondary NUC ready for deployment
backup VPS account ready for deployment (prepaid credit)
up-to-date checklist for configuring the whole software stack
Tiny Player for Mac version 1.5.8 is out now. This update fixes saving of playlists (m3u) and the track info window (⌘I) sometimes not appearing. Download here or update your installation through Preferences.
It took a lot of time & effort but it was a necessary step and I’m happy with how it went.
Generally I wanted to keep the app working at the end of each programming session. I started with a few refactorings of the Objective-C code that I knew would make things easier later. Then I rewrote the smaller components and worked my way up to the main view controllers. Those took the most effort and multiple nights to complete.
In the iOS app, there are about 300 lines of Objective-C left, which I’m probably going to keep. They make interfacing with the C-based HTTP server a bit easier. I got rid of the C++ HTML templating code and replaced it with a simpler Swift version because it’s easier to integrate with the rest of the new code base.
The Mac app is 100% Swift, plain and simple. It felt quite nice completing the last bit and deleting all the @objc attributes.
I’m currently testing both apps, looking for regressions. The first release based on this new codebase probably won’t contain any major user-facing changes. However, the rewrite opens the door to new features and performance & reliability improvements in the future.