mirror of
https://github.com/coder/registry.git
synced 2026-06-03 13:08:14 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f3a559e83 | |||
| b4c162d281 | |||
| e58fd5d5da |
@@ -70,21 +70,38 @@ update_readme_version() {
|
||||
if grep -q "source.*${module_source}" "$readme_path"; then
|
||||
echo "Updating version references for $namespace/$module_name in $readme_path"
|
||||
awk -v module_source="$module_source" -v new_version="$new_version" '
|
||||
/source.*=.*/ {
|
||||
if ($0 ~ module_source) {
|
||||
in_target_module = 1
|
||||
} else {
|
||||
in_target_module = 0
|
||||
}
|
||||
/^[[:space:]]*module[[:space:]]/ {
|
||||
in_module_block = 1
|
||||
module_content = $0 "\n"
|
||||
module_has_target_source = 0
|
||||
next
|
||||
}
|
||||
/^[[:space:]]*version[[:space:]]*=/ {
|
||||
if (in_target_module) {
|
||||
match($0, /^[[:space]]*/
|
||||
indent = substr($0, 1, RLENGTH)
|
||||
print indent "version = \"" new_version "\""
|
||||
in_target_module = 0
|
||||
in_module_block {
|
||||
module_content = module_content $0 "\n"
|
||||
if ($0 ~ /source.*=/ && $0 ~ module_source) {
|
||||
module_has_target_source = 1
|
||||
}
|
||||
if ($0 ~ /^[[:space:]]*}[[:space:]]*$/) {
|
||||
in_module_block = 0
|
||||
if (module_has_target_source) {
|
||||
num_lines = split(module_content, lines, "\n")
|
||||
for (i = 1; i <= num_lines; i++) {
|
||||
line = lines[i]
|
||||
if (line ~ /^[[:space:]]*version[[:space:]]*=/) {
|
||||
match(line, /^[[:space:]]*/)
|
||||
indent = substr(line, 1, RLENGTH)
|
||||
printf "%sversion = \"%s\"\n", indent, new_version
|
||||
} else {
|
||||
print line
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printf "%s", module_content
|
||||
}
|
||||
module_content = ""
|
||||
next
|
||||
}
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$readme_path" > "${readme_path}.tmp" && mv "${readme_path}.tmp" "$readme_path"
|
||||
|
||||
@@ -14,7 +14,7 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-github/coder"
|
||||
version = "1.0.31"
|
||||
version = "1.1.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
}
|
||||
@@ -46,7 +46,7 @@ To configure the Vault module, you must set up a Vault GitHub auth method. See t
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-github/coder"
|
||||
version = "1.0.31"
|
||||
version = "1.1.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
coder_github_auth_id = "my-github-auth-id"
|
||||
@@ -59,7 +59,7 @@ module "vault" {
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-github/coder"
|
||||
version = "1.0.31"
|
||||
version = "1.1.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
coder_github_auth_id = "my-github-auth-id"
|
||||
@@ -73,7 +73,7 @@ module "vault" {
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-github/coder"
|
||||
version = "1.0.31"
|
||||
version = "1.1.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_cli_version = "1.15.0"
|
||||
|
||||
@@ -32,6 +32,12 @@ variable "vault_github_auth_path" {
|
||||
default = "github"
|
||||
}
|
||||
|
||||
variable "vault_namespace" {
|
||||
type = string
|
||||
description = "The Vault Enterprise namespace that contains the GitHub auth mount."
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "vault_cli_version" {
|
||||
type = string
|
||||
description = "The version of Vault to install."
|
||||
@@ -52,6 +58,7 @@ resource "coder_script" "vault" {
|
||||
AUTH_PATH : var.vault_github_auth_path,
|
||||
GITHUB_EXTERNAL_AUTH_ID : data.coder_external_auth.github.id,
|
||||
INSTALL_VERSION : var.vault_cli_version,
|
||||
VAULT_NAMESPACE : var.vault_namespace != null ? var.vault_namespace : "",
|
||||
})
|
||||
run_on_start = true
|
||||
start_blocks_login = true
|
||||
@@ -63,6 +70,13 @@ resource "coder_env" "vault_addr" {
|
||||
value = var.vault_addr
|
||||
}
|
||||
|
||||
resource "coder_env" "vault_namespace" {
|
||||
count = var.vault_namespace == null ? 0 : 1
|
||||
agent_id = var.agent_id
|
||||
name = "VAULT_NAMESPACE"
|
||||
value = var.vault_namespace
|
||||
}
|
||||
|
||||
data "coder_external_auth" "github" {
|
||||
id = var.coder_github_auth_id
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
INSTALL_VERSION=${INSTALL_VERSION}
|
||||
GITHUB_EXTERNAL_AUTH_ID=${GITHUB_EXTERNAL_AUTH_ID}
|
||||
AUTH_PATH=${AUTH_PATH}
|
||||
VAULT_NAMESPACE=${VAULT_NAMESPACE}
|
||||
|
||||
fetch() {
|
||||
dest="$1"
|
||||
@@ -104,6 +105,11 @@ if ! (
|
||||
fi
|
||||
rm -rf "$TMP"
|
||||
|
||||
if [ -n "$${VAULT_NAMESPACE}" ]; then
|
||||
export VAULT_NAMESPACE
|
||||
printf "📁 Using Vault namespace: %s\n\n" "$${VAULT_NAMESPACE}"
|
||||
fi
|
||||
|
||||
# Authenticate with Vault
|
||||
printf "🔑 Authenticating with Vault ...\n\n"
|
||||
GITHUB_TOKEN=$(coder external-auth access-token "$${GITHUB_EXTERNAL_AUTH_ID}")
|
||||
|
||||
@@ -14,7 +14,7 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-jwt/coder"
|
||||
version = "1.1.1"
|
||||
version = "1.2.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_jwt_role = "coder" # The Vault role to use for authentication
|
||||
@@ -42,7 +42,7 @@ curl -H "X-Vault-Token: ${VAULT_TOKEN}" -X GET "${VAULT_ADDR}/v1/coder/secrets/d
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-jwt/coder"
|
||||
version = "1.1.1"
|
||||
version = "1.2.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_jwt_auth_path = "oidc"
|
||||
@@ -58,7 +58,7 @@ data "coder_workspace_owner" "me" {}
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-jwt/coder"
|
||||
version = "1.1.1"
|
||||
version = "1.2.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_jwt_role = data.coder_workspace_owner.me.groups[0]
|
||||
@@ -71,7 +71,7 @@ module "vault" {
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-jwt/coder"
|
||||
version = "1.1.1"
|
||||
version = "1.2.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_jwt_role = "coder" # The Vault role to use for authentication
|
||||
@@ -132,7 +132,7 @@ resource "jwt_signed_token" "vault" {
|
||||
module "vault" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "registry.coder.com/coder/vault-jwt/coder"
|
||||
version = "1.1.1"
|
||||
version = "1.2.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_jwt_role = "coder" # The Vault role to use for authentication
|
||||
|
||||
@@ -38,6 +38,12 @@ variable "vault_jwt_role" {
|
||||
description = "The name of the Vault role to use for authentication."
|
||||
}
|
||||
|
||||
variable "vault_namespace" {
|
||||
type = string
|
||||
description = "The Vault Enterprise namespace that contains the JWT auth mount."
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "vault_cli_version" {
|
||||
type = string
|
||||
description = "The version of Vault to install."
|
||||
@@ -57,6 +63,7 @@ resource "coder_script" "vault" {
|
||||
VAULT_JWT_AUTH_PATH : var.vault_jwt_auth_path,
|
||||
VAULT_JWT_ROLE : var.vault_jwt_role,
|
||||
VAULT_CLI_VERSION : var.vault_cli_version,
|
||||
VAULT_NAMESPACE : var.vault_namespace != null ? var.vault_namespace : "",
|
||||
})
|
||||
run_on_start = true
|
||||
start_blocks_login = true
|
||||
@@ -68,4 +75,11 @@ resource "coder_env" "vault_addr" {
|
||||
value = var.vault_addr
|
||||
}
|
||||
|
||||
resource "coder_env" "vault_namespace" {
|
||||
count = var.vault_namespace == null ? 0 : 1
|
||||
agent_id = var.agent_id
|
||||
name = "VAULT_NAMESPACE"
|
||||
value = var.vault_namespace
|
||||
}
|
||||
|
||||
data "coder_workspace_owner" "me" {}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
VAULT_CLI_VERSION=${VAULT_CLI_VERSION}
|
||||
VAULT_JWT_AUTH_PATH=${VAULT_JWT_AUTH_PATH}
|
||||
VAULT_JWT_ROLE=${VAULT_JWT_ROLE}
|
||||
VAULT_NAMESPACE=${VAULT_NAMESPACE}
|
||||
CODER_OIDC_ACCESS_TOKEN=${CODER_OIDC_ACCESS_TOKEN}
|
||||
|
||||
fetch() {
|
||||
@@ -105,6 +106,11 @@ if ! (
|
||||
fi
|
||||
rm -rf "$TMP"
|
||||
|
||||
if [ -n "$${VAULT_NAMESPACE}" ]; then
|
||||
export VAULT_NAMESPACE
|
||||
printf "📁 Using Vault namespace: %s\n\n" "$${VAULT_NAMESPACE}"
|
||||
fi
|
||||
|
||||
# Authenticate with Vault
|
||||
printf "🔑 Authenticating with Vault ...\n\n"
|
||||
echo "$${CODER_OIDC_ACCESS_TOKEN}" | vault write -field=token auth/"$${VAULT_JWT_AUTH_PATH}"/login role="$${VAULT_JWT_ROLE}" jwt=- | vault login -
|
||||
|
||||
@@ -19,7 +19,7 @@ variable "vault_token" {
|
||||
|
||||
module "vault" {
|
||||
source = "registry.coder.com/coder/vault-token/coder"
|
||||
version = "1.2.2"
|
||||
version = "1.3.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_token = var.token # optional
|
||||
vault_addr = "https://vault.example.com"
|
||||
@@ -73,7 +73,7 @@ variable "vault_token" {
|
||||
|
||||
module "vault" {
|
||||
source = "registry.coder.com/coder/vault-token/coder"
|
||||
version = "1.2.2"
|
||||
version = "1.3.0"
|
||||
agent_id = coder_agent.example.id
|
||||
vault_addr = "https://vault.example.com"
|
||||
vault_token = var.token
|
||||
|
||||
@@ -50,6 +50,7 @@ resource "coder_script" "vault" {
|
||||
icon = "/icon/vault.svg"
|
||||
script = templatefile("${path.module}/run.sh", {
|
||||
INSTALL_VERSION : var.vault_cli_version,
|
||||
VAULT_NAMESPACE : var.vault_namespace != null ? var.vault_namespace : "",
|
||||
})
|
||||
run_on_start = true
|
||||
start_blocks_login = true
|
||||
@@ -73,4 +74,4 @@ resource "coder_env" "vault_namespace" {
|
||||
agent_id = var.agent_id
|
||||
name = "VAULT_NAMESPACE"
|
||||
value = var.vault_namespace
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
# Convert all templated variables to shell variables
|
||||
INSTALL_VERSION=${INSTALL_VERSION}
|
||||
VAULT_NAMESPACE=${VAULT_NAMESPACE}
|
||||
|
||||
fetch() {
|
||||
dest="$1"
|
||||
@@ -101,3 +102,8 @@ if ! (
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "$TMP"
|
||||
|
||||
if [ -n "$${VAULT_NAMESPACE}" ]; then
|
||||
export VAULT_NAMESPACE
|
||||
printf "📁 Using Vault namespace: %s\n\n" "$${VAULT_NAMESPACE}"
|
||||
fi
|
||||
|
||||
@@ -3,7 +3,7 @@ display_name: airflow
|
||||
description: A module that adds Apache Airflow in your Coder template
|
||||
icon: ../../../../.icons/airflow.svg
|
||||
maintainer_github: nataindata
|
||||
verified: true
|
||||
verified: false
|
||||
tags: [airflow, ide, web]
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
display_name: DigitalOcean Region
|
||||
description: A parameter with human region names and icons
|
||||
icon: ../../../../.icons/digital-ocean.svg
|
||||
verified: true
|
||||
verified: false
|
||||
tags: [helper, parameter, digitalocean, regions]
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user