-
Notifications
You must be signed in to change notification settings - Fork 845
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
Fix: Can't use Unix Sockets in Quick Tunnel mode #1367
base: master
Are you sure you want to change the base?
Fix: Can't use Unix Sockets in Quick Tunnel mode #1367
Conversation
shouldRunQuickTunnel := c.IsSet("url") || c.IsSet("unix-socket") || c.IsSet(ingress.HelloWorldFlag) | ||
if !c.IsSet("proxy-dns") && c.String("quick-service") != "" && shouldRunQuickTunnel { | ||
return RunQuickTunnel(sc) | ||
return runQuickTunnel(sc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to avoid changes here as far as possible, but I'm happy to refactor this into a separate function if this is too hacky.
@@ -15,3 +18,76 @@ func TestHostnameFromURI(t *testing.T) { | |||
assert.Equal(t, "", hostnameFromURI("trash")) | |||
assert.Equal(t, "", hostnameFromURI("https://awesomesauce.com")) | |||
} | |||
|
|||
func TestShouldRunQuickTunnel(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've scoped this specifically to quick tunnels, so it won't test falling through to other tunnel types.
@@ -313,9 +314,9 @@ func TunnelCommand(c *cli.Context) error { | |||
// Run a quick tunnel | |||
// A unauthenticated named tunnel hosted on <random>.<quick-tunnels-service>.com | |||
// We don't support running proxy-dns and a quick tunnel at the same time as the same process | |||
shouldRunQuickTunnel := c.IsSet("url") || c.IsSet(ingress.HelloWorldFlag) | |||
shouldRunQuickTunnel := c.IsSet("url") || c.IsSet("unix-socket") || c.IsSet(ingress.HelloWorldFlag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't done any side-effect analysis to check whether anyone could be relying on --unix-socket
forcing a trapdoor to proxy-dns
, but that seems unlikely so it should be okay.
From #1294:
This PR aims to address the above by adding
unix-socket
as an accepted flag for spawning quick tunnels. I unfortunately couldn't find an elegant way to mock out theRunQuickTunnel
command, so I had to add a small work around. Please let me know if there is a better standard for this.Thanks!