Unattended upgrade setting for selfhosted instances with rexctl

(#4343) Feature Closed: Shipped security self-hosting

Thread

Comment by Hampus
HampusStaff 2 votes 7 replies
(I may or may not have actually started working on this implementation a little yesterday because it was cool)
Comment by Ahryoo
Ahryoo OP1 vote 6 replies
Love it!
rexctl auto-upgrade
✓ rexctl upgrades Fluxer every day between 05:00 and 05:30.
Next run  Wed 2026-10-28 05:07:53 CET
Last run  Tue 2026-10-27 21:00:23 CET
Notify    https://ntfy.sh/…
Log       journalctl -u fluxer-upgrade.service
Is there a specific reason for the 30min randomizer?
Comment by Hampus
HampusStaff 1 vote 5 replies
mostly so that not every instance hits the release check and the image registry at the same second, since a lot of people will keep the default 04:00. it spreads the runs over the next 30 minutes, so with --at 04:00 it runs sometime between 04:00 and 04:30, and only the systemd timer does this for now because of its builtin RandomizedDelaySec (haven't looked into how to do it for cron in a good way yet)
Comment by Ahryoo
Ahryoo OP1 vote 4 replies
Alright that makes sense to me, I totally get that. As for cron - I am by no means an expert, but couldn't you just put a random sleep in front of the command? Something like:
0 4 * * * root sleep $(shuf -i 0-1799 -n 1); rexctl upgrade --yes ...
Comment by Hampus
HampusStaff 1 vote 3 replies
probably!
Comment by Hampus
HampusStaff 1 vote 2 replies
https://github.com/fluxerapp/fluxer/pull/3667/changes ended up doing this instead, which makes the offset fixed per instance, making it less dependent on the shell
Comment by Ahryoo
Ahryoo OP1 vote 1 reply
Oh that is way cleaner than my idea. However, and please correct me if I'm wrong, don't you now hash project name and path? which are for most instances fluxer and /opt/fluxer? That would result in no spreading between the individual instances, if I'm not mistaken. If that is the case you could use the domain name instead.