Skip to content

Commit

Permalink
choose username according to whether verb yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
samlhuillier committed Aug 8, 2023
1 parent dcc6ec0 commit e485f47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/entity/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ type Workspace struct {
ExecsV1 *ExecsV1 `json:"execsV1"`
IDEConfig IDEConfig `json:"ideConfig"`
SSHPort int `json:"sshPort"`
VerbYaml string `json:"verbYaml"`
// PrimaryApplicationId string `json:"primaryApplicationId,omitempty"`
// LastOnlineAt string `json:"lastOnlineAt,omitempty"`
// CreatedAt string `json:"createdAt,omitempty"`
Expand Down
8 changes: 7 additions & 1 deletion pkg/ssh/sshconfigurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,17 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string) (st
}
} else {
hostname := workspace.GetHostname()
var userName string
if workspace.VerbYaml != "" {
userName = "root"
} else {
userName = "ubuntu"
}
port := workspace.GetPort()
entry = SSHConfigEntryV2{
Alias: alias,
IdentityFile: privateKeyPath,
User: "ubuntu", // todo param-user
User: userName, // todo param-user
Dir: workspace.GetProjectFolderPath(),
HostName: hostname,
Port: port,
Expand Down

0 comments on commit e485f47

Please sign in to comment.