mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
docs: update SSH command format to use suffix (#18085)
Refactor the workspace SSH command syntax across the project to use the "workspace.coder" format instead of "coder.workspace". This standardizes the SSH host entries for better consistency and clarity. This is a follow-up from #17445 and recommends using the suffix-based format for all new Coder versions. <img width="418" alt="image" src="https://github.com/user-attachments/assets/3893f840-9ce1-4803-a013-736068feb328" />
This commit is contained in:
@ -235,7 +235,7 @@ func (r *RootCmd) configSSH() *serpent.Command {
|
|||||||
cmd := &serpent.Command{
|
cmd := &serpent.Command{
|
||||||
Annotations: workspaceCommand,
|
Annotations: workspaceCommand,
|
||||||
Use: "config-ssh",
|
Use: "config-ssh",
|
||||||
Short: "Add an SSH Host entry for your workspaces \"ssh coder.workspace\"",
|
Short: "Add an SSH Host entry for your workspaces \"ssh workspace.coder\"",
|
||||||
Long: FormatExamples(
|
Long: FormatExamples(
|
||||||
Example{
|
Example{
|
||||||
Description: "You can use -o (or --ssh-option) so set SSH options to be used for all your workspaces",
|
Description: "You can use -o (or --ssh-option) so set SSH options to be used for all your workspaces",
|
||||||
|
2
cli/testdata/coder_--help.golden
vendored
2
cli/testdata/coder_--help.golden
vendored
@ -18,7 +18,7 @@ SUBCOMMANDS:
|
|||||||
completion Install or update shell completion scripts for the
|
completion Install or update shell completion scripts for the
|
||||||
detected or chosen shell.
|
detected or chosen shell.
|
||||||
config-ssh Add an SSH Host entry for your workspaces "ssh
|
config-ssh Add an SSH Host entry for your workspaces "ssh
|
||||||
coder.workspace"
|
workspace.coder"
|
||||||
create Create a workspace
|
create Create a workspace
|
||||||
delete Delete a workspace
|
delete Delete a workspace
|
||||||
dotfiles Personalize your workspace by applying a canonical
|
dotfiles Personalize your workspace by applying a canonical
|
||||||
|
2
cli/testdata/coder_config-ssh_--help.golden
vendored
2
cli/testdata/coder_config-ssh_--help.golden
vendored
@ -3,7 +3,7 @@ coder v0.0.0-devel
|
|||||||
USAGE:
|
USAGE:
|
||||||
coder config-ssh [flags]
|
coder config-ssh [flags]
|
||||||
|
|
||||||
Add an SSH Host entry for your workspaces "ssh coder.workspace"
|
Add an SSH Host entry for your workspaces "ssh workspace.coder"
|
||||||
|
|
||||||
- You can use -o (or --ssh-option) so set SSH options to be used for all
|
- You can use -o (or --ssh-option) so set SSH options to be used for all
|
||||||
your
|
your
|
||||||
|
@ -1097,7 +1097,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "config-ssh",
|
"title": "config-ssh",
|
||||||
"description": "Add an SSH Host entry for your workspaces \"ssh coder.workspace\"",
|
"description": "Add an SSH Host entry for your workspaces \"ssh workspace.coder\"",
|
||||||
"path": "reference/cli/config-ssh.md"
|
"path": "reference/cli/config-ssh.md"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
2
docs/reference/cli/config-ssh.md
generated
2
docs/reference/cli/config-ssh.md
generated
@ -1,7 +1,7 @@
|
|||||||
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
||||||
# config-ssh
|
# config-ssh
|
||||||
|
|
||||||
Add an SSH Host entry for your workspaces "ssh coder.workspace"
|
Add an SSH Host entry for your workspaces "ssh workspace.coder"
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
2
docs/reference/cli/index.md
generated
2
docs/reference/cli/index.md
generated
@ -41,7 +41,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr
|
|||||||
| [<code>users</code>](./users.md) | Manage users |
|
| [<code>users</code>](./users.md) | Manage users |
|
||||||
| [<code>version</code>](./version.md) | Show coder version |
|
| [<code>version</code>](./version.md) | Show coder version |
|
||||||
| [<code>autoupdate</code>](./autoupdate.md) | Toggle auto-update policy for a workspace |
|
| [<code>autoupdate</code>](./autoupdate.md) | Toggle auto-update policy for a workspace |
|
||||||
| [<code>config-ssh</code>](./config-ssh.md) | Add an SSH Host entry for your workspaces "ssh coder.workspace" |
|
| [<code>config-ssh</code>](./config-ssh.md) | Add an SSH Host entry for your workspaces "ssh workspace.coder" |
|
||||||
| [<code>create</code>](./create.md) | Create a workspace |
|
| [<code>create</code>](./create.md) | Create a workspace |
|
||||||
| [<code>delete</code>](./delete.md) | Delete a workspace |
|
| [<code>delete</code>](./delete.md) | Delete a workspace |
|
||||||
| [<code>favorite</code>](./favorite.md) | Add a workspace to your favorites |
|
| [<code>favorite</code>](./favorite.md) | Add a workspace to your favorites |
|
||||||
|
@ -103,9 +103,8 @@ jobs:
|
|||||||
- name: Create a test workspace and run some example commands
|
- name: Create a test workspace and run some example commands
|
||||||
run: |
|
run: |
|
||||||
coder create -t $TEMPLATE_NAME --template-version ${{ steps.name.outputs.version_name }} test-${{ steps.name.outputs.version_name }} --yes
|
coder create -t $TEMPLATE_NAME --template-version ${{ steps.name.outputs.version_name }} test-${{ steps.name.outputs.version_name }} --yes
|
||||||
coder config-ssh --yes
|
|
||||||
# run some example commands
|
# run some example commands
|
||||||
ssh coder.test-${{ steps.name.outputs.version_name }} -- make build
|
coder ssh test-${{ steps.name.outputs.version_name }} -- make build
|
||||||
|
|
||||||
- name: Delete the test workspace
|
- name: Delete the test workspace
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -215,6 +215,7 @@ export const AgentRow: FC<AgentRowProps> = ({
|
|||||||
<AgentSSHButton
|
<AgentSSHButton
|
||||||
workspaceName={workspace.name}
|
workspaceName={workspace.name}
|
||||||
agentName={agent.name}
|
agentName={agent.name}
|
||||||
|
workspaceOwnerUsername={workspace.owner_name}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{proxy.preferredWildcardHostname !== "" &&
|
{proxy.preferredWildcardHostname !== "" &&
|
||||||
|
@ -22,15 +22,17 @@ import { docs } from "utils/docs";
|
|||||||
interface AgentSSHButtonProps {
|
interface AgentSSHButtonProps {
|
||||||
workspaceName: string;
|
workspaceName: string;
|
||||||
agentName: string;
|
agentName: string;
|
||||||
|
workspaceOwnerUsername: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AgentSSHButton: FC<AgentSSHButtonProps> = ({
|
export const AgentSSHButton: FC<AgentSSHButtonProps> = ({
|
||||||
workspaceName,
|
workspaceName,
|
||||||
agentName,
|
agentName,
|
||||||
|
workspaceOwnerUsername,
|
||||||
}) => {
|
}) => {
|
||||||
const paper = useClassName(classNames.paper, []);
|
const paper = useClassName(classNames.paper, []);
|
||||||
const { data } = useQuery(deploymentSSHConfig());
|
const { data } = useQuery(deploymentSSHConfig());
|
||||||
const sshPrefix = data?.hostname_prefix;
|
const sshSuffix = data?.hostname_suffix;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover>
|
<Popover>
|
||||||
@ -54,7 +56,7 @@ export const AgentSSHButton: FC<AgentSSHButtonProps> = ({
|
|||||||
/>
|
/>
|
||||||
<SSHStep
|
<SSHStep
|
||||||
helpText="Connect to the agent:"
|
helpText="Connect to the agent:"
|
||||||
codeExample={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
|
codeExample={`ssh ${workspaceName}.${agentName}.${workspaceOwnerUsername}.${sshSuffix}`}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</ol>
|
</ol>
|
||||||
|
Reference in New Issue
Block a user