Skip to content

Commit

Permalink
Introduce TART_EXECUTOR_SSH_PORT (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev authored Apr 2, 2024
1 parent 8689a13 commit 756c5c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
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

0 comments on commit 756c5c5

Please sign in to comment.