Compare commits
10 Commits
v1.0.29
...
atif/multi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b88d50a7c9 | ||
|
|
cd6aa274f1 | ||
|
|
2f51d70fb7 | ||
|
|
dbf3c47f45 | ||
|
|
d45f2e6ad1 | ||
|
|
70020d8b8c | ||
|
|
937ffcd47b | ||
|
|
5bc2aa4aa0 | ||
|
|
4452630a7e | ||
|
|
27e3faf31c |
35
.github/scripts/check.sh
vendored
35
.github/scripts/check.sh
vendored
@@ -48,7 +48,7 @@ update_component_status() {
|
|||||||
|
|
||||||
# Function to create an incident
|
# Function to create an incident
|
||||||
create_incident() {
|
create_incident() {
|
||||||
local incident_name="Degraded Service"
|
local incident_name="Testing Instatus"
|
||||||
local message="The following modules are experiencing issues:\n"
|
local message="The following modules are experiencing issues:\n"
|
||||||
for i in "${!failures[@]}"; do
|
for i in "${!failures[@]}"; do
|
||||||
message+="$((i + 1)). ${failures[$i]}\n"
|
message+="$((i + 1)). ${failures[$i]}\n"
|
||||||
@@ -59,7 +59,7 @@ create_incident() {
|
|||||||
component_status="MAJOROUTAGE"
|
component_status="MAJOROUTAGE"
|
||||||
fi
|
fi
|
||||||
# see https://instatus.com/help/api/incidents
|
# see https://instatus.com/help/api/incidents
|
||||||
incident_id=$(curl -s -X POST "https://api.instatus.com/v1/$INSTATUS_PAGE_ID/incidents" \
|
response=$(curl -s -X POST "https://api.instatus.com/v1/$INSTATUS_PAGE_ID/incidents" \
|
||||||
-H "Authorization: Bearer $INSTATUS_API_KEY" \
|
-H "Authorization: Bearer $INSTATUS_API_KEY" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{
|
-d "{
|
||||||
@@ -74,25 +74,10 @@ create_incident() {
|
|||||||
\"status\": \"PARTIALOUTAGE\"
|
\"status\": \"PARTIALOUTAGE\"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}" | jq -r '.id')
|
}")
|
||||||
|
|
||||||
echo "Created incident with ID: $incident_id"
|
incident_id=$(echo "$response" | jq -r '.id')
|
||||||
}
|
echo "$incident_id"
|
||||||
|
|
||||||
# Function to check for existing unresolved incidents
|
|
||||||
check_existing_incident() {
|
|
||||||
# Fetch the latest incidents with status not equal to "RESOLVED"
|
|
||||||
local unresolved_incidents=$(curl -s -X GET "https://api.instatus.com/v1/$INSTATUS_PAGE_ID/incidents" \
|
|
||||||
-H "Authorization: Bearer $INSTATUS_API_KEY" \
|
|
||||||
-H "Content-Type: application/json" | jq -r '.incidents[] | select(.status != "RESOLVED") | .id')
|
|
||||||
|
|
||||||
if [[ -n "$unresolved_incidents" ]]; then
|
|
||||||
echo "Unresolved incidents found: $unresolved_incidents"
|
|
||||||
return 0 # Indicate that there are unresolved incidents
|
|
||||||
else
|
|
||||||
echo "No unresolved incidents found."
|
|
||||||
return 1 # Indicate that no unresolved incidents exist
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
force_redeploy_registry () {
|
force_redeploy_registry () {
|
||||||
@@ -189,15 +174,13 @@ else
|
|||||||
update_component_status "PARTIALOUTAGE"
|
update_component_status "PARTIALOUTAGE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if there is an existing incident before creating a new one
|
# Create a new incident
|
||||||
if ! check_existing_incident; then
|
incident_id=$(create_incident)
|
||||||
create_incident
|
echo "Created incident with ID: $incident_id"
|
||||||
fi
|
|
||||||
|
|
||||||
# If a module is down, force a reployment to try getting things back online
|
# If a module is down, force a reployment to try getting things back online
|
||||||
# ASAP
|
# ASAP
|
||||||
# EDIT: registry.coder.com is no longer hosted on vercel
|
force_redeploy_registry
|
||||||
#force_redeploy_registry
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit "${status}"
|
exit "${status}"
|
||||||
|
|||||||
19
.github/workflows/ci.yaml
vendored
19
.github/workflows/ci.yaml
vendored
@@ -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:
|
||||||
|
|||||||
37
.github/workflows/deploy-registry.yaml
vendored
37
.github/workflows/deploy-registry.yaml
vendored
@@ -1,37 +0,0 @@
|
|||||||
name: deploy-registry
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# Set id-token permission for gcloud
|
|
||||||
# Adding a comment because retriggering the build manually hung? I am the lord of devops and you will bend?
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
|
||||||
uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935
|
|
||||||
with:
|
|
||||||
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
|
|
||||||
service_account: registry-v2-github@coder-registry-1.iam.gserviceaccount.com
|
|
||||||
|
|
||||||
- name: Set up Google Cloud SDK
|
|
||||||
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a
|
|
||||||
|
|
||||||
# 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*.
|
|
||||||
# Maybe in the future we could automate this based on the result of E2E tests.
|
|
||||||
- name: Deploy to dev.registry.coder.com
|
|
||||||
run: |
|
|
||||||
gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch dev
|
|
||||||
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,6 +2,3 @@
|
|||||||
node_modules
|
node_modules
|
||||||
*.tfstate
|
*.tfstate
|
||||||
*.tfstate.lock.info
|
*.tfstate.lock.info
|
||||||
|
|
||||||
# Ignore generated credentials from google-github-actions/auth
|
|
||||||
gha-creds-*.json
|
|
||||||
@@ -13,7 +13,6 @@ tags: [helper]
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "MODULE_NAME" {
|
module "MODULE_NAME" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/MODULE_NAME/coder"
|
source = "registry.coder.com/modules/MODULE_NAME/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
}
|
}
|
||||||
@@ -29,7 +28,6 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "MODULE_NAME" {
|
module "MODULE_NAME" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/MODULE_NAME/coder"
|
source = "registry.coder.com/modules/MODULE_NAME/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -47,7 +45,6 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "MODULE_NAME" {
|
module "MODULE_NAME" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/MODULE_NAME/coder"
|
source = "registry.coder.com/modules/MODULE_NAME/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ e.g.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.2"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ A module that adds Apache Airflow in your Coder template.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "airflow" {
|
module "airflow" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/apache-airflow/coder"
|
source = "registry.coder.com/modules/apache-airflow/coder"
|
||||||
version = "1.0.13"
|
version = "1.0.13"
|
||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ Customize the preselected parameter value:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "aws-region" {
|
module "aws-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/aws-region/coder"
|
source = "registry.coder.com/modules/aws-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "us-east-1"
|
default = "us-east-1"
|
||||||
@@ -37,7 +36,6 @@ Change the display name and icon for a region using the corresponding maps:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "aws-region" {
|
module "aws-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/aws-region/coder"
|
source = "registry.coder.com/modules/aws-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "ap-south-1"
|
default = "ap-south-1"
|
||||||
@@ -64,7 +62,6 @@ Hide the Asia Pacific regions Seoul and Osaka:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "aws-region" {
|
module "aws-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/aws-region/coder"
|
source = "registry.coder.com/modules/aws-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
exclude = ["ap-northeast-2", "ap-northeast-3"]
|
exclude = ["ap-northeast-2", "ap-northeast-3"]
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ This module adds a parameter with all Azure regions, allowing developers to sele
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "azure_region" {
|
module "azure_region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/azure-region/coder"
|
source = "registry.coder.com/modules/azure-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "eastus"
|
default = "eastus"
|
||||||
@@ -34,7 +33,6 @@ Change the display name and icon for a region using the corresponding maps:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "azure-region" {
|
module "azure-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/azure-region/coder"
|
source = "registry.coder.com/modules/azure-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
custom_names = {
|
custom_names = {
|
||||||
@@ -58,7 +56,6 @@ Hide all regions in Australia except australiacentral:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "azure-region" {
|
module "azure-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/azure-region/coder"
|
source = "registry.coder.com/modules/azure-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
exclude = [
|
exclude = [
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -28,9 +27,8 @@ module "code-server" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
install_version = "4.8.3"
|
install_version = "4.8.3"
|
||||||
}
|
}
|
||||||
@@ -42,9 +40,8 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
extensions = [
|
extensions = [
|
||||||
"dracula-theme.theme-dracula"
|
"dracula-theme.theme-dracula"
|
||||||
@@ -60,9 +57,8 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
extensions = ["dracula-theme.theme-dracula"]
|
extensions = ["dracula-theme.theme-dracula"]
|
||||||
settings = {
|
settings = {
|
||||||
@@ -77,9 +73,8 @@ Just run code-server in the background, don't fetch it from GitHub:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
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"]
|
||||||
}
|
}
|
||||||
@@ -93,9 +88,8 @@ Run an existing copy of code-server if found, otherwise download from GitHub:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
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"]
|
||||||
@@ -106,9 +100,8 @@ Just run code-server in the background, don't fetch it from GitHub:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
offline = true
|
offline = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ variable "slug" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "settings" {
|
variable "settings" {
|
||||||
type = any
|
type = map(string)
|
||||||
description = "A map of settings to apply to code-server."
|
description = "A map of settings to apply to code-server."
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Automatically logs the user into Coder when creating their workspace.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "coder-login" {
|
module "coder-login" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/coder-login/coder"
|
source = "registry.coder.com/modules/coder-login/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/cursor-coder)
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "cursor" {
|
module "cursor" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/cursor/coder"
|
source = "registry.coder.com/modules/cursor/coder"
|
||||||
version = "1.0.19"
|
version = "1.0.19"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -28,7 +27,6 @@ module "cursor" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "cursor" {
|
module "cursor" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/cursor/coder"
|
source = "registry.coder.com/modules/cursor/coder"
|
||||||
version = "1.0.19"
|
version = "1.0.19"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -17,9 +17,8 @@ Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -30,9 +29,8 @@ module "dotfiles" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -41,9 +39,8 @@ module "dotfiles" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
user = "root"
|
user = "root"
|
||||||
}
|
}
|
||||||
@@ -53,16 +50,14 @@ module "dotfiles" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
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.18"
|
||||||
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
|
|
||||||
source = "registry.coder.com/modules/dotfiles/coder"
|
source = "registry.coder.com/modules/dotfiles/coder"
|
||||||
version = "1.0.29"
|
version = "1.0.18"
|
||||||
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
|
||||||
@@ -75,9 +70,8 @@ You can set a default dotfiles repository for all users by setting the `default_
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "dotfiles" {
|
module "dotfiles" {
|
||||||
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.18"
|
||||||
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}"
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ Customize the preselected parameter value:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "exoscale-instance-type" {
|
module "exoscale-instance-type" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/exoscale-instance-type/coder"
|
source = "registry.coder.com/modules/exoscale-instance-type/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "standard.medium"
|
default = "standard.medium"
|
||||||
@@ -45,7 +44,6 @@ Change the display name a type using the corresponding maps:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "exoscale-instance-type" {
|
module "exoscale-instance-type" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/exoscale-instance-type/coder"
|
source = "registry.coder.com/modules/exoscale-instance-type/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "standard.medium"
|
default = "standard.medium"
|
||||||
@@ -80,7 +78,6 @@ Show only gpu1 types
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "exoscale-instance-type" {
|
module "exoscale-instance-type" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/exoscale-instance-type/coder"
|
source = "registry.coder.com/modules/exoscale-instance-type/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "gpu.large"
|
default = "gpu.large"
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ Customize the preselected parameter value:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "exoscale-zone" {
|
module "exoscale-zone" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/exoscale-zone/coder"
|
source = "registry.coder.com/modules/exoscale-zone/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "ch-dk-2"
|
default = "ch-dk-2"
|
||||||
@@ -44,7 +43,6 @@ Change the display name and icon for a zone using the corresponding maps:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "exoscale-zone" {
|
module "exoscale-zone" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/exoscale-zone/coder"
|
source = "registry.coder.com/modules/exoscale-zone/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = "at-vie-1"
|
default = "at-vie-1"
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ A file browser for your workspace.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "filebrowser" {
|
module "filebrowser" {
|
||||||
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
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -28,9 +27,8 @@ module "filebrowser" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "filebrowser" {
|
module "filebrowser" {
|
||||||
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"
|
||||||
}
|
}
|
||||||
@@ -40,9 +38,8 @@ module "filebrowser" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "filebrowser" {
|
module "filebrowser" {
|
||||||
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"
|
||||||
}
|
}
|
||||||
@@ -52,9 +49,7 @@ module "filebrowser" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "filebrowser" {
|
module "filebrowser" {
|
||||||
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"
|
|
||||||
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,6 @@ We can use the simplest format here, only adding a default selection as the `atl
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "fly-region" {
|
module "fly-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/fly-region/coder"
|
source = "registry.coder.com/modules/fly-region/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
default = "atl"
|
default = "atl"
|
||||||
@@ -32,7 +31,6 @@ The regions argument can be used to display only the desired regions in the Code
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "fly-region" {
|
module "fly-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/fly-region/coder"
|
source = "registry.coder.com/modules/fly-region/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
default = "ams"
|
default = "ams"
|
||||||
@@ -48,7 +46,6 @@ Set custom icons and names with their respective maps.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "fly-region" {
|
module "fly-region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/fly-region/coder"
|
source = "registry.coder.com/modules/fly-region/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
default = "ams"
|
default = "ams"
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ This module adds Google Cloud Platform regions to your Coder template.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "gcp_region" {
|
module "gcp_region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/gcp-region/coder"
|
source = "registry.coder.com/modules/gcp-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
regions = ["us", "europe"]
|
regions = ["us", "europe"]
|
||||||
@@ -34,7 +33,6 @@ Note: setting `gpu_only = true` and using a default region without GPU support,
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "gcp_region" {
|
module "gcp_region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/gcp-region/coder"
|
source = "registry.coder.com/modules/gcp-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
default = ["us-west1-a"]
|
default = ["us-west1-a"]
|
||||||
@@ -51,7 +49,6 @@ resource "google_compute_instance" "example" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "gcp_region" {
|
module "gcp_region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/gcp-region/coder"
|
source = "registry.coder.com/modules/gcp-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
regions = ["europe-west"]
|
regions = ["europe-west"]
|
||||||
@@ -67,7 +64,6 @@ resource "google_compute_instance" "example" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "gcp_region" {
|
module "gcp_region" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/gcp-region/coder"
|
source = "registry.coder.com/modules/gcp-region/coder"
|
||||||
version = "1.0.12"
|
version = "1.0.12"
|
||||||
regions = ["us", "europe"]
|
regions = ["us", "europe"]
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ This module allows you to automatically clone a repository by URL and skip if it
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -27,7 +26,6 @@ module "git-clone" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -42,7 +40,6 @@ To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-prov
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -68,7 +65,6 @@ data "coder_parameter" "git_repo" {
|
|||||||
|
|
||||||
# Clone the repository for branch `feat/example`
|
# Clone the repository for branch `feat/example`
|
||||||
module "git_clone" {
|
module "git_clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -77,24 +73,23 @@ module "git_clone" {
|
|||||||
|
|
||||||
# Create a code-server instance for the cloned repository
|
# Create a code-server instance for the cloned repository
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
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.18"
|
||||||
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.folder_name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a Coder app for the website
|
# Create a Coder app for the website
|
||||||
resource "coder_app" "website" {
|
resource "coder_app" "website" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
order = 2
|
order = 2
|
||||||
slug = "website"
|
slug = "website"
|
||||||
external = true
|
external = true
|
||||||
display_name = module.git_clone[count.index].folder_name
|
display_name = module.git_clone.folder_name
|
||||||
url = module.git_clone[count.index].web_url
|
url = module.git_clone.web_url
|
||||||
icon = module.git_clone[count.index].git_provider != "" ? "/icon/${module.git_clone[count.index].git_provider}.svg" : "/icon/git.svg"
|
icon = module.git_clone.git_provider != "" ? "/icon/${module.git_clone.git_provider}.svg" : "/icon/git.svg"
|
||||||
|
count = module.git_clone.web_url != "" ? 1 : 0
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -102,7 +97,6 @@ Configuring `git-clone` for a self-hosted GitHub Enterprise Server running at `g
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -121,7 +115,6 @@ To GitLab clone with a specific branch like `feat/example`
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -133,7 +126,6 @@ Configuring `git-clone` for a self-hosted GitLab running at `gitlab.example.com`
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -154,7 +146,6 @@ For example, to clone the `feat/example` branch:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -171,7 +162,6 @@ For example, this will clone into the `~/projects/coder/coder-dev` folder:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-clone" {
|
module "git-clone" {
|
||||||
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.18"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ tags: [helper, git]
|
|||||||
|
|
||||||
# git-commit-signing
|
# git-commit-signing
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> This module will only work with Git versions >=2.34, prior versions [do not support signing commits via SSH keys](https://lore.kernel.org/git/xmqq8rxpgwki.fsf@gitster.g/).
|
|
||||||
|
|
||||||
This module downloads your SSH key from Coder and uses it to sign commits with Git.
|
This module downloads your SSH key from Coder and uses it to sign commits with Git.
|
||||||
It requires `curl` and `jq` to be installed inside your workspace.
|
It requires `curl` and `jq` to be installed inside your workspace.
|
||||||
|
|
||||||
@@ -21,7 +18,6 @@ This module has a chance of conflicting with the user's dotfiles / the personali
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-commit-signing" {
|
module "git-commit-signing" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/git-commit-signing/coder"
|
source = "registry.coder.com/modules/git-commit-signing/coder"
|
||||||
version = "1.0.11"
|
version = "1.0.11"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Runs a script that updates git credentials in the workspace to match the user's
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-config" {
|
module "git-config" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/git-config/coder"
|
source = "registry.coder.com/modules/git-config/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -28,7 +27,6 @@ TODO: Add screenshot
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-config" {
|
module "git-config" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/git-config/coder"
|
source = "registry.coder.com/modules/git-config/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -42,7 +40,6 @@ TODO: Add screenshot
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "git-config" {
|
module "git-config" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/git-config/coder"
|
source = "registry.coder.com/modules/git-config/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Templates that utilize Github External Auth can automatically ensure that the Co
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "github-upload-public-key" {
|
module "github-upload-public-key" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/github-upload-public-key/coder"
|
source = "registry.coder.com/modules/github-upload-public-key/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -46,7 +45,6 @@ data "coder_external_auth" "github" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module "github-upload-public-key" {
|
module "github-upload-public-key" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/github-upload-public-key/coder"
|
source = "registry.coder.com/modules/github-upload-public-key/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -11,18 +11,15 @@ 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
|
|
||||||
source = "registry.coder.com/modules/jetbrains-gateway/coder"
|
source = "registry.coder.com/modules/jetbrains-gateway/coder"
|
||||||
version = "1.0.28"
|
version = "1.0.24"
|
||||||
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"]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -34,53 +31,28 @@ module "jetbrains_gateway" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jetbrains_gateway" {
|
module "jetbrains_gateway" {
|
||||||
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.24"
|
||||||
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"]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use the latest version of each IDE
|
### Use the fixed version
|
||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jetbrains_gateway" {
|
module "jetbrains_gateway" {
|
||||||
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.24"
|
||||||
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 = ["GO", "WS"]
|
||||||
default = "IU"
|
default = ["GO"]
|
||||||
latest = true
|
latest = false # current version is 2024.3
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Use fixed versions set by `jetbrains_ide_versions`
|
|
||||||
|
|
||||||
```tf
|
|
||||||
module "jetbrains_gateway" {
|
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/jetbrains-gateway/coder"
|
|
||||||
version = "1.0.28"
|
|
||||||
agent_id = coder_agent.example.id
|
|
||||||
folder = "/home/coder/example"
|
|
||||||
jetbrains_ides = ["IU", "PY"]
|
|
||||||
default = "IU"
|
|
||||||
latest = false
|
|
||||||
jetbrains_ide_versions = {
|
|
||||||
"IU" = {
|
|
||||||
build_number = "243.21565.193"
|
|
||||||
version = "2024.3"
|
|
||||||
}
|
|
||||||
"PY" = {
|
|
||||||
build_number = "243.21565.199"
|
|
||||||
version = "2024.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -88,13 +60,13 @@ module "jetbrains_gateway" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jetbrains_gateway" {
|
module "jetbrains_gateway" {
|
||||||
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.24"
|
||||||
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"]
|
||||||
latest = true
|
latest = true
|
||||||
channel = "eap"
|
channel = "eap"
|
||||||
}
|
}
|
||||||
@@ -106,15 +78,30 @@ Due to the highest priority of the `ide_download_link` parameter in the `(jetbra
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jetbrains_gateway" {
|
module "jetbrains_gateway" {
|
||||||
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.24"
|
||||||
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/"
|
||||||
download_base_link = "https://download.internal.site/"
|
download_base_link = "https://download.internal.site/"
|
||||||
default = "GO"
|
default = ["GO"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Add multiple IDEs
|
||||||
|
|
||||||
|
**Note:** This removes the choice of IDE from the user.
|
||||||
|
|
||||||
|
```tf
|
||||||
|
module "jetbrains_gateway" {
|
||||||
|
source = "registry.coder.com/modules/jetbrains-gateway/coder"
|
||||||
|
version = "1.0.24"
|
||||||
|
agent_id = coder_agent.example.id
|
||||||
|
agent_name = "example"
|
||||||
|
folder = "/home/coder/example"
|
||||||
|
default = ["GO", "WS"]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -122,12 +109,11 @@ module "jetbrains_gateway" {
|
|||||||
|
|
||||||
This module and JetBrains Gateway support the following JetBrains IDEs:
|
This module and JetBrains Gateway support the following JetBrains IDEs:
|
||||||
|
|
||||||
- [GoLand (`GO`)](https://www.jetbrains.com/go/)
|
- GoLand (`GO`)
|
||||||
- [WebStorm (`WS`)](https://www.jetbrains.com/webstorm/)
|
- WebStorm (`WS`)
|
||||||
- [IntelliJ IDEA Ultimate (`IU`)](https://www.jetbrains.com/idea/)
|
- IntelliJ IDEA Ultimate (`IU`)
|
||||||
- [PyCharm Professional (`PY`)](https://www.jetbrains.com/pycharm/)
|
- PyCharm Professional (`PY`)
|
||||||
- [PhpStorm (`PS`)](https://www.jetbrains.com/phpstorm/)
|
- PhpStorm (`PS`)
|
||||||
- [CLion (`CL`)](https://www.jetbrains.com/clion/)
|
- CLion (`CL`)
|
||||||
- [RubyMine (`RM`)](https://www.jetbrains.com/ruby/)
|
- RubyMine (`RM`)
|
||||||
- [Rider (`RD`)](https://www.jetbrains.com/rider/)
|
- Rider (`RD`)
|
||||||
- [RustRover (`RR`)](https://www.jetbrains.com/rust/)
|
|
||||||
|
|||||||
@@ -10,18 +10,19 @@ 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",
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should create a link with the default values", async () => {
|
it("should create a link with the default values", async () => {
|
||||||
const state = await runTerraformApply(import.meta.dir, {
|
const state = await runTerraformApply(import.meta.dir, {
|
||||||
// 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).toEqual([
|
||||||
"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(
|
||||||
(res) => res.type === "coder_app" && res.name === "gateway",
|
(res) => res.type === "coder_app" && res.name === "gateway",
|
||||||
@@ -32,12 +33,31 @@ describe("jetbrains-gateway", async () => {
|
|||||||
expect(coder_app?.instances[0].attributes.order).toBeNull();
|
expect(coder_app?.instances[0].attributes.order).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
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", "PY"],
|
||||||
});
|
});
|
||||||
expect(state.outputs.identifier.value).toBe("IU");
|
expect(state.outputs.identifier.value).toEqual(["IU"]);
|
||||||
|
expect(state.outputs.url.value).toEqual([
|
||||||
|
"jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&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",
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should create multiple IDEs", async () => {
|
||||||
|
const state = await runTerraformApply(import.meta.dir, {
|
||||||
|
agent_id: "foo",
|
||||||
|
agent_name: "foo",
|
||||||
|
folder: "/home/foo",
|
||||||
|
default: ["GO", "IU", "PY"],
|
||||||
|
});
|
||||||
|
expect(state.outputs.identifier.value).toEqual(["GO", "IU", "PY"]);
|
||||||
|
expect(state.outputs.url.value).toEqual([
|
||||||
|
"jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=GO&ide_build_number=243.21565.208&ide_download_link=https://download.jetbrains.com/go/goland-2024.3.tar.gz",
|
||||||
|
"jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/foo&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/foo&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=PY&ide_build_number=243.21565.199&ide_download_link=https://download.jetbrains.com/python/pycharm-professional-2024.3.tar.gz",
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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" {
|
||||||
@@ -41,9 +39,23 @@ variable "folder" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "default" {
|
variable "default" {
|
||||||
default = ""
|
default = []
|
||||||
type = string
|
type = list(string)
|
||||||
description = "Default IDE"
|
description = "List of default IDEs to be added to the Workspace page."
|
||||||
|
# check if the list is unique
|
||||||
|
validation {
|
||||||
|
condition = length(var.default) == length(toset(var.default))
|
||||||
|
error_message = "The default must not contain duplicates."
|
||||||
|
}
|
||||||
|
# check if default are valid jetbrains_ides
|
||||||
|
validation {
|
||||||
|
condition = (
|
||||||
|
alltrue([
|
||||||
|
for code in var.default : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"], code)
|
||||||
|
])
|
||||||
|
)
|
||||||
|
error_message = "The default must be a list of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"])}."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "order" {
|
variable "order" {
|
||||||
@@ -61,7 +73,7 @@ variable "coder_parameter_order" {
|
|||||||
variable "latest" {
|
variable "latest" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Whether to fetch the latest version of the IDE."
|
description = "Whether to fetch the latest version of the IDE."
|
||||||
default = false
|
default = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "channel" {
|
variable "channel" {
|
||||||
@@ -113,32 +125,28 @@ variable "jetbrains_ide_versions" {
|
|||||||
build_number = "243.21565.191"
|
build_number = "243.21565.191"
|
||||||
version = "2024.3"
|
version = "2024.3"
|
||||||
}
|
}
|
||||||
"RR" = {
|
|
||||||
build_number = "243.22562.230"
|
|
||||||
version = "2024.3"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
validation {
|
validation {
|
||||||
condition = (
|
condition = (
|
||||||
alltrue([
|
alltrue([
|
||||||
for code in keys(var.jetbrains_ide_versions) : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"], code)
|
for code in keys(var.jetbrains_ide_versions) : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"], code)
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
error_message = "The jetbrains_ide_versions must contain a map of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"])}."
|
error_message = "The jetbrains_ide_versions must contain a map of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"])}."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "jetbrains_ides" {
|
variable "jetbrains_ides" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "The list of IDE product codes."
|
description = "The list of IDE product codes to be shown to the user. Does not apply when there are multiple defaults."
|
||||||
default = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"]
|
default = ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"]
|
||||||
validation {
|
validation {
|
||||||
condition = (
|
condition = (
|
||||||
alltrue([
|
alltrue([
|
||||||
for code in var.jetbrains_ides : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"], code)
|
for code in var.jetbrains_ides : contains(["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"], code)
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD", "RR"])}."
|
error_message = "The jetbrains_ides must be a list of valid product codes. Valid product codes are ${join(",", ["IU", "PS", "WS", "PY", "CL", "GO", "RM", "RD"])}."
|
||||||
}
|
}
|
||||||
# check if the list is empty
|
# check if the list is empty
|
||||||
validation {
|
validation {
|
||||||
@@ -234,7 +242,7 @@ locals {
|
|||||||
build_number = var.jetbrains_ide_versions["RM"].build_number,
|
build_number = var.jetbrains_ide_versions["RM"].build_number,
|
||||||
download_link = "${var.download_base_link}/ruby/RubyMine-${var.jetbrains_ide_versions["RM"].version}.tar.gz"
|
download_link = "${var.download_base_link}/ruby/RubyMine-${var.jetbrains_ide_versions["RM"].version}.tar.gz"
|
||||||
version = var.jetbrains_ide_versions["RM"].version
|
version = var.jetbrains_ide_versions["RM"].version
|
||||||
},
|
}
|
||||||
"RD" = {
|
"RD" = {
|
||||||
icon = "/icon/rider.svg",
|
icon = "/icon/rider.svg",
|
||||||
name = "Rider",
|
name = "Rider",
|
||||||
@@ -242,34 +250,45 @@ locals {
|
|||||||
build_number = var.jetbrains_ide_versions["RD"].build_number,
|
build_number = var.jetbrains_ide_versions["RD"].build_number,
|
||||||
download_link = "${var.download_base_link}/rider/JetBrains.Rider-${var.jetbrains_ide_versions["RD"].version}.tar.gz"
|
download_link = "${var.download_base_link}/rider/JetBrains.Rider-${var.jetbrains_ide_versions["RD"].version}.tar.gz"
|
||||||
version = var.jetbrains_ide_versions["RD"].version
|
version = var.jetbrains_ide_versions["RD"].version
|
||||||
},
|
|
||||||
"RR" = {
|
|
||||||
icon = "/icon/rustrover.svg",
|
|
||||||
name = "RustRover",
|
|
||||||
identifier = "RR",
|
|
||||||
build_number = var.jetbrains_ide_versions["RR"].build_number,
|
|
||||||
download_link = "${var.download_base_link}/rustrover/RustRover-${var.jetbrains_ide_versions["RR"].version}.tar.gz"
|
|
||||||
version = var.jetbrains_ide_versions["RR"].version
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
icon = local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].icon
|
identifier = try([data.coder_parameter.jetbrains_ide[0].value], var.default)
|
||||||
json_data = var.latest ? jsondecode(data.http.jetbrains_ide_versions[data.coder_parameter.jetbrains_ide.value].response_body) : {}
|
list_json_data = var.latest ? [
|
||||||
key = var.latest ? keys(local.json_data)[0] : ""
|
for ide in local.identifier : jsondecode(data.http.jetbrains_ide_versions[ide].response_body)
|
||||||
display_name = local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].name
|
] : []
|
||||||
identifier = data.coder_parameter.jetbrains_ide.value
|
list_key = var.latest ? [
|
||||||
download_link = var.latest ? local.json_data[local.key][0].downloads.linux.link : local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].download_link
|
for j in local.list_json_data : keys(j)[0]
|
||||||
build_number = var.latest ? local.json_data[local.key][0].build : local.jetbrains_ides[data.coder_parameter.jetbrains_ide.value].build_number
|
] : []
|
||||||
version = var.latest ? local.json_data[local.key][0].version : var.jetbrains_ide_versions[data.coder_parameter.jetbrains_ide.value].version
|
download_links = length(local.list_key) > 0 ? [
|
||||||
|
for i, j in local.list_json_data : j[local.list_key[i]][0].downloads.linux.link
|
||||||
|
] : [
|
||||||
|
for ide in local.identifier : local.jetbrains_ides[ide].download_link
|
||||||
|
]
|
||||||
|
build_numbers = length(local.list_key) > 0 ? [
|
||||||
|
for i, j in local.list_json_data : j[local.list_key[i]][0].build
|
||||||
|
] : [
|
||||||
|
for ide in local.identifier : local.jetbrains_ides[ide].build_number
|
||||||
|
]
|
||||||
|
versions = length(local.list_key) > 0 ? [
|
||||||
|
for i, j in local.list_json_data : j[local.list_key[i]][0].version
|
||||||
|
] : [
|
||||||
|
for ide in local.identifier : local.jetbrains_ides[ide].version
|
||||||
|
]
|
||||||
|
display_names = [for key in keys(coder_app.gateway) : coder_app.gateway[key].display_name]
|
||||||
|
icons = [for key in keys(coder_app.gateway) : coder_app.gateway[key].icon]
|
||||||
|
urls = [for key in keys(coder_app.gateway) : coder_app.gateway[key].url]
|
||||||
}
|
}
|
||||||
|
|
||||||
data "coder_parameter" "jetbrains_ide" {
|
data "coder_parameter" "jetbrains_ide" {
|
||||||
|
# remove the coder_parameter if there are multiple default
|
||||||
|
count = length(var.default) > 1 ? 0 : 1
|
||||||
type = "string"
|
type = "string"
|
||||||
name = "jetbrains_ide"
|
name = "jetbrains_ide"
|
||||||
display_name = "JetBrains IDE"
|
display_name = "JetBrains IDE"
|
||||||
icon = "/icon/gateway.svg"
|
icon = "/icon/gateway.svg"
|
||||||
mutable = true
|
mutable = true
|
||||||
default = var.default == "" ? var.jetbrains_ides[0] : var.default
|
default = length(var.default) > 0 ? var.default[0] : var.jetbrains_ides[0]
|
||||||
order = var.coder_parameter_order
|
order = var.coder_parameter_order
|
||||||
|
|
||||||
dynamic "option" {
|
dynamic "option" {
|
||||||
@@ -286,10 +305,11 @@ data "coder_workspace" "me" {}
|
|||||||
data "coder_workspace_owner" "me" {}
|
data "coder_workspace_owner" "me" {}
|
||||||
|
|
||||||
resource "coder_app" "gateway" {
|
resource "coder_app" "gateway" {
|
||||||
|
for_each = length(var.default) > 1 ? toset(var.default) : toset([data.coder_parameter.jetbrains_ide[0].value])
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
slug = var.slug
|
slug = "${var.slug}-${lower(each.value)}"
|
||||||
display_name = local.display_name
|
display_name = local.jetbrains_ides[each.value].name
|
||||||
icon = local.icon
|
icon = local.jetbrains_ides[each.value].icon
|
||||||
external = true
|
external = true
|
||||||
order = var.order
|
order = var.order
|
||||||
url = join("", [
|
url = join("", [
|
||||||
@@ -297,6 +317,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=",
|
||||||
@@ -304,38 +326,45 @@ resource "coder_app" "gateway" {
|
|||||||
"&token=",
|
"&token=",
|
||||||
"$SESSION_TOKEN",
|
"$SESSION_TOKEN",
|
||||||
"&ide_product_code=",
|
"&ide_product_code=",
|
||||||
data.coder_parameter.jetbrains_ide.value,
|
each.value,
|
||||||
"&ide_build_number=",
|
"&ide_build_number=",
|
||||||
local.build_number,
|
local.jetbrains_ides[each.value].build_number,
|
||||||
"&ide_download_link=",
|
"&ide_download_link=",
|
||||||
local.download_link,
|
local.jetbrains_ides[each.value].download_link,
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
output "identifier" {
|
output "identifier" {
|
||||||
value = local.identifier
|
value = local.identifier
|
||||||
|
description = "The product code of the JetBrains IDE."
|
||||||
}
|
}
|
||||||
|
|
||||||
output "display_name" {
|
output "display_name" {
|
||||||
value = local.display_name
|
value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].display_name]
|
||||||
|
description = "The display name of the JetBrains IDE."
|
||||||
}
|
}
|
||||||
|
|
||||||
output "icon" {
|
output "icon" {
|
||||||
value = local.icon
|
value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].icon]
|
||||||
|
description = "The icon of the JetBrains IDE."
|
||||||
}
|
}
|
||||||
|
|
||||||
output "download_link" {
|
output "download_link" {
|
||||||
value = local.download_link
|
value = local.download_links
|
||||||
|
description = "The download link of the JetBrains IDE."
|
||||||
}
|
}
|
||||||
|
|
||||||
output "build_number" {
|
output "build_number" {
|
||||||
value = local.build_number
|
value = local.build_numbers
|
||||||
|
description = "The build number of the JetBrains IDE."
|
||||||
}
|
}
|
||||||
|
|
||||||
output "version" {
|
output "version" {
|
||||||
value = local.version
|
value = local.versions
|
||||||
|
description = "The version of the JetBrains IDE."
|
||||||
}
|
}
|
||||||
|
|
||||||
output "url" {
|
output "url" {
|
||||||
value = coder_app.gateway.url
|
value = [for key in keys(coder_app.gateway) : coder_app.gateway[key].url]
|
||||||
|
description = "The URL to connect to the JetBrains IDE."
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,6 @@ Install the JF CLI and authenticate package managers with Artifactory using OAut
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jfrog" {
|
module "jfrog" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/jfrog-oauth/coder"
|
source = "registry.coder.com/modules/jfrog-oauth/coder"
|
||||||
version = "1.0.19"
|
version = "1.0.19"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -45,7 +44,6 @@ Configure the Python pip package manager to fetch packages from Artifactory whil
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jfrog" {
|
module "jfrog" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/jfrog-oauth/coder"
|
source = "registry.coder.com/modules/jfrog-oauth/coder"
|
||||||
version = "1.0.19"
|
version = "1.0.19"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -74,7 +72,6 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jfrog" {
|
module "jfrog" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/jfrog-oauth/coder"
|
source = "registry.coder.com/modules/jfrog-oauth/coder"
|
||||||
version = "1.0.19"
|
version = "1.0.19"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -98,8 +95,8 @@ provider "docker" {
|
|||||||
# ...
|
# ...
|
||||||
registry_auth {
|
registry_auth {
|
||||||
address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY"
|
address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY"
|
||||||
username = try(module.jfrog[0].username, "")
|
username = module.jfrog.username
|
||||||
password = try(module.jfrog[0].access_token, "")
|
password = module.jfrog.access_token
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ A module that adds Jupyter Notebook in your Coder template.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jupyter-notebook" {
|
module "jupyter-notebook" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/jupyter-notebook/coder"
|
source = "registry.coder.com/modules/jupyter-notebook/coder"
|
||||||
version = "1.0.19"
|
version = "1.0.19"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ A module that adds JupyterLab in your Coder template.
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "jupyterlab" {
|
module "jupyterlab" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/jupyterlab/coder"
|
source = "registry.coder.com/modules/jupyterlab/coder"
|
||||||
version = "1.0.23"
|
version = "1.0.23"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Automatically install [KasmVNC](https://kasmweb.com/kasmvnc) in a workspace, and
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "kasmvnc" {
|
module "kasmvnc" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/kasmvnc/coder"
|
source = "registry.coder.com/modules/kasmvnc/coder"
|
||||||
version = "1.0.23"
|
version = "1.0.23"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Automatically installs [Node.js](https://github.com/nodejs/node) via [nvm](https
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "nodejs" {
|
module "nodejs" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/nodejs/coder"
|
source = "registry.coder.com/modules/nodejs/coder"
|
||||||
version = "1.0.10"
|
version = "1.0.10"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -26,7 +25,6 @@ This installs multiple versions of Node.js:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "nodejs" {
|
module "nodejs" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/nodejs/coder"
|
source = "registry.coder.com/modules/nodejs/coder"
|
||||||
version = "1.0.10"
|
version = "1.0.10"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -45,7 +43,6 @@ A example with all available options:
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "nodejs" {
|
module "nodejs" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/nodejs/coder"
|
source = "registry.coder.com/modules/nodejs/coder"
|
||||||
version = "1.0.10"
|
version = "1.0.10"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Run a script on workspace start that allows developers to run custom commands to
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "personalize" {
|
module "personalize" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/personalize/coder"
|
source = "registry.coder.com/modules/personalize/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
2
setup.ts
2
setup.ts
@@ -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;
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ slackme npm run long-build
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "slackme" {
|
module "slackme" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/slackme/coder"
|
source = "registry.coder.com/modules/slackme/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -73,7 +72,6 @@ slackme npm run long-build
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "slackme" {
|
module "slackme" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/slackme/coder"
|
source = "registry.coder.com/modules/slackme/coder"
|
||||||
version = "1.0.2"
|
version = "1.0.2"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
16
test.ts
16
test.ts
@@ -194,18 +194,14 @@ 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 ?? {}),
|
// Convert arrays to JSON strings
|
||||||
};
|
combinedEnv[`TF_VAR_${key}`] = Array.isArray(value) ? JSON.stringify(value) : 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 +217,7 @@ export const runTerraformApply = async <TVars extends TerraformVariables>(
|
|||||||
],
|
],
|
||||||
{
|
{
|
||||||
cwd: dir,
|
cwd: dir,
|
||||||
env: childEnv,
|
env: combinedEnv,
|
||||||
stderr: "pipe",
|
stderr: "pipe",
|
||||||
stdout: "pipe",
|
stdout: "pipe",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,39 +21,14 @@ for dir in "${changed_dirs[@]}"; do
|
|||||||
if [[ -f "$dir/README.md" ]]; then
|
if [[ -f "$dir/README.md" ]]; then
|
||||||
file="$dir/README.md"
|
file="$dir/README.md"
|
||||||
tmpfile=$(mktemp /tmp/tempfile.XXXXXX)
|
tmpfile=$(mktemp /tmp/tempfile.XXXXXX)
|
||||||
awk -v tag="$LATEST_TAG" '
|
awk -v tag="$LATEST_TAG" '{
|
||||||
BEGIN { in_code_block = 0; in_nested_block = 0 }
|
if ($1 == "version" && $2 == "=") {
|
||||||
{
|
|
||||||
# Detect the start and end of Markdown code blocks.
|
|
||||||
if ($0 ~ /^```/) {
|
|
||||||
in_code_block = !in_code_block
|
|
||||||
# Reset nested block tracking when exiting a code block.
|
|
||||||
if (!in_code_block) {
|
|
||||||
in_nested_block = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Handle nested blocks within a code block.
|
|
||||||
if (in_code_block) {
|
|
||||||
# Detect the start of a nested block (skipping "module" blocks).
|
|
||||||
if ($0 ~ /{/ && !($1 == "module" || $1 ~ /^[a-zA-Z0-9_]+$/)) {
|
|
||||||
in_nested_block++
|
|
||||||
}
|
|
||||||
|
|
||||||
# Detect the end of a nested block.
|
|
||||||
if ($0 ~ /}/ && in_nested_block > 0) {
|
|
||||||
in_nested_block--
|
|
||||||
}
|
|
||||||
|
|
||||||
# Update "version" only if not in a nested block.
|
|
||||||
if (!in_nested_block && $1 == "version" && $2 == "=") {
|
|
||||||
sub(/"[^"]*"/, "\"" tag "\"")
|
sub(/"[^"]*"/, "\"" tag "\"")
|
||||||
}
|
print
|
||||||
}
|
} else {
|
||||||
|
|
||||||
print
|
print
|
||||||
}
|
}
|
||||||
' "$file" > "$tmpfile" && mv "$tmpfile" "$file"
|
}' "$file" > "$tmpfile" && mv "$tmpfile" "$file"
|
||||||
|
|
||||||
# Check if the README.md file has changed
|
# Check if the README.md file has changed
|
||||||
if ! git diff --quiet -- "$dir/README.md"; then
|
if ! git diff --quiet -- "$dir/README.md"; then
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -46,7 +45,6 @@ To configure the Vault module, you must set up a Vault GitHub auth method. See t
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -59,7 +57,6 @@ module "vault" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -73,7 +70,6 @@ module "vault" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -10,11 +10,10 @@ 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" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-jwt/coder"
|
source = "registry.coder.com/modules/vault-jwt/coder"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -41,7 +40,6 @@ curl -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET "${VAULT_ADDR}/v1/coder/secrets/d
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-jwt/coder"
|
source = "registry.coder.com/modules/vault-jwt/coder"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -57,7 +55,6 @@ module "vault" {
|
|||||||
data "coder_workspace_owner" "me" {}
|
data "coder_workspace_owner" "me" {}
|
||||||
|
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-jwt/coder"
|
source = "registry.coder.com/modules/vault-jwt/coder"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -70,7 +67,6 @@ module "vault" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vault-jwt/coder"
|
source = "registry.coder.com/modules/vault-jwt/coder"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vscode" {
|
module "vscode" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vscode-desktop/coder"
|
source = "registry.coder.com/modules/vscode-desktop/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
@@ -28,7 +27,6 @@ module "vscode" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vscode" {
|
module "vscode" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/vscode-desktop/coder"
|
source = "registry.coder.com/modules/vscode-desktop/coder"
|
||||||
version = "1.0.15"
|
version = "1.0.15"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ Automatically install [Visual Studio Code Server](https://code.visualstudio.com/
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vscode-web" {
|
module "vscode-web" {
|
||||||
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.22"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
accept_license = true
|
accept_license = true
|
||||||
}
|
}
|
||||||
@@ -29,9 +28,8 @@ module "vscode-web" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vscode-web" {
|
module "vscode-web" {
|
||||||
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.22"
|
||||||
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"
|
||||||
@@ -43,9 +41,8 @@ module "vscode-web" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vscode-web" {
|
module "vscode-web" {
|
||||||
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.22"
|
||||||
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
|
||||||
@@ -58,9 +55,8 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "vscode-web" {
|
module "vscode-web" {
|
||||||
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.22"
|
||||||
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,7 +92,7 @@ variable "order" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "settings" {
|
variable "settings" {
|
||||||
type = any
|
type = map(string)
|
||||||
description = "A map of settings to apply to VS Code web."
|
description = "A map of settings to apply to VS Code web."
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ Enable Remote Desktop + a web based client on Windows workspaces, powered by [de
|
|||||||
```tf
|
```tf
|
||||||
# AWS example. See below for examples of using this module with other providers
|
# AWS example. See below for examples of using this module with other providers
|
||||||
module "windows_rdp" {
|
module "windows_rdp" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/windows-rdp/coder"
|
source = "registry.coder.com/modules/windows-rdp/coder"
|
||||||
version = "1.0.18"
|
version = "1.0.18"
|
||||||
|
count = data.coder_workspace.me.start_count
|
||||||
agent_id = resource.coder_agent.main.id
|
agent_id = resource.coder_agent.main.id
|
||||||
resource_id = resource.aws_instance.dev.id
|
resource_id = resource.aws_instance.dev.id
|
||||||
}
|
}
|
||||||
@@ -32,9 +32,9 @@ module "windows_rdp" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "windows_rdp" {
|
module "windows_rdp" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/windows-rdp/coder"
|
source = "registry.coder.com/modules/windows-rdp/coder"
|
||||||
version = "1.0.18"
|
version = "1.0.18"
|
||||||
|
count = data.coder_workspace.me.start_count
|
||||||
agent_id = resource.coder_agent.main.id
|
agent_id = resource.coder_agent.main.id
|
||||||
resource_id = resource.aws_instance.dev.id
|
resource_id = resource.aws_instance.dev.id
|
||||||
}
|
}
|
||||||
@@ -44,9 +44,9 @@ module "windows_rdp" {
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "windows_rdp" {
|
module "windows_rdp" {
|
||||||
count = data.coder_workspace.me.start_count
|
|
||||||
source = "registry.coder.com/modules/windows-rdp/coder"
|
source = "registry.coder.com/modules/windows-rdp/coder"
|
||||||
version = "1.0.18"
|
version = "1.0.18"
|
||||||
|
count = data.coder_workspace.me.start_count
|
||||||
agent_id = resource.coder_agent.main.id
|
agent_id = resource.coder_agent.main.id
|
||||||
resource_id = resource.google_compute_instance.dev[0].id
|
resource_id = resource.google_compute_instance.dev[0].id
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user