Compare commits

...
Sign in to create a new pull request.

10 commits

Author SHA1 Message Date
Carl George
70d52d912c Test page updates
- Update poweredby logos
- Add symlink for system_noindex_logo.png on EL9
- Symlink directly to fedora-testpage directory on Fedora
2023-10-30 18:01:38 -05:00
Carl George
9db3ba7c63 Add fish shell completions 2023-08-24 00:37:33 -05:00
Carl George
a7bfd48390 Use generated shell completion files instead of static ones 2023-08-24 00:36:58 -05:00
Carl George
0817b8e946 Add man pages 2023-08-24 00:36:37 -05:00
Carl George
187cdb9a73 Update to version 2.6.4
I'm targeting this version specifically for EPEL 9, because RHEL 9
currently has golang 1.19, and 2.6.4 is the newest version of caddy that
doesn't require a higher golang version.
2023-08-24 00:36:07 -05:00
Carl George
7abb762bb5 Remove usage of %gometa, %goprep, %gobuilddir, and %gocheck
These macros are inconsistent across EPEL branches.
2023-08-24 00:26:18 -05:00
Carl George
75c9917645 Re-number sources 2023-08-24 00:23:43 -05:00
Carl George
8648d6338a Remove vendor conditionals
The caddy upstream adds and removes dependencies too often to keep up
with.  I doubt that I will ever have the time to package all of the
dependencies as system packages.
2023-08-24 00:22:52 -05:00
Carl George
bf2cf07ee4 Backport of upstream fix for CVE-2022-29718 2023-02-28 20:10:34 -06:00
Carl George
4d622837a8 Rebuild for CVE-2022-41717 in golang 2023-01-24 14:25:58 -06:00
8 changed files with 387 additions and 1551 deletions

View file

