coder / coder/registry

mux: derive default install_prefix and log_path from slug

Open
#1,097 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
HCL
Stars
79
Forks
161
Avg merge
1d 10h
Merged PRs (30d)
38

Description

Follow-up from https://github.com/coder/registry/pull/1095 (review thread https://github.com/coder/registry/pull/1095#discussion_r3928942896).

Since #1095 the module's scripts and `install.log` / `start.log` live under coder-utils' `module_directory = "$HOME/.coder-modules/coder/${var.slug}"`, but the defaults for `install_prefix` and `log_path` are hardcoded to `$HOME/.coder-modules/coder/mux`. With a custom `slug` one instance therefore spans two roots, and two custom-slug instances on the same agent still share the Mux binary and server log even though the module directory is keyed by slug to keep them apart.

Proposed change: derive the defaults from the slug (`install_prefix = "$HOME/.coder-modules/coder/${var.slug}"`, `log_path = ".../${var.slug}/logs/mux.log"`), which needs the variable defaults to become `null` with the value resolved in `locals`. The pre-1.6.0 `/tmp/mux` fallback should keep applying only when the resolved prefix is the default one. README and the tests that assert the default paths need the same update.

Kept out of #1095 because it changes the variable defaults' shape, which is a separate review from the install cache itself.

> Xum acted on behalf of @ibetitsmike when filing this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.