Remix.run Logo
cinimodev 2 days ago

Hey, blog author here. Thanks!

I agree that a VM or container doesn't add to the power usage for a homelab that's already running. I kinda did it for fun and being able to run it off solar. I had original plans to turn the lab off at night and then the phone could keep running from battery. But, the homelab became critical infra and has to be always on lol.

The requirement for Ethernet was just for bandwidth consistency. My WiFi network isn't the best.

_R_ 2 days ago | parent | next [-]

On Android devices, it’s generally difficult for apps to maintain persistent background services. I’m curious how you were able to prevent Android from terminating the process, and how the Pixel 5 server managed to keep running?

cinimodev 2 days ago | parent [-]

It runs inside Termux, which has a persistent notification to keep it open in the background. I believe I also extended the max phantom process to prevent it from being killed.

leidenfrost 2 days ago | parent | next [-]

Question, why are you glad you didnt go for the PostmarketOS route? Do you think it's not worth it? Or that android is better in any way?

Just curious

cinimodev a day ago | parent [-]

The Pixel device I have is from a family member and it is locked to Verizon, who won't unlock the bootloader. I'm sure there's a work around, but I didn't think it was worth the effort. PostmarketOS is rad though, I have it running on an ancient Windows Surface RT.

indigodaddy 2 days ago | parent | prev [-]

Is your nginx proxy also caching the site? If so then that is probably contributing to the site stability under the HN load I would think?

cinimodev 2 days ago | parent [-]

It is not. Somehow the sticks and bubblegum are holding together.

indigodaddy 2 days ago | parent [-]

Wow even more impressive then..

rollcat 2 days ago | parent | prev [-]

> I had original plans to turn the lab off at night and then the phone could keep running from battery. But, the homelab became critical infra and has to be always on lol.

I've rebuilt my entire setup a while ago to "tolerate" power loss.

- Everything is sliced into three zones: "always-on", "desktop", and "homelab". The latter two through a smart plug, so that power can be cut.

- Always-on includes the SOHO router/AP, a RasPi4, and my Mac mini. The router's switch has only two ports populated: the Pi, and the Big Switch.

- Desktop is things like the screen, speakers, dock, wireless charger, camera (dummy battery), cute lamp, etc. All of this can tolerate power loss at any moment.

Homelab: this is the tricky part. There's a big (52 ports!) switch that "everything else" is plugged into, including my Mac (yay 10Gig Ethernet, not sure what for). A bunch of SBCs like Pis, NVidia Jetsons, x86's, etc. Nothing important, still figuring out what to do with all of that, so I kinda don't care if the power is cut.

The important bit is the NAS (RAIDZ 3x3TB). ZFS makes you feel like you're invincible, but I've still built something to keep it clean: 1. it's powered down until required; 2. the router has a cron job to WoL the NAS 5min before all backup jobs start; 3. the NAS has its own cron job that waits for the backups to complete, then waits for all SSH sessions to terminate, then shuts itself down. You can kill the script via SSH.

What I'm planning to do is to build a simple daemon for each box, that checks in once per minute or so, to ask if it's time to shut down. Once everyone is clear, cut the power. Somewhere far down my TODO list ;) until then, you can also use an iOS shortcut to SSH to each box before asking HomeKit to throw the switch, but storing passwords is fugly and handling separate pubkeys is too much bother. So I'm mostly happy with it as-is.

youainti a day ago | parent [-]

I think you might be interested in NUTs, Network UPS Tools. They provide a way to distribute power information about a ups across a network.

https://networkupstools.org/

rollcat 19 hours ago | parent [-]

Looks interesting, but my main obstacle right now is that the power switch is controlled via HomeKit - I could make my Mac an integral part of the setup (it's powered 24x7 after all), but that feels clunky. I think the way to go is to make a shortcut to gracefully shut down via Mac/iPhone. It's one tap, just requires some thinking to set up.