Skip to content

Commit 28ec1b7

Browse files
Merge branch 'main' into dm-fix-defaults-notifications
2 parents 2e03ed1 + 6b1fafb commit 28ec1b7

File tree

13 files changed

+1609
-252
lines changed

13 files changed

+1609
-252
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- "cmd/**"
8181
- "coderd/**"
8282
- "enterprise/**"
83-
- "examples/*"
83+
- "examples/**"
8484
- "helm/**"
8585
- "provisioner/**"
8686
- "provisionerd/**"

coderd/rbac/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Package `rbac` implements Role-Based Access Control for Coder.
44

5+
See [USAGE.md](USAGE.md) for a hands-on approach to using this package.
6+
57
## Overview
68

79
Authorization defines what **permission** a **subject** has to perform **actions** to **objects**:

examples/examples_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,5 @@ func TestSubdirs(t *testing.T) {
5151
entryPaths[header.Typeflag] = append(entryPaths[header.Typeflag], header.Name)
5252
}
5353

54-
require.Subset(t, entryPaths[tar.TypeDir], []string{"build"})
55-
require.Subset(t, entryPaths[tar.TypeReg], []string{"README.md", "main.tf", "build/Dockerfile"})
54+
require.Subset(t, entryPaths[tar.TypeReg], []string{"README.md", "main.tf"})
5655
}

examples/templates/aws-linux/main.tf

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,7 @@ resource "coder_agent" "dev" {
164164
startup_script = <<-EOT
165165
set -e
166166
167-
# Install the latest code-server.
168-
# Append "--version x.x.x" to install a specific version of code-server.
169-
curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server
170-
171-
# Start code-server in the background.
172-
/tmp/code-server/bin/code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
167+
# Add any commands that should be executed at workspace startup (e.g install requirements, start a program, etc) here
173168
EOT
174169

175170
metadata {
@@ -195,21 +190,36 @@ resource "coder_agent" "dev" {
195190
}
196191
}
197192

198-
resource "coder_app" "code-server" {
199-
count = data.coder_workspace.me.start_count
200-
agent_id = coder_agent.dev[0].id
201-
slug = "code-server"
202-
display_name = "code-server"
203-
url = "http://localhost:13337/?folder=/home/coder"
204-
icon = "/icon/code.svg"
205-
subdomain = false
206-
share = "owner"
193+
# See https://registry.coder.com/modules/code-server
194+
module "code-server" {
195+
count = data.coder_workspace.me.start_count
196+
source = "registry.coder.com/modules/code-server/coder"
207197

208-
healthcheck {
209-
url = "http://localhost:13337/healthz"
210-
interval = 3
211-
threshold = 10
212-
}
198+
# This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
199+
version = ">= 1.0.0"
200+
201+
agent_id = coder_agent.dev[0].id
202+
order = 1
203+
}
204+
205+
# See https://registry.coder.com/modules/jetbrains-gateway
206+
module "jetbrains_gateway" {
207+
count = data.coder_workspace.me.start_count
208+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
209+
210+
# JetBrains IDEs to make available for the user to select
211+
jetbrains_ides = ["IU", "PY", "WS", "PS", "RD", "CL", "GO", "RM"]
212+
default = "IU"
213+
214+
# Default folder to open when starting a JetBrains IDE
215+
folder = "/home/coder"
216+
217+
# This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
218+
version = ">= 1.0.0"
219+
220+
agent_id = coder_agent.dev[0].id
221+
agent_name = "dev"
222+
order = 2
213223
}
214224

215225
locals {

examples/templates/docker/build/Dockerfile

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/templates/docker/main.tf

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,9 @@ resource "docker_volume" "home_volume" {
169169
}
170170
}
171171

172-
resource "docker_image" "main" {
173-
name = "coder-${data.coder_workspace.me.id}"
174-
build {
175-
context = "./build"
176-
build_args = {
177-
USER = local.username
178-
}
179-
}
180-
triggers = {
181-
dir_sha1 = sha1(join("", [for f in fileset(path.module, "build/*") : filesha1(f)]))
182-
}
183-
}
184-
185172
resource "docker_container" "workspace" {
186173
count = data.coder_workspace.me.start_count
187-
image = docker_image.main.name
174+
image = "codercom/enterprise-base:ubuntu"
188175
# Uses lower() to avoid Docker restriction on container names.
189176
name = "coder-${data.coder_workspace_owner.me.name}-${lower(data.coder_workspace.me.name)}"
190177
# Hostname makes the shell more user friendly: coder@my-workspace:~$

provisioner/terraform/parse.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ func (s *server) Parse(sess *provisionersdk.Session, _ *proto.ParseRequest, _ <-
2121
defer span.End()
2222

2323
// Load the module and print any parse errors.
24-
module, diags := tfconfig.LoadModule(sess.WorkDirectory)
24+
parser, diags := tfparse.New(sess.WorkDirectory, tfparse.WithLogger(s.logger.Named("tfparse")))
2525
if diags.HasErrors() {
2626
return provisionersdk.ParseErrorf("load module: %s", formatDiagnostics(sess.WorkDirectory, diags))
2727
}
2828

29-
workspaceTags, err := tfparse.WorkspaceTags(ctx, s.logger, module)
29+
workspaceTags, err := parser.WorkspaceTags(ctx)
3030
if err != nil {
3131
return provisionersdk.ParseErrorf("can't load workspace tags: %v", err)
3232
}
3333

34-
templateVariables, err := tfparse.LoadTerraformVariables(module)
34+
templateVariables, err := parser.TemplateVariables()
3535
if err != nil {
3636
return provisionersdk.ParseErrorf("can't load template variables: %v", err)
3737
}

provisioner/terraform/tfparse/tfextract.go

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)