PrivateTmp = true;
StateDirectory = lpath;
StateDirectoryMode = rights;
+ ExecStartPre =
+ let
+ script = pkgs.writeScript "acme-pre-start" ''
+ #!${pkgs.runtimeShell} -e
+ mkdir -p '${data.webroot}/.well-known/acme-challenge'
+ chmod a+w '${data.webroot}/.well-known/acme-challenge'
+ #doesn't work for multiple concurrent runs
+ #chown -R '${data.user}:${data.group}' '${data.webroot}/.well-known/acme-challenge'
+ '';
+ in
+ "+${script}";
WorkingDirectory = "/var/lib/${lpath}";
ExecStart = "${pkgs.simp_le_0_17}/bin/simp_le ${escapeShellArgs cmdline}";
ExecStartPost =
in
servicesAttr;
+ # FIXME: this doesn't work for multiple users
systemd.tmpfiles.rules =
flip mapAttrsToList cfg.certs
(cert: data: "d ${data.webroot}/.well-known/acme-challenge - ${data.user} ${data.group}");