Skip to content

Commit 1deae60

Browse files
committed
Merge branch 'main' into dev-container-ga
2 parents acdbe4d + 1158ca2 commit 1deae60

File tree

136 files changed

+6624
-1497
lines changed

Some content is hidden

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

136 files changed

+6624
-1497
lines changed

.devcontainer/devcontainer.json

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,22 @@
22
"name": "Development environments on your infrastructure",
33
"image": "codercom/oss-dogfood:latest",
44
"features": {
5-
// See all possible options here https://github.com/devcontainers/features/tree/main/src/docker-in-docker
65
"ghcr.io/devcontainers/features/docker-in-docker:2": {
76
"moby": "false"
87
},
98
"ghcr.io/coder/devcontainer-features/code-server:1": {
109
"auth": "none",
1110
"port": 13337
1211
},
13-
"./filebrowser": {}
12+
"./filebrowser": {
13+
"folder": "${containerWorkspaceFolder}"
14+
}
1415
},
1516
// SYS_PTRACE to enable go debugging
16-
"runArgs": [
17-
"--cap-add=SYS_PTRACE"
18-
],
17+
"runArgs": ["--cap-add=SYS_PTRACE"],
1918
"customizations": {
2019
"vscode": {
21-
"extensions": [
22-
"biomejs.biome"
23-
]
20+
"extensions": ["biomejs.biome"]
2421
},
2522
"coder": {
2623
"apps": [
@@ -43,18 +40,43 @@
4340
{
4441
"slug": "zed",
4542
"displayName": "Zed Editor",
46-
"url": "zed://ssh/${localEnv:CODER_WORKSPACE_AGENT_NAME}.${localEnv:CODER_WORKSPACE_NAME}.${localEnv:CODER_WORKSPACE_OWNER_NAME}.coder/${containerWorkspaceFolder}",
43+
"url": "zed://ssh/${localEnv:CODER_WORKSPACE_AGENT_NAME}.${localEnv:CODER_WORKSPACE_NAME}.${localEnv:CODER_WORKSPACE_OWNER_NAME}.coder${containerWorkspaceFolder}",
4744
"external": true,
4845
"icon": "/icon/zed.svg",
4946
"order": 5
47+
},
48+
// Reproduce `code-server` app here from the code-server
49+
// feature so that we can set the correct folder and order.
50+
// Currently, the order cannot be specified via option because
51+
// we parse it as a number whereas variable interpolation
52+
// results in a string. Additionally we set health check which
53+
// is not yet set in the feature.
54+
{
55+
"slug": "code-server",
56+
"displayName": "code-server",
57+
"url": "http://${localEnv:FEATURE_CODE_SERVER_OPTION_HOST:127.0.0.1}:${localEnv:FEATURE_CODE_SERVER_OPTION_PORT:8080}/?folder=${containerWorkspaceFolder}",
58+
"openIn": "${localEnv:FEATURE_CODE_SERVER_OPTION_APPOPENIN:slim-window}",
59+
"share": "${localEnv:FEATURE_CODE_SERVER_OPTION_APPSHARE:owner}",
60+
"icon": "/icon/code.svg",
61+
"group": "${localEnv:FEATURE_CODE_SERVER_OPTION_APPGROUP:Web Editors}",
62+
"order": 3,
63+
"healthCheck": {
64+
"url": "http://${localEnv:FEATURE_CODE_SERVER_OPTION_HOST:127.0.0.1}:${localEnv:FEATURE_CODE_SERVER_OPTION_PORT:8080}/healthz",
65+
"interval": 5,
66+
"threshold": 2
67+
}
5068
}
5169
]
5270
}
5371
},
5472
"mounts": [
73+
// Add a volume for the Coder home directory to persist shell history,
74+
// and speed up dotfiles init and/or personalization.
75+
"source=coder-coder-devcontainer-home,target=/home/coder,type=volume",
5576
// Mount the entire home because conditional mounts are not supported.
5677
// See: https://github.com/devcontainers/spec/issues/132
5778
"source=${localEnv:HOME},target=/mnt/home/coder,type=bind,readonly"
5879
],
59-
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"
80+
"postCreateCommand": ["./.devcontainer/scripts/post_create.sh"],
81+
"postStartCommand": ["./.devcontainer/scripts/post_start.sh"]
6082
}

