Skip to content

Commit 8c25290

Browse files
committed
Merge remote-tracking branch 'upstream/master' into otel-client
2 parents 0b930c6 + 5a6b2f8 commit 8c25290

File tree

167 files changed

+8857
-2155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+8857
-2155
lines changed

.github/SECURITY.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ The Caddy project would like to make sure that it stays on top of all practicall
55

66
## Supported Versions
77

8-
| Version | Supported |
9-
| ------- | ------------------ |
10-
| 2.x | ✔️ |
11-
| 1.x | :x: |
12-
| < 1.x | :x: |
8+
| Version | Supported |
9+
| -------- | ----------|
10+
| 2.latest | ✔️ |
11+
| 1.x | :x: |
12+
| < 1.x | :x: |
1313

1414

1515
## Acceptable Scope

.github/workflows/ci.yml

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ on:
1212
- master
1313
- 2.*
1414

15+
env:
16+
# https://github.com/actions/setup-go/issues/491
17+
GOTOOLCHAIN: local
18+
1519
jobs:
1620
test:
1721
strategy:
1822
# Default is true, cancels jobs for other platforms in the matrix if one fails
1923
fail-fast: false
2024
matrix:
21-
os:
25+
os:
2226
- linux
2327
- mac
2428
- windows
25-
go:
26-
- '1.22'
27-
- '1.23'
29+
go:
30+
- '1.24'
2831

2932
include:
3033
# Set the minimum Go patch version for the given Go minor
3134
# Usable via ${{ matrix.GO_SEMVER }}
32-
- go: '1.22'
33-
GO_SEMVER: '~1.22.3'
34-
35-
- go: '1.23'
36-
GO_SEMVER: '~1.23.0'
35+
- go: '1.24'
36+
GO_SEMVER: '~1.24.1'
3737

3838
# Set some variables per OS, usable via ${{ matrix.VAR }}
3939
# OS_LABEL: the VM label from GitHub Actions (see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories)
@@ -99,7 +99,7 @@ jobs:
9999
env:
100100
CGO_ENABLED: 0
101101
run: |
102-
go build -tags nobadger -trimpath -ldflags="-w -s" -v
102+
go build -tags nobadger,nomysql,nopgx -trimpath -ldflags="-w -s" -v
103103
104104
- name: Smoke test Caddy
105105
working-directory: ./cmd/caddy
@@ -122,7 +122,7 @@ jobs:
122122
# continue-on-error: true
123123
run: |
124124
# (go test -v -coverprofile=cover-profile.out -race ./... 2>&1) > test-results/test-result.out
125-
go test -tags nobadger -v -coverprofile="cover-profile.out" -short -race ./...
125+
go test -tags nobadger,nomysql,nopgx -v -coverprofile="cover-profile.out" -short -race ./...
126126
# echo "status=$?" >> $GITHUB_OUTPUT
127127
128128
# Relevant step if we reinvestigate publishing test/coverage reports
@@ -143,7 +143,7 @@ jobs:
143143
s390x-test:
144144
name: test (s390x on IBM Z)
145145
runs-on: ubuntu-latest
146-
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
146+
if: github.event.pull_request.head.repo.full_name == 'caddyserver/caddy' && github.actor != 'dependabot[bot]'
147147
continue-on-error: true # August 2020: s390x VM is down due to weather and power issues
148148
steps:
149149
- name: Checkout code
@@ -156,13 +156,35 @@ jobs:
156156
# short sha is enough?
157157
short_sha=$(git rev-parse --short HEAD)
158158
159+
# To shorten the following lines
160+
ssh_opts="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
161+
ssh_host="$CI_USER@ci-s390x.caddyserver.com"
162+
159163
# The environment is fresh, so there's no point in keeping accepting and adding the key.
160-
rsync -arz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress --delete --exclude '.git' . "$CI_USER"@ci-s390x.caddyserver.com:/var/tmp/"$short_sha"
161-
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -t "$CI_USER"@ci-s390x.caddyserver.com "cd /var/tmp/$short_sha; go version; go env; printf "\n\n";CGO_ENABLED=0 go test -p 1 -tags nobadger -v ./..."
164+
rsync -arz -e "ssh $ssh_opts" --progress --delete --exclude '.git' . "$ssh_host":/var/tmp/"$short_sha"
165+
ssh $ssh_opts -t "$ssh_host" bash <<EOF
166+
cd /var/tmp/$short_sha
167+
go version
168+
go env
169+
printf "\n\n"
170+
retries=3
171+
exit_code=0
172+
while ((retries > 0)); do
173+
CGO_ENABLED=0 go test -p 1 -tags nobadger,nomysql,nopgx -v ./...
174+
exit_code=$?
175+
if ((exit_code == 0)); then
176+
break
177+
fi
178+
echo "\n\nTest failed: \$exit_code, retrying..."
179+
((retries--))
180+
done
181+
echo "Remote exit code: \$exit_code"
182+
exit \$exit_code
183+
EOF
162184
test_result=$?
163185
164186
# There's no need leaving the files around
165-
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$CI_USER"@ci-s390x.caddyserver.com "rm -rf /var/tmp/'$short_sha'"
187+
ssh $ssh_opts "$ssh_host" "rm -rf /var/tmp/'$short_sha'"
166188
167189
echo "Test exit code: $test_result"
168190
exit $test_result
@@ -172,6 +194,7 @@ jobs:
172194

