Skip to content

Commit dfd2dd0

Browse files
authored
feat: deprecate relative_path in favor of subdomain (#61)
* feat: deprecate relative_path in favor of subdomain * fixup! feat: deprecate relative_path in favor of subdomain
1 parent b6d7077 commit dfd2dd0

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

Diff for: docs/resources/app.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ EOF
2626
}
2727
2828
resource "coder_app" "code-server" {
29-
agent_id = coder_agent.dev.id
30-
name = "VS Code"
31-
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
32-
url = "http://localhost:13337"
33-
relative_path = true
29+
agent_id = coder_agent.dev.id
30+
name = "VS Code"
31+
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
32+
url = "http://localhost:13337"
33+
subdomain = false
3434
healthcheck {
3535
url = "http://localhost:13337/healthz"
3636
interval = 5
@@ -66,7 +66,8 @@ resource "coder_app" "intellij" {
6666
- `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck))
6767
- `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icons. Use a built-in icon with `data.coder_workspace.me.access_url + "/icons/<path>"`.
6868
- `name` (String) A display name to identify the app.
69-
- `relative_path` (Boolean) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable.
69+
- `relative_path` (Boolean, Deprecated) Specifies whether the URL will be accessed via a relative path or wildcard. Use if wildcard routing is unavailable. Defaults to true.
70+
- `subdomain` (Boolean) Determines whether the app will be accessed via it's own subdomain or whether it will be accessed via a path on Coder. If wildcards have not been setup by the administrator then apps with "subdomain" set to true will not be accessible. Defaults to false.
7071
- `url` (String) A URL to be proxied to from inside the workspace. Either "command" or "url" may be specified, but not both.
7172

7273
### Read-Only

Diff for: examples/resources/coder_app/resource.tf

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ EOF
1111
}
1212

1313
resource "coder_app" "code-server" {
14-
agent_id = coder_agent.dev.id
15-
name = "VS Code"
16-
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
17-
url = "http://localhost:13337"
18-
relative_path = true
14+
agent_id = coder_agent.dev.id
15+
name = "VS Code"
16+
icon = data.coder_workspace.me.access_url + "/icons/vscode.svg"
17+
url = "http://localhost:13337"
18+
subdomain = false
1919
healthcheck {
2020
url = "http://localhost:13337/healthz"
2121
interval = 5

Diff for: provider/app.go

+14-5
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,21 @@ func appResource() *schema.Resource {
6060
Optional: true,
6161
},
6262
"relative_path": {
63-
Type: schema.TypeBool,
63+
Type: schema.TypeBool,
64+
Deprecated: "`relative_path` on apps is deprecated, use `subdomain` instead.",
6465
Description: "Specifies whether the URL will be accessed via a relative " +
65-
"path or wildcard. Use if wildcard routing is unavailable.",
66-
ForceNew: true,
67-
Optional: true,
68-
ConflictsWith: []string{"command"},
66+
"path or wildcard. Use if wildcard routing is unavailable. Defaults to true.",
67+
ForceNew: true,
68+
Optional: true,
69+
},
70+
"subdomain": {
71+
Type: schema.TypeBool,
72+
Description: "Determines whether the app will be accessed via it's own " +
73+
"subdomain or whether it will be accessed via a path on Coder. If " +
74+
"wildcards have not been setup by the administrator then apps with " +
75+
"\"subdomain\" set to true will not be accessible. Defaults to false.",
76+
ForceNew: true,
77+
Optional: true,
6978
},
7079
"url": {
7180
Type: schema.TypeString,

Diff for: provider/app_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestApp(t *testing.T) {
2929
agent_id = coder_agent.dev.id
3030
name = "code-server"
3131
icon = "builtin:vim"
32-
relative_path = true
32+
subdomain = false
3333
url = "http://localhost:13337"
3434
healthcheck {
3535
url = "http://localhost:13337/healthz"
@@ -47,7 +47,7 @@ func TestApp(t *testing.T) {
4747
"agent_id",
4848
"name",
4949
"icon",
50-
"relative_path",
50+
"subdomain",
5151
"url",
5252
"healthcheck.0.url",
5353
"healthcheck.0.interval",

0 commit comments

Comments
 (0)