Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce TART_EXECUTOR_SSH_PORT #69

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ that required paid sponsorship upon exceeding a free limit.
|---------------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `TART_EXECUTOR_SSH_USERNAME` | admin | SSH username to use when connecting to the VM |
| `TART_EXECUTOR_SSH_PASSWORD` | admin | SSH password to use when connecting to the VM |
| `TART_EXECUTOR_SSH_PORT` | 22 | Connect to the VM at the given SSH port |
| `TART_EXECUTOR_HEADLESS` | true | Run the VM in headless mode (`true`) or with GUI (`false`) |
| `TART_EXECUTOR_ALWAYS_PULL` | true | Always pull the latest version of the Tart image (`true`) or only when the image doesn't exist locally (`false`) |
| `TART_EXECUTOR_INSECURE_PULL` | false | Set to `true` to connect the OCI registry via insecure HTTP protocol |
Expand Down
1 change: 1 addition & 0 deletions internal/tart/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
type Config struct {
SSHUsername string `env:"SSH_USERNAME" envDefault:"admin"`
SSHPassword string `env:"SSH_PASSWORD" envDefault:"admin"`
SSHPort uint16 `env:"SSH_PORT" envDefault:"22"`
Softnet bool `env:"SOFTNET"`
Headless bool `env:"HEADLESS" envDefault:"true"`
AlwaysPull bool `env:"ALWAYS_PULL" envDefault:"true"`
Expand Down
2 changes: 1 addition & 1 deletion internal/tart/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (vm *VM) OpenSSH(ctx context.Context, config Config) (*ssh.Client, error) {
if err != nil {
return nil, err
}
addr := ip + ":22"
addr := fmt.Sprintf("%s:%d", ip, config.SSHPort)

sshConfig := &ssh.ClientConfig{
HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error {
Expand Down