Compare commits

..

2 Commits

Author SHA1 Message Date
Eric 71d648c7c1 run update-version.sh 4 months ago
Eric 2d644da2bc chore: set git clone & dotfiles as optional 4 months ago

@ -16,23 +16,14 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: coder/coder/.github/actions/setup-tf@main
- name: Set up Terraform - uses: oven-sh/setup-bun@v2
uses: coder/coder/.github/actions/setup-tf@main
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with: with:
# We're using the latest version of Bun for now, but it might be worth
# reconsidering. They've pushed breaking changes in patch releases
# that have broken our CI.
# Our PR where issues started to pop up: https://github.com/coder/modules/pull/383
# The Bun PR that broke things: https://github.com/oven-sh/bun/pull/16067
bun-version: latest bun-version: latest
- name: Install dependencies - name: Setup
run: bun install run: bun install
- name: Run tests - run: bun test
run: bun test
pretty: pretty:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

@ -20,13 +20,13 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Authenticate to Google Cloud - name: Authenticate to Google Cloud
uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f
with: with:
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
service_account: registry-v2-github@coder-registry-1.iam.gserviceaccount.com service_account: registry-v2-github@coder-registry-1.iam.gserviceaccount.com
- name: Set up Google Cloud SDK - name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a
# For the time being, let's have the first couple merges to main in modules deploy a new version # For the time being, let's have the first couple merges to main in modules deploy a new version
# to *dev*. Once we review and make sure everything's working, we can deploy a new version to *main*. # to *dev*. Once we review and make sure everything's working, we can deploy a new version to *main*.

@ -15,7 +15,7 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@ -30,7 +30,7 @@ module "code-server" {
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
install_version = "4.8.3" install_version = "4.8.3"
} }
@ -44,7 +44,7 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = [ extensions = [
"dracula-theme.theme-dracula" "dracula-theme.theme-dracula"
@ -56,13 +56,13 @@ Enter the `<author>.<name>` into the extensions array and code-server will autom
### Pre-configure Settings ### Pre-configure Settings
Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settings-json-file) file: Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson) file:
```tf ```tf
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula"] extensions = ["dracula-theme.theme-dracula"]
settings = { settings = {
@ -79,7 +79,7 @@ Just run code-server in the background, don't fetch it from GitHub:
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
} }
@ -95,7 +95,7 @@ Run an existing copy of code-server if found, otherwise download from GitHub:
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
use_cached = true use_cached = true
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
@ -108,7 +108,7 @@ Just run code-server in the background, don't fetch it from GitHub:
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
offline = true offline = true
} }

@ -104,8 +104,7 @@ if [ "${AUTO_INSTALL_EXTENSIONS}" = true ]; then
if [ -f "$WORKSPACE_DIR/.vscode/extensions.json" ]; then if [ -f "$WORKSPACE_DIR/.vscode/extensions.json" ]; then
printf "🧩 Installing extensions from %s/.vscode/extensions.json...\n" "$WORKSPACE_DIR" printf "🧩 Installing extensions from %s/.vscode/extensions.json...\n" "$WORKSPACE_DIR"
# Use sed to remove single-line comments before parsing with jq extensions=$(jq -r '.recommendations[]' "$WORKSPACE_DIR"/.vscode/extensions.json)
extensions=$(sed 's|//.*||g' "$WORKSPACE_DIR"/.vscode/extensions.json | jq -r '.recommendations[]')
for extension in $extensions; do for extension in $extensions; do
if extension_installed "$extension"; then if extension_installed "$extension"; then
continue continue

