Compare commits

...

5 Commits

Author SHA1 Message Date
Muhammad Atif Ali
7d31865c94 feat!(git-clone): change path input to base_dir and return repo_dir as output (#132) 2024-01-26 16:13:03 +03:00
Muhammad Atif Ali
d3fc2d2212 docs(jfrog-oauth): improve docs (#129)
* docs(jfrog-oauth): improve docs

Adds additional step and screenshot to show creating an OAuth app in JFrog platform

* Update README.md

* Add files via upload

* fmt

* move JFrog Artifactory integration setup instructions

* Update JFrog token documentation
2024-01-26 09:20:21 +03:00
Conor Bèhard Roberts
38a2d86376 feat: enable basename of url to be added to custom path (git-clone) (#124) 2024-01-23 13:55:30 +03:00
Muhammad Atif Ali
b968a2aa22 feat: add version to module docs (#122) 2024-01-23 13:50:55 +03:00
Muhammad Atif Ali
5b3edd9bbd fix(code-server): write settings to User (#123) 2024-01-18 23:22:57 +03:00
28 changed files with 287 additions and 265 deletions

View File

@@ -13,7 +13,8 @@ tags: [helper]
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME/coder"
version = "1.0.0"
} }
``` ```
@@ -27,11 +28,12 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME/coder"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ agent_id = coder_agent.example.id
"dracula-theme.theme-dracula" extensions = [
] "dracula-theme.theme-dracula"
]
} }
``` ```
@@ -43,12 +45,13 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME/coder"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ "dracula-theme.theme-dracula" ] agent_id = coder_agent.example.id
settings = { extensions = [ "dracula-theme.theme-dracula" ]
"workbench.colorTheme" = "Dracula" settings = {
} "workbench.colorTheme" = "Dracula"
}
} }
``` ```
@@ -58,8 +61,9 @@ Run code-server in the background, don't fetch it from GitHub:
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME/coder"
agent_id = coder_agent.example.id version = "1.0.0"
offline = true agent_id = coder_agent.example.id
offline = true
} }
``` ```

View File

@@ -20,7 +20,9 @@ $ bun test -t '<module>'
You can test a module locally by updating the source as follows You can test a module locally by updating the source as follows
```hcl ```hcl
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>" module "example" {
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>"
}
``` ```
> **Note:** This is the responsibility of the module author to implement tests for their module. and test the module locally before submitting a PR. > **Note:** This is the responsibility of the module author to implement tests for their module. and test the module locally before submitting a PR.

View File

@@ -16,8 +16,9 @@ e.g.
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
agent_id = coder_agent.main.id version = "1.0.0"
agent_id = coder_agent.main.id
} }
``` ```

View File

@@ -16,12 +16,13 @@ Customize the preselected parameter value:
```hcl ```hcl
module "aws-region" { module "aws-region" {
source = "https://registry.coder.com/modules/aws-region" source = "registry.coder.com/modules/aws-region/coder"
default = "us-east-1" version = "1.0.0"
default = "us-east-1"
} }
provider "aws" { provider "aws" {
region = module.aws_region.value region = module.aws_region.value
} }
``` ```
@@ -35,18 +36,19 @@ Change the display name and icon for a region using the corresponding maps:
```hcl ```hcl
module "aws-region" { module "aws-region" {
source = "https://registry.coder.com/modules/aws-region" source = "registry.coder.com/modules/aws-region/coder"
default = "ap-south-1" version = "1.0.0"
custom_names = { default = "ap-south-1"
"ap-south-1": "Awesome Mumbai!" custom_names = {
} "ap-south-1": "Awesome Mumbai!"
custom_icons = { }
"ap-south-1": "/emojis/1f33a.png" custom_icons = {
} "ap-south-1": "/emojis/1f33a.png"
}
} }
provider "aws" { provider "aws" {
region = module.aws_region.value region = module.aws_region.value
} }
``` ```
@@ -58,12 +60,13 @@ Hide the Asia Pacific regions Seoul and Osaka:
```hcl ```hcl
module "aws-region" { module "aws-region" {
source = "https://registry.coder.com/modules/aws-region" source = "registry.coder.com/modules/aws-region/coder"
exclude = [ "ap-northeast-2", "ap-northeast-3" ] version = "1.0.0"
exclude = [ "ap-northeast-2", "ap-northeast-3" ]
} }
provider "aws" { provider "aws" {
region = module.aws_region.value region = module.aws_region.value
} }
``` ```

