mole icon indicating copy to clipboard operation
mole copied to clipboard

Missing `config` attribute on `<alias>.toml` file causing application to fail

Open davrodpin opened this issue 3 years ago • 2 comments

Affected Version

Master @ b6c4dc0

Expected Behavior

Application to use the default value $HOME/.ssh/config

Current Behavior

Application crashes with the following error stack:

panic: read .: is a directory

goroutine 20 [running]:
github.com/kevinburke/ssh_config.(*sshLexer).peek(0xc0000d6370, 0x0)
	/go/pkg/mod/github.com/kevinburke/[email protected]/lexer.go:202 +0xf7
github.com/kevinburke/ssh_config.(*sshLexer).lexVoid(0xc0000d6370, 0x0)
	/go/pkg/mod/github.com/kevinburke/[email protected]/lexer.go:141 +0x45
github.com/kevinburke/ssh_config.(*sshLexer).run(0xc0000d6370)
	/go/pkg/mod/github.com/kevinburke/[email protected]/lexer.go:224 +0x4a
created by github.com/kevinburke/ssh_config.lexSSH
	/go/pkg/mod/github.com/kevinburke/[email protected]/lexer.go:239 +0xd7

Steps to Reproduce

  1. Create the following alias
mole add alias remote test --verbose --insecure --source 192.168.33.11:9090 --destination 127.0.0.1:8080 --server [email protected]:22122 --key test-env/ssh-server/keys/key --keep-alive-interval 2s
  1. Start mole with alias
$ ./bin/mole start alias test

davrodpin avatar Aug 16 '21 15:08 davrodpin

#159 should fix this.

davrodpin avatar Sep 01 '21 16:09 davrodpin

#159 made mole to work under the described scenario but with a different behavior. Now the missing config attribute causes mole to use an empty configuration.

I think this issue needs to be kept open since the expected behavior is to try to use $HOME/.ssh/ssh_config before falls back to an empty configuration.

davrodpin avatar Sep 17 '21 22:09 davrodpin