Skip to content

Commit

Permalink
Merge pull request #868 from telepresenceio/localhost-cleanup
Browse files Browse the repository at this point in the history
Replace localhost with 127.0.0.1
  • Loading branch information
Abhay Saxena committed Dec 13, 2018
2 parents 8034a76 + 840ae69 commit df31fe7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions newsfragments/783.bugfix
@@ -0,0 +1 @@
Telepresence is less likely to get confused by network setups that have IPv6 enabled.
2 changes: 1 addition & 1 deletion telepresence/connect/ssh.py
Expand Up @@ -25,7 +25,7 @@ def __init__(
self,
runner: Runner,
port: int,
user_at_host: str = "telepresence@localhost",
user_at_host: str = "telepresence@127.0.0.1",
) -> None:
self.runner = runner
self.port = port
Expand Down
2 changes: 1 addition & 1 deletion telepresence/mount.py
Expand Up @@ -51,7 +51,7 @@ def mount_remote_volumes(
# Don't store host key:
"-o",
"UserKnownHostsFile=/dev/null",
] + middle + ["telepresence@localhost:/", mount_dir],
] + middle + ["telepresence@127.0.0.1:/", mount_dir],
stderr=STDOUT
)
mounted = True
Expand Down
4 changes: 2 additions & 2 deletions telepresence/outbound/container.py
Expand Up @@ -121,7 +121,7 @@ def run_docker_command(
publish_args.append(
"--publish=127.0.0.1:{}:38022/tcp".format(container_sshd_port)
)
local_ssh = SSH(runner, container_sshd_port, "root@localhost")
local_ssh = SSH(runner, container_sshd_port, "root@127.0.0.1")

# Start the sshuttle container:
name = random_name()
Expand Down Expand Up @@ -153,7 +153,7 @@ def run_docker_command(
local_ssh.wait()
runner.launch(
"Local SSH port forward",
local_ssh.bg_command(["-R", "38023:localhost:{}".format(ssh.port)])
local_ssh.bg_command(["-R", "38023:127.0.0.1:{}".format(ssh.port)])
)

# Wait for sshuttle to be running:
Expand Down
2 changes: 1 addition & 1 deletion telepresence/outbound/vpn.py
Expand Up @@ -254,7 +254,7 @@ def connect_sshuttle(
"--to-ns",
"127.0.0.1:9053",
"-r",
"telepresence@localhost:" + str(ssh.port),
"telepresence@127.0.0.1:" + str(ssh.port),
] + get_proxy_cidrs(runner, remote_info, hosts_or_ips),
keep_session=True, # Avoid trouble with interactive sudo
)
Expand Down

0 comments on commit df31fe7

Please sign in to comment.