Commit Graph

9 Commits

Author SHA1 Message Date
Franz Pletz
3f66adff44 nixos/acme: drop email requirement (#489983) 2026-03-22 11:53:08 +00:00
Martin Weinelt
e65f8ef106 nixos/acme: drop email requirement
Let's Encrypt does not require email addreses any longer, so we should
allow users not to provide any.

Unsetting the email adress will change the account hash and Lego will
start using a dummy email address instead. The address is hardcoded in
the Lego source code in the userIDPlaceholder constant.

We then verify in tests that changing between no email address and the
placeholder address does not create a new account nor rotate the previous
certificate.

This is supported since Lego 4.30.1.

bc163db9ed
2026-02-16 20:53:41 +01:00
Martin Weinelt
51d1c22f85 nixos/tests/acme: test IP subject alt names
With IP SANs becoming available on LE excercising them in our tests seems
prudent.
2026-01-12 05:57:06 +01:00
Wolfgang Walther
c319ac6571 various: fix eval
runCommandNoCC has been renamed to runCommand and the former has
recently been turned into a throw.
2025-10-28 18:17:14 +01:00
Leona Maroni
b3a76d495e nixos/nginx: allow adding new ACME certificates without nginx restart
Currently, nginx gets restarted when adding a new ACME certificate, even
when `services.nginx.enableReload = true` because of changes in the
Wants/After/Before sections of `nginx.service`.
This change moves these dependencies to `nginx-config-reload.service` and
the respective ACME systemd units.
2025-09-25 10:36:42 +02:00
Leona Maroni
b76c36dcdc nixos/tests/acme: introduce new test nginx without reload 2025-09-23 15:39:24 +02:00
Christian Theune
2d0a489125 nixos/acme: improve scalability - reduce superfluous unit activations
The previous setup caused all renewal units to be triggered upon
ever so slight changes in config. In larger setups (100+ certificates)
adding a new certificate caused high system load and/or large memory
consumption issues. The memory issues are already a alleviated with
the locking mechanism. However, this then causes long delays upwards
of multiple minutes depending on individual runs and also caused
superfluous activations.

In this change we streamline the overall setup of units:

1. The unit that other services can depend upon is 'acme-{cert}.service'.
We call this the 'base unit'. As this one as `RemainAfterExit` set
the `acme-finished-{cert}` targets are not required any longer.

2. We now always generate initial self-signed certificates to simplify
the dependency structure. This deprecates the `preliminarySelfsigned`
option.

3. The `acme-order-renew-{cert}` service gets activated after the base
unit and services using certificates have started and performs all acme
interactions. When it finishes others services (like web servers) will
be notified through the `reloadServices` option or they can use
`wantedBy` and `after` dependencies if they implement their own reload
units.

The renewal timer also triggers this unit.

4. The timer unit is explicitly blocked from being started by s-t-c.

5. Permission management has been cleaned up a bit: there was an
   inconsistency between having the .lego files set to 600 vs 640
   on the exposed side. This is unified to 640 now.

6. Exempt the account target from being restarted by s-t-c. This will
   happen automatically if something relevant to the account changes.
2025-08-08 16:28:42 +02:00
Lucas Savva
eeaa42f670 nixos/tests/acme: Add CSR test 2025-05-16 13:09:03 +02:00
Lucas Savva
229640ed3a nixos/tests/acme: Refactor test suite
Split tests up based on certain use cases:

- http01-builtin: Tests most functionality of the core module, such
 as the systemd and hashing components, whilst utilising lego's built
 in http01 resolution mechanis.
- dns01: Tests only that DNS01 renewal works as expected.
- nginx: Tests nginx compatability
- httpd: Tests httpd compatability
- caddy: Tests caddy compatability
2025-02-22 23:58:29 +00:00