NixOS ACME / LetsEncrypt | 103 Members | |
| Another day, another cert renewal | 41 Servers |
| Sender | Message | Time |
|---|---|---|
| 2 Jan 2022 | ||
In reply to @m1cr0man:m1cr0man.comDo you mean users.groups..members? | 21:14:59 | |
| yeah sorry, trying to remember it off the top of my head | 21:15:28 | |
m1cr0man: You’ll be pleased to know that it does do merging of them, users.groups.<name>.members is the source of truth. (https://github.com/NixOS/nixpkgs/blob/59bfda72480496f32787cec8c557182738b1bd3f/nixos/modules/config/users-groups.nix#L362) | 23:03:14 | |
| I’d be happy to take a stab at adding the assertions to the modules, if you’d be okay with that. | 23:03:36 | |
| Awesome find! :D Yeah absolutely, I'll review it as soon as I can (but I'll be going offline soon for tonight) | 23:08:49 | |
| I’ll do it sometime tomorrow most likely, so that’s perfectly fine. | 23:16:11 | |
There has to be some way that we can centralize the assertion, but I’m not really sure where a function to generate it can be stored in a way that it can easily be imported by all the modules. Unless I can do something like putting it next to the acme module (probably by making a folder and moving acme into there), then importing it in the other modules? Like, is that “allowed?” (Obviously it would work, but would it be accepted?) | 23:18:23 | |
* There has to be some way that we can centralize the assertion generation, but I’m not really sure where a function to generate it can be stored in a way that it can easily be imported by all the modules. Unless I can do something like putting it next to the acme module (probably by making a folder and moving acme into there), then importing it in the other modules? Like, is that “allowed?” (Obviously it would work, but would it be accepted?) | 23:18:30 | |
| 3 Jan 2022 | ||
| Maybe you can just add a file under the lib/tests (https://github.com/NixOS/nixpkgs/blob/master/lib/tests) folder? But fwiw, there is already quite a lot of duplication between nginx + http, and adding some assertions isn't going to break the bank, at least not yet. | 00:07:52 | |
| Why tests specifically? Seems like a strange place for stuff in modules tbh... | 00:49:39 | |
| On second look, maybe not there. I took a quick look last night and noticed some option/module specific assertions in that folder but they seem to be designed to be run manually to validate nixpkgs as a whole. I also thought lib itself felt wrong because it's such a specific thing. Maybe ask nixpkgs/NixOS Dev where the best place would be? I'm really not sure myself | 14:02:09 | |
| Sure, will do. | 14:02:25 | |
| V curious to know what the answer is. Acme isn't the only module that is a dependency in other modules (namely I'm thinking of all the services that can auto configure virtual hosts). There doesn't seem to be a set place for these sort of helpers right now | 14:04:23 | |
In reply to @m1cr0man:m1cr0man.comThe answer is that the solution I described (moving acme.nix to acme/default.nix and making a new file with the function in it to import) is fine, and is apparently how problems like this are currently handled in tree. | 14:55:26 | |
| I’ll try to get a patch out tonight. | 14:55:43 | |
| 4 Jan 2022 | ||
| acme inside nixos containers are a temporary lookup failure waiting to happen | 19:35:31 | |
| * acme (dns01) inside nixos containers are a temporary lookup failure waiting to happen | 19:52:14 | |
| 6 Jan 2022 | ||
| m1cr0man: I promise I haven't forgotten about the assertions, it's just been a long week and want to do this the right way. If not sometime this week, I'll get a PR open this weekend. My apologies! | 03:24:19 | |
In reply to @winterqt:nixos.devYeah don't worry about it! First week of a new year is always a busy one, I doubt I'd have time to review until the weekend anyway 😅 | 07:00:30 | |
| 8 Jan 2022 | ||
| https://github.com/NixOS/nixpkgs/pull/153942 | 03:45:48 | |
| there we go! | 03:45:51 | |
| I also have a very small documentation change I wanna get in at some point, but I'll probably wait till this lands. | 03:47:32 | |
| * I also have a very small documentation change I wanna get in at some point, but I'll probably wait till this lands. (It's not related to this, else I'd sneak it into here.) | 03:47:46 | |
| m1cr0man: Sorry about that — I know we did have that conversation so I have no clue how that slipped my mind. However, this is now a bit more complicated, and I’m not really sure what the best way to proceed is. Ideally, the assertion would handle both the case where only a single service is using the certificate (where the original assertion would work), and when multiple services are using it (this would check the members of the acme group). But I’m not really sure how to make it handle both since there’s no way we can track the number of usages of a certificate in a configuration. Do you have any ideas? | 15:29:51 | |
| Of course, we could just enforce using the acme group, but that would break existing manual configurations (like the one I currently use, for example), so that’s not ideal. | 15:38:18 | |
| So my thought was that you could simply check that a service' user is in the assigned group, as per that feature I was questioning before. So I think this would work (OR'd with the current assertion)
| 16:13:15 | |
| (Completely untested, I just wrote that in element as-is ;) ) | 16:13:31 | |
| not I'm not assuming the acme group was used for the cert, even. I can imagine someone assigning a group at some stage, later needing to use the certs for another service, and assigning that new service's user to whatever group was assigned to the cert (aka, being lazy and not standardising on the acme group) | 16:15:59 | |
| Oh, that’s… much simpler than what I was thinking. | 16:18:27 | |
| I have absolutely no clue how I didn’t think of that 🤦♀️ | 16:18:41 | |