.devcontainer/filebrowser/devcontainer-feature.json

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@
99
"default": "13339",
1010
"description": "The port to run filebrowser on"
1111
},
12-
// "folder": {
13-
// "type": "string",
14-
// "default": "${containerWorkspaceFolder}",
15-
// "description": "The root directory for filebrowser to serve"
16-
// },
17-
"auth": {
12+
"folder": {
1813
"type": "string",
19-
"enum": [
20-
"none",
21-
"password"
22-
],
23-
"default": "none",
24-
"description": "Authentication method (none or password)"
14+
"default": "",
15+
"description": "The root directory for filebrowser to serve"
16+
},
17+
"baseUrl": {
18+
"type": "string",
19+
"default": "",
20+
"description": "The base URL for filebrowser (e.g., /filebrowser)"
2521
}
2622
},
2723
"entrypoint": "/usr/local/bin/filebrowser-entrypoint",
@@ -41,7 +37,7 @@
4137
"healthcheck": {
4238
"url": "http://localhost:${localEnv:FEATURE_FILEBROWSER_OPTION_PORT:13339}/health",
4339
"interval": 5,
44-
"threshold": 6
40+
"threshold": 2
4541
}
4642
}
4743
]

.devcontainer/filebrowser/install.sh

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,29 @@ if ! command -v filebrowser &>/dev/null; then
1111
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
1212
fi
1313

14-
printf "🥳 Installation complete!\n\n"
15-
16-
# Create run script.
14+
# Create entrypoint.
1715
cat >/usr/local/bin/filebrowser-entrypoint <<EOF
18-
#!/bin/bash
19-
20-
printf "🛠️ Configuring filebrowser\n\n"
16+
#!/usr/bin/env bash
2117
22-
AUTH="${AUTH}"
2318
PORT="${PORT}"
24-
FOLDER="$(pwd)"
19+
FOLDER="${FOLDER:-}"
20+
FOLDER="\${FOLDER:-\$(pwd)}"
21+
BASEURL="${BASEURL:-}"
2522
LOG_PATH=/tmp/filebrowser.log
26-
export FB_DATABASE="/tmp/filebrowser.db"
23+
export FB_DATABASE="\${HOME}/.filebrowser.db"
24+
25+
printf "🛠️ Configuring filebrowser\n\n"
2726
2827
# Check if filebrowser db exists.
2928
if [[ ! -f "\${FB_DATABASE}" ]]; then
30-
filebrowser config init
31-
if [[ "\$AUTH" == "password" ]]; then
32-
filebrowser users add admin admin --perm.admin=true --viewMode=mosaic
33-
fi
34-
fi
35-
36-
# Configure filebrowser.
37-
if [[ "\$AUTH" == "none" ]]; then
38-
filebrowser config set --port="\${PORT}" --auth.method=noauth --root="\${FOLDER}"
39-
else
40-
filebrowser config set --port="\${PORT}" --auth.method=json --root="\${FOLDER}"
29+
filebrowser config init >>\${LOG_PATH} 2>&1
30+
filebrowser users add admin "" --perm.admin=true --viewMode=mosaic >>\${LOG_PATH} 2>&1
4131
fi
4232
43-
set -euo pipefail
33+
filebrowser config set --baseurl=\${BASEURL} --port=\${PORT} --auth.method=noauth --root=\${FOLDER} >>\${LOG_PATH} 2>&1
4434
4535
printf "👷 Starting filebrowser...\n\n"
36+
4637
printf "📂 Serving \${FOLDER} at http://localhost:\${PORT}\n\n"
4738
4839
filebrowser >>\${LOG_PATH} 2>&1 &
@@ -52,5 +43,4 @@ EOF
5243

5344
chmod +x /usr/local/bin/filebrowser-entrypoint
5445

55-
printf "✅ File Browser installed!\n\n"
56-
printf "🚀 Run 'filebrowser-entrypoint' to start the service\n\n"
46+
printf "🥳 Installation complete!\n\n"

.devcontainer/postCreateCommand.sh renamed to .devcontainer/scripts/post_create.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