View File

@@ -13,12 +13,13 @@ This module adds a parameter with all Azure regions, allowing developers to sele
```hcl ```hcl
module "azure_region" { module "azure_region" {
source = "https://registry.coder.com/modules/azure-region" source = "registry.coder.com/modules/azure-region/coder"
default = "eastus" version = "1.0.0"
default = "eastus"
} }
resource "azurem_resource_group" "example" { resource "azurem_resource_group" "example" {
location = module.azure_region.value location = module.azure_region.value
} }
``` ```
@@ -32,17 +33,18 @@ Change the display name and icon for a region using the corresponding maps:
```hcl ```hcl
module "azure-region" { module "azure-region" {
source = "https://registry.coder.com/modules/azure-region" source = "registry.coder.com/modules/azure-region/coder"
custom_names = { version = "1.0.0"
"australia": "Go Australia!" custom_names = {
} "australia": "Go Australia!"
custom_icons = { }
"australia": "/icons/smiley.svg" custom_icons = {
} "australia": "/icons/smiley.svg"
}
} }
resource "azurerm_resource_group" "example" { resource "azurerm_resource_group" "example" {
location = module.azure_region.value location = module.azure_region.value
} }
``` ```
@@ -54,17 +56,18 @@ Hide all regions in Australia except australiacentral:
```hcl ```hcl
module "azure-region" { module "azure-region" {
source = "https://registry.coder.com/modules/azure-region" source = "registry.coder.com/modules/azure-region/coder"
exclude = [ version = "1.0.0"
"australia", exclude = [
"australiacentral2", "australia",
"australiaeast", "australiacentral2",
"australiasoutheast" "australiaeast",
] "australiasoutheast"
]
} }
resource "azurerm_resource_group" "example" { resource "azurerm_resource_group" "example" {
location = module.azure_region.value location = module.azure_region.value
} }
``` ```

View File

@@ -13,8 +13,9 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```
@@ -26,7 +27,8 @@ module "code-server" {
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
install_version = "4.8.3" install_version = "4.8.3"
} }
@@ -38,11 +40,12 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ agent_id = coder_agent.example.id
"dracula-theme.theme-dracula" extensions = [
] "dracula-theme.theme-dracula"
]
} }
``` ```
@@ -54,12 +57,13 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```hcl ```hcl
module "settings" { module "settings" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ "dracula-theme.theme-dracula" ] agent_id = coder_agent.example.id
settings = { extensions = [ "dracula-theme.theme-dracula" ]
"workbench.colorTheme" = "Dracula" settings = {
} "workbench.colorTheme" = "Dracula"
}
} }
``` ```
@@ -69,9 +73,10 @@ Just run code-server in the background, don't fetch it from GitHub:
```hcl ```hcl
module "settings" { module "settings" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ] agent_id = coder_agent.example.id
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ]
} }
``` ```
@@ -81,8 +86,9 @@ Just run code-server in the background, don't fetch it from GitHub:
```hcl ```hcl
module "settings" { module "settings" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server/coder"
agent_id = coder_agent.example.id version = "1.0.0"
offline = true agent_id = coder_agent.example.id
offline = true
} }
``` ```

View File

@@ -39,10 +39,10 @@ for extension in "$${EXTENSIONLIST[@]}"; do
done done
# Check if the settings file exists... # Check if the settings file exists...
if [ ! -f ~/.local/share/code-server/Machine/settings.json ]; then if [ ! -f ~/.local/share/code-server/User/settings.json ]; then
echo "⚙️ Creating settings file..." echo "⚙️ Creating settings file..."
mkdir -p ~/.local/share/code-server/Machine mkdir -p ~/.local/share/code-server/User
echo "${SETTINGS}" > ~/.local/share/code-server/Machine/settings.json echo "${SETTINGS}" > ~/.local/share/code-server/User/settings.json
fi fi
echo "👷 Running code-server in the background..." echo "👷 Running code-server in the background..."

View File

@@ -13,8 +13,9 @@ Automatically logs the user into Coder when creating their workspace.
```hcl ```hcl
module "coder-login" { module "coder-login" {
source = "https://registry.coder.com/modules/coder-login" source = "registry.coder.com/modules/coder-login/coder"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

View File

@@ -13,7 +13,8 @@ Allow developers to optionally bring their own [dotfiles repository](https://dot
```hcl ```hcl
module "dotfiles" { module "dotfiles" {
source = "https://registry.coder.com/modules/dotfiles" source = "registry.coder.com/modules/dotfiles/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```