173195
goreleaser-check:
174196
runs-on: ubuntu-latest
197+
if: github.event.pull_request.head.repo.full_name == 'caddyserver/caddy' && github.actor != 'dependabot[bot]'
175198
steps:
176199
- name: Checkout code
177200
uses: actions/checkout@v4
@@ -180,3 +203,18 @@ jobs:
180203
with:
181204
version: latest
182205
args: check
206+
- name: Install Go
207+
uses: actions/setup-go@v5
208+
with:
209+
go-version: "~1.24"
210+
check-latest: true
211+
- name: Install xcaddy
212+
run: |
213+
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
214+
xcaddy version
215+
- uses: goreleaser/goreleaser-action@v6
216+
with:
217+
version: latest
218+
args: build --single-target --snapshot
219+
env:
220+
TAG: ${{ github.head_ref || github.ref_name }}

.github/workflows/cross-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ on:
1010
- master
1111
- 2.*
1212

13+
env:
14+
# https://github.com/actions/setup-go/issues/491
15+
GOTOOLCHAIN: local
16+
1317
jobs:
1418
build:
1519
strategy:
1620
fail-fast: false
1721
matrix:
18-
goos:
22+
goos:
1923
- 'aix'
2024
- 'linux'
2125
- 'solaris'
@@ -26,18 +30,14 @@ jobs:
2630
- 'windows'
2731
- 'darwin'
2832
- 'netbsd'
29-
go:
30-
- '1.22'
31-
- '1.23'
33+
go:
34+
- '1.24'
3235

3336
include:
3437
# Set the minimum Go patch version for the given Go minor
3538
# Usable via ${{ matrix.GO_SEMVER }}
36-
- go: '1.22'
37-
GO_SEMVER: '~1.22.3'
38-
39-
- go: '1.23'
40-
GO_SEMVER: '~1.23.0'
39+
- go: '1.24'
40+
GO_SEMVER: '~1.24.1'
4141

4242
runs-on: ubuntu-latest
4343
continue-on-error: true
@@ -70,4 +70,4 @@ jobs:
7070
continue-on-error: true
7171
working-directory: ./cmd/caddy
7272
run: |
73-
GOOS=$GOOS GOARCH=$GOARCH go build -tags nobadger -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null
73+
GOOS=$GOOS GOARCH=$GOARCH go build -tags=nobadger,nomysql,nopgx -trimpath -o caddy-"$GOOS"-$GOARCH 2> /dev/null

.github/workflows/lint.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
permissions:
1414
contents: read
1515

16+
env:
17+
# https://github.com/actions/setup-go/issues/491
18+
GOTOOLCHAIN: local
19+
1620
jobs:
1721
# From https://github.com/golangci/golangci-lint-action
1822
golangci:
@@ -43,7 +47,7 @@ jobs:
4347
- uses: actions/checkout@v4
4448
- uses: actions/setup-go@v5
4549
with:
46-
go-version: '~1.23'
50+
go-version: '~1.24'
4751
check-latest: true
4852

