Commit ff07c076 authored by Lukas Werling's avatar Lukas Werling
Browse files

nixos/caddy: Fix default log file for http:// hostnames

Caddy hostnames can begin with http:// to disable automatic HTTPS.
The default value for services.caddy.<host>.logFormat puts the hostname
in the log filename, resulting in a broken path. Similarly, multiple
space-separated host names would not work before.

Since version 2.9.0 (commit 7c52e7a0), caddy fails to start if it cannot
open the log file. This caused NixOS test failures (e.g.,
nixosTests.dokuwiki).
parent c270cdce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ in
    logFormat = mkOption {
      type = types.lines;
      default = ''
        output file ${cfg.logDir}/access-${config.hostName}.log
        output file ${cfg.logDir}/access-${lib.replaceStrings [ "/" " " ] [ "_" "_" ] config.hostName}.log
      '';
      defaultText = ''
        output file ''${config.services.caddy.logDir}/access-''${hostName}.log