3+
install_devcontainer_cli() {
4+
npm install -g @devcontainers/cli
5+
}
6+
37
install_ssh_config() {
48
echo "🔑 Installing SSH configuration..."
59
rsync -a /mnt/home/coder/.ssh/ ~/.ssh/
@@ -49,6 +53,7 @@ personalize() {
4953
fi
5054
}
5155

56+
install_devcontainer_cli
5257
install_ssh_config
5358
install_dotfiles
5459
personalize

.devcontainer/scripts/post_start.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
# Start Docker service if not already running.
4+
sudo service docker start

.github/workflows/ci.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
tailnet-integration: ${{ steps.filter.outputs.tailnet-integration }}
3535
steps:
3636
- name: Harden Runner
37-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
37+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
3838
with:
3939
egress-policy: audit
4040

@@ -154,7 +154,7 @@ jobs:
154154
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
155155
steps:
156156
- name: Harden Runner
157-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
157+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
158158
with:
159159
egress-policy: audit
160160

@@ -226,7 +226,7 @@ jobs:
226226
if: ${{ !cancelled() }}
227227
steps:
228228
- name: Harden Runner
229-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
229+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
230230
with:
231231
egress-policy: audit
232232

@@ -281,7 +281,7 @@ jobs:
281281
timeout-minutes: 7
282282
steps:
283283
- name: Harden Runner
284-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
284+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
285285
with:
286286
egress-policy: audit
287287

@@ -327,7 +327,7 @@ jobs:
327327
- name: Harden Runner
328328
# Harden Runner is only supported on Ubuntu runners.
329329
if: runner.os == 'Linux'
330-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
330+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
331331
with:
332332
egress-policy: audit
333333

@@ -418,7 +418,7 @@ jobs:
418418
- windows-2022
419419
steps:
420420
- name: Harden Runner
421-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
421+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
422422
with:
423423
egress-policy: audit
424424

@@ -613,7 +613,7 @@ jobs:
613613
timeout-minutes: 25
614614
steps:
615615
- name: Harden Runner
616-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
616+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
617617
with:
618618
egress-policy: audit
619619

@@ -662,7 +662,7 @@ jobs:
662662
timeout-minutes: 25
663663
steps:
664664
- name: Harden Runner
665-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
665+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
666666
with:
667667
egress-policy: audit
668668

@@ -711,7 +711,7 @@ jobs:
711711
timeout-minutes: 25
712712
steps:
713713
- name: Harden Runner
714-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
714+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
715715
with:
716716
egress-policy: audit
717717

@@ -770,7 +770,7 @@ jobs:
770770
timeout-minutes: 20
771771
steps:
772772
- name: Harden Runner
773-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
773+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
774774
with:
775775
egress-policy: audit
776776

@@ -796,7 +796,7 @@ jobs:
796796
timeout-minutes: 20
797797
steps:
798798
- name: Harden Runner
799-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
799+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
800800
with:
801801
egress-policy: audit
802802

@@ -828,7 +828,7 @@ jobs:
828828
name: ${{ matrix.variant.name }}
829829
steps:
830830
- name: Harden Runner
831-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
831+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
832832
with:
833833
egress-policy: audit
834834

@@ -901,7 +901,7 @@ jobs:
901901
if: needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true'
902902
steps:
903903
- name: Harden Runner
904-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
904+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
905905
with:
906906
egress-policy: audit
907907

@@ -981,7 +981,7 @@ jobs:
981981

982982
steps:
983983
- name: Harden Runner
984-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
984+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
985985
with:
986986
egress-policy: audit
987987

@@ -1050,7 +1050,7 @@ jobs:
10501050
if: always()
10511051
steps:
10521052
- name: Harden Runner
1053-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
1053+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
10541054
with:
10551055
egress-policy: audit
10561056

@@ -1180,7 +1180,7 @@ jobs:
11801180
IMAGE: ghcr.io/coder/coder-preview:${{ steps.build-docker.outputs.tag }}
11811181
steps:
11821182
- name: Harden Runner
1183-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
1183+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
11841184
with:
11851185
egress-policy: audit
11861186

@@ -1526,7 +1526,7 @@ jobs:
15261526
id-token: write
15271527
steps:
15281528
- name: Harden Runner
1529-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
1529+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
15301530
with:
15311531
egress-policy: audit
15321532

@@ -1545,7 +1545,7 @@ jobs:
15451545
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
15461546

15471547
- name: Set up Flux CLI
1548-
uses: fluxcd/flux2/action@a48f81a66c4ca9fbd993233ab99dd03a7cfbe09a # v2.6.2
1548+
uses: fluxcd/flux2/action@bda4c8187e436462be0d072e728b67afa215c593 # v2.6.3
15491549
with:
15501550
# Keep this and the github action up to date with the version of flux installed in dogfood cluster
15511551
version: "2.5.1"
@@ -1590,7 +1590,7 @@ jobs:
15901590
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
15911591
steps:
15921592
- name: Harden Runner
1593-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
1593+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
15941594
with:
15951595
egress-policy: audit
15961596

@@ -1625,7 +1625,7 @@ jobs:
16251625
if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
16261626
steps:
16271627
- name: Harden Runner
1628-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
1628+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
16291629
with:
16301630
egress-policy: audit
16311631

.github/workflows/docker-base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
if: github.repository_owner == 'coder'
3939
steps:
4040
- name: Harden Runner
41-
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
41+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
4242
with:
4343
egress-policy: audit
4444

0 commit comments

Comments
 (0)