From 48c689ae9da26ab56bcf229297b216b36c816d53 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 13 Jan 2016 04:52:58 +0100 Subject: first attempt at simp_le --- custom/simp_le.nix | 9 ++++++++- ymir.nix | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/custom/simp_le.nix b/custom/simp_le.nix index e03e2b2c..a7196618 100644 --- a/custom/simp_le.nix +++ b/custom/simp_le.nix @@ -6,6 +6,13 @@ let getcert = domain: '' - echo ${domain} >> /tmp/domains.test + date=$(date -u +'%Y-%m-%d') + mkdir -p /etc/ssl/${domain}/$date /srv/www/acme/${domain} || exit 1 + cd /etc/ssl/${domain}/$date || exit 1 + simp_le \ + -f cert.pem -f key.pem -f fullchain.pem -f account_key.json \ + --email phikeebaogobaegh@141.li \ + -d ${domain}:/srv/www/acme/${domain} \ + && ln -fs /etc/ssl/${domain}/$date /etc/ssl/current ''; in writeText "certs.sh" (lib.concatMapStringsSep "\n" getcert domains) diff --git a/ymir.nix b/ymir.nix index d6229f6f..79f7cf9b 100644 --- a/ymir.nix +++ b/ymir.nix @@ -131,7 +131,7 @@ in rec { systab = '' %weekly * * nix-collect-garbage --delete-older-than '7d' - %monthly * * * ${pkgs.bash}/bin/bash ${pkgs.callPackage ./custom/simp_le.nix { domains = ["dirty-haskell.org" "www.dirty-haskell.org" "git.yggdrasil.li" "git.dirty-haskell.org" "git.141.li"]; } } + %monthly * * * ${pkgs.bash}/bin/bash ${pkgs.callPackage ./custom/simp_le.nix { domains = ["dirty-haskell.org" "www.dirty-haskell.org" "git.yggdrasil.li" "git.dirty-haskell.org" "git.141.li"]; } } 2>&1 | ${pkgs.util-linux}/bin/logger -p auth.info ''; }; -- cgit v1.2.3