From 9e7e0e9aa1af7001ee368508e019fa8a2ef9972d Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Fri, 2 Oct 2020 17:36:23 +1000 Subject: [PATCH 1/2] caddy1: remove --- pkgs/servers/caddy/v1.nix | 38 --------------------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 ---- 3 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 pkgs/servers/caddy/v1.nix diff --git a/pkgs/servers/caddy/v1.nix b/pkgs/servers/caddy/v1.nix deleted file mode 100644 index dce4eea84b8a..000000000000 --- a/pkgs/servers/caddy/v1.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ stdenv, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "caddy"; - version = "1.0.5"; - - goPackagePath = "github.com/caddyserver/caddy"; - - subPackages = [ "caddy" ]; - - src = fetchFromGitHub { - owner = "caddyserver"; - repo = pname; - rev = "v${version}"; - sha256 = "0jrhwmr6gggppskg5h450wybzkv17iq69dgw36hd1dp56q002i7g"; - }; - - vendorSha256 = "09vnci9pp8zp7bvn8zj68wslz2nc54nhcd0ll31sqfjbp00215mj"; - - preBuild = '' - cat << EOF > caddy/main.go - package main - import "github.com/caddyserver/caddy/caddy/caddymain" - var run = caddymain.Run // replaced for tests - func main() { - caddymain.EnableTelemetry = false - run() - } - EOF - ''; - - meta = with stdenv.lib; { - homepage = "https://caddyserver.com"; - description = "Fast, cross-platform HTTP/2 web server with automatic HTTPS"; - license = licenses.asl20; - maintainers = with maintainers; [ rushmorem fpletz zimbatm filalex77 ]; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b4029f870794..645d70bc3161 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -67,6 +67,7 @@ mapAliases ({ buildGo112Package = throw "buildGo112Package has been removed"; # added 2020-04-26 buildGo112Module = throw "buildGo112Module has been removed"; # added 2020-04-26 bundler_HEAD = bundler; # added 2015-11-15 + caddy1 = throw "caddy 1.x has been removed from nixpkgs, as it's unmaintained: https://github.com/caddyserver/caddy/blob/master/.github/SECURITY.md#supported-versions"; # added 2020-10-02 cantarell_fonts = cantarell-fonts; # added 2018-03-03 cargo-tree = throw "cargo-tree has been removed, use the builtin `cargo tree` command instead."; # added 2020-08-20 casperjs = throw "casperjs has been removed, it was abandoned by upstream and broken."; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2ba6493b1fc3..f171448f5dd9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1531,10 +1531,6 @@ in }); caddy = callPackage ../servers/caddy { }; - caddy1 = callPackage ../servers/caddy/v1.nix { - # https://github.com/lucas-clemente/quic-go/issues/2614 - buildGoModule = buildGo114Module; - }; traefik = callPackage ../servers/traefik { }; From 8f74e9e90541fdc34a4eb228d7dbab5ff761c20d Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Fri, 2 Oct 2020 17:46:46 +1000 Subject: [PATCH 2/2] nixos/caddy: remove caddy1 --- nixos/modules/services/web-servers/caddy.nix | 23 ++++---------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/nixos/modules/services/web-servers/caddy.nix b/nixos/modules/services/web-servers/caddy.nix index dda26fe491a1..72bf9a9a1f44 100644 --- a/nixos/modules/services/web-servers/caddy.nix +++ b/nixos/modules/services/web-servers/caddy.nix @@ -6,8 +6,6 @@ let cfg = config.services.caddy; configFile = pkgs.writeText "Caddyfile" cfg.config; - # v2-specific options - isCaddy2 = versionAtLeast cfg.package.version "2.0"; tlsConfig = { apps.tls.automation.policies = [{ issuer = { @@ -50,7 +48,7 @@ in { example = "nginx"; type = types.str; description = '' - Name of the config adapter to use. Not applicable to Caddy v1. + Name of the config adapter to use. See https://caddyserver.com/docs/config-adapters for the full list. ''; }; @@ -90,11 +88,10 @@ in { package = mkOption { default = pkgs.caddy; defaultText = "pkgs.caddy"; - example = "pkgs.caddy1"; + example = "pkgs.caddy"; type = types.package; description = '' Caddy package to use. - To use Caddy v1 (obsolete), set this to pkgs.caddy1. ''; }; }; @@ -106,21 +103,9 @@ in { after = [ "network-online.target" ]; wants = [ "network-online.target" ]; # systemd-networkd-wait-online.service wantedBy = [ "multi-user.target" ]; - environment = mkIf (versionAtLeast config.system.stateVersion "17.09" && !isCaddy2) - { CADDYPATH = cfg.dataDir; }; serviceConfig = { - ExecStart = if isCaddy2 then '' - ${cfg.package}/bin/caddy run --config ${configJSON} - '' else '' - ${cfg.package}/bin/caddy -log stdout -log-timestamps=false \ - -root=/var/tmp -conf=${configFile} \ - -ca=${cfg.ca} -email=${cfg.email} ${optionalString cfg.agree "-agree"} - ''; - ExecReload = - if isCaddy2 then - "${cfg.package}/bin/caddy reload --config ${configJSON}" - else - "${pkgs.coreutils}/bin/kill -USR1 $MAINPID"; + ExecStart = "${cfg.package}/bin/caddy run --config ${configJSON}"; + ExecReload = "${cfg.package}/bin/caddy reload --config ${configJSON}"; Type = "simple"; User = "caddy"; Group = "caddy";