Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e254a3bb9 | ||
|
|
1ab53139b3 | ||
|
|
147bea9782 | ||
|
|
8d8910c52a | ||
|
|
c00b7536cb | ||
|
|
d66d7e994e |
3
.github/workflows/update-readme.yaml
vendored
3
.github/workflows/update-readme.yaml
vendored
@@ -9,7 +9,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
update-readme:
|
update-readme:
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -33,6 +33,7 @@ jobs:
|
|||||||
title: 'chore: bump version to ${{ env.TAG }} in README.md files'
|
title: 'chore: bump version to ${{ env.TAG }} in README.md files'
|
||||||
body: 'This is an auto-generated PR to update README.md files of all modules with the new tag ${{ env.TAG }}'
|
body: 'This is an auto-generated PR to update README.md files of all modules with the new tag ${{ env.TAG }}'
|
||||||
branch: 'update-readme-branch'
|
branch: 'update-readme-branch'
|
||||||
|
base: 'main'
|
||||||
env:
|
env:
|
||||||
TAG: ${{ steps.get-latest-tag.outputs.TAG }}
|
TAG: ${{ steps.get-latest-tag.outputs.TAG }}
|
||||||
|
|
||||||
|
|||||||
BIN
.images/hcp-vault-secrets-credentials.png
Normal file
BIN
.images/hcp-vault-secrets-credentials.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 174 KiB |
@@ -32,6 +32,12 @@ variable "display_name" {
|
|||||||
default = "code-server"
|
default = "code-server"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "slug" {
|
||||||
|
type = string
|
||||||
|
description = "The slug for the code-server application."
|
||||||
|
default = "code-server"
|
||||||
|
}
|
||||||
|
|
||||||
variable "settings" {
|
variable "settings" {
|
||||||
type = map(string)
|
type = map(string)
|
||||||
description = "A map of settings to apply to code-server."
|
description = "A map of settings to apply to code-server."
|
||||||
@@ -89,7 +95,7 @@ resource "coder_script" "code-server" {
|
|||||||
|
|
||||||
resource "coder_app" "code-server" {
|
resource "coder_app" "code-server" {
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
slug = "code-server"
|
slug = var.slug
|
||||||
display_name = var.display_name
|
display_name = var.display_name
|
||||||
url = "http://localhost:${var.port}/${var.folder != "" ? "?folder=${urlencode(var.folder)}" : ""}"
|
url = "http://localhost:${var.port}/${var.folder != "" ? "?folder=${urlencode(var.folder)}" : ""}"
|
||||||
icon = "/icon/code.svg"
|
icon = "/icon/code.svg"
|
||||||
|
|||||||
@@ -23,7 +23,14 @@ module "vault" {
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
To configure the HCP Vault Secrets module, you must create an HCP Service Principal from the HCP Vault Secrets app in the HCP console. This will give you the `HCP_CLIENT_ID` and `HCP_CLIENT_SECRET` that you need to authenticate with HCP Vault Secrets. See the [HCP Vault Secrets documentation](https://developer.hashicorp.com/hcp/docs/vault-secrets) for more information.
|
To configure the HCP Vault Secrets module, follow these steps,
|
||||||
|
|
||||||
|
1. [Create secrets in HCP Vault Secrets](https://developer.hashicorp.com/vault/tutorials/hcp-vault-secrets-get-started/hcp-vault-secrets-create-secret)
|
||||||
|
2. Create an HCP Service Principal from the HCP Vault Secrets app in the HCP console. This will give you the `HCP_CLIENT_ID` and `HCP_CLIENT_SECRET` that you need to authenticate with HCP Vault Secrets.
|
||||||
|

|
||||||
|
3. Set `HCP_CLIENT_ID` and `HCP_CLIENT_SECRET` variables on the coder provisioner (recommended) or supply them as input to the module.
|
||||||
|
|
||||||
|
> See the [HCP Vault Secrets documentation](https://developer.hashicorp.com/hcp/docs/vault-secrets) for more information.
|
||||||
|
|
||||||
## Fetch All Secrets
|
## Fetch All Secrets
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ variable "jfrog_url" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "jfrog_server_id" {
|
||||||
|
type = string
|
||||||
|
description = "The server ID of the JFrog instance for JFrog CLI configuration"
|
||||||
|
default = "0"
|
||||||
|
}
|
||||||
|
|
||||||
variable "username_field" {
|
variable "username_field" {
|
||||||
type = string
|
type = string
|
||||||
description = "The field to use for the artifactory username. i.e. Coder username or email."
|
description = "The field to use for the artifactory username. i.e. Coder username or email."
|
||||||
@@ -79,6 +85,7 @@ resource "coder_script" "jfrog" {
|
|||||||
script = templatefile("${path.module}/run.sh", {
|
script = templatefile("${path.module}/run.sh", {
|
||||||
JFROG_URL : var.jfrog_url,
|
JFROG_URL : var.jfrog_url,
|
||||||
JFROG_HOST : local.jfrog_host,
|
JFROG_HOST : local.jfrog_host,
|
||||||
|
JFROG_SERVER_ID : var.jfrog_server_id,
|
||||||
ARTIFACTORY_USERNAME : local.username,
|
ARTIFACTORY_USERNAME : local.username,
|
||||||
ARTIFACTORY_EMAIL : data.coder_workspace.me.owner_email,
|
ARTIFACTORY_EMAIL : data.coder_workspace.me.owner_email,
|
||||||
ARTIFACTORY_ACCESS_TOKEN : data.coder_external_auth.jfrog.access_token,
|
ARTIFACTORY_ACCESS_TOKEN : data.coder_external_auth.jfrog.access_token,
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ fi
|
|||||||
# flows.
|
# flows.
|
||||||
export CI=true
|
export CI=true
|
||||||
# Authenticate JFrog CLI with Artifactory.
|
# Authenticate JFrog CLI with Artifactory.
|
||||||
echo "${ARTIFACTORY_ACCESS_TOKEN}" | jf c add --access-token-stdin --url "${JFROG_URL}" --overwrite 0
|
echo "${ARTIFACTORY_ACCESS_TOKEN}" | jf c add --access-token-stdin --url "${JFROG_URL}" --overwrite "${JFROG_SERVER_ID}"
|
||||||
# Set the configured server as the default.
|
# Set the configured server as the default.
|
||||||
jf c use 0
|
jf c use "${JFROG_SERVER_ID}"
|
||||||
|
|
||||||
# Configure npm to use the Artifactory "npm" repository.
|
# Configure npm to use the Artifactory "npm" repository.
|
||||||
if [ -z "${REPOSITORY_NPM}" ]; then
|
if [ -z "${REPOSITORY_NPM}" ]; then
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ variable "jfrog_url" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "jfrog_server_id" {
|
||||||
|
type = string
|
||||||
|
description = "The server ID of the JFrog instance for JFrog CLI configuration"
|
||||||
|
default = "0"
|
||||||
|
}
|
||||||
|
|
||||||
variable "artifactory_access_token" {
|
variable "artifactory_access_token" {
|
||||||
type = string
|
type = string
|
||||||
description = "The admin-level access token to use for JFrog."
|
description = "The admin-level access token to use for JFrog."
|
||||||
@@ -112,6 +118,7 @@ resource "coder_script" "jfrog" {
|
|||||||
script = templatefile("${path.module}/run.sh", {
|
script = templatefile("${path.module}/run.sh", {
|
||||||
JFROG_URL : var.jfrog_url,
|
JFROG_URL : var.jfrog_url,
|
||||||
JFROG_HOST : local.jfrog_host,
|
JFROG_HOST : local.jfrog_host,
|
||||||
|
JFROG_SERVER_ID : var.jfrog_server_id,
|
||||||
ARTIFACTORY_USERNAME : local.username,
|
ARTIFACTORY_USERNAME : local.username,
|
||||||
ARTIFACTORY_EMAIL : data.coder_workspace.me.owner_email,
|
ARTIFACTORY_EMAIL : data.coder_workspace.me.owner_email,
|
||||||
ARTIFACTORY_ACCESS_TOKEN : artifactory_scoped_token.me.access_token,
|
ARTIFACTORY_ACCESS_TOKEN : artifactory_scoped_token.me.access_token,
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ fi
|
|||||||
# flows.
|
# flows.
|
||||||
export CI=true
|
export CI=true
|
||||||
# Authenticate JFrog CLI with Artifactory.
|
# Authenticate JFrog CLI with Artifactory.
|
||||||
echo "${ARTIFACTORY_ACCESS_TOKEN}" | jf c add --access-token-stdin --url "${JFROG_URL}" --overwrite 0
|
echo "${ARTIFACTORY_ACCESS_TOKEN}" | jf c add --access-token-stdin --url "${JFROG_URL}" --overwrite "${JFROG_SERVER_ID}"
|
||||||
# Set the configured server as the default.
|
# Set the configured server as the default.
|
||||||
jf c use 0
|
jf c use "${JFROG_SERVER_ID}"
|
||||||
|
|
||||||
# Configure npm to use the Artifactory "npm" repository.
|
# Configure npm to use the Artifactory "npm" repository.
|
||||||
if [ -z "${REPOSITORY_NPM}" ]; then
|
if [ -z "${REPOSITORY_NPM}" ]; then
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
|
|||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_addr = "https://vault.example.com"
|
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
|
|||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
coder_github_auth_id = "my-github-auth-id"
|
coder_github_auth_id = "my-github-auth-id"
|
||||||
@@ -58,7 +58,7 @@ module "vault" {
|
|||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
coder_github_auth_id = "my-github-auth-id"
|
coder_github_auth_id = "my-github-auth-id"
|
||||||
@@ -71,7 +71,7 @@ module "vault" {
|
|||||||
```tf
|
```tf
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/modules/vault-github/coder"
|
source = "registry.coder.com/modules/vault-github/coder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
vault_cli_version = "1.15.0"
|
vault_cli_version = "1.15.0"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ variable "vault_token" {
|
|||||||
|
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/modules/vault-token/coder"
|
source = "registry.coder.com/modules/vault-token/coder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_token = var.token
|
vault_token = var.token
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
@@ -74,7 +74,7 @@ variable "vault_token" {
|
|||||||
|
|
||||||
module "vault" {
|
module "vault" {
|
||||||
source = "registry.coder.com/modules/vault-token/coder"
|
source = "registry.coder.com/modules/vault-token/coder"
|
||||||
version = "1.0.3"
|
version = "1.0.4"
|
||||||
agent_id = coder_agent.example.id
|
agent_id = coder_agent.example.id
|
||||||
vault_addr = "https://vault.example.com"
|
vault_addr = "https://vault.example.com"
|
||||||
vault_token = var.token
|
vault_token = var.token
|
||||||
|
|||||||
Reference in New Issue
Block a user