Skip to content

Commit ecbdf2e

Browse files
authored
Merge branch 'main' into release-docs-hotfix
2 parents 1105203 + 71d3171 commit ecbdf2e

File tree

467 files changed

+12691
-13351
lines changed

Some content is hidden

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

467 files changed

+12691
-13351
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jobs:
186186
187187
# Check for any typos
188188
- name: Check for typos
189-
uses: crate-ci/typos@v1.24.6
189+
uses: crate-ci/typos@v1.26.0
190190
with:
191191
config: .github/workflows/typos.toml
192192

.github/workflows/scorecard.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: OpenSSF Scorecard
2+
on:
3+
branch_protection_rule:
4+
schedule:
5+
- cron: "27 7 * * 3" # A random time to run weekly
6+
push:
7+
branches: ["main"]
8+
9+
permissions: read-all
10+
11+
jobs:
12+
analysis:
13+
name: Scorecard analysis
14+
runs-on: ubuntu-latest
15+
permissions:
16+
# Needed to upload the results to code-scanning dashboard.
17+
security-events: write
18+
# Needed to publish results and get a badge (see publish_results below).
19+
id-token: write
20+
21+
steps:
22+
- name: "Checkout code"
23+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
24+
with:
25+
persist-credentials: false
26+
27+
- name: "Run analysis"
28+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
29+
with:
30+
results_file: results.sarif
31+
results_format: sarif
32+
repo_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_results: true
34+
35+
# Upload the results as artifacts.
36+
- name: "Upload artifact"
37+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
38+
with:
39+
name: SARIF file
40+
path: results.sarif
41+
retention-days: 5
42+
43+
# Upload the results to GitHub's code scanning dashboard.
44+
- name: "Upload to code-scanning"
45+
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
46+
with:
47+
sarif_file: results.sarif

.github/workflows/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
echo "image=$(cat "$image_job")" >> $GITHUB_OUTPUT
115115
116116
- name: Run Trivy vulnerability scanner
117-
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8
117+
uses: aquasecurity/trivy-action@f781cce5aab226378ee181d764ab90ea0be3cdd8
118118
with:
119119
image-ref: ${{ steps.build.outputs.image }}
120120
format: sarif

.github/workflows/typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pn = "pn"
2222
EDE = "EDE"
2323
# HELO is an SMTP command
2424
HELO = "HELO"
25+
LKE = "LKE"
2526

