Skip to content

Commit 7c9787a

Browse files
committed
Merge branch 'main' of github.com:coder/coder into cj/howto-add-rbac-frobulation
2 parents cf9df67 + 208a5be commit 7c9787a

File tree

504 files changed

+17944
-7185
lines changed

Some content is hidden

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

504 files changed

+17944
-7185
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trim_trailing_whitespace = true
77
insert_final_newline = true
88
indent_style = tab
99

10-
[*.{md,yaml,yml,tf,tfvars,nix}]
10+
[*.{yaml,yml,tf,tfvars,nix}]
1111
indent_style = space
1212
indent_size = 2
1313

.github/workflows/ci.yaml

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -117,38 +117,40 @@ jobs:
117117
run: |
118118
echo "${{ toJSON(steps.filter )}}"
119119
120-
update-flake:
121-
needs: changes
122-
if: needs.changes.outputs.gomod == 'true'
123-
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
124-
steps:
125-
- name: Checkout
126-
uses: actions/checkout@v4
127-
with:
128-
fetch-depth: 1
129-
# See: https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
130-
token: ${{ secrets.CDRCI_GITHUB_TOKEN }}
131-
132-
- name: Setup Go
133-
uses: ./.github/actions/setup-go
134-
135-
- name: Update Nix Flake SRI Hash
136-
run: ./scripts/update-flake.sh
137-
138-
# auto update flake for dependabot
139-
- uses: stefanzweifel/git-auto-commit-action@v5
140-
if: github.actor == 'dependabot[bot]'
141-
with:
142-
# Allows dependabot to still rebase!
143-
commit_message: "[dependabot skip] Update Nix Flake SRI Hash"
144-
commit_user_name: "dependabot[bot]"
145-
commit_user_email: "49699333+dependabot[bot]@users.noreply.github.com>"
146-
commit_author: "dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>"
147-
148-
# require everyone else to update it themselves
149-
- name: Ensure No Changes
150-
if: github.actor != 'dependabot[bot]'
151-
run: git diff --exit-code
120+
# Disabled due to instability. See: https://github.com/coder/coder/issues/14553
121+
# Re-enable once the flake hash calculation is stable.
122+
# update-flake:
123+
# needs: changes
124+
# if: needs.changes.outputs.gomod == 'true'
125+
# runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
126+
# steps:
127+
# - name: Checkout
128+
# uses: actions/checkout@v4
129+
# with:
130+
# fetch-depth: 1
131+
# # See: https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
132+
# token: ${{ secrets.CDRCI_GITHUB_TOKEN }}
133+
134+
# - name: Setup Go
135+
# uses: ./.github/actions/setup-go
136+
137+
# - name: Update Nix Flake SRI Hash
138+
# run: ./scripts/update-flake.sh
139+
140+
# # auto update flake for dependabot
141+
# - uses: stefanzweifel/git-auto-commit-action@v5
142+
# if: github.actor == 'dependabot[bot]'
143+
# with:
144+
# # Allows dependabot to still rebase!
145+
# commit_message: "[dependabot skip] Update Nix Flake SRI Hash"
146+
# commit_user_name: "dependabot[bot]"
147+
# commit_user_email: "49699333+dependabot[bot]@users.noreply.github.com>"
148+
# commit_author: "dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>"
149+
150+
# # require everyone else to update it themselves
151+
# - name: Ensure No Changes
152+
# if: github.actor != 'dependabot[bot]'
153+
# run: git diff --exit-code
152154

153155
lint:
154156
needs: changes
@@ -184,7 +186,7 @@ jobs:
184186
185187
# Check for any typos
186188
- name: Check for typos
187-
uses: crate-ci/typos@v1.23.6
189+
uses: crate-ci/typos@v1.24.3
188190
with:
189191
config: .github/workflows/typos.toml
190192

.github/workflows/contrib.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
- name: cla
3636
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
37-
uses: contributor-assistant/github-action@v2.4.0
37+
uses: contributor-assistant/github-action@v2.5.1
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
# the below token should have repo scope and must be manually added by you in the repository's secret

