## Description The URL validation regex in the dotfiles module was rejecting URLs containing tilde (`~`) characters, which are commonly used in Bitbucket Server for user repositories (e.g. `ssh://git@bitbucket.example.org:7999/~username/repo.git`). This adds `~` to the allowed character set in all three validation regexes (for `default_dotfiles_uri`, `dotfiles_uri`, and the `coder_parameter` validation). ## Type of Change - [ ] New module - [ ] New template - [x] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information **Path:** `registry/coder/modules/dotfiles` **New version:** `v1.3.1` **Breaking change:** [ ] Yes [x] No ## Testing & Validation - [x] Tests pass (`bun test`) - [x] Code formatted (`bun fmt`) - [ ] Changes tested locally ## Related Issues Fixes #762 Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
2.3 KiB
2.3 KiB
| display_name | description | icon | verified | tags | ||
|---|---|---|---|---|---|---|
| Dotfiles | Allow developers to optionally bring their own dotfiles repository to customize their shell and IDE settings! | ../../../../.icons/dotfiles.svg | true |
|
Dotfiles
Allow developers to optionally bring their own dotfiles repository.
This will prompt the user for their dotfiles repository URL on template creation using a coder_parameter.
Under the hood, this module uses the coder dotfiles command.
module "dotfiles" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/dotfiles/coder"
version = "1.3.1"
agent_id = coder_agent.example.id
}
Examples
Apply dotfiles as the current user
module "dotfiles" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/dotfiles/coder"
version = "1.3.1"
agent_id = coder_agent.example.id
}
Apply dotfiles as another user (only works if sudo is passwordless)
module "dotfiles" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/dotfiles/coder"
version = "1.3.1"
agent_id = coder_agent.example.id
user = "root"
}
Apply the same dotfiles as the current user and root (the root dotfiles can only be applied if sudo is passwordless)
module "dotfiles" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/dotfiles/coder"
version = "1.3.1"
agent_id = coder_agent.example.id
}
module "dotfiles-root" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/dotfiles/coder"
version = "1.3.1"
agent_id = coder_agent.example.id
user = "root"
dotfiles_uri = module.dotfiles.dotfiles_uri
}
Setting a default dotfiles repository
You can set a default dotfiles repository for all users by setting the default_dotfiles_uri variable:
module "dotfiles" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/dotfiles/coder"
version = "1.3.1"
agent_id = coder_agent.example.id
default_dotfiles_uri = "https://github.com/coder/dotfiles"
}