{{ message }}
feat: add --no-wildcard flag to coder config-ssh#26753
Open
BobbyHo wants to merge 7 commits into
Open
Conversation
Add --no-wildcard (CODER_CONFIGSSH_NO_WILDCARD) to coder config-ssh that generates an individual Host entry per workspace instead of a single wildcard block (Host *.coder). The wildcard approach cannot be enumerated by third-party SSH clients, the VS Code Remote-SSH sidebar, or scripts that parse ~/.ssh/config to discover hosts. With --no-wildcard, each workspace gets its own entry so those tools work without Coder-specific extensions. The flag is persisted in the config section header so re-running without it prompts the user about the option change. Workspaces are fetched with pagination before writing so the diff shows actual hostnames.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add
--no-wildcard(CODER_CONFIGSSH_NO_WILDCARD) tocoder config-sshthat generates an individualHostentry per workspace instead of a single wildcard block (Host *.coder).The wildcard approach cannot be enumerated by third-party SSH clients, the VS Code Remote-SSH sidebar, or scripts that parse
~/.ssh/configto discover hosts. With--no-wildcard, each workspace gets its own entry so those tools work without Coder-specific extensions.The flag is persisted in the config section header so re-running without it prompts the user about the option change. Workspaces are fetched with pagination before writing so the diff shows actual hostnames.
Manual testing
Unit tests (no server needed):
End-to-end with a dev server:
go build -o ./coder ../scripts/develop.sh./coder login http://localhost:3000Output:
--no-wildcardOutput: wildcard (default)
diff wildcard → --no-wildcard
Closes #17153 (Phase 1: CLI flag)