nixpkgs/nixos/modules/services
Arian van Putten 604b7c139f Fix letsencrypt (#60219)
* nixos/acme: Fix ordering of cert requests

When subsequent certificates would be added, they would
not wake up nginx correctly due to target units only being triggered
once. We now added more fine-grained systemd dependencies to make sure
nginx always is aware of new certificates and doesn't restart too early
resulting in a crash.

Furthermore, the acme module has been refactored. Mostly to get
rid of the deprecated PermissionStartOnly systemd options which were
deprecated. Below is a summary of changes made.

* Use SERVICE_RESULT to determine status
This was added in systemd v232. we don't have to keep track
of the EXITCODE ourselves anymore.

* Add regression test for requesting mutliple domains

* Deprecate 'directory' option
We now use systemd's StateDirectory option to manage
create and permissions of the acme state directory.

* The webroot is created using a systemd.tmpfiles.rules rule
instead of the preStart script.

* Depend on certs directly

By getting rid of the target units, we make sure ordering
is correct in the case that you add new certs after already
having deployed some.

Reason it broke before:  acme-certificates.target would
be in active state, and if you then add a new cert, it
would still be active and hence nginx would restart
without even requesting a new cert. Not good!  We
make the dependencies more fine-grained now. this should fix that

* Remove activationDelay option

It complicated the code a lot, and is rather arbitrary. What if
your activation script takes more than activationDelay seconds?

Instead, one should use systemd dependencies to make sure some
action happens before setting the certificate live.

e.g. If you want to wait until your cert is published in DNS DANE /
TLSA, you could create a unit that blocks until it appears in DNS:

```
RequiredBy=acme-${cert}.service
After=acme-${cert}.service
ExecStart=publish-wait-for-dns-script
```
2019-08-29 16:32:59 +02:00
..
admin nixos/oxidized: Use symlinks for config files 2019-08-14 09:30:51 +00:00
amqp nixos/rabbitmq: replace deprecated usage of PermissionsStartOnly 2019-04-13 07:00:57 -04:00
audio roon-server: add back state directory 2019-08-09 22:21:46 -07:00
backup Merge pull request #65728 from Infinisil/types-eithers 2019-08-13 11:48:42 -04:00
cluster treewide: remove unused variables (#63177) 2019-06-16 19:59:05 +00:00
computing nixos/boinc: replace deprecated usage of PermissionsStartOnly 2019-05-26 07:20:56 -04:00
continuous-integration nixos/gitlab-runner: add missing HOME to environment (#67450) 2019-08-28 20:27:28 +00:00
databases nixos/memcached: Remove PrivateUsers 2019-08-25 16:34:06 +02:00
desktops nixos/gnome-user-share: cleanup 2019-08-27 03:07:57 -04:00
development bloop: allow specifying extra cli options 2019-07-25 09:28:13 +02:00
editors remove all instances of nix-env -i without -A in the NixOS manual 2019-08-17 18:04:43 +02:00
games nixos/modules: Replace all nested types.either's with types.oneOf's 2019-08-08 23:35:52 +02:00
hardware Merge pull request #66722 from mmahut/trezord-emulator 2019-08-22 23:25:18 +02:00
logging nixos/awstats: replace usage of deprecated services.httpd.extraSubservices 2019-08-15 21:00:27 -04:00
mail nixos/treewide: drop dependencies to keys.target 2019-08-27 18:55:55 +02:00
misc nix.conf: Set sandbox-fallback = false 2019-08-27 21:17:20 +02:00
monitoring Merge pull request #66922 from davidak/netdata_enableCgroupAccounting 2019-08-29 11:56:57 +02:00
network-filesystems Merge pull request #63973 from apvodney/master 2019-08-19 21:11:19 +02:00
networking nixos/treewide: drop dependencies to keys.target 2019-08-27 18:55:55 +02:00
printing cups: add myself as maintainer 2019-08-14 11:47:48 -04:00
scheduling Merge pull request #51918 from bobvanderlinden/var-run 2019-04-07 20:09:46 +02:00
search elasticsearch: add example on how to use plugins (#55115) 2019-08-18 17:11:20 +03:00
security vault: add raft backend to vault service 2019-08-28 18:42:18 +02:00
system nixos/nscd: document why it is configured this way 2019-07-12 12:07:45 -07:00
torrent Merge pull request #64738 from rnhmjoj/magnetico 2019-08-28 18:39:21 +02:00
ttys nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00
web-apps nixos/matomo: fixing the configuration path 2019-08-27 11:44:34 +02:00
web-servers Fix letsencrypt (#60219) 2019-08-29 16:32:59 +02:00
x11 Merge pull request #67260 from pstch/fix/xsession-allow-session-choice 2019-08-28 11:07:19 -04:00