!MthpOIxqJhTgrMNxDS:nixos.org

NixOS ACME / LetsEncrypt

107 Members
Another day, another cert renewal45 Servers

Load older messages


SenderMessageTime
8 Nov 2024
@m1cr0man:m1cr0man.comm1cr0manI know before/after don't queue start jobs, but the target implicitly will23:21:10
@m1cr0man:m1cr0man.comm1cr0man iirc the target requires the renewal, so that will queue the start job, and those before/after should queue them appropriately in the same transaction 23:21:32
@k900:0upti.meK900The target will if you start the server, yes 23:21:33
@k900:0upti.meK900But not if you start the target 23:21:38
@m1cr0man:m1cr0man.comm1cr0manoh fuck23:21:51
@k900:0upti.meK900So either the test needs to wait for the server before the target 23:21:55
@k900:0upti.meK900Or the units need to also wants the server 23:22:07
@k900:0upti.meK900Which I think is more correct because they actually do 23:22:18
@m1cr0man:m1cr0man.comm1cr0manhm let me quickly check sth in the webserver units23:22:41
@m1cr0man:m1cr0man.comm1cr0manYeah no, it's totally missing23:24:00
@m1cr0man:m1cr0man.comm1cr0man

Or the units need to also wants the server

Problem is now, from the acme module, we can't determine what web server will be serving .well-known/acme-challenge. We can solve this per-webserver, as you said flip the before to a requiredBy (actually... maybe keep before and add requiredBy).

I'm now remembering a very old conversation about having web server units register a common target, but I ended up implementing nginx-config-reload as it met the requirements at the time.

not if you start the target

I wonder how bad it would be to remove the install/wantedBy directives from the acme module, and let dependent services trigger its startup? Infact what if we had a mkDefault value for requiredBy on the ACME certs, and set an explicit value in the web servers?

23:30:00
@m1cr0man:m1cr0man.comm1cr0man *

Or the units need to also wants the server

Problem is now, from the acme module, we can't determine what web server will be serving .well-known/acme-challenge. We can solve this per-webserver, as you said flip the before to a requiredBy (actually... maybe keep before and add requiredBy).

I'm now remembering a very old conversation about having web server units register a common target, but I ended up implementing nginx-config-reload as it met the requirements at the time.

not if you start the target

I wonder how bad it would be to remove the install/wantedBy directives from the acme module, and let dependent services trigger its startup? Infact what if we had a mkDefault value for wantedBy on the ACME certs, and set an explicit value in the web servers?

23:30:16
@m1cr0man:m1cr0man.comm1cr0manThis has probably been the issue the whole damn time. How does switch-to-configuration sort/order the start requests for the units? It's probably not a stable sort 😅23:32:21
@k900:0upti.meK900It doesn't 23:37:24
@m1cr0man:m1cr0man.comm1cr0manI could do something really smart and find the webserver that serves port 80 and only mark the HTTP-01 certs as requiring that webserver as necessary. Infact, that's not even a big stretch given the existing complexity 🙃23:52:17
9 Nov 2024
@emilazy:matrix.orgemilycan we just integrate this into the web server modules?04:40:42
@emilazy:matrix.orgemily they support useACMEHost etc., could the logic be there? 04:40:54
@emilazy:matrix.orgemilyI really don't want to see more magic04:40:59
@k900:0upti.meK900
In reply to@emilazy:matrix.org
they support useACMEHost etc., could the logic be there?
It should be there, yeah
06:30:17
@k900:0upti.meK900I guess I can just make the test wait for the server to start for now06:30:31
@k900:0upti.meK900OK so06:50:27
@k900:0upti.meK900https://github.com/NixOS/nixpkgs/pull/35462906:50:27
@k900:0upti.meK900 I added a commit that makes it work for now 06:50:34
@k900:0upti.meK900
webserver # [  426.884702] (es-start)[2816]: acme-lockfiles.service: Changing to the requested working directory failed: Permission denied
webserver # [  426.934208] (es-start)[2816]: acme-lockfiles.service: Failed at step CHDIR spawning /nix/store/n24xs3nmndyyivq3q5w52f7aqlb06hqh-unit-script-acme-lockfiles-start/bin/acme-lockfiles-start: Permission denied
08:03:11
@k900:0upti.meK900You fucking what08:03:13
@k900:0upti.meK900https://hydra.nixos.org/build/278094707/log08:05:12
@k900:0upti.meK900Also this thing08:05:13
@k900:0upti.meK900What is even happening anymore08:05:18
@k900:0upti.meK900OK looks like that machine is just hella overloaded08:06:32
@m1cr0man:m1cr0man.comm1cr0manLooking into that ^ The acme-lockfiles.service is configured in a less than stellar manner. Working directory is /run/acme, but it is managed by tmpfiles instead of RuntimeDirectory, despite being RemainAfterExit (so the runtime dir should not get deleted). Gonna fix all of this now.21:06:42

Show newer messages


Back to Room ListRoom Version: 6