4953
- name: golangci-lint
@@ -63,5 +67,5 @@ jobs:
6367
- name: govulncheck
6468
uses: golang/govulncheck-action@v1
6569
with:
66-
go-version-input: '~1.23.0'
70+
go-version-input: '~1.24.1'
6771
check-latest: true

.github/workflows/release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- 'v*.*.*'
77

8+
env:
9+
# https://github.com/actions/setup-go/issues/491
10+
GOTOOLCHAIN: local
11+
812
jobs:
913
release:
1014
name: Release
@@ -13,13 +17,13 @@ jobs:
1317
os:
1418
- ubuntu-latest
1519
go:
16-
- '1.23'
20+
- '1.24'
1721

1822
include:
1923
# Set the minimum Go patch version for the given Go minor
2024
# Usable via ${{ matrix.GO_SEMVER }}
21-
- go: '1.23'
22-
GO_SEMVER: '~1.23.0'
25+
- go: '1.24'
26+
GO_SEMVER: '~1.24.1'
2327

2428
runs-on: ${{ matrix.os }}
2529
# https://github.com/sigstore/cosign/issues/1258#issuecomment-1002251233
@@ -104,6 +108,10 @@ jobs:
104108
uses: anchore/sbom-action/download-syft@main
105109
- name: Syft version
106110
run: syft version
111+
- name: Install xcaddy
112+
run: |
113+
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
114+
xcaddy version
107115
# GoReleaser will take care of publishing those artifacts into the release
108116
- name: Run GoReleaser
109117
uses: goreleaser/goreleaser-action@v6

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ issues:
171171
- path: modules/logging/filters.go
172172
linters:
173173
- dupl
174+
- path: modules/caddyhttp/matchers.go
175+
linters:
176+
- dupl
177+
- path: modules/caddyhttp/vars.go
178+
linters:
179+
- dupl
174180
- path: _test\.go
175181
linters:
176182
- errcheck

.goreleaser.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ before:
1313
- cp cmd/caddy/main.go caddy-build/main.go
1414
- /bin/sh -c 'cd ./caddy-build && go mod init caddy'
1515
# prepare syso files for windows embedding
16-
- go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
17-
- /bin/sh -c 'for a in amd64 arm arm64; do XCADDY_SKIP_BUILD=1 GOOS=windows GOARCH=$a $GOPATH/bin/xcaddy build {{.Env.TAG}}; done'
16+
- /bin/sh -c 'for a in amd64 arm arm64; do XCADDY_SKIP_BUILD=1 GOOS=windows GOARCH=$a xcaddy build {{.Env.TAG}}; done'
1817
- /bin/sh -c 'mv /tmp/buildenv_*/*.syso caddy-build'
1918
# GoReleaser doesn't seem to offer {{.Tag}} at this stage, so we have to embed it into the env
2019
# so we run: TAG=$(git describe --abbrev=0) goreleaser release --rm-dist --skip-publish --skip-validate
@@ -84,6 +83,8 @@ builds:
8483
- -s -w
8584
tags:
8685
- nobadger
86+
- nomysql
87+
- nopgx
8788

8889
signs:
8990
- cmd: cosign
@@ -110,7 +111,7 @@ archives:
110111
- id: default
111112
format_overrides:
112113
- goos: windows
113-
format: zip
114+
formats: zip
114115
name_template: >-
115116
{{ .ProjectName }}_
116117
{{- .Version }}_
@@ -191,6 +192,9 @@ nfpms:
191192
preremove: ./caddy-dist/scripts/preremove.sh
192193
postremove: ./caddy-dist/scripts/postremove.sh
193194

