-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
agnos: init at 0.1.0, nixos/agnos: init #351678
base: master
Are you sure you want to change the base?
Conversation
Thanks a lot for working on this! I am no nix expert, so I can merely say that I am impressed and happy with how you have integrated configuration and testing in the package. For testing, you can have a look at the docker based infrastructure I am using here: https://github.com/krtab/agnos/tree/23590e3d2261169c3426ad6d4b9562772da8b454/test-docker. I am not too happy with it and was in the process of moving it to nix but the pebble and agnos conf can perhaps be reused here. (The bind9 is not used, I should delete it). Also, the repo has a bunch of things that are not needed to build agnos itself, so if you want to be extra pedantic you can either pull the crate from crates io (but then you don't get the systemd units and test confs) or build an include list like the one I made in krtab/agnos@0358d4f. The biggest culprit in terms of size is the resources folder though so you can just exclude that if you're not building the doc. In any case, please let me know if you need things upstream to help with the packaging effort, and thanks again. |
I don't think that's a huge deal. We often just
Oh I did look at it a lot for my implementation 🙂 I'm afraid re-using these configs verbatim might not be viable due to various reasons, but they were of huge help for me writing the NixOS test here. We could in theory re-use the systemd units from the |
Bumped to v0.1.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! I am running this PR in my homelab with nginx, replacing acme and acme-dns
I really like the temporarilyOpenFirewall option!
Agnos really seems to work well with the systemd timer trigger. I had such a hack going for temporarily running acme-dns (which expects to run indefinitely)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approving, as this looks like just a rebase onto a newer checkout.
I also just tested the auto renewal timer by setting days = 75
using krtab/agnos#67 and everything works great
Force-pushed with a single change: in the case where the nftables-based NixOS firewall is used, |
after = [ | ||
"firewall.target" | ||
"network-online.target" | ||
"nftables.service" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if !useNftables
will the service never start? or will systemd realize there is no nftables.service, and start agnos as if it wasn't specified in the service ordering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, After
does not imply Wants
(that's why After
is usually paired with Wants
) nor Requires
, only the latter of which would make the service fail to start if the referenced unit does not exist or fails to start.
The iptables
and no-firewall
varieties of the integration test should also ensure this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if these approvals help, but I would like to see this merged sometime
@FliegendeWurst thanks, I've applied your suggestions. |
Fixes #219372
Agnos lets you obtain certificates (including wildcards) from Let's Encrypt using DNS-01 challenges. It answers Let's Encrypt DNS queries on its own, bypassing the need for API calls to your DNS provider.
This PR introduces a derivation for agnos, as well as a NixOS module with a systemd timer for running it.
As of currently, the module is not as flexible/powerful as
security.acme
. For example, we don't do the dance thatsecurity.acme
does to figure out whether certificates were actually renewed. For my use, I simply reload the services depending on TLS certs unconditionally (whether certs were renewed or not).This module also implements a pattern that I have not seen used in nixpkgs previously:
temporarilyOpenFirewall
opens the required port (usually 53) inExecStartPre
, and closes it again inExecStopPost
. This suits agnos well, as agnos is intended to be a short-lived unit activated by a timer. If the reviewers see any problems with this approach, we could change this to a conventional, persistentopenFirewall
.I have been successfully running this PR on top of 24.05 for about 3 months now on my personal servers.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.