2627
[files]
2728
extend-exclude = [

.vscode/settings.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,37 @@
66
"ASKPASS",
77
"authcheck",
88
"autostop",
9+
"autoupdate",
910
"awsidentity",
1011
"bodyclose",
1112
"buildinfo",
1213
"buildname",
14+
"Caddyfile",
1315
"circbuf",
1416
"cliflag",
1517
"cliui",
1618
"codecov",
19+
"codercom",
1720
"coderd",
1821
"coderdenttest",
1922
"coderdtest",
2023
"codersdk",
2124
"contravariance",
2225
"cronstrue",
2326
"databasefake",
27+
"dbcrypt",
2428
"dbgen",
2529
"dbmem",
2630
"dbtype",
2731
"DERP",
2832
"derphttp",
2933
"derpmap",
34+
"devcontainers",
3035
"devel",
3136
"devtunnel",
3237
"dflags",
38+
"dogfood",
39+
"dotfiles",
3340
"drpc",
3441
"drpcconn",
3542
"drpcmux",
@@ -38,18 +45,22 @@
3845
"embeddedpostgres",
3946
"enablements",
4047
"enterprisemeta",
48+
"Entra",
4149
"errgroup",
4250
"eventsourcemock",
4351
"externalauth",
4452
"Failf",
4553
"fatih",
54+
"filebrowser",
4655
"Formik",
4756
"gitauth",
57+
"Gitea",
4858
"gitsshkey",
4959
"goarch",
5060
"gographviz",
5161
"goleak",
5262
"gonet",
63+
"googleclouddns",
5364
"gossh",
5465
"gsyslog",
5566
"GTTY",
@@ -63,9 +74,11 @@
6374
"initialisms",
6475
"ipnstate",
6576
"isatty",
77+
"jetbrains",
6678
"Jobf",
6779
"Keygen",
6880
"kirsle",
81+
"knowledgebase",
6982
"Kubernetes",
7083
"ldflags",
7184
"magicsock",
@@ -77,6 +90,7 @@
7790
"namesgenerator",
7891
"namespacing",
7992
"netaddr",
93+
"netcheck",
8094
"netip",
8195
"netmap",
8296
"netns",
@@ -93,13 +107,16 @@
93107
"opty",
94108
"paralleltest",
95109
"parameterscopeid",
110+
"portsharing",
96111
"pqtype",
97112
"prometheusmetrics",
98113
"promhttp",
99114
"protobuf",
100115
"provisionerd",
101116
"provisionerdserver",
102117
"provisionersdk",
118+
"psql",
119+
"ptrace",
103120
"ptty",
104121
"ptys",
105122
"ptytest",
@@ -114,6 +131,7 @@
114131
"Signup",
115132
"slogtest",
116133
"sourcemapped",
134+
"speedtest",
117135
"spinbutton",
118136
"Srcs",
119137
"stdbuf",
@@ -154,13 +172,15 @@
154172
"turnconn",
155173
"typegen",
156174
"typesafe",
175+
"unauthenticate",
157176
"unconvert",
158-
"Untar",
159-
"Userspace",
177+
"untar",
178+
"userspace",
160179
"VMID",
161180
"walkthrough",
162181
"weblinks",
163182
"webrtc",
183+
"websockets",
164184
"wgcfg",
165185
"wgconfig",
166186
"wgengine",
@@ -172,6 +192,7 @@
172192
"workspaceapps",
173193
"workspacebuilds",
174194
"workspacename",
195+
"workspaceproxies",
175196
"wsjson",
176197
"xerrors",
177198
"xlarge",

Makefile

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@ gen: \
495495
coderd/rbac/object_gen.go \
496496
codersdk/rbacresources_gen.go \
497497
site/src/api/rbacresourcesGenerated.ts \
498-
docs/admin/prometheus.md \
499-
docs/reference/cli/README.md \
500-
docs/admin/audit-logs.md \
498+
docs/admin/integrations/prometheus.md \
499+
docs/reference/cli/index.md \
500+
docs/admin/security/audit-logs.md \
501501
coderd/apidoc/swagger.json \
502502
.prettierignore.include \
503503
.prettierignore \
@@ -525,9 +525,9 @@ gen/mark-fresh:
525525
coderd/rbac/object_gen.go \
526526
codersdk/rbacresources_gen.go \
527527
site/src/api/rbacresourcesGenerated.ts \
528-
docs/admin/prometheus.md \
529-
docs/reference/cli/README.md \
530-
docs/admin/audit-logs.md \
528+
docs/admin/integrations/prometheus.md \
529+
docs/reference/cli/index.md \
530+
docs/admin/security/audit-logs.md \
531531
coderd/apidoc/swagger.json \
532532
.prettierignore.include \
533533
.prettierignore \
@@ -537,7 +537,8 @@ gen/mark-fresh:
537537
tailnet/tailnettest/coordinatormock.go \
538538
tailnet/tailnettest/coordinateemock.go \
539539
tailnet/tailnettest/multiagentmock.go \
540-
"
540+
"
541+
541542
for file in $$files; do
542543
echo "$$file"
543544
if [ ! -f "$$file" ]; then
@@ -629,26 +630,28 @@ coderd/rbac/object_gen.go: scripts/rbacgen/rbacobject.gotmpl scripts/rbacgen/mai
629630
go run scripts/rbacgen/main.go rbac > coderd/rbac/object_gen.go
630631

631632
codersdk/rbacresources_gen.go: scripts/rbacgen/codersdk.gotmpl scripts/rbacgen/main.go coderd/rbac/object.go coderd/rbac/policy/policy.go
632-
go run scripts/rbacgen/main.go codersdk > codersdk/rbacresources_gen.go
633+
# Do no overwrite codersdk/rbacresources_gen.go directly, as it would make the file empty, breaking
634+
# the `codersdk` package and any parallel build targets.
635+
go run scripts/rbacgen/main.go codersdk > /tmp/rbacresources_gen.go
636+
mv /tmp/rbacresources_gen.go codersdk/rbacresources_gen.go
633637

634638
site/src/api/rbacresourcesGenerated.ts: scripts/rbacgen/codersdk.gotmpl scripts/rbacgen/main.go coderd/rbac/object.go coderd/rbac/policy/policy.go
635639
go run scripts/rbacgen/main.go typescript > "$@"
636640

637-
638-
docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
641+
docs/admin/integrations/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
639642
go run scripts/metricsdocgen/main.go
640643
./scripts/pnpm_install.sh
641-
pnpm exec prettier --write ./docs/admin/prometheus.md
644+
pnpm exec prettier --write ./docs/admin/integrations/prometheus.md
642645

643-
docs/reference/cli/README.md: scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES)
646+
docs/reference/cli/index.md: scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES)
644647
CI=true BASE_PATH="." go run ./scripts/clidocgen
645648
./scripts/pnpm_install.sh
646-
pnpm exec prettier --write ./docs/reference/cli/README.md ./docs/reference/cli/*.md ./docs/manifest.json
649+
pnpm exec prettier --write ./docs/reference/cli/index.md ./docs/reference/cli/*.md ./docs/manifest.json
647650

648-
docs/admin/audit-logs.md: coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
651+
docs/admin/security/audit-logs.md: coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
649652
go run scripts/auditdocgen/main.go
650653
./scripts/pnpm_install.sh
651-
pnpm exec prettier --write ./docs/admin/audit-logs.md
654+
pnpm exec prettier --write ./docs/admin/security/audit-logs.md
652655

653656
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go
654657
./scripts/apidocgen/generate.sh

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
[![release](https://img.shields.io/github/v/release/coder/coder)](https://github.com/coder/coder/releases/latest)
2727
[![godoc](https://pkg.go.dev/badge/github.com/coder/coder.svg)](https://pkg.go.dev/github.com/coder/coder)
2828
[![Go Report Card](https://goreportcard.com/badge/github.com/coder/coder/v2)](https://goreportcard.com/report/github.com/coder/coder/v2)
29+
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9511/badge)](https://www.bestpractices.dev/projects/9511)
30+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/coder/coder/badge)](https://api.securityscorecards.dev/projects/github.com/coder/coder)
2931
[![license](https://img.shields.io/github/license/coder/coder)](./LICENSE)
3032

3133
</div>
@@ -111,6 +113,7 @@ We are always working on new integrations. Please feel free to open an issue and
111113
- [**Module Registry**](https://registry.coder.com): Extend development environments with common use-cases
112114
- [**Kubernetes Log Stream**](https://github.com/coder/coder-logstream-kube): Stream Kubernetes Pod events to the Coder startup logs
113115
- [**Self-Hosted VS Code Extension Marketplace**](https://github.com/coder/code-marketplace): A private extension marketplace that works in restricted or airgapped networks integrating with [code-server](https://github.com/coder/code-server).
116+
- [**Setup Coder**](https://github.com/marketplace/actions/setup-coder): An action to setup coder CLI in GitHub workflows.
114117

115118
### Community
116119

agent/agent.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ type Options struct {
8282
SSHMaxTimeout time.Duration
8383
TailnetListenPort uint16
8484
Subsystems []codersdk.AgentSubsystem
85-
Addresses []netip.Prefix
8685
PrometheusRegistry *prometheus.Registry
8786
ReportMetadataInterval time.Duration
8887
ServiceBannerRefreshInterval time.Duration
@@ -180,7 +179,6 @@ func New(options Options) Agent {
180179
announcementBannersRefreshInterval: options.ServiceBannerRefreshInterval,
181180
sshMaxTimeout: options.SSHMaxTimeout,
182181
subsystems: options.Subsystems,
183-
addresses: options.Addresses,
184182
syscaller: options.Syscaller,
185183
modifiedProcs: options.ModifiedProcesses,
186184
processManagementTick: options.ProcessManagementTick,
@@ -250,7 +248,6 @@ type agent struct {
250248
lifecycleLastReportedIndex int // Keeps track of the last lifecycle state we successfully reported.
251249

252250
network *tailnet.Conn
253-
addresses []netip.Prefix
254251
statsReporter *statsReporter
255252
logSender *agentsdk.LogSender
256253

@@ -1112,15 +1109,14 @@ func (a *agent) updateCommandEnv(current []string) (updated []string, err error)
11121109
return updated, nil
11131110
}
11141111

1115-
func (a *agent) wireguardAddresses(agentID uuid.UUID) []netip.Prefix {
1116-
if len(a.addresses) == 0 {
1117-
return []netip.Prefix{
1118-
// This is the IP that should be used primarily.
1119-
netip.PrefixFrom(tailnet.IPFromUUID(agentID), 128),
1120-
}
1112+
func (*agent) wireguardAddresses(agentID uuid.UUID) []netip.Prefix {
1113+
return []netip.Prefix{
1114+
// This is the IP that should be used primarily.
1115+
tailnet.TailscaleServicePrefix.PrefixFromUUID(agentID),
1116+
// We'll need this address for CoderVPN, but aren't using it from clients until that feature
1117+
// is ready
1118+
tailnet.CoderServicePrefix.PrefixFromUUID(agentID),
11211119
}
1122-
1123-
return a.addresses
11241120
}
11251121

11261122
func (a *agent) trackGoroutine(fn func()) error {

0 commit comments

Comments
 (0)