View File

@@ -16,8 +16,9 @@ Customize the preselected parameter value:
```hcl ```hcl
module "exoscale-instance-type" { module "exoscale-instance-type" {
source = "https://registry.coder.com/modules/exoscale-instance-type" source = "registry.coder.com/modules/exoscale-instance-type/coder"
default = "standard.medium" version = "1.0.0"
default = "standard.medium"
} }
resource "exoscale_compute_instance" "instance" { resource "exoscale_compute_instance" "instance" {
@@ -43,14 +44,15 @@ Change the display name a type using the corresponding maps:
```hcl ```hcl
module "exoscale-instance-type" { module "exoscale-instance-type" {
source = "https://registry.coder.com/modules/exoscale-instance-type" source = "registry.coder.com/modules/exoscale-instance-type/coder"
default = "standard.medium" version = "1.0.0"
custom_names = { default = "standard.medium"
"standard.medium": "Mittlere Instanz" # German translation custom_names = {
} "standard.medium": "Mittlere Instanz" # German translation
custom_descriptions = { }
"standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation custom_descriptions = {
} "standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation
}
} }
resource "exoscale_compute_instance" "instance" { resource "exoscale_compute_instance" "instance" {
@@ -74,19 +76,20 @@ Show only gpu1 types
```hcl ```hcl
module "exoscale-instance-type" { module "exoscale-instance-type" {
source = "https://registry.coder.com/modules/exoscale-instance-type" source = "registry.coder.com/modules/exoscale-instance-type/coder"
default = "gpu.large" version = "1.0.0"
type_category = ["gpu"] default = "gpu.large"
exclude = [ type_category = ["gpu"]
"gpu2.small", exclude = [
"gpu2.medium", "gpu2.small",
"gpu2.large", "gpu2.medium",
"gpu2.huge", "gpu2.large",
"gpu3.small", "gpu2.huge",
"gpu3.medium", "gpu3.small",
"gpu3.large", "gpu3.medium",
"gpu3.huge" "gpu3.large",
] "gpu3.huge"
]
} }
resource "exoscale_compute_instance" "instance" { resource "exoscale_compute_instance" "instance" {

View File

@@ -16,8 +16,9 @@ Customize the preselected parameter value:
```hcl ```hcl
module "exoscale-zone" { module "exoscale-zone" {
source = "https://registry.coder.com/modules/exoscale-zone" source = "registry.coder.com/modules/exoscale-zone/coder"
default = "ch-dk-2" version = "1.0.0"
default = "ch-dk-2"
} }
@@ -42,14 +43,15 @@ Change the display name and icon for a zone using the corresponding maps:
```hcl ```hcl
module "exoscale-zone" { module "exoscale-zone" {
source = "https://registry.coder.com/modules/exoscale-zone" source = "registry.coder.com/modules/exoscale-zone/coder"
default = "at-vie-1" version = "1.0.0"
custom_names = { default = "at-vie-1"
"at-vie-1": "Home Vienna" custom_names = {
} "at-vie-1": "Home Vienna"
custom_icons = { }
"at-vie-1": "/emojis/1f3e0.png" custom_icons = {
} "at-vie-1": "/emojis/1f3e0.png"
}
} }
data "exoscale_compute_template" "my_template" { data "exoscale_compute_template" "my_template" {
@@ -71,8 +73,9 @@ Hide the Switzerland zones Geneva and Zurich
```hcl ```hcl
module "exoscale-zone" { module "exoscale-zone" {
source = "https://registry.coder.com/modules/exoscale-zone" source = "registry.coder.com/modules/exoscale-zone/coder"
exclude = [ "ch-gva-2", "ch-dk-2" ] version = "1.0.0"
exclude = [ "ch-gva-2", "ch-dk-2" ]
} }
data "exoscale_compute_template" "my_template" { data "exoscale_compute_template" "my_template" {

View File

@@ -13,8 +13,9 @@ A file browser for your workspace.
```hcl ```hcl
module "filebrowser" { module "filebrowser" {
source = "https://registry.coder.com/modules/filebrowser" source = "registry.coder.com/modules/filebrowser/coder"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```
@@ -26,9 +27,10 @@ module "filebrowser" {
```hcl ```hcl
module "filebrowser" { module "filebrowser" {
source = "https://registry.coder.com/modules/filebrowser" source = "registry.coder.com/modules/filebrowser/coder"
agent_id = coder_agent.example.id version = "1.0.0"
folder = "/home/coder/project" agent_id = coder_agent.example.id
folder = "/home/coder/project"
} }
``` ```
@@ -36,8 +38,9 @@ module "filebrowser" {
```hcl ```hcl
module "filebrowser" { module "filebrowser" {
source = "https://registry.coder.com/modules/filebrowser" source = "registry.coder.com/modules/filebrowser/coder"
agent_id = coder_agent.example.id version = "1.0.0"
database_path = ".config/filebrowser.db" agent_id = coder_agent.example.id
database_path = ".config/filebrowser.db"
} }
``` ```

View File

@@ -15,8 +15,9 @@ We can use the simplest format here, only adding a default selection as the `atl
```hcl ```hcl
module "fly-region" { module "fly-region" {
source = "https://registry.coder.com/modules/fly-region" source = "registry.coder.com/modules/fly-region/coder"
default = "atl" version = "1.0.0"
default = "atl"
} }
``` ```
@@ -30,9 +31,10 @@ The regions argument can be used to display only the desired regions in the Code
```hcl ```hcl
module "fly-region" { module "fly-region" {
source = "https://registry.coder.com/modules/fly-region" source = "registry.coder.com/modules/fly-region/coder"
default = "ams" version = "1.0.0"
regions = ["ams", "arn", "atl"] default = "ams"
regions = ["ams", "arn", "atl"]
} }
``` ```
@@ -44,14 +46,15 @@ Set custom icons and names with their respective maps.
```hcl ```hcl
module "fly-region" { module "fly-region" {
source = "https://registry.coder.com/modules/fly-region" source = "registry.coder.com/modules/fly-region/coder"
default = "ams" version = "1.0.0"
custom_icons = { default = "ams"
"ams" = "/emojis/1f90e.png" custom_icons = {
} "ams" = "/emojis/1f90e.png"
custom_names = { }
"ams" = "We love the Netherlands!" custom_names = {
} "ams" = "We love the Netherlands!"
}
} }
``` ```

View File

@@ -13,12 +13,13 @@ This module adds Google Cloud Platform regions to your Coder template.
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "registry.coder.com/modules/gcp-region/coder"
regions = ["us", "europe"] version = "1.0.0"
regions = ["us", "europe"]
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```
@@ -32,14 +33,15 @@ Note: setting `gpu_only = true` and using a default region without GPU support,
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "registry.coder.com/modules/gcp-region/coder"
default = ["us-west1-a"] version = "1.0.0"
regions = ["us-west1"] default = ["us-west1-a"]
gpu_only = false regions = ["us-west1"]
gpu_only = false
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```
@@ -47,13 +49,14 @@ resource "google_compute_instance" "example" {
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "registry.coder.com/modules/gcp-region/coder"
regions = ["europe-west"] version = "1.0.0"
single_zone_per_region = false regions = ["europe-west"]
single_zone_per_region = false
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```
@@ -61,13 +64,14 @@ resource "google_compute_instance" "example" {
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "registry.coder.com/modules/gcp-region/coder"
regions = ["us", "europe"] version = "1.0.0"
gpu_only = true regions = ["us", "europe"]
single_zone_per_region = true gpu_only = true
single_zone_per_region = true
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```

View File

@@ -9,13 +9,14 @@ tags: [git, helper]
# Git Clone # Git Clone
This module allows you to automatically clone a repository by URL and skip if it exists in the path provided. This module allows you to automatically clone a repository by URL and skip if it exists in the base directory provided.
```hcl ```hcl
module "git-clone" { module "git-clone" {
source = "https://registry.coder.com/modules/git-clone" source = "registry.coder.com/modules/git-clone/coder"
agent_id = coder_agent.example.id version = "1.0.0"
url = "https://github.com/coder/coder" agent_id = coder_agent.example.id
url = "https://github.com/coder/coder"
} }
``` ```
@@ -23,7 +24,7 @@ To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-prov
```hcl ```hcl
data "coder_git_auth" "github" { data "coder_git_auth" "github" {
id = "github" id = "github"
} }
``` ```
@@ -33,9 +34,10 @@ data "coder_git_auth" "github" {
```hcl ```hcl
module "git-clone" { module "git-clone" {
source = "https://registry.coder.com/modules/git-clone" source = "registry.coder.com/modules/git-clone/coder"
agent_id = coder_agent.example.id version = "1.0.0"
url = "https://github.com/coder/coder" agent_id = coder_agent.example.id
path = "~/projects/coder/coder" url = "https://github.com/coder/coder"
base_dir = "~/projects/coder"
} }
``` ```

View File

@@ -14,9 +14,9 @@ variable "url" {
type = string type = string
} }
variable "path" { variable "base_dir" {
default = "" default = ""
description = "The path to clone the repository. Defaults to \"$HOME/<basename of url>\"." description = "The base directory to clone the repository. Defaults to \"$HOME\"."
type = string type = string
} }
@@ -25,10 +25,19 @@ variable "agent_id" {
type = string type = string
} }
locals {
clone_path = var.base_dir != "" ? join("/", [var.base_dir, replace(basename(var.url), ".git", "")]) : join("/", ["~", replace(basename(var.url), ".git", "")])
}
output "repo_dir" {
value = local.clone_path
description = "Full path of cloned repo directory"
}
resource "coder_script" "git_clone" { resource "coder_script" "git_clone" {
agent_id = var.agent_id agent_id = var.agent_id
script = templatefile("${path.module}/run.sh", { script = templatefile("${path.module}/run.sh", {
CLONE_PATH : var.path != "" ? var.path : join("/", ["~", basename(var.url)]), CLONE_PATH = local.clone_path
REPO_URL : var.url, REPO_URL : var.url,
}) })
display_name = "Git Clone" display_name = "Git Clone"

View File

@@ -18,7 +18,8 @@ This module has a chance of conflicting with the user's dotfiles / the personali
```hcl ```hcl
module "git-commit-signing" { module "git-commit-signing" {
source = "https://registry.coder.com/modules/git-commit-signing" source = "registry.coder.com/modules/git-commit-signing/coder"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

View File

@@ -13,7 +13,8 @@ Runs a script that updates git credentials in the workspace to match the user's
```hcl ```hcl
module "git-config" { module "git-config" {
source = "https://registry.coder.com/modules/git-config" source = "registry.coder.com/modules/git-config/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@@ -26,7 +27,8 @@ TODO: Add screenshot
```hcl ```hcl
module "git-config" { module "git-config" {
source = "https://registry.coder.com/modules/git-config" source = "registry.coder.com/modules/git-config/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
allow_email_change = true allow_email_change = true
} }
@@ -38,7 +40,8 @@ TODO: Add screenshot
```hcl ```hcl
module "git-config" { module "git-config" {
source = "https://registry.coder.com/modules/git-config" source = "registry.coder.com/modules/git-config/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
allow_username_change = false allow_username_change = false
allow_email_change = false allow_email_change = false

View File

@@ -13,7 +13,8 @@ This module adds a JetBrains Gateway Button to open any workspace with a single
```hcl ```hcl
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "https://registry.coder.com/modules/jetbrains-gateway" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["GO", "WS", "IU", "PY", "PS", "CL", "RM"] jetbrains_ides = ["GO", "WS", "IU", "PY", "PS", "CL", "RM"]
@@ -29,7 +30,8 @@ module "jetbrains_gateway" {
```hcl ```hcl
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "https://registry.coder.com/modules/jetbrains-gateway" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["GO", "WS"] jetbrains_ides = ["GO", "WS"]

View File

@@ -10,17 +10,16 @@ tags: [integration, jfrog]
# JFrog # JFrog
Install the JF CLI and authenticate package managers with Artifactory using OAuth configured via the Coder `external-auth` feature. Install the JF CLI and authenticate package managers with Artifactory using OAuth configured via the Coder [`external-auth`](https://coder.com/docs/v2/latest/admin/external-auth) feature.
<p align="center"> ![JFrog OAuth](../.images/jfrog-oauth.png)
<img src='../.images/jfrog-oauth.png' alt="JFrog OAuth" width='600'>
</p>
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth" source = "registry.coder.com/modules/jfrog-oauth/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com" jfrog_url = "https://example.jfrog.io"
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"
package_managers = { package_managers = {
"npm": "npm", "npm": "npm",
@@ -35,49 +34,7 @@ module "jfrog" {
## Prerequisites ## Prerequisites
Coder [`external-auth`](https://coder.com/docs/v2/latest/admin/external-auth) configured with Artifactory. This requires a [custom integration](https://jfrog.com/help/r/jfrog-installation-setup-documentation/enable-new-integrations) in Artifactory with **Callback URL** set to `https://<your-coder-url>/external-auth/jfrog/callback`. This module is usable by JFrog self-hosted (on-premises) Artifactory as it requires configuring a custom integration. This integration benefits from Coder's [external-auth](https://coder.com/docs/v2/latest/admin/external-auth) feature and allows each user to authenticate with Artifactory using an OAuth flow and issues user-scoped tokens to each user. For configuration instructions, see this [guide](coder.com/docs/v2/latest/guides/artifactory-integration#jfrog-oauth) on the Coder documentation.
To set this up,
1. Modify your `values.yaml` for JFrog Artifactory to add,
```yaml
artifactory:
enabled: true
frontend:
extraEnvironmentVariables:
- name: JF_FRONTEND_FEATURETOGGLER_ACCESSINTEGRATION
value: "true"
access:
accessConfig:
integrations-enabled: true
integration-templates:
- id: "1"
name: "CODER"
redirect-uri: "https://CODER_URL/external-auth/jfrog/callback"
scope: "applied-permissions/user"
```
> Note
> Replace `CODER_URL` with your Coder deployment URL, e.g., <coder.example.com>
2. Add a new [external authetication](https://coder.com/docs/v2/latest/admin/external-auth) to Coder by setting these env variables,
```env
# JFrog Artifactory External Auth
CODER_EXTERNAL_AUTH_1_ID="jfrog"
CODER_EXTERNAL_AUTH_1_TYPE="jfrog"
CODER_EXTERNAL_AUTH_1_CLIENT_ID="YYYYYYYYYYYYYYY"
CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXX"
CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="JFrog Artifactory"
CODER_EXTERNAL_AUTH_1_DISPLAY_ICON="/icon/jfrog.svg"
CODER_EXTERNAL_AUTH_1_AUTH_URL="https://JFROG_URL/ui/authorization"
CODER_EXTERNAL_AUTH_1_TOKEN_URL="https://JFROG_URL/access/api/v1/integrations/YYYYYYYYYYYYYYY/token"
CODER_EXTERNAL_AUTH_1_SCOPES="applied-permissions/user"
```
> Note
> Replace `JFROG_URL` with your JFrog Artifactory base URL, e.g., <artifactory.example.com>
## Examples ## Examples
@@ -85,10 +42,10 @@ Configure the Python pip package manager to fetch packages from Artifactory whil
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth" source = "registry.coder.com/modules/jfrog-oauth/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com" jfrog_url = "https://example.jfrog.io"
auth_method = "oauth"
username_field = "email" username_field = "email"
package_managers = { package_managers = {
"pypi": "pypi" "pypi": "pypi"
@@ -112,9 +69,10 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth" source = "registry.coder.com/modules/jfrog-oauth/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com" jfrog_url = "https://example.jfrog.io"
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"
configure_code_server = true # Add JFrog extension configuration for code-server configure_code_server = true # Add JFrog extension configuration for code-server
package_managers = { package_managers = {
@@ -130,13 +88,14 @@ module "jfrog" {
JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs). JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs).
```hcl ```hcl
provider "docker" { provider "docker" {
... ...
registry_auth { registry_auth {
address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY" address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY"
username = module.jfrog.username username = module.jfrog.username
password = module.jfrog.access_token password = module.jfrog.access_token
} }
} }
``` ```
> Here `REPO_KEY` is the name of docker repository in Artifactory.

View File

@@ -14,7 +14,8 @@ Install the JF CLI and authenticate package managers with Artifactory using Arti
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "registry.coder.com/modules/jfrog-token/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io" jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token artifactory_access_token = var.artifactory_access_token
@@ -26,14 +27,7 @@ module "jfrog" {
} }
``` ```
Get a JFrog access token from your Artifactory instance. The token must be an [admin token](https://registry.terraform.io/providers/jfrog/artifactory/latest/docs#access-token). It is recommended to store the token in a secret terraform variable. For detailed instructions, please see this [guide](https://coder.com/docs/v2/latest/guides/artifactory-integration#jfrog-token) on the Coder documentation.
```hcl
variable "artifactory_access_token" {
type = string
sensitive = true
}
```
> Note > Note
> This module does not install `npm`, `go`, `pip`, etc but only configure them. You need to handle the installation of these tools yourself. > This module does not install `npm`, `go`, `pip`, etc but only configure them. You need to handle the installation of these tools yourself.
@@ -46,7 +40,8 @@ variable "artifactory_access_token" {
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "registry.coder.com/modules/jfrog-token/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://YYYY.jfrog.io" jfrog_url = "https://YYYY.jfrog.io"
artifactory_access_token = var.artifactory_access_token # An admin access token artifactory_access_token = var.artifactory_access_token # An admin access token
@@ -78,7 +73,8 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "registry.coder.com/modules/jfrog-token/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io" jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token artifactory_access_token = var.artifactory_access_token

View File

@@ -15,7 +15,8 @@ A module that adds Jupyter Notebook in your Coder template.
```hcl ```hcl
module "jupyter-notebook" { module "jupyter-notebook" {
source = "https://registry.coder.com/modules/jupyter-notebook" source = "registry.coder.com/modules/jupyter-notebook/coder"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

View File

@@ -15,7 +15,8 @@ A module that adds JupyterLab in your Coder template.
```hcl ```hcl
module "jupyterlab" { module "jupyterlab" {
source = "https://registry.coder.com/modules/jupyterlab" source = "registry.coder.com/modules/jupyterlab/coder"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

View File

@@ -13,7 +13,8 @@ Run a script on workspace start that allows developers to run custom commands to
```hcl ```hcl
module "personalize" { module "personalize" {
source = "https://registry.coder.com/modules/personalize" source = "registry.coder.com/modules/personalize/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```

View File

@@ -12,7 +12,7 @@ tags: [helper]
Add the `slackme` command to your workspace that DMs you on Slack when your command finishes running. Add the `slackme` command to your workspace that DMs you on Slack when your command finishes running.
```bash ```bash
$ slackme npm run long-build slackme npm run long-build
``` ```
## Setup ## Setup
@@ -56,7 +56,8 @@ $ slackme npm run long-build
```hcl ```hcl
module "slackme" { module "slackme" {
source = "https://registry.coder.com/modules/slackme" source = "registry.coder.com/modules/slackme/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
auth_provider_id = "slack" auth_provider_id = "slack"
} }
@@ -71,7 +72,8 @@ $ slackme npm run long-build
```hcl ```hcl
module "slackme" { module "slackme" {
source = "https://registry.coder.com/modules/slackme" source = "registry.coder.com/modules/slackme/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
auth_provider_id = "slack" auth_provider_id = "slack"
slack_message = <<EOF slack_message = <<EOF

View File

@@ -13,9 +13,10 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault-github" source = "registry.coder.com/modules/vault-github/coder"
agent_id = coder_agent.example.id version = "1.0.0"
vault_addr = "https://vault.example.com" agent_id = coder_agent.example.id
vault_addr = "https://vault.example.com"
} }
``` ```
@@ -43,10 +44,11 @@ To configure the Vault module, you must set up a Vault GitHub auth method. See t
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault" source = "registry.coder.com/modules/vault-github/coder"
agent_id = coder_agent.example.id version = "1.0.0"
vault_addr = "https://vault.example.com" agent_id = coder_agent.example.id
coder_github_auth_id = "my-github-auth-id" vault_addr = "https://vault.example.com"
coder_github_auth_id = "my-github-auth-id"
} }
``` ```
@@ -54,11 +56,12 @@ module "vault" {
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault" source = "registry.coder.com/modules/vault-github/coder"
agent_id = coder_agent.example.id version = "1.0.0"
vault_addr = "https://vault.example.com" agent_id = coder_agent.example.id
coder_github_auth_id = "my-github-auth-id" vault_addr = "https://vault.example.com"
vault_github_auth_path = "my-github-auth-path" coder_github_auth_id = "my-github-auth-id"
vault_github_auth_path = "my-github-auth-path"
} }
``` ```
@@ -66,9 +69,10 @@ module "vault" {
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault" source = "registry.coder.com/modules/vault-github/coder"
agent_id = coder_agent.example.id version = "1.0.0"
vault_addr = "https://vault.example.com" agent_id = coder_agent.example.id
vault_cli_version = "1.15.0" vault_addr = "https://vault.example.com"
vault_cli_version = "1.15.0"
} }
``` ```

View File

@@ -15,7 +15,8 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
```hcl ```hcl
module "vscode" { module "vscode" {
source = "https://registry.coder.com/modules/vscode-desktop" source = "registry.coder.com/modules/vscode-desktop/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@@ -26,7 +27,8 @@ module "vscode" {
```hcl ```hcl
module "vscode" { module "vscode" {
source = "https://registry.coder.com/modules/vscode-desktop" source = "registry.coder.com/modules/vscode-desktop/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
folder = "/home/coder/project" folder = "/home/coder/project"
} }

View File

@@ -13,7 +13,8 @@ Automatically install [Visual Studio Code Server](https://code.visualstudio.com/
```hcl ```hcl
module "vscode-web" { module "vscode-web" {
source = "https://registry.coder.com/modules/vscode-web" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
accept_license = true accept_license = true
} }
@@ -27,7 +28,8 @@ module "vscode-web" {
```hcl ```hcl
module "vscode-web" { module "vscode-web" {
source = "https://registry.coder.com/modules/vscode-web" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
install_dir = "/home/coder/.vscode-web" install_dir = "/home/coder/.vscode-web"
folder = "/home/coder" folder = "/home/coder"