mirror of
https://github.com/coder/coder.git
synced 2026-11-05 15:54:09 +08:00
feat: add a per-template workspace rename setting (#27558)
This commit is contained in:
@@ -45,7 +45,7 @@ We track the following resources:
|
||||
| PrebuildsSettings<br><i></i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>id</td><td>false</td></tr><tr><td>reconciliation_paused</td><td>true</td></tr></tbody></table> |
|
||||
| RoleSyncSettings<br><i></i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>field</td><td>true</td></tr><tr><td>mapping</td><td>true</td></tr></tbody></table> |
|
||||
| TaskTable<br><i></i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>created_at</td><td>false</td></tr><tr><td>deleted_at</td><td>false</td></tr><tr><td>display_name</td><td>true</td></tr><tr><td>id</td><td>true</td></tr><tr><td>name</td><td>true</td></tr><tr><td>organization_id</td><td>false</td></tr><tr><td>owner_id</td><td>true</td></tr><tr><td>prompt</td><td>true</td></tr><tr><td>template_parameters</td><td>true</td></tr><tr><td>template_version_id</td><td>true</td></tr><tr><td>workspace_id</td><td>true</td></tr></tbody></table> |
|
||||
| Template<br><i>write, delete</i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>active_version_id</td><td>true</td></tr><tr><td>activity_bump</td><td>true</td></tr><tr><td>agents_allowed</td><td>true</td></tr><tr><td>allow_user_autostart</td><td>true</td></tr><tr><td>allow_user_autostop</td><td>true</td></tr><tr><td>allow_user_cancel_workspace_jobs</td><td>true</td></tr><tr><td>autostart_block_days_of_week</td><td>true</td></tr><tr><td>autostop_requirement_days_of_week</td><td>true</td></tr><tr><td>autostop_requirement_weeks</td><td>true</td></tr><tr><td>cors_behavior</td><td>true</td></tr><tr><td>created_at</td><td>false</td></tr><tr><td>created_by</td><td>true</td></tr><tr><td>created_by_avatar_url</td><td>false</td></tr><tr><td>created_by_name</td><td>false</td></tr><tr><td>created_by_username</td><td>false</td></tr><tr><td>default_ttl</td><td>true</td></tr><tr><td>deleted</td><td>false</td></tr><tr><td>deprecated</td><td>true</td></tr><tr><td>description</td><td>true</td></tr><tr><td>disable_module_cache</td><td>true</td></tr><tr><td>display_name</td><td>true</td></tr><tr><td>failure_ttl</td><td>true</td></tr><tr><td>group_acl</td><td>true</td></tr><tr><td>icon</td><td>true</td></tr><tr><td>id</td><td>true</td></tr><tr><td>max_port_sharing_level</td><td>true</td></tr><tr><td>name</td><td>true</td></tr><tr><td>organization_display_name</td><td>false</td></tr><tr><td>organization_icon</td><td>false</td></tr><tr><td>organization_id</td><td>false</td></tr><tr><td>organization_name</td><td>false</td></tr><tr><td>provisioner</td><td>true</td></tr><tr><td>require_active_version</td><td>true</td></tr><tr><td>time_til_autostop_notify</td><td>true</td></tr><tr><td>time_til_dormant</td><td>true</td></tr><tr><td>time_til_dormant_autodelete</td><td>true</td></tr><tr><td>updated_at</td><td>false</td></tr><tr><td>use_classic_parameter_flow</td><td>true</td></tr><tr><td>user_acl</td><td>true</td></tr></tbody></table> |
|
||||
| Template<br><i>write, delete</i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>active_version_id</td><td>true</td></tr><tr><td>activity_bump</td><td>true</td></tr><tr><td>agents_allowed</td><td>true</td></tr><tr><td>allow_user_autostart</td><td>true</td></tr><tr><td>allow_user_autostop</td><td>true</td></tr><tr><td>allow_user_cancel_workspace_jobs</td><td>true</td></tr><tr><td>allow_workspace_renames</td><td>true</td></tr><tr><td>autostart_block_days_of_week</td><td>true</td></tr><tr><td>autostop_requirement_days_of_week</td><td>true</td></tr><tr><td>autostop_requirement_weeks</td><td>true</td></tr><tr><td>cors_behavior</td><td>true</td></tr><tr><td>created_at</td><td>false</td></tr><tr><td>created_by</td><td>true</td></tr><tr><td>created_by_avatar_url</td><td>false</td></tr><tr><td>created_by_name</td><td>false</td></tr><tr><td>created_by_username</td><td>false</td></tr><tr><td>default_ttl</td><td>true</td></tr><tr><td>deleted</td><td>false</td></tr><tr><td>deprecated</td><td>true</td></tr><tr><td>description</td><td>true</td></tr><tr><td>disable_module_cache</td><td>true</td></tr><tr><td>display_name</td><td>true</td></tr><tr><td>failure_ttl</td><td>true</td></tr><tr><td>group_acl</td><td>true</td></tr><tr><td>icon</td><td>true</td></tr><tr><td>id</td><td>true</td></tr><tr><td>max_port_sharing_level</td><td>true</td></tr><tr><td>name</td><td>true</td></tr><tr><td>organization_display_name</td><td>false</td></tr><tr><td>organization_icon</td><td>false</td></tr><tr><td>organization_id</td><td>false</td></tr><tr><td>organization_name</td><td>false</td></tr><tr><td>provisioner</td><td>true</td></tr><tr><td>require_active_version</td><td>true</td></tr><tr><td>time_til_autostop_notify</td><td>true</td></tr><tr><td>time_til_dormant</td><td>true</td></tr><tr><td>time_til_dormant_autodelete</td><td>true</td></tr><tr><td>updated_at</td><td>false</td></tr><tr><td>use_classic_parameter_flow</td><td>true</td></tr><tr><td>user_acl</td><td>true</td></tr></tbody></table> |
|
||||
| TemplateVersion<br><i>create, write</i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>archived</td><td>true</td></tr><tr><td>created_at</td><td>false</td></tr><tr><td>created_by</td><td>true</td></tr><tr><td>created_by_avatar_url</td><td>false</td></tr><tr><td>created_by_name</td><td>false</td></tr><tr><td>created_by_username</td><td>false</td></tr><tr><td>external_auth_providers</td><td>false</td></tr><tr><td>has_ai_task</td><td>false</td></tr><tr><td>has_external_agent</td><td>false</td></tr><tr><td>id</td><td>true</td></tr><tr><td>job_id</td><td>false</td></tr><tr><td>message</td><td>false</td></tr><tr><td>name</td><td>true</td></tr><tr><td>organization_id</td><td>false</td></tr><tr><td>readme</td><td>true</td></tr><tr><td>source_example_id</td><td>false</td></tr><tr><td>template_id</td><td>true</td></tr><tr><td>updated_at</td><td>false</td></tr></tbody></table> |
|
||||
| User<br><i>create, write, delete</i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>avatar_url</td><td>false</td></tr><tr><td>chat_spend_limit_micros</td><td>true</td></tr><tr><td>created_at</td><td>false</td></tr><tr><td>deleted</td><td>true</td></tr><tr><td>email</td><td>true</td></tr><tr><td>github_com_user_id</td><td>false</td></tr><tr><td>hashed_one_time_passcode</td><td>false</td></tr><tr><td>hashed_password</td><td>true</td></tr><tr><td>id</td><td>true</td></tr><tr><td>is_service_account</td><td>true</td></tr><tr><td>is_system</td><td>true</td></tr><tr><td>last_seen_at</td><td>false</td></tr><tr><td>login_type</td><td>true</td></tr><tr><td>name</td><td>true</td></tr><tr><td>one_time_passcode_expires_at</td><td>true</td></tr><tr><td>quiet_hours_schedule</td><td>true</td></tr><tr><td>rbac_roles</td><td>true</td></tr><tr><td>status</td><td>true</td></tr><tr><td>updated_at</td><td>false</td></tr><tr><td>username</td><td>true</td></tr></tbody></table> |
|
||||
| UserSecret<br><i>create, write, delete</i> | <table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody> | <tr><td>created_at</td><td>false</td></tr><tr><td>description</td><td>true</td></tr><tr><td>enabled</td><td>true</td></tr><tr><td>env_name</td><td>true</td></tr><tr><td>file_path</td><td>true</td></tr><tr><td>id</td><td>true</td></tr><tr><td>name</td><td>true</td></tr><tr><td>updated_at</td><td>false</td></tr><tr><td>user_id</td><td>true</td></tr><tr><td>value</td><td>true</td></tr><tr><td>value_key_id</td><td>false</td></tr></tbody></table> |
|
||||
|
||||
@@ -22,15 +22,6 @@ Deprecated options are listed at the end of each section.
|
||||
|
||||
## General
|
||||
|
||||
### Allow workspace renames
|
||||
|
||||
Allow users to rename their workspaces. WARNING: Renaming a workspace can cause Terraform resources that depend on the workspace name to be destroyed and recreated, potentially causing data loss. Only enable this if your templates do not use workspace names in resource identifiers, or if you understand the risks.
|
||||
|
||||
- Environment variable: `CODER_ALLOW_WORKSPACE_RENAMES`
|
||||
- CLI flag: [`--allow-workspace-renames`](../../reference/cli/server.md#--allow-workspace-renames)
|
||||
- YAML key: `allowWorkspaceRenames`
|
||||
- Default value: `false`
|
||||
|
||||
### Cache directory
|
||||
|
||||
The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is set, it will be used for compatibility with systemd. This directory is NOT safe to be configured as a shared directory across coderd/provisionerd replicas.
|
||||
|
||||
@@ -52,12 +52,19 @@ Because we depend on `coder_workspace.me.owner`, if the owner changes their
|
||||
username, Terraform will recreate the volume (wiping its data!) the next time
|
||||
that Coder starts the workspace.
|
||||
|
||||
To prevent this, use immutable IDs:
|
||||
✅ To prevent this, use immutable IDs:
|
||||
|
||||
- `coder_workspace.me.owner_id`
|
||||
- `coder_workspace.me.id`
|
||||
|
||||
You should also avoid using `coder_workspace.me.name` if your deployment allows workspace renaming via `CODER_ALLOW_WORKSPACE_RENAMES` or `--allow-workspace-renames`.
|
||||
⚠️ Avoid mutable IDs:
|
||||
|
||||
- `coder_workspace.me.name`
|
||||
- `coder_workspace.me.owner`
|
||||
|
||||
Workspace renaming is disabled by default to help prevent this kind of
|
||||
destruction, but a template admin can enable it. Refer to
|
||||
[Workspace renaming](../managing-templates/index.md#workspace-renaming).
|
||||
|
||||
```tf
|
||||
data "coder_workspace" "me" {
|
||||
|
||||
@@ -77,6 +77,49 @@ automatically updated on the next startup.
|
||||
|
||||

|
||||
|
||||
## Workspace renaming
|
||||
|
||||
Workspace renaming is disabled by default on every template.
|
||||
Enable it per template, once you have confirmed that a rename won't destroy anything.
|
||||
|
||||
Terraform exposes the workspace name as `data.coder_workspace.me.name`.
|
||||
If a template uses that value in an attribute Terraform can't change in place, renaming the workspace makes Terraform destroy the resource and create a new one on the next build.
|
||||
When that resource is the home volume, the developer loses their data.
|
||||
|
||||
Other uses of the name are harmless.
|
||||
A Kubernetes label or an environment variable changes without replacing anything.
|
||||
Coder can't tell the two cases apart, so the decision stays with the template admin.
|
||||
|
||||
### Check whether your template is safe to rename
|
||||
|
||||
Search the template for uses of the workspace name:
|
||||
|
||||
```sh
|
||||
grep -rn 'coder_workspace\.[a-z_]*\.name' .
|
||||
```
|
||||
|
||||
For each result, ask whether Terraform would replace the resource if that value changed.
|
||||
Attributes such as a volume name, a disk name, or an instance name usually force replacement.
|
||||
Labels, tags, and environment variables usually don't.
|
||||
|
||||
If a resource would be replaced, reference an immutable identifier instead, such as `data.coder_workspace.me.id`.
|
||||
Refer to [Resource persistence](../extending-templates/resource-persistence.md) for the full set of practices.
|
||||
|
||||
### Enable renaming for a template
|
||||
|
||||
1. Go to the template, then select **Settings**.
|
||||
1. On the **General** page, under **Operations**, select **Allow users to rename their workspaces**.
|
||||
1. Select **Save**.
|
||||
|
||||
Developers can then rename a workspace from the workspace's **Settings** page, or with `coder rename`.
|
||||
|
||||
While the setting is off, the workspace name field is disabled and the API rejects renames.
|
||||
|
||||
> [!WARNING]
|
||||
> The deployment-wide `CODER_ALLOW_WORKSPACE_RENAMES` option is deprecated.
|
||||
> While it is set, renaming is enabled for every template in the deployment, and the per-template setting can't turn it off.
|
||||
> Unset it, then enable renaming on the templates that need it.
|
||||
|
||||
## Delete templates
|
||||
|
||||
You can delete a template using both the coder CLI and UI. Only
|
||||
|
||||
Generated
+86
-79
@@ -6449,6 +6449,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -6487,6 +6488,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
| `allow_user_autostart` | boolean | false | | Allow user autostart allows users to set a schedule for autostarting their workspace. By default this is true. This can only be disabled when using an enterprise license. |
|
||||
| `allow_user_autostop` | boolean | false | | Allow user autostop allows users to set a custom workspace TTL to use in place of the template's DefaultTTL field. By default this is true. If false, the DefaultTTL will always be used. This can only be disabled when using an enterprise license. |
|
||||
| `allow_user_cancel_workspace_jobs` | boolean | false | | Allow users to cancel in-progress workspace jobs. *bool as the default value is "true". |
|
||||
| `allow_workspace_renames` | boolean | false | | Allow workspace renames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name, so this defaults to false. |
|
||||
| `autostart_requirement` | [codersdk.TemplateAutostartRequirement](#codersdktemplateautostartrequirement) | false | | Autostart requirement allows optionally specifying the autostart allowed days for workspaces created from this template. This is an enterprise feature. |
|
||||
| `autostop_requirement` | [codersdk.TemplateAutostopRequirement](#codersdktemplateautostoprequirement) | false | | Autostop requirement allows optionally specifying the autostop requirement for workspaces created from this template. This is an enterprise feature. |
|
||||
| `cors_behavior` | [codersdk.CORSBehavior](#codersdkcorsbehavior) | false | | Cors behavior allows optionally specifying the CORS behavior for all shared ports. |
|
||||
@@ -8421,84 +8423,84 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|------------------------------------------------|------------------------------------------------------------------------------------------------------|----------|--------------|--------------------------------------------------------------------|
|
||||
| `access_url` | [serpent.URL](#serpenturl) | false | | |
|
||||
| `additional_csp_policy` | array of string | false | | |
|
||||
| `address` | [serpent.HostPort](#serpenthostport) | false | | Deprecated: Use HTTPAddress or TLS.Address instead. |
|
||||
| `agent_fallback_troubleshooting_url` | [serpent.URL](#serpenturl) | false | | |
|
||||
| `agent_stat_refresh_interval` | integer | false | | |
|
||||
| `ai` | [codersdk.AIConfig](#codersdkaiconfig) | false | | |
|
||||
| `allow_workspace_renames` | boolean | false | | |
|
||||
| `autobuild_poll_interval` | integer | false | | |
|
||||
| `browser_only` | boolean | false | | |
|
||||
| `cache_directory` | string | false | | |
|
||||
| `cli_upgrade_message` | string | false | | |
|
||||
| `cluster` | [codersdk.ClusterConfig](#codersdkclusterconfig) | false | | |
|
||||
| `config` | string | false | | |
|
||||
| `config_ssh` | [codersdk.SSHConfig](#codersdksshconfig) | false | | |
|
||||
| `dangerous` | [codersdk.DangerousConfig](#codersdkdangerousconfig) | false | | |
|
||||
| `derp` | [codersdk.DERP](#codersdkderp) | false | | |
|
||||
| `disable_chat_sharing` | boolean | false | | |
|
||||
| `disable_owner_workspace_exec` | boolean | false | | |
|
||||
| `disable_password_auth` | boolean | false | | |
|
||||
| `disable_path_apps` | boolean | false | | |
|
||||
| `disable_workspace_agent_context_sync` | boolean | false | | |
|
||||
| `disable_workspace_sharing` | boolean | false | | |
|
||||
| `docs_url` | [serpent.URL](#serpenturl) | false | | |
|
||||
| `enable_ai_tasks` | boolean | false | | |
|
||||
| `enable_authz_recording` | boolean | false | | |
|
||||
| `enable_terraform_debug_mode` | boolean | false | | |
|
||||
| `ephemeral_deployment` | boolean | false | | |
|
||||
| `experiments` | array of string | false | | |
|
||||
| `external_auth` | [serpent.Struct-array_codersdk_ExternalAuthConfig](#serpentstruct-array_codersdk_externalauthconfig) | false | | |
|
||||
| `external_auth_github_default_provider_enable` | boolean | false | | |
|
||||
| `external_token_encryption_keys` | array of string | false | | |
|
||||
| `healthcheck` | [codersdk.HealthcheckConfig](#codersdkhealthcheckconfig) | false | | |
|
||||
| `http_address` | string | false | | Http address is a string because it may be set to zero to disable. |
|
||||
| `http_cookies` | [codersdk.HTTPCookieConfig](#codersdkhttpcookieconfig) | false | | |
|
||||
| `job_hang_detector_interval` | integer | false | | |
|
||||
| `logging` | [codersdk.LoggingConfig](#codersdkloggingconfig) | false | | |
|
||||
| `metrics_cache_refresh_interval` | integer | false | | |
|
||||
| `notifications` | [codersdk.NotificationsConfig](#codersdknotificationsconfig) | false | | |
|
||||
| `oauth2` | [codersdk.OAuth2Config](#codersdkoauth2config) | false | | |
|
||||
| `oidc` | [codersdk.OIDCConfig](#codersdkoidcconfig) | false | | |
|
||||
| `pg_auth` | string | false | | |
|
||||
| `pg_conn_max_idle` | string | false | | |
|
||||
| `pg_conn_max_open` | integer | false | | |
|
||||
| `pg_connection_url` | string | false | | |
|
||||
| `pprof` | [codersdk.PprofConfig](#codersdkpprofconfig) | false | | |
|
||||
| `prometheus` | [codersdk.PrometheusConfig](#codersdkprometheusconfig) | false | | |
|
||||
| `provisioner` | [codersdk.ProvisionerConfig](#codersdkprovisionerconfig) | false | | |
|
||||
| `proxy_health_status_interval` | integer | false | | |
|
||||
| `proxy_trusted_headers` | array of string | false | | |
|
||||
| `proxy_trusted_origins` | array of string | false | | |
|
||||
| `rate_limit` | [codersdk.RateLimitConfig](#codersdkratelimitconfig) | false | | |
|
||||
| `redirect_to_access_url` | boolean | false | | |
|
||||
| `retention` | [codersdk.RetentionConfig](#codersdkretentionconfig) | false | | |
|
||||
| `scim_api_key` | string | false | | |
|
||||
| `scim_use_legacy` | boolean | false | | |
|
||||
| `session_lifetime` | [codersdk.SessionLifetime](#codersdksessionlifetime) | false | | |
|
||||
| `ssh_keygen_algorithm` | string | false | | |
|
||||
| `stats_collection` | [codersdk.StatsCollectionConfig](#codersdkstatscollectionconfig) | false | | |
|
||||
| `strict_transport_security` | integer | false | | |
|
||||
| `strict_transport_security_options` | array of string | false | | |
|
||||
| `support` | [codersdk.SupportConfig](#codersdksupportconfig) | false | | |
|
||||
| `swagger` | [codersdk.SwaggerConfig](#codersdkswaggerconfig) | false | | |
|
||||
| `telemetry` | [codersdk.TelemetryConfig](#codersdktelemetryconfig) | false | | |
|
||||
| `template_builder` | [codersdk.TemplateBuilderConfig](#codersdktemplatebuilderconfig) | false | | |
|
||||
| `terms_of_service_url` | string | false | | |
|
||||
| `tls` | [codersdk.TLSConfig](#codersdktlsconfig) | false | | |
|
||||
| `trace` | [codersdk.TraceConfig](#codersdktraceconfig) | false | | |
|
||||
| `update_check` | boolean | false | | |
|
||||
| `user_quiet_hours_schedule` | [codersdk.UserQuietHoursScheduleConfig](#codersdkuserquiethoursscheduleconfig) | false | | |
|
||||
| `verbose` | boolean | false | | |
|
||||
| `web_terminal_renderer` | string | false | | |
|
||||
| `wgtunnel_host` | string | false | | |
|
||||
| `wildcard_access_url` | string | false | | |
|
||||
| `workspace_hostname_suffix` | string | false | | |
|
||||
| `workspace_prebuilds` | [codersdk.PrebuildsConfig](#codersdkprebuildsconfig) | false | | |
|
||||
| `write_config` | boolean | false | | |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|------------------------------------------------|------------------------------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------|
|
||||
| `access_url` | [serpent.URL](#serpenturl) | false | | |
|
||||
| `additional_csp_policy` | array of string | false | | |
|
||||
| `address` | [serpent.HostPort](#serpenthostport) | false | | Deprecated: Use HTTPAddress or TLS.Address instead. |
|
||||
| `agent_fallback_troubleshooting_url` | [serpent.URL](#serpenturl) | false | | |
|
||||
| `agent_stat_refresh_interval` | integer | false | | |
|
||||
| `ai` | [codersdk.AIConfig](#codersdkaiconfig) | false | | |
|
||||
| `allow_workspace_renames` | boolean | false | | Deprecated: Use the per-template allow_workspace_renames setting instead. |
|
||||
| `autobuild_poll_interval` | integer | false | | |
|
||||
| `browser_only` | boolean | false | | |
|
||||
| `cache_directory` | string | false | | |
|
||||
| `cli_upgrade_message` | string | false | | |
|
||||
| `cluster` | [codersdk.ClusterConfig](#codersdkclusterconfig) | false | | |
|
||||
| `config` | string | false | | |
|
||||
| `config_ssh` | [codersdk.SSHConfig](#codersdksshconfig) | false | | |
|
||||
| `dangerous` | [codersdk.DangerousConfig](#codersdkdangerousconfig) | false | | |
|
||||
| `derp` | [codersdk.DERP](#codersdkderp) | false | | |
|
||||
| `disable_chat_sharing` | boolean | false | | |
|
||||
| `disable_owner_workspace_exec` | boolean | false | | |
|
||||
| `disable_password_auth` | boolean | false | | |
|
||||
| `disable_path_apps` | boolean | false | | |
|
||||
| `disable_workspace_agent_context_sync` | boolean | false | | |
|
||||
| `disable_workspace_sharing` | boolean | false | | |
|
||||
| `docs_url` | [serpent.URL](#serpenturl) | false | | |
|
||||
| `enable_ai_tasks` | boolean | false | | |
|
||||
| `enable_authz_recording` | boolean | false | | |
|
||||
| `enable_terraform_debug_mode` | boolean | false | | |
|
||||
| `ephemeral_deployment` | boolean | false | | |
|
||||
| `experiments` | array of string | false | | |
|
||||
| `external_auth` | [serpent.Struct-array_codersdk_ExternalAuthConfig](#serpentstruct-array_codersdk_externalauthconfig) | false | | |
|
||||
| `external_auth_github_default_provider_enable` | boolean | false | | |
|
||||
| `external_token_encryption_keys` | array of string | false | | |
|
||||
| `healthcheck` | [codersdk.HealthcheckConfig](#codersdkhealthcheckconfig) | false | | |
|
||||
| `http_address` | string | false | | Http address is a string because it may be set to zero to disable. |
|
||||
| `http_cookies` | [codersdk.HTTPCookieConfig](#codersdkhttpcookieconfig) | false | | |
|
||||
| `job_hang_detector_interval` | integer | false | | |
|
||||
| `logging` | [codersdk.LoggingConfig](#codersdkloggingconfig) | false | | |
|
||||
| `metrics_cache_refresh_interval` | integer | false | | |
|
||||
| `notifications` | [codersdk.NotificationsConfig](#codersdknotificationsconfig) | false | | |
|
||||
| `oauth2` | [codersdk.OAuth2Config](#codersdkoauth2config) | false | | |
|
||||
| `oidc` | [codersdk.OIDCConfig](#codersdkoidcconfig) | false | | |
|
||||
| `pg_auth` | string | false | | |
|
||||
| `pg_conn_max_idle` | string | false | | |
|
||||
| `pg_conn_max_open` | integer | false | | |
|
||||
| `pg_connection_url` | string | false | | |
|
||||
| `pprof` | [codersdk.PprofConfig](#codersdkpprofconfig) | false | | |
|
||||
| `prometheus` | [codersdk.PrometheusConfig](#codersdkprometheusconfig) | false | | |
|
||||
| `provisioner` | [codersdk.ProvisionerConfig](#codersdkprovisionerconfig) | false | | |
|
||||
| `proxy_health_status_interval` | integer | false | | |
|
||||
| `proxy_trusted_headers` | array of string | false | | |
|
||||
| `proxy_trusted_origins` | array of string | false | | |
|
||||
| `rate_limit` | [codersdk.RateLimitConfig](#codersdkratelimitconfig) | false | | |
|
||||
| `redirect_to_access_url` | boolean | false | | |
|
||||
| `retention` | [codersdk.RetentionConfig](#codersdkretentionconfig) | false | | |
|
||||
| `scim_api_key` | string | false | | |
|
||||
| `scim_use_legacy` | boolean | false | | |
|
||||
| `session_lifetime` | [codersdk.SessionLifetime](#codersdksessionlifetime) | false | | |
|
||||
| `ssh_keygen_algorithm` | string | false | | |
|
||||
| `stats_collection` | [codersdk.StatsCollectionConfig](#codersdkstatscollectionconfig) | false | | |
|
||||
| `strict_transport_security` | integer | false | | |
|
||||
| `strict_transport_security_options` | array of string | false | | |
|
||||
| `support` | [codersdk.SupportConfig](#codersdksupportconfig) | false | | |
|
||||
| `swagger` | [codersdk.SwaggerConfig](#codersdkswaggerconfig) | false | | |
|
||||
| `telemetry` | [codersdk.TelemetryConfig](#codersdktelemetryconfig) | false | | |
|
||||
| `template_builder` | [codersdk.TemplateBuilderConfig](#codersdktemplatebuilderconfig) | false | | |
|
||||
| `terms_of_service_url` | string | false | | |
|
||||
| `tls` | [codersdk.TLSConfig](#codersdktlsconfig) | false | | |
|
||||
| `trace` | [codersdk.TraceConfig](#codersdktraceconfig) | false | | |
|
||||
| `update_check` | boolean | false | | |
|
||||
| `user_quiet_hours_schedule` | [codersdk.UserQuietHoursScheduleConfig](#codersdkuserquiethoursscheduleconfig) | false | | |
|
||||
| `verbose` | boolean | false | | |
|
||||
| `web_terminal_renderer` | string | false | | |
|
||||
| `wgtunnel_host` | string | false | | |
|
||||
| `wildcard_access_url` | string | false | | |
|
||||
| `workspace_hostname_suffix` | string | false | | |
|
||||
| `workspace_prebuilds` | [codersdk.PrebuildsConfig](#codersdkprebuildsconfig) | false | | |
|
||||
| `write_config` | boolean | false | | |
|
||||
|
||||
## codersdk.DiagnosticExtra
|
||||
|
||||
@@ -13613,6 +13615,7 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -13675,6 +13678,7 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith
|
||||
| `allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| `allow_user_autostop` | boolean | false | | |
|
||||
| `allow_user_cancel_workspace_jobs` | boolean | false | | |
|
||||
| `allow_workspace_renames` | boolean | false | | Allow workspace renames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name. |
|
||||
| `autostart_requirement` | [codersdk.TemplateAutostartRequirement](#codersdktemplateautostartrequirement) | false | | |
|
||||
| `autostop_requirement` | [codersdk.TemplateAutostopRequirement](#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| `build_time_stats` | [codersdk.TemplateBuildTimeStats](#codersdktemplatebuildtimestats) | false | | |
|
||||
@@ -14079,6 +14083,7 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -15578,6 +15583,7 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -15619,6 +15625,7 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
|
||||
| `allow_user_autostart` | boolean | false | | |
|
||||
| `allow_user_autostop` | boolean | false | | |
|
||||
| `allow_user_cancel_workspace_jobs` | boolean | false | | |
|
||||
| `allow_workspace_renames` | boolean | false | | Allow workspace renames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name. |
|
||||
| `autostart_requirement` | [codersdk.TemplateAutostartRequirement](#codersdktemplateautostartrequirement) | false | | |
|
||||
| `autostop_requirement` | [codersdk.TemplateAutostopRequirement](#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement can only be set if your license includes the advanced template scheduling feature. If you attempt to set this value while unlicensed, it will be ignored. |
|
||||
| `cors_behavior` | [codersdk.CORSBehavior](#codersdkcorsbehavior) | false | | |
|
||||
@@ -17049,7 +17056,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|---------------------------------------------|-------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `allow_renames` | boolean | false | | |
|
||||
| `allow_renames` | boolean | false | | Allow renames is the effective rename permission for this workspace, derived from the template's allow_workspace_renames setting and the deprecated deployment-wide flag. |
|
||||
| `automatic_updates` | [codersdk.AutomaticUpdates](#codersdkautomaticupdates) | false | | |
|
||||
| `autostart_schedule` | string | false | | |
|
||||
| `created_at` | string | false | | |
|
||||
|
||||
Generated
+1
@@ -169,6 +169,7 @@ curl -X POST http://coder-server:8080/api/v2/templatebuilder/compose/template \
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
|
||||
Generated
+36
-26
@@ -42,6 +42,7 @@ To include deprecated templates, specify `deprecated:true` in the search query.
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -104,19 +105,20 @@ To include deprecated templates, specify `deprecated:true` in the search query.
|
||||
|
||||
Status Code **200**
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|--------------------------------------|------------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `[array item]` | array | false | | |
|
||||
| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. |
|
||||
| `» active_version_id` | string(uuid) | false | | |
|
||||
| `» activity_bump_ms` | integer | false | | |
|
||||
| `» agents_allowed` | boolean | false | | |
|
||||
| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| `» allow_user_autostop` | boolean | false | | |
|
||||
| `» allow_user_cancel_workspace_jobs` | boolean | false | | |
|
||||
| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | |
|
||||
| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. |
|
||||
| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|--------------------------------------|------------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `[array item]` | array | false | | |
|
||||
| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. |
|
||||
| `» active_version_id` | string(uuid) | false | | |
|
||||
| `» activity_bump_ms` | integer | false | | |
|
||||
| `» agents_allowed` | boolean | false | | |
|
||||
| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| `» allow_user_autostop` | boolean | false | | |
|
||||
| `» allow_user_cancel_workspace_jobs` | boolean | false | | |
|
||||
| `» allow_workspace_renames` | boolean | false | | Allow workspace renames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name. |
|
||||
| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | |
|
||||
| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. |
|
||||
| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
|`»» days_of_week`|array|false||Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice.
|
||||
Restarts will only happen on weekdays in this list on weeks which line up with Weeks.|
|
||||
|`»» weeks`|integer|false||Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.|
|
||||
@@ -185,6 +187,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -234,6 +237,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -388,6 +392,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -812,6 +817,7 @@ To include deprecated templates, specify `deprecated:true` in the search query.
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -874,19 +880,20 @@ To include deprecated templates, specify `deprecated:true` in the search query.
|
||||
|
||||
Status Code **200**
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|--------------------------------------|------------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `[array item]` | array | false | | |
|
||||
| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. |
|
||||
| `» active_version_id` | string(uuid) | false | | |
|
||||
| `» activity_bump_ms` | integer | false | | |
|
||||
| `» agents_allowed` | boolean | false | | |
|
||||
| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| `» allow_user_autostop` | boolean | false | | |
|
||||
| `» allow_user_cancel_workspace_jobs` | boolean | false | | |
|
||||
| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | |
|
||||
| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. |
|
||||
| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|--------------------------------------|------------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `[array item]` | array | false | | |
|
||||
| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. |
|
||||
| `» active_version_id` | string(uuid) | false | | |
|
||||
| `» activity_bump_ms` | integer | false | | |
|
||||
| `» agents_allowed` | boolean | false | | |
|
||||
| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
| `» allow_user_autostop` | boolean | false | | |
|
||||
| `» allow_user_cancel_workspace_jobs` | boolean | false | | |
|
||||
| `» allow_workspace_renames` | boolean | false | | Allow workspace renames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name. |
|
||||
| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | |
|
||||
| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. |
|
||||
| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. |
|
||||
|`»» days_of_week`|array|false||Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice.
|
||||
Restarts will only happen on weekdays in this list on weeks which line up with Weeks.|
|
||||
|`»» weeks`|integer|false||Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.|
|
||||
@@ -1020,6 +1027,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template} \
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -1146,6 +1154,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template} \
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
@@ -1198,6 +1207,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template} \
|
||||
"allow_user_autostart": true,
|
||||
"allow_user_autostop": true,
|
||||
"allow_user_cancel_workspace_jobs": true,
|
||||
"allow_workspace_renames": true,
|
||||
"autostart_requirement": {
|
||||
"days_of_week": [
|
||||
"monday"
|
||||
|
||||
Generated
-11
@@ -1370,17 +1370,6 @@ Allow users to set their own quiet hours schedule for workspaces to stop in (dep
|
||||
|
||||
The renderer to use when opening a web terminal. Valid values are 'canvas', 'webgl', or 'dom'.
|
||||
|
||||
### --allow-workspace-renames
|
||||
|
||||
| | |
|
||||
|-------------|---------------------------------------------|
|
||||
| Type | <code>bool</code> |
|
||||
| Environment | <code>$CODER_ALLOW_WORKSPACE_RENAMES</code> |
|
||||
| YAML | <code>allowWorkspaceRenames</code> |
|
||||
| Default | <code>false</code> |
|
||||
|
||||
Allow users to rename their workspaces. WARNING: Renaming a workspace can cause Terraform resources that depend on the workspace name to be destroyed and recreated, potentially causing data loss. Only enable this if your templates do not use workspace names in resource identifiers, or if you understand the risks.
|
||||
|
||||
### --health-check-refresh
|
||||
|
||||
| | |
|
||||
|
||||
@@ -45,6 +45,10 @@ coder show <workspace-name>
|
||||
| Reserved names | Cannot use `new` or `create` |
|
||||
| Uniqueness | Must be unique within your workspaces |
|
||||
|
||||
Renaming a workspace after you create it is off by default. A template admin can
|
||||
allow it per template. Refer to
|
||||
[Workspace renaming](../admin/templates/managing-templates/index.md#workspace-renaming).
|
||||
|
||||
## Workspace filtering
|
||||
|
||||
In the Coder UI, you can filter your workspaces using pre-defined filters or
|
||||
|
||||
Reference in New Issue
Block a user