195+
provides:
196+
- httpd
197+
194198
release:
195199
github:
196200
owner: caddyserver

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<a href="https://github.com/caddyserver/caddy/actions/workflows/ci.yml"><img src="https://github.com/caddyserver/caddy/actions/workflows/ci.yml/badge.svg"></a>
1717
<a href="https://pkg.go.dev/github.com/caddyserver/caddy/v2"><img src="https://img.shields.io/badge/godoc-reference-%23007d9c.svg"></a>
1818
<br>
19-
<a href="https://twitter.com/caddyserver" title="@caddyserver on Twitter"><img src="https://img.shields.io/badge/twitter-@caddyserver-55acee.svg" alt="@caddyserver on Twitter"></a>
19+
<a href="https://x.com/caddyserver" title="@caddyserver on Twitter"><img src="https://img.shields.io/twitter/follow/caddyserver" alt="@caddyserver on Twitter"></a>
2020
<a href="https://caddy.community" title="Caddy Forum"><img src="https://img.shields.io/badge/community-forum-ff69b4.svg" alt="Caddy Forum"></a>
2121
<br>
2222
<a href="https://sourcegraph.com/github.com/caddyserver/caddy?badge" title="Caddy on Sourcegraph"><img src="https://sourcegraph.com/github.com/caddyserver/caddy/-/badge.svg" alt="Caddy on Sourcegraph"></a>
@@ -67,6 +67,7 @@
6767
- Fully-managed local CA for internal names & IPs
6868
- Can coordinate with other Caddy instances in a cluster
6969
- Multi-issuer fallback
70+
- Encrypted ClientHello (ECH) support
7071
- **Stays up when other servers go down** due to TLS/OCSP/certificate-related issues
7172
- **Production-ready** after serving trillions of requests and managing millions of TLS certificates
7273
- **Scales to hundreds of thousands of sites** as proven in production
@@ -87,7 +88,7 @@ See [our online documentation](https://caddyserver.com/docs/install) for other i
8788

8889
Requirements:
8990

90-
- [Go 1.22.3 or newer](https://golang.org/dl/)
91+
- [Go 1.24.0 or newer](https://golang.org/dl/)
9192

9293
### For development
9394

@@ -131,7 +132,7 @@ $ xcaddy build
131132
4. Initialize a Go module: `go mod init caddy`
132133
5. (Optional) Pin Caddy version: `go get github.com/caddyserver/caddy/v2@version` replacing `version` with a git tag, commit, or branch name.
133134
6. (Optional) Add plugins by adding their import: `_ "import/path/here"`
134-
7. Compile: `go build`
135+
7. Compile: `go build -tags=nobadger,nomysql,nopgx`
135136

136137

137138

@@ -176,7 +177,7 @@ The docs are also open source. You can contribute to them here: https://github.c
176177

177178
## Getting help
178179

179-
- We advise companies using Caddy to secure a support contract through [Ardan Labs](https://www.ardanlabs.com/my/contact-us?dd=caddy) before help is needed.
180+
- We advise companies using Caddy to secure a support contract through [Ardan Labs](https://www.ardanlabs.com) before help is needed.
180181

181182
- A [sponsorship](https://github.com/sponsors/mholt) goes a long way! We can offer private help to sponsors. If Caddy is benefitting your company, please consider a sponsorship. This not only helps fund full-time work to ensure the longevity of the project, it provides your company the resources, support, and discounts you need; along with being a great look for your company to your customers and potential customers!
182183

@@ -192,8 +193,8 @@ Matthew Holt began developing Caddy in 2014 while studying computer science at B
192193

193194
**The name "Caddy" is trademarked.** The name of the software is "Caddy", not "Caddy Server" or "CaddyServer". Please call it "Caddy" or, if you wish to clarify, "the Caddy web server". Caddy is a registered trademark of Stack Holdings GmbH.
194195

195-
- _Project on Twitter: [@caddyserver](https://twitter.com/caddyserver)_
196-
- _Author on Twitter: [@mholt6](https://twitter.com/mholt6)_
196+
- _Project on X: [@caddyserver](https://x.com/caddyserver)_
197+
- _Author on X: [@mholt6](https://x.com/mholt6)_
197198

198199
Caddy is a project of [ZeroSSL](https://zerossl.com), a Stack Holdings company.
199200

0 commit comments

Comments
 (0)