Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 2dd41576fb97
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: d7046947e5f7
Choose a head ref
  • 7 commits
  • 16 files changed
  • 2 contributors

Commits on Sep 2, 2020

  1. nixos/acme: Restructure module

    - Use an acme user and group, allow group override only
    - Use hashes to determine when certs actually need to regenerate
    - Avoid running lego more than necessary
    - Harden permissions
    - Support "systemctl clean" for cert regeneration
    - Support reuse of keys between some configuration changes
    - Permissions fix services solves for previously root owned certs
    - Add a note about multiple account creation and emails
    - Migrate extraDomains to a list
    - Deprecate user option
    - Use minica for self-signed certs
    - Rewrite all tests
    
    I thought of a few more cases where things may go wrong,
    and added tests to cover them. In particular, the web server
    reload services were depending on the target - which stays alive,
    meaning that the renewal timer wouldn't be triggering a reload
    and old certs would stay on the web servers.
    
    I encountered some problems ensuring that the reload took place
    without accidently triggering it as part of the test. The sync
    commands I added ended up being essential and I'm not sure why,
    it seems like either node.succeed ends too early or there's an
    oddity of the vm's filesystem I'm not aware of.
    
    - Fix duplicate systemd rules on reload services
    
    Since useACMEHost is not unique to every vhost, if one cert
    was reused many times it would create duplicate entries in
    ${server}-config-reload.service for wants, before and
    ConditionPathExists
    m1cr0man committed Sep 2, 2020
    Copy the full SHA
    982c5a1 View commit details
    Browse the repository at this point in the history
  2. nixos/acme: Add proper nginx/httpd config reload checks

    Testing of certs failed randomly when the web server was still
    returning old certs even after the reload was "complete". This was
    because the reload commands send process signals and do not wait
    for the worker processes to restart. This commit adds log watchers
    which wait for the worker processes to be restarted.
    m1cr0man committed Sep 2, 2020
    Copy the full SHA
    61dbf4b View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2020

  1. nixos/acme: Fix race condition, dont be smart with keys

    Attempting to reuse keys on a basis different to the cert (AKA,
    storing the key in a directory with a hashed name different to
    the cert it is associated with) was ineffective since when
    "lego run" is used it will ALWAYS generate a new key. This causes
    issues when you revert changes since your "reused" key will not
    be the one associated with the old cert. As such, I tore out the
    whole keyDir implementation.
    
    As for the race condition, checking the mtime of the cert file
    was not sufficient to detect changes. In testing, selfsigned
    and full certs could be generated/installed within 1 second of
    each other. cmp is now used instead.
    
    Also, I removed the nginx/httpd reload waiters in favour of
    simple retry logic for the curl-based tests
    m1cr0man committed Sep 4, 2020
    Copy the full SHA
    1b6cfd9 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    67a5d66 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2020

  1. Copy the full SHA
    f57824c View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2020

  1. nixos/acme: More features and fixes

    - Allow for key reuse when domains are the only thing that
      were changed.
    - Fixed systemd service failure when preliminarySelfsigned
      was set to false
    m1cr0man committed Sep 6, 2020
    Copy the full SHA
    34b5c5c View commit details
    Browse the repository at this point in the history
  2. Merge pull request #91121 from m1cr0man/master

    Restructure acme module
    flokli committed Sep 6, 2020
    Copy the full SHA
    d704694 View commit details
    Browse the repository at this point in the history