Skip to content

Commit b06aebe

Browse files
authored
Merge branch 'master' into 6956-feat-sort-files
2 parents ccb741e + 3b4d966 commit b06aebe

File tree

86 files changed

+2122
-461
lines changed

Some content is hidden

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

86 files changed

+2122
-461
lines changed

.github/SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ We consider publicly-registered domain names to be public information. This nece
4848

4949
It will speed things up if you suggest a working patch, such as a code diff, and explain why and how it works. Reports that are not actionable, do not contain enough information, are too pushy/demanding, or are not able to convince us that it is a viable and practical attack on the web server itself may be deferred to a later time or possibly ignored, depending on available resources. Priority will be given to credible, responsible reports that are constructive, specific, and actionable. (We get a lot of invalid reports.) Thank you for understanding.
5050

51-
When you are ready, please email Matt Holt (the author) directly: matt at dyanim dot com.
51+
When you are ready, please submit a [new private vulnerability report](https://github.com/caddyserver/caddy/security/advisories/new).
5252

53-
Please don't encrypt the email body. It only makes the process more complicated.
53+
Please don't encrypt the message. It only makes the process more complicated.
5454

5555
Please also understand that due to our nature as an open source project, we do not have a budget to award security bounties. We can only thank you.
5656

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "monthly"
8+
9+
- package-ecosystem: gomod
10+
directory: /
11+
schedule:
12+
interval: weekly

.github/workflows/ci.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
# https://github.com/actions/setup-go/issues/491
1717
GOTOOLCHAIN: local
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
test:
2124
strategy:
@@ -55,13 +58,21 @@ jobs:
5558
SUCCESS: 'True'
5659

5760
runs-on: ${{ matrix.OS_LABEL }}
58-
61+
permissions:
62+
contents: read
63+
pull-requests: read
64+
actions: write # to allow uploading artifacts and cache
5965
steps:
66+
- name: Harden the runner (Audit all outbound calls)
67+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
68+
with:
69+
egress-policy: audit
70+
6071
- name: Checkout code
61-
uses: actions/checkout@v4
72+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6273

6374
- name: Install Go
64-
uses: actions/setup-go@v5
75+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
6576
with:
6677
go-version: ${{ matrix.GO_SEMVER }}
6778
check-latest: true
@@ -108,7 +119,7 @@ jobs:
108119
./caddy stop
109120
110121
- name: Publish Build Artifact
111-
uses: actions/upload-artifact@v4
122+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
112123
with:
113124
name: caddy_${{ runner.os }}_go${{ matrix.go }}_${{ steps.vars.outputs.short_sha }}
114125
path: ${{ matrix.CADDY_BIN_PATH }}
@@ -142,12 +153,21 @@ jobs:
142153

143154
s390x-test:
144155
name: test (s390x on IBM Z)
156+
permissions:
157+
contents: read
158+
pull-requests: read
145159
runs-on: ubuntu-latest
146160
if: github.event.pull_request.head.repo.full_name == 'caddyserver/caddy' && github.actor != 'dependabot[bot]'
147161
continue-on-error: true # August 2020: s390x VM is down due to weather and power issues
148162
steps:
163+
- name: Harden the runner (Audit all outbound calls)
164+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
165+
with:
166+
egress-policy: audit
167+
allowed-endpoints: ci-s390x.caddyserver.com:22
168+
149169
- name: Checkout code
150-
uses: actions/checkout@v4
170+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151171
- name: Run Tests
152172
run: |
153173
set +e
@@ -194,25 +214,33 @@ jobs:
194214

195215
goreleaser-check:
196216
runs-on: ubuntu-latest
217+
permissions:
218+
contents: read
219+
pull-requests: read
197220
if: github.event.pull_request.head.repo.full_name == 'caddyserver/caddy' && github.actor != 'dependabot[bot]'
198221
steps:
222+
- name: Harden the runner (Audit all outbound calls)
223+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
224+
with:
225+
egress-policy: audit
226+
199227
- name: Checkout code
200-
uses: actions/checkout@v4
228+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
201229

202-
- uses: goreleaser/goreleaser-action@v6
230+
- uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
203231
with:
204232
version: latest
205233
args: check
206234
- name: Install Go
207-
uses: actions/setup-go@v5
235+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
208236
with:
209237
go-version: "~1.24"
210238
check-latest: true
211239
- name: Install xcaddy
212240
run: |
213241
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
214242
xcaddy version
215-
- uses: goreleaser/goreleaser-action@v6
243+
- uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
216244
with:
217245
version: latest
218246
args: build --single-target --snapshot

.github/workflows/cross-build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ env:
1414
# https://github.com/actions/setup-go/issues/491
1515
GOTOOLCHAIN: local
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
strategy:
@@ -40,13 +43,21 @@ jobs:
4043
GO_SEMVER: '~1.24.1'
4144

4245
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
48+
pull-requests: read
4349
continue-on-error: true
4450
steps:
51+
- name: Harden the runner (Audit all outbound calls)
52+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
53+
with:
54+
egress-policy: audit
55+
4556
- name: Checkout code
46-
uses: actions/checkout@v4
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4758

4859
- name: Install Go
49-
uses: actions/setup-go@v5
60+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
5061
with:
5162
go-version: ${{ matrix.GO_SEMVER }}
5263
check-latest: true

.github/workflows/lint.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,19 @@ jobs:
4444
runs-on: ${{ matrix.OS_LABEL }}
4545

4646
steps:
47-
- uses: actions/checkout@v4
48-
- uses: actions/setup-go@v5
47+
- name: Harden the runner (Audit all outbound calls)
48+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
49+
with:
50+
egress-policy: audit
51+
52+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4954
with:
5055
go-version: '~1.24'
5156
check-latest: true
5257

5358
- name: golangci-lint
54-
uses: golangci/golangci-lint-action@v6
59+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
5560
with:
5661
version: latest
5762

@@ -62,10 +67,39 @@ jobs:
6267
# only-new-issues: true
6368

6469
govulncheck:
70+
permissions:
71+
contents: read
72+
pull-requests: read
6573
runs-on: ubuntu-latest
6674
steps:
75+
- name: Harden the runner (Audit all outbound calls)
76+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
77+
with:
78+
egress-policy: audit
79+
6780
- name: govulncheck
68-
uses: golang/govulncheck-action@v1
81+
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
6982
with:
7083
go-version-input: '~1.24.1'
7184
check-latest: true
85+
86+
dependency-review:
87+
runs-on: ubuntu-latest
88+
permissions:
89+
contents: read
90+
pull-requests: write
91+
steps:
92+
- name: Harden the runner (Audit all outbound calls)
93+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
94+
with:
95+
egress-policy: audit
96+
97+
- name: 'Checkout Repository'
98+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99+
- name: 'Dependency Review'
100+
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
101+
with:
102+
comment-summary-in-pr: on-failure
103+
# https://github.com/actions/dependency-review-action/issues/430#issuecomment-1468975566
104+
base-ref: ${{ github.event.pull_request.base.sha || 'master' }}
105+
head-ref: ${{ github.event.pull_request.head.sha || github.ref }}

.github/workflows/release.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ env:
99
# https://github.com/actions/setup-go/issues/491
1010
GOTOOLCHAIN: local
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
release:
1417
name: Release
@@ -35,19 +38,24 @@ jobs:
3538
contents: write
3639

3740
steps:
41+
- name: Harden the runner (Audit all outbound calls)
42+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
43+
with:
44+
egress-policy: audit
45+
3846
- name: Checkout code
39-
uses: actions/checkout@v4
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4048
with:
4149
fetch-depth: 0
4250

4351
- name: Install Go
44-
uses: actions/setup-go@v5
52+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4553
with:
4654
go-version: ${{ matrix.GO_SEMVER }}
4755
check-latest: true
4856

4957
# Force fetch upstream tags -- because 65 minutes
50-
# tl;dr: actions/checkout@v4 runs this line:
58+
# tl;dr: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 runs this line:
5159
# git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +ebc278ec98bb24f2852b61fde2a9bf2e3d83818b:refs/tags/
5260
# which makes its own local lightweight tag, losing all the annotations in the process. Our earlier script ran:
5361
# git fetch --prune --unshallow
@@ -101,11 +109,11 @@ jobs:
101109
git verify-tag "${{ steps.vars.outputs.version_tag }}" || exit 1
102110
103111
- name: Install Cosign
104-
uses: sigstore/cosign-installer@main
112+
uses: sigstore/cosign-installer@e9a05e6d32d7ed22b5656cd874ef31af58d05bfa # main
105113
- name: Cosign version
106114
run: cosign version
107115
- name: Install Syft
108-
uses: anchore/sbom-action/download-syft@main
116+
uses: anchore/sbom-action/download-syft@9246b90769f852b3a8921f330c59e0b3f439d6e9 # main
109117
- name: Syft version
110118
run: syft version
111119
- name: Install xcaddy
@@ -114,7 +122,7 @@ jobs:
114122
xcaddy version
115123
# GoReleaser will take care of publishing those artifacts into the release
116124
- name: Run GoReleaser
117-
uses: goreleaser/goreleaser-action@v6
125+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
118126
with:
119127
version: latest
120128
args: release --clean --timeout 60m

.github/workflows/release_published.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
release:
66
types: [published]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
release:
1013
name: Release Published
@@ -13,20 +16,28 @@ jobs:
1316
os:
1417
- ubuntu-latest
1518
runs-on: ${{ matrix.os }}
16-
19+
permissions:
20+
contents: read
21+
pull-requests: read
22+
actions: write
1723
steps:
1824

1925
# See https://github.com/peter-evans/repository-dispatch
26+
- name: Harden the runner (Audit all outbound calls)
27+
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
28+
with:
29+
egress-policy: audit
30+
2031
- name: Trigger event on caddyserver/dist
21-
uses: peter-evans/repository-dispatch@v3
32+
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
2233
with:
2334
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
2435
repository: caddyserver/dist
2536
event-type: release-tagged
2637
client-payload: '{"tag": "${{ github.event.release.tag_name }}"}'
2738

2839
- name: Trigger event on caddyserver/caddy-docker
29-
uses: peter-evans/repository-dispatch@v3
40+
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
3041
with:
3142
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
3243
repository: caddyserver/caddy-docker

0 commit comments

Comments
 (0)