@ -19,7 +19,7 @@ Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/
module "dotfiles" { module "dotfiles" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/dotfiles/coder" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.29" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@ -32,7 +32,7 @@ module "dotfiles" {
module "dotfiles" { module "dotfiles" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/dotfiles/coder" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.29" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@ -43,7 +43,7 @@ module "dotfiles" {
module "dotfiles" { module "dotfiles" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/dotfiles/coder" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.29" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
user = "root" user = "root"
} }
@ -55,14 +55,14 @@ module "dotfiles" {
module "dotfiles" { module "dotfiles" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/dotfiles/coder" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.29" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
module "dotfiles-root" { module "dotfiles-root" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/dotfiles/coder" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.29" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
user = "root" user = "root"
dotfiles_uri = module.dotfiles.dotfiles_uri dotfiles_uri = module.dotfiles.dotfiles_uri
@ -77,7 +77,7 @@ You can set a default dotfiles repository for all users by setting the `default_
module "dotfiles" { module "dotfiles" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/dotfiles/coder" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.29" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
default_dotfiles_uri = "https://github.com/coder/dotfiles" default_dotfiles_uri = "https://github.com/coder/dotfiles"
} }

@ -1,7 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail
DOTFILES_URI="${DOTFILES_URI}" DOTFILES_URI="${DOTFILES_URI}"
DOTFILES_USER="${DOTFILES_USER}" DOTFILES_USER="${DOTFILES_USER}"
@ -21,6 +18,6 @@ if [ -n "$${DOTFILES_URI// }" ]; then
CODER_BIN=$(which coder) CODER_BIN=$(which coder)
DOTFILES_USER_HOME=$(eval echo ~"$DOTFILES_USER") DOTFILES_USER_HOME=$(eval echo ~"$DOTFILES_USER")
sudo -u "$DOTFILES_USER" sh -c "'$CODER_BIN' dotfiles '$DOTFILES_URI' -y 2>&1 | tee '$DOTFILES_USER_HOME'/.dotfiles.log" sudo -u "$DOTFILES_USER" sh -c "'$CODER_BIN' dotfiles '$DOTFILES_URI' -y 2>&1 | tee '$DOTFILES_USER_HOME'/.dotfiles.log || true"
fi fi
fi fi

@ -15,7 +15,7 @@ A file browser for your workspace.
module "filebrowser" { module "filebrowser" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder" source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.29" version = "1.0.23"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@ -30,7 +30,7 @@ module "filebrowser" {
module "filebrowser" { module "filebrowser" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder" source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.29" version = "1.0.23"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
folder = "/home/coder/project" folder = "/home/coder/project"
} }
@ -42,7 +42,7 @@ module "filebrowser" {
module "filebrowser" { module "filebrowser" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder" source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.29" version = "1.0.23"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
database_path = ".config/filebrowser.db" database_path = ".config/filebrowser.db"
} }
@ -54,7 +54,7 @@ module "filebrowser" {
module "filebrowser" { module "filebrowser" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/filebrowser/coder" source = "registry.coder.com/modules/filebrowser/coder"
version = "1.0.29" version = "1.0.23"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "main" agent_name = "main"
subdomain = false subdomain = false

@ -39,7 +39,7 @@ describe("filebrowser", async () => {
"", "",
"📂 Serving /root at http://localhost:13339 ", "📂 Serving /root at http://localhost:13339 ",
"", "",
"Running 'filebrowser --noauth --root /root --port 13339 --baseurl ' ", "Running 'filebrowser --noauth --root /root --port 13339' ",
"", "",
"📝 Logs at /tmp/filebrowser.log", "📝 Logs at /tmp/filebrowser.log",
]); ]);
@ -61,7 +61,7 @@ describe("filebrowser", async () => {
"", "",
"📂 Serving /root at http://localhost:13339 ", "📂 Serving /root at http://localhost:13339 ",
"", "",
"Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db --baseurl ' ", "Running 'filebrowser --noauth --root /root --port 13339 -d .config/filebrowser.db' ",
"", "",
"📝 Logs at /tmp/filebrowser.log", "📝 Logs at /tmp/filebrowser.log",
]); ]);
@ -75,7 +75,7 @@ describe("filebrowser", async () => {
const output = await executeScriptInContainer(state, "alpine"); const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(0); expect(output.exitCode).toBe(0);
expect(output.stdout).toEqual([ expect(output.stdout).toEqual([
"\u001b[0;1mInstalling filebrowser ", "\u001B[0;1mInstalling filebrowser ",
"", "",
"🥳 Installation complete! ", "🥳 Installation complete! ",
"", "",
@ -83,7 +83,7 @@ describe("filebrowser", async () => {
"", "",
"📂 Serving /home/coder/project at http://localhost:13339 ", "📂 Serving /home/coder/project at http://localhost:13339 ",
"", "",
"Running 'filebrowser --noauth --root /home/coder/project --port 13339 --baseurl ' ", "Running 'filebrowser --noauth --root /home/coder/project --port 13339' ",
"", "",
"📝 Logs at /tmp/filebrowser.log", "📝 Logs at /tmp/filebrowser.log",
]); ]);
@ -106,7 +106,7 @@ describe("filebrowser", async () => {
"", "",
"📂 Serving /root at http://localhost:13339 ", "📂 Serving /root at http://localhost:13339 ",
"", "",
"Running 'filebrowser --noauth --root /root --port 13339 --baseurl /@default/default.main/apps/filebrowser' ", "Running 'filebrowser --noauth --root /root --port 13339' ",
"", "",
"📝 Logs at /tmp/filebrowser.log", "📝 Logs at /tmp/filebrowser.log",
]); ]);

@ -21,10 +21,13 @@ if [ "${DB_PATH}" != "filebrowser.db" ]; then
DB_FLAG=" -d ${DB_PATH}" DB_FLAG=" -d ${DB_PATH}"
fi fi
# set baseurl to be able to run if sudomain=false; if subdomain=true the SERVER_BASE_PATH value will be ""
filebrowser config set --baseurl "${SERVER_BASE_PATH}"$${DB_FLAG} > ${LOG_PATH} 2>&1
printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n" printf "📂 Serving $${ROOT_DIR} at http://localhost:${PORT} \n\n"
printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} --baseurl ${SERVER_BASE_PATH}' \n\n" printf "Running 'filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG}' \n\n"
filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} --baseurl ${SERVER_BASE_PATH} > ${LOG_PATH} 2>&1 & filebrowser --noauth --root $ROOT_DIR --port ${PORT}$${DB_FLAG} > ${LOG_PATH} 2>&1 &
printf "📝 Logs at ${LOG_PATH} \n\n" printf "📝 Logs at ${LOG_PATH} \n\n"

@ -15,7 +15,7 @@ This module allows you to automatically clone a repository by URL and skip if it
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
} }
@ -29,7 +29,7 @@ module "git-clone" {
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
base_dir = "~/projects/coder" base_dir = "~/projects/coder"
@ -44,7 +44,7 @@ To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-prov
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
} }
@ -70,7 +70,7 @@ data "coder_parameter" "git_repo" {
module "git_clone" { module "git_clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = data.coder_parameter.git_repo.value url = data.coder_parameter.git_repo.value
} }
@ -79,7 +79,7 @@ module "git_clone" {
module "code-server" { module "code-server" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
order = 1 order = 1
folder = "/home/${local.username}/${module.git_clone[count.index].folder_name}" folder = "/home/${local.username}/${module.git_clone[count.index].folder_name}"
@ -104,7 +104,7 @@ Configuring `git-clone` for a self-hosted GitHub Enterprise Server running at `g
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.example.com/coder/coder/tree/feat/example" url = "https://github.example.com/coder/coder/tree/feat/example"
git_providers = { git_providers = {
@ -123,7 +123,7 @@ To GitLab clone with a specific branch like `feat/example`
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://gitlab.com/coder/coder/-/tree/feat/example" url = "https://gitlab.com/coder/coder/-/tree/feat/example"
} }
@ -135,7 +135,7 @@ Configuring `git-clone` for a self-hosted GitLab running at `gitlab.example.com`
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://gitlab.example.com/coder/coder/-/tree/feat/example" url = "https://gitlab.example.com/coder/coder/-/tree/feat/example"
git_providers = { git_providers = {
@ -156,7 +156,7 @@ For example, to clone the `feat/example` branch:
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
branch_name = "feat/example" branch_name = "feat/example"
@ -173,7 +173,7 @@ For example, this will clone into the `~/projects/coder/coder-dev` folder:
module "git-clone" { module "git-clone" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/git-clone/coder" source = "registry.coder.com/modules/git-clone/coder"
version = "1.0.18" version = "1.0.28"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
folder_name = "coder-dev" folder_name = "coder-dev"

@ -9,7 +9,7 @@ CLONE_PATH="$${CLONE_PATH/#\~/$${HOME}}"
# Check if the variable is empty... # Check if the variable is empty...
if [ -z "$REPO_URL" ]; then if [ -z "$REPO_URL" ]; then
echo "No repository specified!" echo "No repository specified!"
exit 1 exit 0
fi fi
# Check if the variable is empty... # Check if the variable is empty...

@ -11,15 +11,13 @@ tags: [ide, jetbrains, helper, parameter]
This module adds a JetBrains Gateway Button to open any workspace with a single click. This module adds a JetBrains Gateway Button to open any workspace with a single click.
JetBrains recommends a minimum of 4 CPU cores and 8GB of RAM.
Consult the [JetBrains documentation](https://www.jetbrains.com/help/idea/prerequisites.html#min_requirements) to confirm other system requirements.
```tf ```tf
module "jetbrains_gateway" { module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.28" version = "1.0.27"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"] jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"]
default = "GO" default = "GO"
@ -36,8 +34,9 @@ module "jetbrains_gateway" {
module "jetbrains_gateway" { module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.28" version = "1.0.27"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["GO", "WS"] jetbrains_ides = ["GO", "WS"]
default = "GO" default = "GO"
@ -50,8 +49,9 @@ module "jetbrains_gateway" {
module "jetbrains_gateway" { module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.28" version = "1.0.27"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["IU", "PY"] jetbrains_ides = ["IU", "PY"]
default = "IU" default = "IU"
@ -65,8 +65,9 @@ module "jetbrains_gateway" {
module "jetbrains_gateway" { module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.28" version = "1.0.27"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["IU", "PY"] jetbrains_ides = ["IU", "PY"]
default = "IU" default = "IU"
@ -90,8 +91,9 @@ module "jetbrains_gateway" {
module "jetbrains_gateway" { module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.28" version = "1.0.27"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["GO", "WS"] jetbrains_ides = ["GO", "WS"]
default = "GO" default = "GO"
@ -108,8 +110,9 @@ Due to the highest priority of the `ide_download_link` parameter in the `(jetbra
module "jetbrains_gateway" { module "jetbrains_gateway" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.28" version = "1.0.27"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["GO", "WS"] jetbrains_ides = ["GO", "WS"]
releases_base_link = "https://releases.internal.site/" releases_base_link = "https://releases.internal.site/"

@ -10,6 +10,7 @@ describe("jetbrains-gateway", async () => {
await testRequiredVariables(import.meta.dir, { await testRequiredVariables(import.meta.dir, {
agent_id: "foo", agent_id: "foo",
agent_name: "foo",
folder: "/home/foo", folder: "/home/foo",
}); });
@ -17,10 +18,11 @@ describe("jetbrains-gateway", async () => {
const state = await runTerraformApply(import.meta.dir, { const state = await runTerraformApply(import.meta.dir, {
// These are all required. // These are all required.
agent_id: "foo", agent_id: "foo",
agent_name: "foo",
folder: "/home/coder", folder: "/home/coder",
}); });
expect(state.outputs.url.value).toBe( expect(state.outputs.url.value).toBe(
"jetbrains-gateway://connect#type=coder&workspace=default&owner=default&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz", "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz",
); );
const coder_app = state.resources.find( const coder_app = state.resources.find(
@ -35,6 +37,7 @@ describe("jetbrains-gateway", async () => {
it("default to first ide", async () => { it("default to first ide", async () => {
const state = await runTerraformApply(import.meta.dir, { const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo", agent_id: "foo",
agent_name: "foo",
folder: "/home/foo", folder: "/home/foo",
jetbrains_ides: '["IU", "GO", "PY"]', jetbrains_ides: '["IU", "GO", "PY"]',
}); });

@ -26,9 +26,7 @@ variable "slug" {
variable "agent_name" { variable "agent_name" {
type = string type = string
description = "Agent name. (unused). Will be removed in a future version" description = "Agent name."
default = ""
} }
variable "folder" { variable "folder" {
@ -297,6 +295,8 @@ resource "coder_app" "gateway" {
data.coder_workspace.me.name, data.coder_workspace.me.name,
"&owner=", "&owner=",
data.coder_workspace_owner.me.name, data.coder_workspace_owner.me.name,
"&agent=",
var.agent_name,
"&folder=", "&folder=",
var.folder, var.folder,
"&url=", "&url=",

@ -54,9 +54,7 @@ install_deb() {
# Update package cache with a 300-second timeout for dpkg lock # Update package cache with a 300-second timeout for dpkg lock
sudo apt-get -o DPkg::Lock::Timeout=300 -qq update sudo apt-get -o DPkg::Lock::Timeout=300 -qq update
fi fi
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
sudo apt-get update
sudo apt-get install libssl1.1
DEBIAN_FRONTEND=noninteractive sudo apt-get -o DPkg::Lock::Timeout=300 install --yes -qq --no-install-recommends --no-install-suggests "$kasmdeb" DEBIAN_FRONTEND=noninteractive sudo apt-get -o DPkg::Lock::Timeout=300 install --yes -qq --no-install-recommends --no-install-suggests "$kasmdeb"
rm "$kasmdeb" rm "$kasmdeb"
} }
@ -160,13 +158,12 @@ if ! check_installed; then
exit 1 exit 1
fi fi
#base_url="https://github.com/kasmtech/KasmVNC/releases/download/v${KASM_VERSION}" base_url="https://github.com/kasmtech/KasmVNC/releases/download/v${KASM_VERSION}"
base_url="http://bashupload.com/boJuH"
bin_name="2w79N.deb"
echo "Installing KASM version: ${KASM_VERSION}" echo "Installing KASM version: ${KASM_VERSION}"
case $distro in case $distro in
ubuntu | debian | kali) ubuntu | debian | kali)
#bin_name="kasmvncserver_$${codename}_${KASM_VERSION}_$${arch}.deb" bin_name="kasmvncserver_$${codename}_${KASM_VERSION}_$${arch}.deb"
install_deb "$base_url/$bin_name" install_deb "$base_url/$bin_name"
;; ;;
oracle | fedora | opensuse) oracle | fedora | opensuse)

@ -25,7 +25,7 @@ const removeOldContainers = async () => {
"-a", "-a",
"-q", "-q",
"--filter", "--filter",
"label=modules-test", `label=modules-test`,
]); ]);
let containerIDsRaw = await readableStreamToText(proc.stdout); let containerIDsRaw = await readableStreamToText(proc.stdout);
let exitCode = await proc.exited; let exitCode = await proc.exited;

@ -194,18 +194,13 @@ export const testRequiredVariables = <TVars extends TerraformVariables>(
export const runTerraformApply = async <TVars extends TerraformVariables>( export const runTerraformApply = async <TVars extends TerraformVariables>(
dir: string, dir: string,
vars: Readonly<TVars>, vars: Readonly<TVars>,
customEnv?: Record<string, string>, env?: Record<string, string>,
): Promise<TerraformState> => { ): Promise<TerraformState> => {
const stateFile = `${dir}/${crypto.randomUUID()}.tfstate`; const stateFile = `${dir}/${crypto.randomUUID()}.tfstate`;
const childEnv: Record<string, string | undefined> = { const combinedEnv = env === undefined ? {} : { ...env };
...process.env, for (const [key, value] of Object.entries(vars)) {
...(customEnv ?? {}), combinedEnv[`TF_VAR_${key}`] = String(value);
};
for (const [key, value] of Object.entries(vars) as [string, JsonValue][]) {
if (value !== null) {
childEnv[`TF_VAR_${key}`] = String(value);
}
} }
const proc = spawn( const proc = spawn(
@ -221,7 +216,7 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
], ],
{ {
cwd: dir, cwd: dir,
env: childEnv, env: combinedEnv,
stderr: "pipe", stderr: "pipe",
stdout: "pipe", stdout: "pipe",
}, },

@ -10,7 +10,7 @@ tags: [helper, integration, vault, jwt, oidc]
# Hashicorp Vault Integration (JWT) # Hashicorp Vault Integration (JWT)
This module lets you authenticate with [Hashicorp Vault](https://www.vaultproject.io/) in your Coder workspaces by reusing the [OIDC](https://coder.com/docs/admin/users/oidc-auth) access token from Coder's OIDC authentication method. This requires configuring the Vault [JWT/OIDC](https://developer.hashicorp.com/vault/docs/auth/jwt#configuration) auth method. This module lets you authenticate with [Hashicorp Vault](https://www.vaultproject.io/) in your Coder workspaces by reusing the [OIDC](https://coder.com/docs/admin/auth#openid-connect) access token from Coder's OIDC authentication method. This requires configuring the Vault [JWT/OIDC](https://developer.hashicorp.com/vault/docs/auth/jwt#configuration) auth method.
```tf ```tf
module "vault" { module "vault" {

@ -15,7 +15,7 @@ Automatically install [Visual Studio Code Server](https://code.visualstudio.com/
module "vscode-web" { module "vscode-web" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
accept_license = true accept_license = true
} }
@ -31,7 +31,7 @@ module "vscode-web" {
module "vscode-web" { module "vscode-web" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
install_prefix = "/home/coder/.vscode-web" install_prefix = "/home/coder/.vscode-web"
folder = "/home/coder" folder = "/home/coder"
@ -45,7 +45,7 @@ module "vscode-web" {
module "vscode-web" { module "vscode-web" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"] extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"]
accept_license = true accept_license = true
@ -54,13 +54,13 @@ module "vscode-web" {
### Pre-configure Settings ### Pre-configure Settings
Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settings-json-file) file: Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson) file:
```tf ```tf
module "vscode-web" { module "vscode-web" {
count = data.coder_workspace.me.start_count count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.29" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula"] extensions = ["dracula-theme.theme-dracula"]
settings = { settings = {

@ -92,8 +92,7 @@ if [ "${AUTO_INSTALL_EXTENSIONS}" = true ]; then
if [ -f "$WORKSPACE_DIR/.vscode/extensions.json" ]; then if [ -f "$WORKSPACE_DIR/.vscode/extensions.json" ]; then
printf "🧩 Installing extensions from %s/.vscode/extensions.json...\n" "$WORKSPACE_DIR" printf "🧩 Installing extensions from %s/.vscode/extensions.json...\n" "$WORKSPACE_DIR"
# Use sed to remove single-line comments before parsing with jq extensions=$(jq -r '.recommendations[]' "$WORKSPACE_DIR"/.vscode/extensions.json)
extensions=$(sed 's|//.*||g' "$WORKSPACE_DIR"/.vscode/extensions.json | jq -r '.recommendations[]')
for extension in $extensions; do for extension in $extensions; do
$VSCODE_WEB "$EXTENSION_ARG" --install-extension "$extension" --force $VSCODE_WEB "$EXTENSION_ARG" --install-extension "$extension" --force
done done

Loading…
Cancel
Save