diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index f173d0d93b1d3..320239d51445f 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -73,6 +73,10 @@ - `nodePackages.expo-cli` has been removed, as it was deprecated by upstream. The suggested replacement is the `npx expo` command. +- DokuWiki with the Caddy webserver (`services.dokuwiki.webserver = "caddy"`) now sets up sites with Caddy's automatic HTTPS instead of HTTP-only. + To keep the old behavior for a site `example.com`, set `services.caddy.virtualHosts."example.com".hostName = "http://example.com"`. + If you set custom Caddy options for a DokuWiki site, migrate these options by removing `http://` from `services.caddy.virtualHosts."http://example.com"`. + - `vscode-utils.buildVscodeExtension` now requires pname as an argument - `nerdfonts` has been separated into individual font packages under the namespace `nerd-fonts`. The directories for font diff --git a/nixos/modules/services/web-apps/dokuwiki.nix b/nixos/modules/services/web-apps/dokuwiki.nix index b288a08efd856..d6ca14c40ef97 100644 --- a/nixos/modules/services/web-apps/dokuwiki.nix +++ b/nixos/modules/services/web-apps/dokuwiki.nix @@ -475,7 +475,7 @@ in services.caddy = { enable = true; virtualHosts = mapAttrs' (hostName: cfg: ( - nameValuePair "http://${hostName}" { + nameValuePair hostName { extraConfig = '' root * ${pkg hostName cfg}/share/dokuwiki file_server diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index ce3102eec7801..6f7ee60fc1937 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -78,6 +78,11 @@ let }; }; + services.caddy.virtualHosts = { + "site1.local".hostName = "http://site1.local"; + "site2.local".hostName = "http://site2.local"; + }; + networking.firewall.allowedTCPPorts = [ 80 ]; networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ]; };