@ -1,4 +1,4 @@
From 7bf03a1414b1ebc1a9ef573369fe8e7ee9956a33 Mon Sep 17 00:00:00 2001
From 08a40c6b09cf5e649c82829724b858b385b3cd66 Mon Sep 17 00:00:00 2001
From: Carl George <carl@george.computer>
Date: Wed, 16 Feb 2022 11:45:03 -0600
Subject: [PATCH] Disable commands that can alter the binary
@ -8,10 +8,10 @@ Subject: [PATCH] Disable commands that can alter the binary
1 file changed, 48 deletions(-)
diff --git a/cmd/commands.go b/cmd/commands.go
index 1e2c40de..cc091bce 100644
index 9216b898..85f7bc7d 100644
--- a/cmd/commands.go
+++ b/cmd/commands.go
@@ -289,54 +289,6 @@ is always printed to stdout.`,
@@ -333,54 +333,6 @@ is always printed to stdout.`,
}(),
})
@ -63,9 +63,9 @@ index 1e2c40de..cc091bce 100644
- }(),
- })
-
}
// RegisterCommand registers the command cmd.
RegisterCommand(Command{
Name: "manpage",
Func: func(fl Flags) (int, error) {
--
2.35.1
2.41.0

File diff suppressed because it is too large Load diff

View file

@ -1,150 +1,297 @@
%bcond_without vendor
%if %{without vendor}
%bcond_without check
%endif
# https://github.com/caddyserver/caddy
%global goipath github.com/caddyserver/caddy
%global basever 2.4.6
#global prerel rc
#global prerelnum 3
Version: %{basever}%{?prerel:~%{prerel}%{prerelnum}}
%gometa
%global common_description %{expand:
Caddy is the web server with automatic HTTPS.}
Name: caddy
Release: 4%{?dist}
Version: 2.6.4
Release: 2%{?dist}
Summary: Web server with automatic HTTPS
%if %{with vendor}
# github.com/caddyserver/caddy ASL 2.0
# github.com/Masterminds/sprig/v3 MIT
# github.com/alecthomas/chroma MIT
# github.com/aryann/difflib MIT
# github.com/caddyserver/certmagic ASL 2.0
# github.com/dustin/go-humanize MIT
# github.com/go-chi/chi MIT
# github.com/google/cel-go ASL 2.0
# github.com/google/uuid BSD
# github.com/klauspost/compress BSD and ASL 2.0
# github.com/klauspost/cpuid/v2 MIT
# github.com/lucas-clemente/quic-go MIT
# github.com/mholt/acmez ASL 2.0
# github.com/naoina/go-stringutil MIT
# github.com/naoina/toml MIT
# github.com/prometheus/client_golang ASL 2.0
# github.com/smallstep/certificates ASL 2.0
# github.com/smallstep/cli ASL 2.0
# github.com/smallstep/nosql ASL 2.0
# github.com/smallstep/truststore ASL 2.0
# github.com/yuin/goldmark MIT
# github.com/yuin/goldmark-highlighting MIT
# go.uber.org/zap MIT
# golang.org/x/crypto BSD
# golang.org/x/net BSD
# golang.org/x/term BSD
# google.golang.org/genproto ASL 2.0
# google.golang.org/protobuf BSD
# gopkg.in/natefinch/lumberjack.v2 MIT
# gopkg.in/yaml.v2 ASL 2.0 and MIT
License: ASL 2.0 and MIT and BSD
%else
License: ASL 2.0
%endif
# main source code is Apache-2.0
# see comments above provides tags for bundled license breakdown
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND BSD-2-Clause-Views AND ISC AND CC0-1.0 AND MPL-2.0
URL: https://caddyserver.com
%if %{with vendor}
# git clone https://github.com/caddyserver/caddy.git caddy-%%{version}
# cd caddy-%%{version}
# git checkout v%%{version}
# go mod vendor
# cd ..
# tar --exclude .git -czf caddy-%%{version}-vendored.tar.gz caddy-%%{version}
Source0: caddy-%{version}-vendored.tar.gz
%if %{defined fedora}
ExclusiveArch: %{golang_arches_future}
%else
Source0: %{gosource}
ExclusiveArch: %{golang_arches}
%endif
%if %{undefined el8}
BuildRequires: go-rpm-macros
%endif
# see create-vendor-tarball.sh in this distgit repo
Source0: caddy-%{version}-vendored.tar.gz
# based on reference files upstream
# https://github.com/caddyserver/dist
Source1: Caddyfile
Source2: caddy.service
Source3: caddy-api.service
Source4: poweredby-white.png
Source5: poweredby-black.png
Source6: bash-completion
Source7: zsh-completion
Source10: Caddyfile
Source20: caddy.service
Source21: caddy-api.service
Source30: poweredby-white.png
Source31: poweredby-black.png
# downstream only patch to disable commands that can alter the binary
Patch: 0001-Disable-commands-that-can-alter-the-binary.patch
# https://github.com/caddyserver/caddy/commit/6bc87ea2ff50a962f16dfafeb125f0f947c1a885
BuildRequires: golang >= 1.16
# https://github.com/caddyserver/caddy/commit/141872ed80d6323505e7543628c259fdae8506d3
BuildRequires: golang >= 1.18
%if %{with vendor}
Provides: bundled(golang(github.com/Masterminds/sprig/v3))
Provides: bundled(golang(github.com/alecthomas/chroma))
Provides: bundled(golang(github.com/aryann/difflib))
Provides: bundled(golang(github.com/caddyserver/certmagic))
Provides: bundled(golang(github.com/dustin/go-humanize))
Provides: bundled(golang(github.com/go-chi/chi))
Provides: bundled(golang(github.com/google/cel-go))
Provides: bundled(golang(github.com/google/uuid))
Provides: bundled(golang(github.com/klauspost/compress))
Provides: bundled(golang(github.com/klauspost/cpuid/v2))
Provides: bundled(golang(github.com/lucas-clemente/quic-go))
Provides: bundled(golang(github.com/mholt/acmez))
Provides: bundled(golang(github.com/naoina/go-stringutil))
Provides: bundled(golang(github.com/naoina/toml))
Provides: bundled(golang(github.com/prometheus/client_golang))
Provides: bundled(golang(github.com/smallstep/certificates))
Provides: bundled(golang(github.com/smallstep/cli))
Provides: bundled(golang(github.com/smallstep/nosql))
Provides: bundled(golang(github.com/smallstep/truststore))
Provides: bundled(golang(github.com/yuin/goldmark))
Provides: bundled(golang(github.com/yuin/goldmark-highlighting))
Provides: bundled(golang(go.uber.org/zap))
Provides: bundled(golang(golang.org/x/crypto))
Provides: bundled(golang(golang.org/x/net))
Provides: bundled(golang(golang.org/x/term))
Provides: bundled(golang(google.golang.org/genproto))
Provides: bundled(golang(google.golang.org/protobuf))
Provides: bundled(golang(gopkg.in/natefinch/lumberjack.v2))
Provides: bundled(golang(gopkg.in/yaml.v2))
%else
BuildRequires: golang(github.com/Masterminds/sprig/v3)
BuildRequires: golang(github.com/alecthomas/chroma)
BuildRequires: golang(github.com/aryann/difflib)
BuildRequires: golang(github.com/caddyserver/certmagic)
BuildRequires: golang(github.com/dustin/go-humanize)
BuildRequires: golang(github.com/go-chi/chi)
BuildRequires: golang(github.com/google/cel-go)
BuildRequires: golang(github.com/google/uuid)
BuildRequires: golang(github.com/klauspost/compress)
BuildRequires: golang(github.com/klauspost/cpuid/v2)
BuildRequires: golang(github.com/lucas-clemente/quic-go)
BuildRequires: golang(github.com/mholt/acmez)
BuildRequires: golang(github.com/naoina/go-stringutil)
BuildRequires: golang(github.com/naoina/toml)
BuildRequires: golang(github.com/prometheus/client_golang)
BuildRequires: golang(github.com/smallstep/certificates)
BuildRequires: golang(github.com/smallstep/cli)
BuildRequires: golang(github.com/smallstep/nosql)
BuildRequires: golang(github.com/smallstep/truststore)
BuildRequires: golang(github.com/yuin/goldmark)
BuildRequires: golang(github.com/yuin/goldmark-highlighting)
BuildRequires: golang(go.uber.org/zap)
BuildRequires: golang(golang.org/x/crypto)
BuildRequires: golang(golang.org/x/net)
BuildRequires: golang(golang.org/x/term)
BuildRequires: golang(google.golang.org/genproto)
BuildRequires: golang(google.golang.org/protobuf)
BuildRequires: golang(gopkg.in/natefinch/lumberjack.v2)
BuildRequires: golang(gopkg.in/yaml.v2)
%endif
# BSD-3-Clause
Provides: bundled(golang(filippo.io/edwards25519)) = 1.0.0
# MIT AND CC0-1.0
Provides: bundled(golang(github.com/AndreasBriese/bbloom)) = 46b345b
# MIT
Provides: bundled(golang(github.com/BurntSushi/toml)) = 1.2.1
# Apache-2.0
Provides: bundled(golang(github.com/Masterminds/goutils)) = 1.1.1
# MIT
Provides: bundled(golang(github.com/Masterminds/semver/v3)) = 3.2.0
# MIT
Provides: bundled(golang(github.com/Masterminds/sprig/v3)) = 3.2.3
# MIT
Provides: bundled(golang(github.com/Microsoft/go-winio)) = 0.6.0
# MIT
Provides: bundled(golang(github.com/alecthomas/chroma/v2)) = 2.5.0
# BSD-3-Clause
Provides: bundled(golang(github.com/antlr/antlr4/runtime/Go/antlr)) = 1.4.10
# MIT
Provides: bundled(golang(github.com/aryann/difflib)) = ff5ff6d
# MIT
Provides: bundled(golang(github.com/beorn7/perks)) = 1.0.1
# Apache-2.0
Provides: bundled(golang(github.com/caddyserver/certmagic)) = 0.17.2
# MIT
Provides: bundled(golang(github.com/cenkalti/backoff/v4)) = 4.1.2
# MIT
Provides: bundled(golang(github.com/cespare/xxhash)) = 1.1.0
# MIT
Provides: bundled(golang(github.com/cespare/xxhash/v2)) = 2.1.2
# MIT
Provides: bundled(golang(github.com/chzyer/readline)) = 2972be2
# MIT
Provides: bundled(golang(github.com/cpuguy83/go-md2man/v2)) = 2.0.2
# ISC
Provides: bundled(golang(github.com/davecgh/go-spew)) = 1.1.1
# Apache-2.0
Provides: bundled(golang(github.com/dgraph-io/badger)) = 1.6.2
# Apache-2.0
Provides: bundled(golang(github.com/dgraph-io/badger/v2)) = 2.2007.4
# Apache-2.0 AND MIT
Provides: bundled(golang(github.com/dgraph-io/ristretto)) = 0.1.0
# MIT
Provides: bundled(golang(github.com/dgryski/go-farm)) = a6ae236
# MIT
Provides: bundled(golang(github.com/dlclark/regexp2)) = 1.7.0
# MIT
Provides: bundled(golang(github.com/dustin/go-humanize)) = 1.0.1
# MIT
Provides: bundled(golang(github.com/felixge/httpsnoop)) = 1.0.3
# MIT
Provides: bundled(golang(github.com/fxamacker/cbor/v2)) = 2.4.0
# MIT
Provides: bundled(golang(github.com/go-chi/chi)) = 4.1.2+incompatible
# MIT
Provides: bundled(golang(github.com/go-kit/kit)) = 0.10.0
# MIT
Provides: bundled(golang(github.com/go-logfmt/logfmt)) = 0.5.1
# Apache-2.0
Provides: bundled(golang(github.com/go-logr/logr)) = 1.2.3
# Apache-2.0
Provides: bundled(golang(github.com/go-logr/stdr)) = 1.2.2
# MPL-2.0
Provides: bundled(golang(github.com/go-sql-driver/mysql)) = 1.6.0
# MIT
Provides: bundled(golang(github.com/go-task/slim-sprig)) = 348f09d
# Apache-2.0
Provides: bundled(golang(github.com/golang/glog)) = 1.0.0
# Apache-2.0
Provides: bundled(golang(github.com/golang/mock)) = 1.6.0
# BSD-3-Clause
Provides: bundled(golang(github.com/golang/protobuf)) = 1.5.2
# BSD-3-Clause
Provides: bundled(golang(github.com/golang/snappy)) = 0.0.4
# Apache-2.0
Provides: bundled(golang(github.com/google/cel-go)) = 0.13.0
# Apache-2.0
Provides: bundled(golang(github.com/google/pprof)) = 94a9f03
# BSD-3-Clause
Provides: bundled(golang(github.com/google/uuid)) = 1.3.0
# BSD-3-Clause
Provides: bundled(golang(github.com/grpc-ecosystem/grpc-gateway)) = 1.16.0
# MIT
Provides: bundled(golang(github.com/huandu/xstrings)) = 1.3.3
# BSD-3-Clause
Provides: bundled(golang(github.com/imdario/mergo)) = 0.3.12
# Apache-2.0
Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.0.1
# MIT
Provides: bundled(golang(github.com/jackc/chunkreader/v2)) = 2.0.1
# MIT
Provides: bundled(golang(github.com/jackc/pgconn)) = 1.13.0
# MIT
Provides: bundled(golang(github.com/jackc/pgio)) = 1.0.0
# MIT
Provides: bundled(golang(github.com/jackc/pgpassfile)) = 1.0.0
# MIT
Provides: bundled(golang(github.com/jackc/pgproto3/v2)) = 2.3.1
# MIT
Provides: bundled(golang(github.com/jackc/pgservicefile)) = 2b9c447
# MIT
Provides: bundled(golang(github.com/jackc/pgtype)) = 1.12.0
# MIT
Provides: bundled(golang(github.com/jackc/pgx/v4)) = 4.17.2
# BSD-3-Clause AND Apache-2.0 AND MIT
Provides: bundled(golang(github.com/klauspost/compress)) = 1.15.15
# MIT
Provides: bundled(golang(github.com/klauspost/cpuid/v2)) = 2.2.3
# MIT
Provides: bundled(golang(github.com/libdns/libdns)) = 0.2.1
# BSD-3-Clause
Provides: bundled(golang(github.com/manifoldco/promptui)) = 0.9.0
# MIT
Provides: bundled(golang(github.com/mattn/go-colorable)) = 0.1.8
# MIT
Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.13
# Apache-2.0
Provides: bundled(golang(github.com/matttproud/golang_protobuf_extensions)) = 1.0.1
# MIT
Provides: bundled(golang(github.com/mgutz/ansi)) = d51e80e
# Apache-2.0
Provides: bundled(golang(github.com/mholt/acmez)) = 1.1.0
# MIT
Provides: bundled(golang(github.com/micromdm/scep/v2)) = 2.1.0
# BSD-3-Clause
Provides: bundled(golang(github.com/miekg/dns)) = 1.1.50
# MIT
Provides: bundled(golang(github.com/mitchellh/copystructure)) = 1.2.0
# MIT
Provides: bundled(golang(github.com/mitchellh/go-ps)) = 1.0.0
# MIT
Provides: bundled(golang(github.com/mitchellh/reflectwalk)) = 1.0.2
# MIT
Provides: bundled(golang(github.com/onsi/ginkgo/v2)) = 2.2.0
# BSD-2-Clause
Provides: bundled(golang(github.com/pkg/errors)) = 0.9.1
# Apache-2.0
Provides: bundled(golang(github.com/prometheus/client_golang)) = 1.14.0
# Apache-2.0
Provides: bundled(golang(github.com/prometheus/client_model)) = 0.3.0
# Apache-2.0
Provides: bundled(golang(github.com/prometheus/common)) = 0.37.0
# Apache-2.0
Provides: bundled(golang(github.com/prometheus/procfs)) = 0.8.0
# MIT
Provides: bundled(golang(github.com/quic-go/qpack)) = 0.4.0
# BSD-3-Clause
Provides: bundled(golang(github.com/quic-go/qtls-go1-18)) = 0.2.0
# BSD-3-Clause
Provides: bundled(golang(github.com/quic-go/qtls-go1-19)) = 0.2.0
# BSD-3-Clause
Provides: bundled(golang(github.com/quic-go/qtls-go1-20)) = 0.1.0
# MIT
Provides: bundled(golang(github.com/quic-go/quic-go)) = 0.32.0
# MIT
Provides: bundled(golang(github.com/rs/xid)) = 1.4.0
# BSD-2-Clause
Provides: bundled(golang(github.com/russross/blackfriday/v2)) = 2.1.0
# MIT
Provides: bundled(golang(github.com/shopspring/decimal)) = 1.2.0
# MIT
Provides: bundled(golang(github.com/shurcooL/sanitized_anchor_name)) = 1.0.0
# MIT
Provides: bundled(golang(github.com/sirupsen/logrus)) = 1.9.0
# MIT
Provides: bundled(golang(github.com/slackhq/nebula)) = 1.6.1
# Apache-2.0
Provides: bundled(golang(github.com/smallstep/certificates)) = 0.23.2
# Apache-2.0
Provides: bundled(golang(github.com/smallstep/nosql)) = 0.5.0
# Apache-2.0
Provides: bundled(golang(github.com/smallstep/truststore)) = 0.12.1
# MIT
Provides: bundled(golang(github.com/spf13/cast)) = 1.4.1
# Apache-2.0
Provides: bundled(golang(github.com/spf13/cobra)) = 1.6.1
# BSD-3-Clause
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.5
# MIT
Provides: bundled(golang(github.com/stoewer/go-strcase)) = 1.2.0
# BSD-3-Clause
Provides: bundled(golang(github.com/tailscale/tscert)) = c6dc1f4
# MIT
Provides: bundled(golang(github.com/urfave/cli)) = 1.22.12
# MIT
Provides: bundled(golang(github.com/x448/float16)) = 0.8.4
# MIT
Provides: bundled(golang(github.com/yuin/goldmark)) = 1.5.4
# MIT
Provides: bundled(golang(github.com/yuin/goldmark-highlighting/v2)) = 1513624
# MIT
Provides: bundled(golang(go.etcd.io/bbolt)) = 1.3.6
# MIT
Provides: bundled(golang(go.mozilla.org/pkcs7)) = 33d0574
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp)) = 0.39.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel)) = 1.13.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel/exporters/otlp/internal/retry)) = 1.4.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel/exporters/otlp/otlptrace)) = 1.4.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)) = 1.4.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel/metric)) = 0.36.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel/sdk)) = 1.13.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/otel/trace)) = 1.13.0
# Apache-2.0
Provides: bundled(golang(go.opentelemetry.io/proto/otlp)) = 0.12.0
# Apache-2.0 AND BSD-2-Clause
Provides: bundled(golang(go.step.sm/cli-utils)) = 0.7.5
# Apache-2.0 AND BSD-2-Clause
Provides: bundled(golang(go.step.sm/crypto)) = 0.23.2
# Apache-2.0
Provides: bundled(golang(go.step.sm/linkedca)) = 0.19.0
# MIT
Provides: bundled(golang(go.uber.org/atomic)) = 1.9.0
# MIT
Provides: bundled(golang(go.uber.org/multierr)) = 1.6.0
# MIT
Provides: bundled(golang(go.uber.org/zap)) = 1.24.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/crypto)) = 0.5.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/exp)) = 47842c8
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/mod)) = 0.6.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/net)) = 0.7.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/sync)) = 0.1.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/sys)) = 0.5.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/term)) = 0.5.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/text)) = 0.7.0
# BSD-3-Clause
Provides: bundled(golang(golang.org/x/tools)) = 0.2.0
# Apache-2.0
Provides: bundled(golang(google.golang.org/genproto)) = 008b390
# Apache-2.0
Provides: bundled(golang(google.golang.org/grpc)) = 1.52.3
# BSD-3-Clause
Provides: bundled(golang(google.golang.org/protobuf)) = 1.28.1
# MIT
Provides: bundled(golang(gopkg.in/natefinch/lumberjack.v2)) = 2.2.1
# Apache-2.0 AND BSD-3-Clause
Provides: bundled(golang(gopkg.in/square/go-jose.v2)) = 2.6.0
# Apache-2.0 AND MIT
Provides: bundled(golang(gopkg.in/yaml.v3)) = 3.0.1
# BSD-2-Clause-Views AND BSD-3-Clause
Provides: bundled(golang(howett.net/plist)) = 1.0.0
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
@ -152,64 +299,74 @@ Requires: system-logos-httpd
Provides: webserver
%description %{common_description}
%if %{without vendor}
%gopkg
%endif
%description
Caddy is the web server with automatic HTTPS.
%prep
%goprep %{?with_vendor:-k}
%autopatch -p 1
sed -e '/mod.Version/ s/unknown/%{version}-%{release}/' -i caddy.go
%autosetup -p 1
mkdir -p src/$(dirname %{goipath})
ln -s $PWD src/%{goipath}
%build
%gobuild -o %{gobuilddir}/bin/caddy %{goipath}/cmd/caddy
export GO111MODULE=off
export GOPATH=$PWD
export LDFLAGS="-X %{goipath}.CustomVersion=v%{version}"
%gobuild -o bin/caddy %{goipath}/cmd/caddy
%install
%if %{without vendor}
%gopkginstall
%endif
# command
install -D -p -m 0755 %{gobuilddir}/bin/caddy %{buildroot}%{_bindir}/caddy
install -D -p -m 0755 bin/caddy %{buildroot}%{_bindir}/caddy
# man pages
./bin/caddy manpage --directory %{buildroot}%{_mandir}/man8
# config
install -D -p -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/caddy/Caddyfile
install -D -p -m 0644 %{S:10} %{buildroot}%{_sysconfdir}/caddy/Caddyfile
install -d -m 0755 %{buildroot}%{_sysconfdir}/caddy/Caddyfile.d
# systemd units
install -D -p -m 0644 %{S:2} %{buildroot}%{_unitdir}/caddy.service
install -D -p -m 0644 %{S:3} %{buildroot}%{_unitdir}/caddy-api.service
install -D -p -m 0644 %{S:20} %{buildroot}%{_unitdir}/caddy.service
install -D -p -m 0644 %{S:21} %{buildroot}%{_unitdir}/caddy-api.service
# data directory
install -d -m 0750 %{buildroot}%{_sharedstatedir}/caddy
# welcome page
%if %{defined fedora}
install -D -p -m 0644 %{S:4} %{buildroot}%{_datadir}/caddy/poweredby.png
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:5} %{buildroot}%{_datadir}/caddy/poweredby.png
%endif
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
# shell completion
install -D -p -m 0644 %{S:6} %{buildroot}%{_datadir}/bash-completion/completions/caddy
install -D -p -m 0644 %{S:7} %{buildroot}%{_datadir}/zsh/site-functions/_caddy
%if %{with check}
%check
%gocheck
%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}%{_datadir}/bash-completion/completions
./bin/caddy completion bash > %{buildroot}%{_datadir}/bash-completion/completions/caddy
install -d -m 0755 %{buildroot}%{_datadir}/zsh/site-functions
./bin/caddy completion zsh > %{buildroot}%{_datadir}/zsh/site-functions/_caddy
install -d -m 0755 %{buildroot}%{_datadir}/fish/vendor_completions.d
./bin/caddy completion fish > %{buildroot}%{_datadir}/fish/vendor_completions.d/caddy.fish
%check
# ensure that the version was embedded correctly
[[ "$(./bin/caddy version)" == "v%{version}" ]] || exit 1
# run the upstream tests
export GO111MODULE=off
export GOPATH=$PWD
cd src/%{goipath}
%gotest ./...
%pre
getent group caddy &> /dev/null || \
@ -274,6 +431,7 @@ fi
%license LICENSE
%doc README.md AUTHORS
%{_bindir}/caddy
%{_mandir}/man8/caddy*.8*
%{_datadir}/caddy
%{_unitdir}/caddy.service
%{_unitdir}/caddy-api.service
@ -287,14 +445,30 @@ fi
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_caddy
%if %{without vendor}
%gopkgfiles
%endif
# own parent directories in case fish is not installed
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/caddy.fish
%changelog
* Mon Oct 30 2023 Carl George <carlwgeorge@fedoraproject.org> - 2.6.4-2
- Update poweredby logos
- Add symlink for system_noindex_logo.png on EL9
- Symlink directly to fedora-testpage directory on Fedora
* Thu Aug 24 2023 Carl George <carlwgeorge@fedoraproject.org> - 2.6.4-1
- Update to version 2.6.4
- Add man pages
- Use generated shell completion files instead of static ones
- Add fish shell completions
* Wed Mar 01 2023 Carl George <carl@george.computer> - 2.4.6-6
- Backport of upstream fix for CVE-2022-29718
* Tue Jan 24 2023 Carl George <carl@george.computer> - 2.4.6-5
- Rebuild for CVE-2022-41717 in golang
* Tue Jul 19 2022 Maxwell G <gotmax@e.email> - 2.4.6-4
- Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in
golang

