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

updated lima config ssh forwardAgent true by default #403

Merged
merged 1 commit into from
Jul 18, 2023
Merged

updated lima config ssh forwardAgent true by default #403

merged 1 commit into from
Jul 18, 2023

Conversation

johnkraczek
Copy link
Contributor

@johnkraczek johnkraczek commented Jul 18, 2023

Fixes #402

Setting the ssh: forwardAgent: true in the lima config allows the agent to be forwarded.
If you are good with that being the default then that's all that is needed.

@swalkinshaw
Copy link
Member

I'm good with this being the default. I can't see why we'd want it be disabled but we can always make it configurable in the future 👍

@johnkraczek there's a test that needs to be updated as well:

func TestCreateConfig(t *testing.T) {
defer trellis.LoadFixtureProject(t)()
trellis := trellis.NewTrellis()
if err := trellis.LoadProject(); err != nil {
t.Fatal(err)
}
dir := t.TempDir()
configFile := filepath.Join(dir, "lima.yaml")
instance := &Instance{
Dir: dir,
ConfigFile: configFile,
Config: Config{
Images: []Image{
{
Location: "http://ubuntu.com/focal",
Arch: "aarch64",
},
},
PortForwards: []PortForward{
{
HostPort: 1234,
GuestPort: 80,
},
},
},
Sites: trellis.Environments["development"].WordPressSites,
}
err := instance.CreateConfig()
if err != nil {
t.Fatal(err)
}
content, err := os.ReadFile(configFile)
if err != nil {
t.Fatal(err)
}
absSitePath := filepath.Join(trellis.Path, "../site")
expected := fmt.Sprintf(`vmType: "vz"
rosetta:
enabled: false
images:
- location: http://ubuntu.com/focal
arch: aarch64
mounts:
- location: %s
mountPoint: /srv/www/example.com/current
writable: true
mountType: "virtiofs"
networks:
- vzNAT: true
portForwards:
- guestPort: 80
hostPort: 1234
containerd:
user: false
provision:
- mode: system
script: |
#!/bin/bash
echo "127.0.0.1 $(hostname)" >> /etc/hosts
`, absSitePath)
if string(content) != expected {
t.Errorf("expected %s\ngot %s", expected, string(content))
}
}

The expected output needs to have the new ssh entry

@swalkinshaw swalkinshaw merged commit 8086450 into roots:master Jul 18, 2023
@swalkinshaw
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trellis vm shell doesn't forward ssh agent
2 participants