Skip to content

Commit 8df7dc1

Browse files
committed
Add toggle for JetBrains Toolbox backend updates
1 parent f1ce2c5 commit 8df7dc1

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ the workspace in Coder.
3030
| `rtk` | [rtk](https://github.com/rtk-ai/rtk), token-reducing Claude proxy | Auto-patches Claude Code via a post-create hook at workspace start |
3131
| `nvm` | [nvm](https://github.com/nvm-sh/nvm) at `/usr/local/share/nvm` | Default Node = LTS, `node`/`npm`/`npx` in `/usr/local/bin` |
3232
| `web-shell` | [web-shell](https://github.com/SoureCode/web-shell), persistent browser terminal | systemd unit, registered as a Coder app |
33-
| `jetbrains` | JetBrains Toolbox workspace integration | Uses Coder's JetBrains Toolbox module (`registry.coder.com/coder/jetbrains/coder`). Persists `~/.config/JetBrains/`, `~/.local/share/JetBrains/`, and `~/.java/.userPrefs/jetbrains/` for settings/plugins and JetProfile/license state. On startup, writes Toolbox `environment.json` (`allowUpdate=false`) and pins backend install location to `/mnt/home-persist/.jetbrains-dist` to avoid per-restart re-downloads, enforces `idea.properties` path split (`config/plugins` persisted, `system/log` in `/tmp`), prunes persisted `Daemon`, Toolbox `download/backup`, and per-IDE `caches/logs`, and does not persist `~/.cache/JetBrains/`. |
33+
| `jetbrains` | JetBrains Toolbox workspace integration | Uses Coder's JetBrains Toolbox module (`registry.coder.com/coder/jetbrains/coder`). Persists `~/.config/JetBrains/`, `~/.local/share/JetBrains/`, and `~/.java/.userPrefs/jetbrains/` for settings/plugins and JetProfile/license state. On startup, writes Toolbox `environment.json` with `allowUpdate` controlled by template parameter `jetbrains_allow_updates` (default `false`), pins backend install location to `/mnt/home-persist/.jetbrains-dist` to avoid per-restart re-downloads, enforces `idea.properties` path split (`config/plugins` persisted, `system/log` in `/tmp`), prunes persisted `Daemon`, Toolbox `download/backup`, and per-IDE `caches/logs`, and does not persist `~/.cache/JetBrains/`. |
3434
| `home-persist` | Manifest-driven `$HOME` persistence | Reads `/etc/home-persist.d/*.json`, symlinks declared paths under `/mnt/home-persist` (per-owner volume). Add extra per-workspace paths via the `home_persist_paths` Coder parameter. See [`docs/persistence.md`](docs/persistence.md). |
3535
| `llvm` (cpp) | Clang toolchain via [apt.llvm.org](https://apt.llvm.org/) | `CC=clang`, `CXX=clang++` via `/etc/profile.d/llvm-env.sh` |
3636
| `cmake` (cpp) | CMake from [Kitware's GitHub releases](https://cmake.org/) | latest by default |

docs/persistence.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,22 @@ prunes subpaths that should remain ephemeral:
264264
`~/.local/share/JetBrains/*/{caches,logs}/`
265265

266266
`main.tf` startup also writes `~/.local/share/JetBrains/Toolbox/environment.json`
267-
with `tools.allowUpdate=false` and a pinned tool location, and writes `idea.properties` in each
267+
with `tools.allowUpdate` driven by template parameter `jetbrains_allow_updates`
268+
(default `false`) and a pinned tool location, and writes `idea.properties` in each
268269
`~/.config/JetBrains/<IDE>/` directory with:
269270

270271
`idea.config.path=~/.config/JetBrains/<IDE>`
271272
`idea.plugins.path=~/.local/share/JetBrains/<IDE>/plugins`
272273
`idea.system.path=/tmp/jetbrains/system/<IDE>`
273274
`idea.log.path=/tmp/jetbrains/log/<IDE>`
274275

276+
Recommended update workflow:
277+
278+
1. Set `jetbrains_allow_updates=true`.
279+
2. Start one workspace and let Toolbox update/install backend artifacts.
280+
3. Set `jetbrains_allow_updates=false`.
281+
4. Restart workspace(s) to return to pinned/no-auto-update mode.
282+
275283
The sweep runs once per owner volume (the sentinel
276284
`/mnt/home-persist/.workspaces/.migrated/<sentinel-name>` blocks reruns) and
277285
is a no-op if the orphan is already gone. Delete the line from `main.tf`

main.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ data "coder_parameter" "home_persist_paths" {
129129
mutable = true
130130
}
131131

132+
data "coder_parameter" "jetbrains_allow_updates" {
133+
type = "bool"
134+
name = "jetbrains_allow_updates"
135+
display_name = "JetBrains auto-updates"
136+
description = "Allow JetBrains Toolbox to update IDE backends in the workspace. Keep false by default; temporarily set true only when you intentionally refresh backend versions."
137+
default = false
138+
mutable = true
139+
}
140+
132141
provider "coder" {}
133142
provider "docker" {
134143
host = var.docker_socket != "" ? var.docker_socket : null
@@ -387,7 +396,7 @@ resource "coder_script" "lifecycle_init" {
387396
printf '%s\n' \
388397
'{' \
389398
' "tools": {' \
390-
' "allowUpdate": false,' \
399+
' "allowUpdate": ${data.coder_parameter.jetbrains_allow_updates.value},' \
391400
' "location": [' \
392401
' {' \
393402
' "path": "/mnt/home-persist/.jetbrains-dist",' \

0 commit comments

Comments
 (0)