diff --git a/.gitignore b/.gitignore index 7b6357f..7ae9cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ caddy-*.tar.gz +dnsproviders-*.tar.gz +geoip-*.tar.gz +lego-*.tar.gz +realip-*.tar.gz +geohash-*.tar.gz diff --git a/0001-Disable-commands-that-can-alter-the-binary.patch b/0001-Disable-commands-that-can-alter-the-binary.patch deleted file mode 100644 index 73a53c8..0000000 --- a/0001-Disable-commands-that-can-alter-the-binary.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 41711beb6776923a84c06fad76964e5932333bd7 Mon Sep 17 00:00:00 2001 -From: Carl George -Date: Wed, 16 Feb 2022 11:45:03 -0600 -Subject: [PATCH] Disable commands that can alter the binary - ---- - cmd/commands.go | 45 -------------------------------------------- - cmd/commands_test.go | 8 ++++---- - 2 files changed, 4 insertions(+), 49 deletions(-) - -diff --git a/cmd/commands.go b/cmd/commands.go -index c9ea636b..791ddf6d 100644 ---- a/cmd/commands.go -+++ b/cmd/commands.go -@@ -404,51 +404,6 @@ is always printed to stdout. - }, - }) - -- RegisterCommand(Command{ -- Name: "upgrade", -- Short: "Upgrade Caddy (EXPERIMENTAL)", -- Long: ` --Downloads an updated Caddy binary with the same modules/plugins at the --latest versions. EXPERIMENTAL: May be changed or removed. --`, -- CobraFunc: func(cmd *cobra.Command) { -- cmd.Flags().BoolP("keep-backup", "k", false, "Keep the backed up binary, instead of deleting it") -- cmd.RunE = WrapCommandFuncForCobra(cmdUpgrade) -- }, -- }) -- -- RegisterCommand(Command{ -- Name: "add-package", -- Usage: "", -- Short: "Adds Caddy packages (EXPERIMENTAL)", -- Long: ` --Downloads an updated Caddy binary with the specified packages (module/plugin) --added, with an optional version specified (e.g., "package@version"). Retains --existing packages. Returns an error if any of the specified packages are already --included. EXPERIMENTAL: May be changed or removed. --`, -- CobraFunc: func(cmd *cobra.Command) { -- cmd.Flags().BoolP("keep-backup", "k", false, "Keep the backed up binary, instead of deleting it") -- cmd.RunE = WrapCommandFuncForCobra(cmdAddPackage) -- }, -- }) -- -- RegisterCommand(Command{ -- Name: "remove-package", -- Func: cmdRemovePackage, -- Usage: "", -- Short: "Removes Caddy packages (EXPERIMENTAL)", -- Long: ` --Downloads an updated Caddy binaries without the specified packages (module/plugin). --Returns an error if any of the packages are not included. --EXPERIMENTAL: May be changed or removed. --`, -- CobraFunc: func(cmd *cobra.Command) { -- cmd.Flags().BoolP("keep-backup", "k", false, "Keep the backed up binary, instead of deleting it") -- cmd.RunE = WrapCommandFuncForCobra(cmdRemovePackage) -- }, -- }) -- - defaultFactory.Use(func(rootCmd *cobra.Command) { - manpageCommand := Command{ - Name: "manpage", -diff --git a/cmd/commands_test.go b/cmd/commands_test.go -index 085a9d78..f6d01fa3 100644 ---- a/cmd/commands_test.go -+++ b/cmd/commands_test.go -@@ -19,7 +19,7 @@ func TestCommandsAreAvailable(t *testing.T) { - // include the commands registered through calls to init in - // other packages - cmds := Commands() -- if len(cmds) != 17 { -+ if len(cmds) != 14 { - t.Errorf("expected 17 commands, got %d", len(cmds)) - } - -@@ -27,10 +27,10 @@ func TestCommandsAreAvailable(t *testing.T) { - slices.Sort(commandNames) - - expectedCommandNames := []string{ -- "adapt", "add-package", "build-info", "completion", -+ "adapt", "build-info", "completion", - "environ", "fmt", "list-modules", "manpage", -- "reload", "remove-package", "run", "start", -- "stop", "storage", "upgrade", "validate", "version", -+ "reload", "run", "start", -+ "stop", "storage", "validate", "version", - } - - if !reflect.DeepEqual(expectedCommandNames, commandNames) { --- -2.50.1 - diff --git a/Caddyfile b/Caddyfile deleted file mode 100644 index e36677f..0000000 --- a/Caddyfile +++ /dev/null @@ -1,36 +0,0 @@ -# The Caddyfile is an easy way to configure your Caddy web server. -# -# https://caddyserver.com/docs/caddyfile - - -# The configuration below serves a welcome page over HTTP on port 80. To use -# your own domain name with automatic HTTPS, ensure your A/AAAA DNS record is -# pointing to this machine's public IP, then replace `http://` with your domain -# name. Refer to the documentation for full instructions on the address -# specification. -# -# https://caddyserver.com/docs/caddyfile/concepts#addresses -http:// { - - # Set this path to your site's directory. - root * /usr/share/caddy - - # Enable the static file server. - file_server - - # Another common task is to set up a reverse proxy: - # reverse_proxy localhost:8080 - - # Or serve a PHP site through php-fpm: - # php_fastcgi localhost:9000 - - # Refer to the directive documentation for more options. - # https://caddyserver.com/docs/caddyfile/directives - -} - - -# As an alternative to editing the above site block, you can add your own site -# block files in the Caddyfile.d directory, and they will be included as long -# as they use the .caddyfile extension. -import Caddyfile.d/*.caddyfile diff --git a/caddy-api.service b/caddy-api.service deleted file mode 100644 index 255a289..0000000 --- a/caddy-api.service +++ /dev/null @@ -1,28 +0,0 @@ -# caddy-api.service -# -# For using Caddy with its API. -# -# This unit is "durable" in that it will automatically resume -# the last active configuration if the service is restarted. -# -# See https://caddyserver.com/docs/install for instructions. - -[Unit] -Description=Caddy web server -Documentation=https://caddyserver.com/docs/ -After=network.target - -[Service] -Type=notify -User=caddy -Group=caddy -ExecStart=/usr/bin/caddy run --environ --resume -TimeoutStopSec=5s -LimitNOFILE=1048576 -PrivateTmp=true -ProtectHome=true -ProtectSystem=full -AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE - -[Install] -WantedBy=multi-user.target diff --git a/caddy.conf b/caddy.conf new file mode 100644 index 0000000..f8d3fff --- /dev/null +++ b/caddy.conf @@ -0,0 +1,6 @@ +http:// { + gzip + root /usr/share/caddy +} + +import conf.d/*.conf diff --git a/caddy.service b/caddy.service index c6b6851..89503b2 100644 --- a/caddy.service +++ b/caddy.service @@ -1,31 +1,25 @@ -# caddy.service -# -# For using Caddy with a config file. -# -# WARNING: This service does not use the --resume flag, so if you -# use the API to make changes, they will be overwritten by the -# Caddyfile next time the service is restarted. If you intend to -# use Caddy's API to configure it, add the --resume flag to the -# `caddy run` command or use the caddy-api.service file instead. - [Unit] -Description=Caddy web server -Documentation=https://caddyserver.com/docs/ +Description=Caddy HTTP/2 web server +Documentation=https://caddyserver.com/docs After=network.target [Service] -Type=notify User=caddy Group=caddy -ExecStartPre=/usr/bin/caddy validate --config /etc/caddy/Caddyfile -ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile -ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile +Environment=CADDYPATH=/var/lib/caddy +EnvironmentFile=-/etc/caddy/envfile +ExecStartPre=/usr/bin/caddy -conf /etc/caddy/caddy.conf -validate +ExecStart=/usr/bin/caddy -conf /etc/caddy/caddy.conf -root /tmp -agree +ExecReload=/usr/bin/kill -USR1 $MAINPID +KillMode=mixed +KillSignal=SIGQUIT TimeoutStopSec=5s LimitNOFILE=1048576 +LimitNPROC=512 PrivateTmp=true ProtectHome=true ProtectSystem=full -AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target diff --git a/caddy.spec b/caddy.spec index c7e502f..aa41859 100644 --- a/caddy.spec +++ b/caddy.spec @@ -1,310 +1,276 @@ -%global goipath github.com/caddyserver/caddy +# http plugins +%bcond_without geoip +%bcond_without realip +# dns plugins +%bcond_without azure +%bcond_without cloudflare +%bcond_without digitalocean +%bcond_without googlecloud +%bcond_without pdns +%bcond_without rackspace +%bcond_without route53 -%if %{defined el8} -%global gotest() go test -short -compiler gc -ldflags "${LDFLAGS:-}" %{?**}; -%else -%global gotestflags %{gocompilerflags} -short +%if %{with azure}%{with cloudflare}%{with digitalocean}%{with googlecloud}%{with pdns}%{with rackspace}%{with route53} +%bcond_without dnsproviders +%endif + +# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 +%global _dwz_low_mem_die_limit 0 + +%if %{undefined gobuild} +%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**}; %endif Name: caddy -Version: 2.10.2 -Release: %autorelease +Version: 1.0.3 +Release: 2%{?dist} Summary: Web server with automatic HTTPS +License: ASL 2.0 and MIT URL: https://caddyserver.com - -# main source code is Apache-2.0 -# see comments above bundled provides for a breakdown of the rest -License: Apache-2.0 AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND MPL-2.0 - -Source0: https://%{goipath}/archive/v%{version}/caddy-%{version}.tar.gz -Source1: caddy-%{version}-vendor.tar.gz -Source2: create-vendor-tarball.sh - -# based on reference files upstream -# https://github.com/caddyserver/dist -Source10: Caddyfile -Source20: caddy.service -Source21: caddy-api.service -Source22: caddy.sysusers -Source30: poweredby-white.png -Source31: poweredby-black.png - -# downstream only patch to disable commands that can alter the binary -Patch1: 0001-Disable-commands-that-can-alter-the-binary.patch - -%if %{defined el8} -ExclusiveArch: %{golang_arches} -%else -BuildRequires: go-rpm-macros -ExclusiveArch: %{golang_arches_future} -%endif - -BuildRequires: systemd-rpm-macros +ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm} aarch64 ppc64le s390x %{mips}} +%{?go_compiler:BuildRequires: compiler(go-compiler)} +# https://github.com/mholt/caddy/commit/80dfb8b2a7f89b120a627bc4d866a1dc5ed3d92f#diff-04c6e90faac2675aa89e2176d2eec7d8 +BuildRequires: golang >= 1.12 +BuildRequires: systemd %{?systemd_requires} -%{?sysusers_requires_compat} - -Requires: system-logos-httpd Provides: webserver -# https://github.com/caddyserver/caddy/commit/05acc5131ed5c80acbd28ed8d907b166cd15b72c -BuildRequires: golang >= 1.25 +# caddy +%global import_path github.com/caddyserver/caddy +# Upstream stopped vendoring dependencies in 1.0.0. F31+ has those +# dependencies packaged, but in order to update earlier branches we must +# generate our own tarball with vendored dependencies. +# +# git clone https://github.com/caddyserver/caddy.git +# cd caddy +# git checkout v%%{version} +# go mod vendor +# git add vendor +# git commit -m vendor +# git archive --format=tar.gz --prefix=caddy-%%{version}/ HEAD > caddy-%%{version}-vendor.tar.gz +Source0: caddy-%{version}-vendor.tar.gz +Source1: caddy.conf +Source2: caddy.service +Source3: index.html +# https://github.com/caddyserver/caddy/issues/2584 +Patch0: enable-appVersion-ldflag.patch -# Apache-2.0: -Provides: bundled(golang(cel.dev/expr)) = 0.24.0 -Provides: bundled(golang(cloud.google.com/go/auth)) = 0.16.2 -Provides: bundled(golang(cloud.google.com/go/auth/oauth2adapt)) = 0.2.8 -Provides: bundled(golang(cloud.google.com/go/compute/metadata)) = 0.7.0 -Provides: bundled(golang(github.com/Masterminds/goutils)) = 1.1.1 -Provides: bundled(golang(github.com/caddyserver/certmagic)) = 0.24.0 -Provides: bundled(golang(github.com/coreos/go-oidc/v3)) = 3.14.1 -Provides: bundled(golang(github.com/dgraph-io/badger)) = 1.6.2 -Provides: bundled(golang(github.com/dgraph-io/badger/v2)) = 2.2007.4 -Provides: bundled(golang(github.com/go-logr/logr)) = 1.4.3 -Provides: bundled(golang(github.com/go-logr/stdr)) = 1.2.2 -Provides: bundled(golang(github.com/google/cel-go)) = 0.26.0 -Provides: bundled(golang(github.com/google/certificate-transparency-go)) = 74a5dd3 -Provides: bundled(golang(github.com/google/go-tpm)) = 0.9.5 -Provides: bundled(golang(github.com/google/go-tspi)) = 0.3.0 -Provides: bundled(golang(github.com/google/s2a-go)) = 0.1.9 -Provides: bundled(golang(github.com/googleapis/enterprise-certificate-proxy)) = 0.3.6 -Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.1.0 -Provides: bundled(golang(github.com/kylelemons/godebug)) = 1.1.0 -Provides: bundled(golang(github.com/pires/go-proxyproto)) = 0.8.1 -Provides: bundled(golang(github.com/prometheus/client_model)) = 0.6.2 -Provides: bundled(golang(github.com/prometheus/common)) = 0.65.0 -Provides: bundled(golang(github.com/prometheus/procfs)) = 0.16.1 -Provides: bundled(golang(github.com/smallstep/go-attestation)) = 2306d5b -Provides: bundled(golang(github.com/smallstep/linkedca)) = 0.23.0 -Provides: bundled(golang(github.com/smallstep/nosql)) = 0.7.0 -Provides: bundled(golang(github.com/smallstep/truststore)) = 0.13.0 -Provides: bundled(golang(github.com/spf13/cobra)) = 1.9.1 -Provides: bundled(golang(go.opentelemetry.io/auto/sdk)) = 1.1.0 -Provides: bundled(golang(go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp)) = 0.61.0 -Provides: bundled(golang(go.opentelemetry.io/contrib/propagators/autoprop)) = 0.62.0 -Provides: bundled(golang(go.opentelemetry.io/contrib/propagators/aws)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/contrib/propagators/b3)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/contrib/propagators/jaeger)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/contrib/propagators/ot)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/otel)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/otel/exporters/otlp/otlptrace)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/otel/metric)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/otel/sdk)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/otel/trace)) = 1.37.0 -Provides: bundled(golang(go.opentelemetry.io/proto/otlp)) = 1.7.0 -Provides: bundled(golang(go.uber.org/mock)) = 0.5.2 -Provides: bundled(golang(google.golang.org/genproto/googleapis/api)) = 513f239 -Provides: bundled(golang(google.golang.org/genproto/googleapis/rpc)) = 513f239 -Provides: bundled(golang(google.golang.org/grpc)) = 1.73.0 -Provides: bundled(golang(google.golang.org/grpc/cmd/protoc-gen-go-grpc)) = 1.5.1 +# dnsproviders +%global import_path_dnsproviders github.com/caddyserver/dnsproviders +%global version_dnsproviders 0.3.0 +Source10: https://%{import_path_dnsproviders}/archive/v%{version_dnsproviders}/dnsproviders-%{version_dnsproviders}.tar.gz -# BSD-2-Clause: -Provides: bundled(golang(github.com/pkg/errors)) = 0.9.1 -Provides: bundled(golang(github.com/russross/blackfriday/v2)) = 2.1.0 +# lego +%global import_path_lego github.com/go-acme/lego +%global version_lego 2.5.0 +Source11: https://%{import_path_lego}/archive/v%{version_lego}/lego-%{version_lego}.tar.gz -# BSD-3-Clause: -Provides: bundled(golang(dario.cat/mergo)) = 1.0.1 -Provides: bundled(golang(github.com/antlr4-go/antlr/v4)) = 4.13.0 -Provides: bundled(golang(github.com/cloudflare/circl)) = 1.6.1 -Provides: bundled(golang(github.com/golang/protobuf)) = 1.5.4 -Provides: bundled(golang(github.com/golang/snappy)) = 0.0.4 -Provides: bundled(golang(github.com/google/uuid)) = 1.6.0 -Provides: bundled(golang(github.com/grpc-ecosystem/grpc-gateway/v2)) = 2.27.1 -Provides: bundled(golang(github.com/manifoldco/promptui)) = 0.9.0 -Provides: bundled(golang(github.com/miekg/dns)) = 1.1.63 -Provides: bundled(golang(github.com/munnerz/goautoneg)) = a7dc8b6 -Provides: bundled(golang(github.com/pbnjay/memory)) = 7b4eea6 -Provides: bundled(golang(github.com/pmezard/go-difflib)) = 1.0.0 -Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.7 -Provides: bundled(golang(github.com/tailscale/tscert)) = d3f8340 -Provides: bundled(golang(golang.org/x/crypto)) = 0.40.0 -Provides: bundled(golang(golang.org/x/crypto/x509roots/fallback)) = 49bf5b8 -Provides: bundled(golang(golang.org/x/exp)) = 7e4ce0a -Provides: bundled(golang(golang.org/x/mod)) = 0.25.0 -Provides: bundled(golang(golang.org/x/net)) = 0.42.0 -Provides: bundled(golang(golang.org/x/oauth2)) = 0.30.0 -Provides: bundled(golang(golang.org/x/sync)) = 0.16.0 -Provides: bundled(golang(golang.org/x/sys)) = 0.34.0 -Provides: bundled(golang(golang.org/x/term)) = 0.33.0 -Provides: bundled(golang(golang.org/x/text)) = 0.27.0 -Provides: bundled(golang(golang.org/x/time)) = 0.12.0 -Provides: bundled(golang(golang.org/x/tools)) = 0.34.0 -Provides: bundled(golang(google.golang.org/api)) = 0.240.0 -Provides: bundled(golang(google.golang.org/protobuf)) = 1.36.6 +%if %{with azure} +Provides: bundled(golang(%{import_path_dnsproviders}/azure)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/azure)) = %{version_lego} +%endif +%if %{with cloudflare} +Provides: bundled(golang(%{import_path_dnsproviders}/cloudflare)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/cloudflare)) = %{version_lego} +%endif +%if %{with digitalocean} +Provides: bundled(golang(%{import_path_dnsproviders}/digitalocean)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/digitalocean)) = %{version_lego} +%endif +%if %{with googlecloud} +Provides: bundled(golang(%{import_path_dnsproviders}/googlecloud)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/gcloud)) = %{version_lego} +%endif +%if %{with pdns} +Provides: bundled(golang(%{import_path_dnsproviders}/pdns)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/pdns)) = %{version_lego} +%endif +%if %{with rackspace} +Provides: bundled(golang(%{import_path_dnsproviders}/rackspace)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/rackspace)) = %{version_lego} +%endif +%if %{with route53} +Provides: bundled(golang(%{import_path_dnsproviders}/route53)) = %{version_dnsproviders} +Provides: bundled(golang(%{import_path_lego}/providers/dns/route53)) = %{version_lego} +%endif -# CC0-1.0: -Provides: bundled(golang(github.com/zeebo/blake3)) = 0.2.4 +# geoip +%global import_path_geoip github.com/aablinov/caddy-geoip +%global commit_geoip c06787a76821ab7852dc1a5219dd5c05d904dce4 +Source20: https://%{import_path_geoip}/archive/%{commit_geoip}/geoip-%{commit_geoip}.tar.gz +%global import_path_geohash github.com/mmcloughlin/geohash +%global version_geohash 0.9.0 +Source21: https://%{import_path_geohash}/archive/v%{version_geohash}/geohash-%{version_geohash}.tar.gz +%if %{with geoip} +Provides: bundled(golang(%{import_path_geoip})) +Provides: bundled(golang(%{import_path_geohash})) +BuildRequires: golang(github.com/oschwald/maxminddb-golang) +%endif -# ISC: -Provides: bundled(golang(github.com/davecgh/go-spew)) = 1.1.1 +# realip +%global import_path_realip github.com/captncraig/caddy-realip +%global commit_realip 6df827e22ab8cd5ea90e0844ff29cf62b95127f9 +Source22: https://%{import_path_realip}/archive/%{commit_realip}/realip-%{commit_realip}.tar.gz +%if %{with realip} +Provides: bundled(golang(%{import_path_realip})) +%endif -# MIT: -Provides: bundled(golang(github.com/BurntSushi/toml)) = 1.5.0 -Provides: bundled(golang(github.com/KimMachineGun/automemlimit)) = 0.7.4 -Provides: bundled(golang(github.com/Masterminds/semver/v3)) = 3.3.0 -Provides: bundled(golang(github.com/Masterminds/sprig/v3)) = 3.3.0 -Provides: bundled(golang(github.com/Microsoft/go-winio)) = 0.6.0 -Provides: bundled(golang(github.com/alecthomas/chroma/v2)) = 2.20.0 -Provides: bundled(golang(github.com/aryann/difflib)) = ff5ff6d -Provides: bundled(golang(github.com/beorn7/perks)) = 1.0.1 -Provides: bundled(golang(github.com/caddyserver/zerossl)) = 0.1.3 -Provides: bundled(golang(github.com/ccoveille/go-safecast)) = 1.6.1 -Provides: bundled(golang(github.com/cenkalti/backoff/v5)) = 5.0.2 -Provides: bundled(golang(github.com/cespare/xxhash)) = 1.1.0 -Provides: bundled(golang(github.com/cespare/xxhash/v2)) = 2.3.0 -Provides: bundled(golang(github.com/chzyer/readline)) = 1.5.1 -Provides: bundled(golang(github.com/cpuguy83/go-md2man/v2)) = 2.0.7 -Provides: bundled(golang(github.com/dgryski/go-farm)) = a6ae236 -Provides: bundled(golang(github.com/dlclark/regexp2)) = 1.11.5 -Provides: bundled(golang(github.com/dustin/go-humanize)) = 1.0.1 -Provides: bundled(golang(github.com/felixge/httpsnoop)) = 1.0.4 -Provides: bundled(golang(github.com/francoispqt/gojay)) = 1.2.13 -Provides: bundled(golang(github.com/fxamacker/cbor/v2)) = 2.8.0 -Provides: bundled(golang(github.com/go-chi/chi/v5)) = 5.2.2 -Provides: bundled(golang(github.com/huandu/xstrings)) = 1.5.0 -Provides: bundled(golang(github.com/jackc/pgpassfile)) = 1.0.0 -Provides: bundled(golang(github.com/jackc/pgservicefile)) = 091c0ba -Provides: bundled(golang(github.com/jackc/pgx/v5)) = 5.6.0 -Provides: bundled(golang(github.com/jackc/puddle/v2)) = 2.2.1 -Provides: bundled(golang(github.com/klauspost/cpuid/v2)) = 2.3.0 -Provides: bundled(golang(github.com/libdns/libdns)) = 1.1.0 -Provides: bundled(golang(github.com/mattn/go-colorable)) = 0.1.13 -Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.20 -Provides: bundled(golang(github.com/mgutz/ansi)) = d51e80e -Provides: bundled(golang(github.com/mitchellh/copystructure)) = 1.2.0 -Provides: bundled(golang(github.com/mitchellh/go-ps)) = 1.0.0 -Provides: bundled(golang(github.com/mitchellh/reflectwalk)) = 1.0.2 -Provides: bundled(golang(github.com/quic-go/qpack)) = 0.5.1 -Provides: bundled(golang(github.com/quic-go/quic-go)) = 0.54.0 -Provides: bundled(golang(github.com/rs/xid)) = 1.6.0 -Provides: bundled(golang(github.com/shopspring/decimal)) = 1.4.0 -Provides: bundled(golang(github.com/shurcooL/sanitized_anchor_name)) = 1.0.0 -Provides: bundled(golang(github.com/sirupsen/logrus)) = 1.9.3 -Provides: bundled(golang(github.com/slackhq/nebula)) = 1.9.5 -Provides: bundled(golang(github.com/smallstep/pkcs7)) = 0.2.1 -Provides: bundled(golang(github.com/spf13/cast)) = 1.7.0 -Provides: bundled(golang(github.com/stoewer/go-strcase)) = 1.2.0 -Provides: bundled(golang(github.com/stretchr/testify)) = 1.10.0 -Provides: bundled(golang(github.com/urfave/cli)) = 1.22.17 -Provides: bundled(golang(github.com/x448/float16)) = 0.8.4 -Provides: bundled(golang(github.com/yuin/goldmark)) = 1.7.13 -Provides: bundled(golang(github.com/yuin/goldmark-highlighting/v2)) = 37449ab -Provides: bundled(golang(go.etcd.io/bbolt)) = 1.3.10 -Provides: bundled(golang(go.uber.org/automaxprocs)) = 1.6.0 -Provides: bundled(golang(go.uber.org/multierr)) = 1.11.0 -Provides: bundled(golang(go.uber.org/zap)) = 1.27.0 -Provides: bundled(golang(go.uber.org/zap/exp)) = 0.3.0 -Provides: bundled(golang(gopkg.in/natefinch/lumberjack.v2)) = 2.2.1 +# vendored libraries (Source0) +Provides: bundled(golang(github.com/bifurcation/mint)) +Provides: bundled(golang(github.com/cenkalti/backoff)) = 2.1.1 +Provides: bundled(golang(github.com/cheekybits/genny)) +Provides: bundled(golang(github.com/dustin/go-humanize)) = 1.0.0 +Provides: bundled(golang(github.com/flynn/go-shlex)) +Provides: bundled(golang(github.com/go-acme/lego)) = 2.5.0 +Provides: bundled(golang(github.com/google/uuid)) = 1.1.1 +Provides: bundled(golang(github.com/gorilla/websocket)) = 1.4.0 +Provides: bundled(golang(github.com/hashicorp/go-syslog)) = 1.0.0 +Provides: bundled(golang(github.com/hashicorp/golang-lru)) +Provides: bundled(golang(github.com/jimstudt/http-authentication)) +Provides: bundled(golang(github.com/klauspost/cpuid)) = 1.2.0 +Provides: bundled(golang(github.com/lucas-clemente/aes12)) +Provides: bundled(golang(github.com/lucas-clemente/quic-go)) = 0.10.2 +Provides: bundled(golang(github.com/lucas-clemente/quic-go-certificates)) +Provides: bundled(golang(github.com/mholt/certmagic)) = 0.6.2 +Provides: bundled(golang(github.com/miekg/dns)) = 1.1.3 +Provides: bundled(golang(github.com/naoina/go-stringutil)) = 0.1.0 +Provides: bundled(golang(github.com/naoina/toml)) = 0.1.1 +Provides: bundled(golang(github.com/russross/blackfriday)) +Provides: bundled(golang(golang.org/x/crypto)) +Provides: bundled(golang(golang.org/x/net)) +Provides: bundled(golang(golang.org/x/sys)) +Provides: bundled(golang(golang.org/x/text)) = 0.3.0 +Provides: bundled(golang(gopkg.in/mcuadros/go-syslog.v2)) = 2.2.1 +Provides: bundled(golang(gopkg.in/natefinch/lumberjack.v2)) = 2.0.0 +Provides: bundled(golang(gopkg.in/square/go-jose.v2)) = 2.2.2 +Provides: bundled(golang(gopkg.in/yaml.v2)) = 2.2.2 -# MPL-2.0: -Provides: bundled(golang(github.com/go-sql-driver/mysql)) = 1.8.1 - -# Apache-2.0 AND BSD-2-Clause: -Provides: bundled(golang(go.step.sm/crypto)) = 0.67.0 -Provides: bundled(golang(github.com/smallstep/cli-utils)) = 0.12.1 - -# Apache-2.0 AND BSD-3-Clause: -Provides: bundled(golang(github.com/go-jose/go-jose/v3)) = 3.0.4 -Provides: bundled(golang(github.com/go-jose/go-jose/v4)) = 4.0.5 -Provides: bundled(golang(github.com/googleapis/gax-go/v2)) = 2.14.2 -Provides: bundled(golang(github.com/mholt/acmez/v3)) = 3.1.2 -Provides: bundled(golang(github.com/smallstep/certificates)) = 0.28.4 - -# Apache-2.0 AND MIT: -Provides: bundled(golang(github.com/dgraph-io/ristretto)) = 0.2.0 -Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1 - -# BSD-1-Clause AND BSD-3-Clause: -Provides: bundled(golang(filippo.io/edwards25519)) = 1.1.0 - -# BSD-2-Clause-Views AND BSD-3-Clause: -Provides: bundled(golang(howett.net/plist)) = 1.0.0 - -# BSD-3-Clause AND MIT: -Provides: bundled(golang(github.com/smallstep/scep)) = 8cf1ca4 - -# CC0-1.0 AND MIT: -Provides: bundled(golang(github.com/AndreasBriese/bbloom)) = 46b345b - -# Apache-2.0 AND BSD-3-Clause AND MIT: -Provides: bundled(golang(github.com/klauspost/compress)) = 1.18.0 -Provides: bundled(golang(github.com/prometheus/client_golang)) = 1.23.0 +# vendored libraries (Source11) +Provides: bundled(golang(github.com/akamai/AkamaiOPEN-edgegrid-golang)) +Provides: bundled(golang(github.com/aliyun/alibaba-cloud-sdk-go)) +Provides: bundled(golang(github.com/aws/aws-sdk-go)) +Provides: bundled(golang(github.com/Azure/azure-sdk-for-go)) +Provides: bundled(golang(github.com/Azure/go-autorest)) +Provides: bundled(golang(github.com/BurntSushi/toml)) +Provides: bundled(golang(github.com/cenkalti/backoff)) +Provides: bundled(golang(github.com/cloudflare/cloudflare-go)) +Provides: bundled(golang(github.com/cpu/goacmedns)) +Provides: bundled(golang(github.com/decker502/dnspod-go)) +Provides: bundled(golang(github.com/dnsimple/dnsimple-go)) +Provides: bundled(golang(github.com/exoscale/egoscale)) +Provides: bundled(golang(github.com/gophercloud/gophercloud)) +Provides: bundled(golang(github.com/iij/doapi)) +Provides: bundled(golang(github.com/JamesClonk/vultr)) +Provides: bundled(golang(github.com/linode/linodego)) +Provides: bundled(golang(github.com/miekg/dns)) +Provides: bundled(golang(github.com/namedotcom/go)) +Provides: bundled(golang(github.com/nrdcg/auroradns)) +Provides: bundled(golang(github.com/nrdcg/goinwx)) +Provides: bundled(golang(github.com/OpenDNS/vegadns2client)) +Provides: bundled(golang(github.com/oracle/oci-go-sdk)) +Provides: bundled(golang(github.com/ovh/go-ovh)) +Provides: bundled(golang(github.com/rainycape/memcache)) +Provides: bundled(golang(github.com/sacloud/libsacloud)) +Provides: bundled(golang(github.com/stretchr/testify)) +Provides: bundled(golang(github.com/timewasted/linode)) +Provides: bundled(golang(github.com/transip/gotransip)) +Provides: bundled(golang(github.com/urfave/cli)) +Provides: bundled(golang(golang.org/x/crypto)) +Provides: bundled(golang(golang.org/x/net)) +Provides: bundled(golang(golang.org/x/oauth2)) +Provides: bundled(golang(google.golang.org/api)) +Provides: bundled(golang(gopkg.in/ns1/ns1-go.v2)) +Provides: bundled(golang(gopkg.in/square/go-jose.v2)) %description -Caddy is an extensible server platform that uses TLS by default. +Caddy is the web server with automatic HTTPS. + +This package was built with the following plugins: + +%{?with_geoip: http.geoip +}%{?with_realip: http.realip +}%{?with_azure: tls.dns.azure +}%{?with_cloudflare: tls.dns.cloudflare +}%{?with_digitalocean: tls.dns.digitalocean +}%{?with_googlecloud: tls.dns.googlecloud +}%{?with_pdns: tls.dns.powerdns +}%{?with_rackspace: tls.dns.rackspace +}%{?with_route53: tls.dns.route53 +} %prep -%autosetup -p 1 -a 1 -mkdir -p src/$(dirname %{goipath}) -ln -s $PWD src/%{goipath} +%setup -q -c -a 10 -a 11 -a 20 -a 21 -a 22 + +pushd caddy-%{version} +%patch0 -p 1 +popd + +cp caddy-%{version}/LICENSE.txt LICENSE.txt +cp caddy-%{version}/dist/README.txt README.txt +cp caddy-%{version}/dist/CHANGES.txt CHANGES.txt +mkdir -p $(dirname _build/src/%{import_path}) +mv caddy-%{version} _build/src/%{import_path} + +%if %{with dnsproviders} +cp dnsproviders-%{version_dnsproviders}/LICENSE LICENSE-dnsproviders +mkdir -p $(dirname _build/src/%{import_path_dnsproviders}) +mv dnsproviders-%{version_dnsproviders} _build/src/%{import_path_dnsproviders} +cp lego-%{version_lego}/LICENSE LICENSE-lego +mkdir -p $(dirname _build/src/%{import_path_lego}) +mv lego-%{version_lego} _build/src/%{import_path_lego} +%endif + +%if %{with geoip} +cp caddy-geoip-%{commit_geoip}/LICENSE LICENSE-geoip +mkdir -p $(dirname _build/src/%{import_path_geoip}) +mv caddy-geoip-%{commit_geoip} _build/src/%{import_path_geoip} +cp geohash-%{version_geohash}/LICENSE LICENSE-geohash +mkdir -p $(dirname _build/src/%{import_path_geohash}) +mv geohash-%{version_geohash} _build/src/%{import_path_geohash} +%endif + +%if %{with realip} +cp caddy-realip-%{commit_realip}/LICENSE LICENSE-realip +mkdir -p $(dirname _build/src/%{import_path_realip}) +mv caddy-realip-%{commit_realip} _build/src/%{import_path_realip} +%endif + +sed -e '/other plugins/ a \\t// plugins added during rpmbuild' \ +%{?with_geoip: -e '/other plugins/ a \\t_ "%{import_path_geoip}"'} \ +%{?with_realip: -e '/other plugins/ a \\t_ "%{import_path_realip}"'} \ +%{?with_azure: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/azure"'} \ +%{?with_cloudflare: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/cloudflare"'} \ +%{?with_digitalocean: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/digitalocean"'} \ +%{?with_googlecloud: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/googlecloud"'} \ +%{?with_pdns: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/pdns"'} \ +%{?with_rackspace: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/rackspace"'} \ +%{?with_route53: -e '/other plugins/ a \\t_ "%{import_path_dnsproviders}/route53"'} \ + -i _build/src/%{import_path}/caddy/caddymain/run.go %build -%if %{defined el8} -export GO111MODULE=off -%endif -export GOPATH=$PWD -export LDFLAGS="-X %{goipath}.CustomVersion=v%{version}" -%gobuild -o bin/caddy %{goipath}/cmd/caddy +export GOPATH="$PWD/_build:%{gopath}" +export LDFLAGS="${LDFLAGS:-} -X %{import_path}/caddy/caddymain.appVersion=v%{version} " +%gobuild -o _bin/caddy %{import_path}/caddy %install -# command -install -D -p -m 0755 -t %{buildroot}%{_bindir} bin/caddy - -# man pages -./bin/caddy manpage --directory %{buildroot}%{_mandir}/man8 - -# config -install -D -p -m 0644 -t %{buildroot}%{_sysconfdir}/caddy %{S:10} -install -d -m 0755 %{buildroot}%{_sysconfdir}/caddy/Caddyfile.d - -# systemd units -install -D -p -m 0644 -t %{buildroot}%{_unitdir} %{S:20} %{S:21} - -# sysusers -install -D -p -m 0644 %{S:22} %{buildroot}%{_sysusersdir}/caddy.conf - -# data directory +install -D -m 0755 _bin/caddy %{buildroot}%{_bindir}/caddy +install -D -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/caddy/caddy.conf +install -D -m 0644 %{S:2} %{buildroot}%{_unitdir}/caddy.service +install -D -m 0644 %{S:3} %{buildroot}%{_datadir}/caddy/index.html +install -d -m 0755 %{buildroot}%{_sysconfdir}/caddy/conf.d install -d -m 0750 %{buildroot}%{_sharedstatedir}/caddy -# welcome page -%if %{defined fedora} -install -D -p -m 0644 %{S:30} %{buildroot}%{_datadir}/caddy/poweredby.png -ln -s ../fedora-testpage/index.html %{buildroot}%{_datadir}/caddy/index.html -%else -install -D -p -m 0644 %{S:31} %{buildroot}%{_datadir}/caddy/poweredby.png -ln -s ../testpage/index.html %{buildroot}%{_datadir}/caddy/index.html -%endif -install -d -m 0755 %{buildroot}%{_datadir}/caddy/icons -ln -s ../../pixmaps/poweredby.png %{buildroot}%{_datadir}/caddy/icons/poweredby.png -%if %{defined rhel} && 0%{?rhel} >= 9 -ln -s ../pixmaps/system-noindex-logo.png %{buildroot}%{_datadir}/caddy/system_noindex_logo.png -%endif - -# shell completions -install -d -m 0755 %{buildroot}%{bash_completions_dir} -./bin/caddy completion bash > %{buildroot}%{bash_completions_dir}/caddy -install -d -m 0755 %{buildroot}%{zsh_completions_dir} -./bin/caddy completion zsh > %{buildroot}%{zsh_completions_dir}/_caddy -install -d -m 0755 %{buildroot}%{fish_completions_dir} -./bin/caddy completion fish > %{buildroot}%{fish_completions_dir}/caddy.fish - - -%check -# ensure that the version was embedded correctly -[[ "$(./bin/caddy version)" == "v%{version}" ]] || exit 1 - -# run the upstream tests -export GOPATH=$PWD -cd src/%{goipath} -%gotest ./... - %pre -%sysusers_create_compat %{S:22} +getent group caddy &> /dev/null || \ +groupadd -r caddy &> /dev/null +getent passwd caddy &> /dev/null || \ +useradd -r -g caddy -d %{_sharedstatedir}/caddy -s /sbin/nologin -c 'Caddy web server' caddy &> /dev/null +exit 0 %post @@ -326,8 +292,8 @@ if [ -x /usr/sbin/semanage ]; then # QUIC semanage port --add --type http_port_t --proto udp 80 2> /dev/null || : semanage port --add --type http_port_t --proto udp 443 2> /dev/null || : - # admin endpoint - semanage port --add --type http_port_t --proto tcp 2019 2> /dev/null || : + # HTTP challenge alternate port + semanage port --add --type http_port_t --proto tcp 5033 2> /dev/null || : fi @@ -352,36 +318,165 @@ if [ $1 -eq 0 ]; then # QUIC semanage port --delete --type http_port_t --proto udp 80 2> /dev/null || : semanage port --delete --type http_port_t --proto udp 443 2> /dev/null || : - # admin endpoint - semanage port --delete --type http_port_t --proto tcp 2019 2> /dev/null || : + # HTTP challenge alternate port + semanage port --delete --type http_port_t --proto tcp 5033 2> /dev/null || : fi fi %files -%license LICENSE -%doc README.md AUTHORS +%license LICENSE.txt +%{?with_geoip:%license LICENSE-geoip} +%{?with_geoip:%license LICENSE-geohash} +%{?with_realip:%license LICENSE-realip} +%{?with_dnsproviders:%license LICENSE-dnsproviders} +%{?with_dnsproviders:%license LICENSE-lego} +%doc README.txt CHANGES.txt %{_bindir}/caddy -%{_mandir}/man8/caddy*.8* %{_datadir}/caddy %{_unitdir}/caddy.service -%{_unitdir}/caddy-api.service -%{_sysusersdir}/caddy.conf %dir %{_sysconfdir}/caddy -%config(noreplace) %{_sysconfdir}/caddy/Caddyfile -%dir %{_sysconfdir}/caddy/Caddyfile.d +%dir %{_sysconfdir}/caddy/conf.d +%config(noreplace) %{_sysconfdir}/caddy/caddy.conf %attr(0750,caddy,caddy) %dir %{_sharedstatedir}/caddy -%if %{defined el8} -# this is normally owned by filesystem -%dir %{_datadir}/zsh -%dir %{_datadir}/zsh/site-functions -%dir %{_datadir}/fish -%dir %{_datadir}/fish/vendor_completions.d -%endif -%{bash_completions_dir}/caddy -%{zsh_completions_dir}/_caddy -%{fish_completions_dir}/caddy.fish %changelog -%autochangelog +* Mon Feb 17 2020 Elliott Sales de Andrade - 1.0.3-2 +- Rebuilt for GHSA-jf24-p9p9-4rjh + +* Wed Oct 23 2019 Carl George - 1.0.3-1 +- Update to v1 +- Remove dyn, gandi, namecheap, and rfc2136 dns providers +- Add patch0 to fix `-version` flag + +* Wed Jul 24 2019 Fedora Release Engineering - 0.11.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu May 09 2019 Carl George - 0.11.4-2 +- Switch unit file from ProtectSystem strict to full rhbz#1706651 + +* Wed Mar 06 2019 Carl George - 0.11.4-1 +- Latest upstream +- Update bundled dnsproviders to 0.1.3 +- Update bundled lego to 2.2.0 +- Enable googlecloud, route53, and azure dns providers on epel7 +- Allow custom http port with default config file rhbz#1685446 + +* Thu Jan 31 2019 Fedora Release Engineering - 0.11.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Nov 14 2018 Carl George - 0.11.1-2 +- Buildrequires at least golang 1.10 + +* Tue Nov 13 2018 Carl George - 0.11.1-1 +- Latest upstream +- Update bundled geoip + +* Fri Oct 19 2018 Carl George - 0.11.0-3 +- Enable httpd_can_network_connect selinux boolean to connect to ACME endpoint rhbz#1641158 +- Define UDP 80/443 as selinux http_port_t for QUIC rhbz#1608548 +- Define TCP 5033 as selinux http_port_t for HTTP challenge rhbz#1641160 + +* Thu Jul 12 2018 Fedora Release Engineering - 0.11.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Sat May 12 2018 Carl George - 0.11.0-1 +- Latest upstream + +* Sat Apr 21 2018 Carl George - 0.10.14-1 +- Latest upstream +- Overhaul %%prep to extract everything with %%setup +- Edit lego providers to require acmev2 instead of acme +- Add provides for specific providers from %%import_path_dnsproviders and %%import_path_lego +- Add azure dns provider on f28+ + +* Fri Apr 20 2018 Carl George - 0.10.11-6 +- Enable geoip plugin on EL7 +- Only provide bundled geoip/realip/dnsproviders/lego when the respective plugin is enabled + +* Wed Apr 18 2018 Carl George - 0.10.11-5 +- Add geoip plugin + +* Tue Apr 17 2018 Carl George - 0.10.11-4 +- Correct ExclusiveArch fallback + +* Mon Apr 16 2018 Carl George - 0.10.11-3 +- Enable s390x +- Disable googlecloud and route53 dns providers on EL7 due to dependency issues + +* Fri Mar 30 2018 Carl George - 0.10.11-2 +- Add googlecloud dns provider +- Add route53 dns provider +- Set minimum golang version to 1.9 +- Set selinux labels in scriptlets + +* Sat Feb 24 2018 Carl George - 0.10.11-1 +- Latest upstream + +* Sat Feb 24 2018 Carl George - 0.10.10-4 +- Change ProtectSystem from strict to full in unit file on RHEL + +* Wed Feb 07 2018 Fedora Release Engineering - 0.10.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jan 11 2018 Carl George - 0.10.10-2 +- Add powerdns provider + +* Mon Oct 09 2017 Carl George - 0.10.10-1 +- Latest upstream + +* Mon Oct 02 2017 Carl George - 0.10.9-6 +- Add provides for bundled libraries + +* Mon Oct 02 2017 Carl George - 0.10.9-5 +- Enable rfc2136 dns provider +- List plugins in description + +* Mon Sep 18 2017 Carl George - 0.10.9-4 +- Exclude s390x + +* Sun Sep 17 2017 Carl George - 0.10.9-3 +- Add realip plugin +- Add conditionals for plugins + +* Sat Sep 16 2017 Carl George - 0.10.9-2 +- Add sources for caddyserver/dnsproviders and xenolf/lego +- Disable all dns providers that require additional libraries (dnsimple, dnspod, googlecloud, linode, ovh, route53, vultr) +- Rewrite default index.html + +* Tue Sep 12 2017 Carl George - 0.10.9-1 +- Latest upstream +- Add config validation to unit file +- Disable exoscale dns provider https://github.com/xenolf/lego/issues/429 + +* Fri Sep 08 2017 Carl George - 0.10.8-1 +- Latest upstream +- Build with %%gobuild macro +- Move config subdirectory from /etc/caddy/caddy.conf.d to /etc/caddy/conf.d + +* Tue Aug 29 2017 Carl George - 0.10.7-1 +- Latest upstream + +* Fri Aug 25 2017 Carl George - 0.10.6-2 +- Use SIQQUIT to stop service +- Increase the process limit from 64 to 512 +- Only `go get` in caddy/caddymain + +* Fri Aug 11 2017 Carl George - 0.10.6-1 +- Latest upstream +- Add webserver virtual provides +- Drop tmpfiles and just own /var/lib/caddy directly +- Remove PrivateDevices setting from unit file, it prevents selinux process transitions +- Disable rfc2136 dns provider https://github.com/caddyserver/dnsproviders/issues/11 + +* Sat Jun 03 2017 Carl George - 0.10.3-2 +- Rename Envfile to envfile +- Rename Caddyfile to caddy.conf +- Include additional configs from caddy.conf.d directory + +* Fri May 19 2017 Carl George - 0.10.3-1 +- Latest upstream + +* Mon May 15 2017 Carl George - 0.10.2-1 +- Initial package diff --git a/caddy.sysusers b/caddy.sysusers deleted file mode 100644 index 3e98c73..0000000 --- a/caddy.sysusers +++ /dev/null @@ -1 +0,0 @@ -u caddy - "Caddy web server" /var/lib/caddy /usr/sbin/nologin diff --git a/changelog b/changelog deleted file mode 100644 index 8e10c3e..0000000 --- a/changelog +++ /dev/null @@ -1,285 +0,0 @@ -* Wed Jan 22 2025 Carl George - 2.9.1-3 -- Run tests with -short flag like upstream to avoid test failures -- Resolves FTBFS rhbz#2339573 rhbz#2339954 - -* Thu Jan 16 2025 Fedora Release Engineering - 2.9.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Wed Jan 08 2025 Carl George - 2.9.1-1 -- Update to version 2.9.1 rhbz#2336409 - -* Wed Jan 01 2025 Carl George - 2.9.0-1 -- Update to version 2.9.0 rhbz#2316289 - -* Wed Jul 17 2024 Fedora Release Engineering - 2.8.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Fri Jul 05 2024 Carl George - 2.8.4-1 -- Update to version 2.8.4 rhbz#2278549 -- Resolves CVE-2023-49295 rhbz#2257829 -- Resolves CVE-2024-27304 rhbz#2268278 -- Resolves CVE-2024-27289 rhbz#2268468 -- Resolves CVE-2024-28180 rhbz#2268877 -- Resolves CVE-2024-22189 rhbz#2273517 -- Remove LimitNPROC from systemd unit files - -* Sun Feb 11 2024 Maxwell G - 2.7.6-2 -- Rebuild for golang 1.22.0 - -* Fri Feb 09 2024 Carl George - 2.7.6-1 -- Update to version 2.7.6 rhbz#2253698 -- Includes fix for CVE-2023-45142 rhbz#2246587 - -* Tue Jan 23 2024 Fedora Release Engineering - 2.7.5-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jan 19 2024 Fedora Release Engineering - 2.7.5-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Oct 30 2023 Carl George - 2.7.5-1 -- Update to version 2.7.5 -- Update poweredby logos -- Add symlink for system_noindex_logo.png on EL9 -- Symlink directly to fedora-testpage directory on Fedora - -* Thu Aug 17 2023 Carl George - 2.7.4-1 -- Update to version 2.7.4, resolves rhbz#2232696 -- Fix CVE-2023-3978, resolves rhbz#2229582 - -* Tue Aug 08 2023 Carl George - 2.7.3-1 -- Update to version 2.7.3, resolves rhbz#2229638 - -* Thu Aug 03 2023 Carl George - 2.7.2-1 -- Update to version 2.7.2, resolves rhbz#2228776 - -* Thu Jul 27 2023 Carl George - 2.7.0~beta2-1 -- Update to version 2.7.0~beta2, resolves rhbz#2225732 rhbz#2124366 -- Resolves CVE-2022-41717 rhbz#2164315 -- Resolves CVE-2022-41723 rhbz#2178412 -- Add man pages -- Use generated shell completion files instead of static ones -- Add fish shell completions -- Switch to systemd sysusers - -* Wed Jul 19 2023 Fedora Release Engineering - 2.5.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Tue Jan 24 2023 Carl George - 2.5.2-3 -- Rebuild for CVE-2022-41717 in golang - -* Wed Jan 18 2023 Fedora Release Engineering - 2.5.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Tue Aug 09 2022 Carl George - 2.5.2-1 -- Latest upstream, resolves rhbz#2062499 rhbz#2113136 - -* Wed Jul 20 2022 Fedora Release Engineering - 2.4.6-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Tue Jul 19 2022 Maxwell G - 2.4.6-4 -- Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in - golang - -* Fri Jun 17 2022 Robert-André Mauchin - 2.4.6-3 -- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, - CVE-2022-29526, CVE-2022-30629 - -* Fri Feb 25 2022 Carl George - 2.4.6-2 -- Update welcome page symlink and image to work on both Fedora and EPEL - -* Wed Feb 16 2022 Carl George - 2.4.6-1 -- Latest upstream rhbz#1984163 - -* Wed Jan 19 2022 Fedora Release Engineering - 2.3.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Wed Jul 21 2021 Fedora Release Engineering - 2.3.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Wed Mar 03 2021 Carl George - 2.3.0-1 -- Latest upstream -- Fix vendored license handling -- Switch to white logo rhbz#1934864 - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 2.2.1-3 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Tue Jan 26 2021 Fedora Release Engineering - 2.2.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Fri Oct 30 2020 Carl George - 2.2.1-1 -- Latest upstream - -* Sat Sep 26 2020 Carl George - 2.2.0-1 -- Latest upstream - -* Sat Sep 19 2020 Carl George - 2.2.0~rc3-1 -- Latest upstream - -* Fri Aug 14 2020 Carl George - 2.1.1-2 -- Add bash and zsh completion support - -* Sun Aug 09 2020 Carl George - 2.1.1-1 -- Update to Caddy v2 -- Remove all v1 plugins -- Use vendored dependencies -- Remove devel subpackage -- Rename config file per upstream request -- Use webserver test page from system-logos-httpd - -* Sat Aug 01 2020 Fedora Release Engineering - 1.0.4-3 -- Second attempt - Rebuilt for - https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon Jul 27 2020 Fedora Release Engineering - 1.0.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jul 07 20:56:10 CEST 2020 Robert-André Mauchin - 1.0.4-1 -- Update to 1.0.4 (#1803691) - -* Mon Feb 17 2020 Elliott Sales de Andrade - 1.0.3-3 -- Rebuilt for GHSA-jf24-p9p9-4rjh - -* Tue Jan 28 2020 Fedora Release Engineering - 1.0.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Sep 07 2019 Carl George - 1.0.3-1 -- Latest upstream -- Remove bundled lego and plugins -- Remove dyn, gandi, namecheap, and rfc2136 dns providers -- Add patch0 to fix `-version` flag -- Add patch1 to adjust blackfriday import path -- Add devel subpackages -- Run test suite - -* Wed Jul 24 2019 Fedora Release Engineering - 0.11.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Thu May 09 2019 Carl George - 0.11.4-2 -- Switch unit file from ProtectSystem strict to full rhbz#1706651 - -* Wed Mar 06 2019 Carl George - 0.11.4-1 -- Latest upstream -- Update bundled dnsproviders to 0.1.3 -- Update bundled lego to 2.2.0 -- Enable googlecloud, route53, and azure dns providers on epel7 -- Allow custom http port with default config file rhbz#1685446 - -* Thu Jan 31 2019 Fedora Release Engineering - 0.11.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Wed Nov 14 2018 Carl George - 0.11.1-2 -- Buildrequires at least golang 1.10 - -* Tue Nov 13 2018 Carl George - 0.11.1-1 -- Latest upstream -- Update bundled geoip - -* Fri Oct 19 2018 Carl George - 0.11.0-3 -- Enable httpd_can_network_connect selinux boolean to connect to ACME endpoint rhbz#1641158 -- Define UDP 80/443 as selinux http_port_t for QUIC rhbz#1608548 -- Define TCP 5033 as selinux http_port_t for HTTP challenge rhbz#1641160 - -* Thu Jul 12 2018 Fedora Release Engineering - 0.11.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Sat May 12 2018 Carl George - 0.11.0-1 -- Latest upstream - -* Sat Apr 21 2018 Carl George - 0.10.14-1 -- Latest upstream -- Overhaul %%prep to extract everything with %%setup -- Edit lego providers to require acmev2 instead of acme -- Add provides for specific providers from %%import_path_dnsproviders and %%import_path_lego -- Add azure dns provider on f28+ - -* Fri Apr 20 2018 Carl George - 0.10.11-6 -- Enable geoip plugin on EL7 -- Only provide bundled geoip/realip/dnsproviders/lego when the respective plugin is enabled - -* Wed Apr 18 2018 Carl George - 0.10.11-5 -- Add geoip plugin - -* Tue Apr 17 2018 Carl George - 0.10.11-4 -- Correct ExclusiveArch fallback - -* Mon Apr 16 2018 Carl George - 0.10.11-3 -- Enable s390x -- Disable googlecloud and route53 dns providers on EL7 due to dependency issues - -* Fri Mar 30 2018 Carl George - 0.10.11-2 -- Add googlecloud dns provider -- Add route53 dns provider -- Set minimum golang version to 1.9 -- Set selinux labels in scriptlets - -* Sat Feb 24 2018 Carl George - 0.10.11-1 -- Latest upstream - -* Sat Feb 24 2018 Carl George - 0.10.10-4 -- Change ProtectSystem from strict to full in unit file on RHEL - -* Wed Feb 07 2018 Fedora Release Engineering - 0.10.10-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Jan 11 2018 Carl George - 0.10.10-2 -- Add powerdns provider - -* Mon Oct 09 2017 Carl George - 0.10.10-1 -- Latest upstream - -* Mon Oct 02 2017 Carl George - 0.10.9-6 -- Add provides for bundled libraries - -* Mon Oct 02 2017 Carl George - 0.10.9-5 -- Enable rfc2136 dns provider -- List plugins in description - -* Mon Sep 18 2017 Carl George - 0.10.9-4 -- Exclude s390x - -* Sun Sep 17 2017 Carl George - 0.10.9-3 -- Add realip plugin -- Add conditionals for plugins - -* Sat Sep 16 2017 Carl George - 0.10.9-2 -- Add sources for caddyserver/dnsproviders and xenolf/lego -- Disable all dns providers that require additional libraries (dnsimple, dnspod, googlecloud, linode, ovh, route53, vultr) -- Rewrite default index.html - -* Tue Sep 12 2017 Carl George - 0.10.9-1 -- Latest upstream -- Add config validation to unit file -- Disable exoscale dns provider https://github.com/xenolf/lego/issues/429 - -* Fri Sep 08 2017 Carl George - 0.10.8-1 -- Latest upstream -- Build with %%gobuild macro -- Move config subdirectory from /etc/caddy/caddy.conf.d to /etc/caddy/conf.d - -* Tue Aug 29 2017 Carl George - 0.10.7-1 -- Latest upstream - -* Fri Aug 25 2017 Carl George - 0.10.6-2 -- Use SIQQUIT to stop service -- Increase the process limit from 64 to 512 -- Only `go get` in caddy/caddymain - -* Fri Aug 11 2017 Carl George - 0.10.6-1 -- Latest upstream -- Add webserver virtual provides -- Drop tmpfiles and just own /var/lib/caddy directly -- Remove PrivateDevices setting from unit file, it prevents selinux process transitions -- Disable rfc2136 dns provider https://github.com/caddyserver/dnsproviders/issues/11 - -* Sat Jun 03 2017 Carl George - 0.10.3-2 -- Rename Envfile to envfile -- Rename Caddyfile to caddy.conf -- Include additional configs from caddy.conf.d directory - -* Fri May 19 2017 Carl George - 0.10.3-1 -- Latest upstream - -* Mon May 15 2017 Carl George - 0.10.2-1 -- Initial package diff --git a/create-vendor-tarball.sh b/create-vendor-tarball.sh deleted file mode 100755 index 87bace1..0000000 --- a/create-vendor-tarball.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/bash - -tag=$1 - -if [[ -z $tag ]]; then - echo "This script requires the tag as an argument." - exit 1 -fi - -set -euo pipefail - -PKG="caddy" -REPO="https://github.com/caddyserver/$PKG" - -# transform tag into version -case $tag in - *beta*) - # v2.0.0-beta.1 -> 2.0.0~beta1 - temp=${tag#v} - version=${temp/-beta./~beta} - ;; - *rc*) - # v2.0.0-rc.1 -> 2.0.0~rc1 - temp=${tag#v} - version=${temp/-rc./~rc} - ;; - *) - # v2.0.0 -> 2.0.0 - version=${tag#v} - ;; -esac - -echo "Using tag: $tag" -echo "Using version: $version" - -git -c advice.detachedHead=false clone --branch $tag --depth 1 $REPO.git $PKG-$version -pushd $PKG-$version -GOPROXY='https://proxy.golang.org,direct' go mod vendor -popd -tar -C $PKG-$version -czf $PKG-$version-vendor.tar.gz vendor diff --git a/enable-appVersion-ldflag.patch b/enable-appVersion-ldflag.patch new file mode 100644 index 0000000..359bdfd --- /dev/null +++ b/enable-appVersion-ldflag.patch @@ -0,0 +1,88 @@ +diff -Nurp caddy-1.0.3.orig/caddy/caddymain/run.go caddy-1.0.3/caddy/caddymain/run.go +--- caddy-1.0.3.orig/caddy/caddymain/run.go 2019-08-14 14:45:42.000000000 -0500 ++++ caddy-1.0.3/caddy/caddymain/run.go 2019-08-26 19:46:28.041828503 -0500 +@@ -25,7 +25,6 @@ import ( + "os" + "path/filepath" + "runtime" +- "runtime/debug" + "strconv" + "strings" + +@@ -78,12 +77,10 @@ func init() { + func Run() { + flag.Parse() + +- module := getBuildModule() +- cleanModVersion := strings.TrimPrefix(module.Version, "v") +- + caddy.AppName = appName +- caddy.AppVersion = module.Version +- certmagic.UserAgent = appName + "/" + cleanModVersion ++ caddy.AppVersion = appVersion ++ cleanVersion := strings.TrimPrefix(appVersion, "v") ++ certmagic.UserAgent = appName + "/" + cleanVersion + + // Set up process log before anything bad happens + switch logfile { +@@ -147,12 +144,7 @@ func Run() { + os.Exit(0) + } + if version { +- if module.Sum != "" { +- // a build with a known version will also have a checksum +- fmt.Printf("Caddy %s (%s)\n", module.Version, module.Sum) +- } else { +- fmt.Println(module.Version) +- } ++ fmt.Println(appVersion) + os.Exit(0) + } + if plugins { +@@ -196,7 +188,7 @@ func Run() { + } + + // Begin telemetry (these are no-ops if telemetry disabled) +- telemetry.Set("caddy_version", module.Version) ++ telemetry.Set("caddy_version", appVersion) + telemetry.Set("num_listeners", len(instance.Servers())) + telemetry.Set("server_type", serverType) + telemetry.Set("os", runtime.GOOS) +@@ -277,27 +269,6 @@ func defaultLoader(serverType string) (c + }, nil + } + +-// getBuildModule returns the build info of Caddy +-// from debug.BuildInfo (requires Go modules). If +-// no version information is available, a non-nil +-// value will still be returned, but with an +-// unknown version. +-func getBuildModule() *debug.Module { +- bi, ok := debug.ReadBuildInfo() +- if ok { +- // The recommended way to build Caddy involves +- // creating a separate main module, which +- // preserves caddy a read-only dependency +- // TODO: track related Go issue: https://github.com/golang/go/issues/29228 +- for _, mod := range bi.Deps { +- if mod.Path == "github.com/caddyserver/caddy" { +- return mod +- } +- } +- } +- return &debug.Module{Version: "unknown"} +-} +- + func checkJSONCaddyfile() { + if fromJSON { + jsonBytes, err := ioutil.ReadAll(os.Stdin) +@@ -578,6 +549,9 @@ func ParseEnvFile(envInput io.Reader) (m + + const appName = "Caddy" + ++// Build information ++var appVersion = "unknown" ++ + // Flags that control program flow or startup + var ( + serverType string diff --git a/index.html b/index.html new file mode 100644 index 0000000..7c1b011 --- /dev/null +++ b/index.html @@ -0,0 +1,45 @@ + + + + + + + Test page for the Caddy web server on Fedora + + + + + + + + + + + + + + + + + + diff --git a/poweredby-black.png b/poweredby-black.png deleted file mode 100644 index f0df626..0000000 Binary files a/poweredby-black.png and /dev/null differ diff --git a/poweredby-white.png b/poweredby-white.png deleted file mode 100644 index a2098ab..0000000 Binary files a/poweredby-white.png and /dev/null differ diff --git a/sources b/sources index 83d8cbc..64c6690 100644 --- a/sources +++ b/sources @@ -1,2 +1,6 @@ -SHA512 (caddy-2.10.2.tar.gz) = 986b11e26cdaa4fbe554cf7b6bb333404fc33190945ef995122518a3fe2fe582a4cf4d2a8ab463e045857650e9deb88123f8d86a93dbdc465635755b00356205 -SHA512 (caddy-2.10.2-vendor.tar.gz) = 8b4b63f5b8ba4b29ec01da55820214f4c63a1c545756815e26d73bdcc3b3ac5aada863ef32ab6db898b90a9501c0ed6e03ed44e53612cdb8d872ab89480d466d +SHA512 (caddy-1.0.3-vendor.tar.gz) = 83a95df7a09b1ed78f94a81d0f2e715beec66ce329a5907b664419b8fd7711a252a5db6533cff175f5a751a0d749d630f54e2cb923b3d632fa2c2c86a4b07fe1 +SHA512 (dnsproviders-0.3.0.tar.gz) = 1732089afc1babc9d1ded6a95c07fb80b280e42b2f9944b6dcac25e2cb5e08a163c6049d63eb0ceca7c9d07968b3c46ff55f1333590ad4f57d8338be729af53d +SHA512 (geoip-c06787a76821ab7852dc1a5219dd5c05d904dce4.tar.gz) = a168a6cf4dbc2fdc634b7009dc6f6842652224d396df0090090acbc062530d65308632cfd50a43a238a67733b5240e0c472092d734d7c2d83012ecb972ecbbdb +SHA512 (lego-2.5.0.tar.gz) = 173bd25eb6621a3d3131ad1d14574e59fa10dee0414c487f8202850b9e2c93fe07ea8690eb12e7f22ecd4d951a852eede22fc17bcbdd9ed46ce71f923e73d70d +SHA512 (realip-6df827e22ab8cd5ea90e0844ff29cf62b95127f9.tar.gz) = fc3589cd4252e2dcffe7e2abb6a12bb150e7fc3a0870122e3bcdd17bd6bd81d7547656d9790b39338edccd91586ddabe29252d570d5fc14a1d96ebfc1134684c +SHA512 (geohash-0.9.0.tar.gz) = f717b6a366108a231e0c679841e25c051e8425c6e97c2d7095c3d15c6c4bc2d60dbf57e3cbe253885f303a00e261350de5726b544f3e44cdbb25727dfc79d5b2