.github/workflows/dogfood.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
- "flake.nix"
1818
workflow_dispatch:
1919

20+
permissions:
21+
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
22+
id-token: write
23+
2024
jobs:
2125
build_image:
2226
if: github.actor != 'dependabot[bot]' # Skip Dependabot PRs
@@ -85,6 +89,12 @@ jobs:
8589
- name: Setup Terraform
8690
uses: ./.github/actions/setup-tf
8791

92+
- name: Authenticate to Google Cloud
93+
uses: google-github-actions/auth@v2
94+
with:
95+
workload_identity_provider: projects/573722524737/locations/global/workloadIdentityPools/github/providers/github
96+
service_account: coder-ci@coder-dogfood.iam.gserviceaccount.com
97+
8898
- name: Terraform init and validate
8999
run: |
90100
cd dogfood
@@ -110,11 +120,12 @@ jobs:
110120
cd dogfood
111121
terraform apply -auto-approve
112122
env:
113-
# Consumed by Coder CLI
123+
# Consumed by coderd provider
114124
CODER_URL: https://dev.coder.com
115125
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
116126
# Template source & details
117127
TF_VAR_CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }}
118128
TF_VAR_CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
119129
TF_VAR_CODER_TEMPLATE_DIR: ./contents
120130
TF_VAR_CODER_TEMPLATE_MESSAGE: ${{ steps.message.outputs.pr_title }}
131+
TF_LOG: info

.github/workflows/meticulous.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ func (a *agent) HandleHTTPDebugLogs(w http.ResponseWriter, r *http.Request) {
17871787
}
17881788
defer f.Close()
17891789

1790-
// Limit to 10MB.
1790+
// Limit to 10MiB.
17911791
w.WriteHeader(http.StatusOK)
17921792
_, err = io.Copy(w, io.LimitReader(f, 10*1024*1024))
17931793
if err != nil && !errors.Is(err, io.EOF) {

agent/agentssh/agentssh.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ type Config struct {
7979
// where users will land when they connect via SSH. Default is the home
8080
// directory of the user.
8181
WorkingDirectory func() string
82-
// X11SocketDir is the directory where X11 sockets are created. Default is
83-
// /tmp/.X11-unix.
84-
X11SocketDir string
82+
// X11DisplayOffset is the offset to add to the X11 display number.
83+
// Default is 10.
84+
X11DisplayOffset *int
8585
// BlockFileTransfer restricts use of file transfer applications.
8686
BlockFileTransfer bool
8787
}
@@ -124,8 +124,9 @@ func NewServer(ctx context.Context, logger slog.Logger, prometheusRegistry *prom
124124
if config == nil {
125125
config = &Config{}
126126
}
127-
if config.X11SocketDir == "" {
128-
config.X11SocketDir = filepath.Join(os.TempDir(), ".X11-unix")
127+
if config.X11DisplayOffset == nil {
128+
offset := X11DefaultDisplayOffset
129+
config.X11DisplayOffset = &offset
129130
}
130131
if config.UpdateEnv == nil {
131132
config.UpdateEnv = func(current []string) ([]string, error) { return current, nil }
@@ -273,13 +274,13 @@ func (s *Server) sessionHandler(session ssh.Session) {
273274
extraEnv := make([]string, 0)
274275
x11, hasX11 := session.X11()
275276
if hasX11 {
276-
handled := s.x11Handler(session.Context(), x11)
277+
display, handled := s.x11Handler(session.Context(), x11)
277278
if !handled {
278279
_ = session.Exit(1)
279280
logger.Error(ctx, "x11 handler failed")
280281
return
281282
}
282-
extraEnv = append(extraEnv, fmt.Sprintf("DISPLAY=:%d.0", x11.ScreenNumber))
283+
extraEnv = append(extraEnv, fmt.Sprintf("DISPLAY=localhost:%d.%d", display, x11.ScreenNumber))
283284
}
284285

285286
if s.fileTransferBlocked(session) {

0 commit comments

Comments
 (0)