38
create-vendor-tarball.sh Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/bash
tag=$1
if [[ -z $tag ]]; then
echo "This script requires the tag as an argument."
exit 1
fi
set -euo pipefail
# 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 https://github.com/caddyserver/caddy.git caddy-$version
pushd caddy-$version
GOPROXY='https://proxy.golang.org,direct' go mod vendor
popd
tar --exclude .git -czf caddy-$version-vendored.tar.gz caddy-$version
rm -r caddy-$version

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before After
Before After

View file

@ -1 +1 @@
SHA512 (caddy-2.4.6-vendored.tar.gz) = d2a3d98f831f153dc408c6793331e16649fd0e543e4be8ec0cf8b4d3918d1e11f6e57a9459bb3ac2d7c3345e036252f7666c4b7535ced5d7b6f3f52162e850ea
SHA512 (caddy-2.6.4-vendored.tar.gz) = 877e5975eab7315f3327fa381f2361563b3e8711f66240029768a9d0b4b7d0b961973a7a67e5baf4ba8039659bc708a408482442b3dba9b51822bb196f3cf2e0

View file

@ -1,166 +0,0 @@
#compdef caddy
function _caddy {
local _line
_arguments -C \
"1: :(adapt build-info environ file-server fmt hash-password help list-modules reload reverse-proxy run start stop trust untrust validate version)" \
"*::arg:->args"
case $line[1] in
adapt)
__caddy_adapt
;;
build-info)
__caddy_build-info
;;
environ)
__caddy_environ
;;
file-server)
__caddy_file-server
;;
fmt)
__caddy_fmt
;;
hash-password)
__caddy_hash-password
;;
help)
__caddy_help
;;
list-modules)
__caddy_list-modules
;;
reload)
__caddy_reload
;;
reverse-proxy)
__caddy_reverse-proxy
;;
run)
__caddy_run
;;
start)
__caddy_start
;;
stop)
__caddy_stop
;;
trust)
__caddy_trust
;;
untrust)
__caddy_untrust
;;
validate)
__caddy_validate
;;
version)
__caddy_version
;;
esac
}
function __caddy_adapt {
_arguments \
"--pretty: :" \
"--validate: :" \
"--adapter: :_files" \
"--config: :_files" \
}
function __caddy_build-info {
}
function __caddy_environ {
}
function __caddy_file-server {
_arguments \
"--browse: :" \
"--templates: :" \
"--domain: :_files" \
"--listen: :_files" \
"--root: :_dirs" \
}
function __caddy_fmt {
_arguments \
"--overwrite: :" \
}
function __caddy_hash-password {
_arguments \
"--algorithm: :_files" \
"--plaintext: :_files" \
"--salt: :_files" \
}
function __caddy_help {
}
function __caddy_list-modules {
_arguments \
"--versions: :" \
}
function __caddy_reload {
_arguments \
"--adapter: :_files" \
"--config: :_files" \
"--address: :_files" \
}
function __caddy_reverse-proxy {
_arguments \
"--change-host-header: :" \
"--from: :_files" \
"--to: :_files" \
}
function __caddy_run {
_arguments \
"--environ: :" \
"--resume: :" \
"--watch: :" \
"--adapter: :_files" \
"--config: :_files" \
"--pingback: :_files" \
"--pidfile: :_files" \
}
function __caddy_start {
_arguments \
"--watch: :" \
"--adapter: :_files" \
"--config: :_files" \
"--pidfile: :_files" \
}
function __caddy_stop {
_arguments \
"--address: :_files" \
}
function __caddy_trust {
}
function __caddy_untrust {
_arguments \
"--ca: :_files" \
"--cert: :_files" \
}
function __caddy_validate {
_arguments \
"--config: :_files" \
"--adapter: :_files" \
}
function __caddy_version {
}
_caddy