ThomDietrich/home-assistant-addons

Localhost.run - not getting the Sub-domain name from the log

iosoft opened this issue ยท 11 comments

Hello,

I am using the Localhost.run service because its free.
Here is my configuration -

hostname: localhost.run
ssh_port: 22
username: autossh
remote_forwarding:
  - localhost.run:80:192.168.79.79:8123
other_ssh_options: '-v'
force_keygen: false

Even though the connection works, but, I can not find the subdomain name from the log details.

==============================================================
Welcome to localhost.run!
Follow your favourite reverse tunnel at [https://twitter.com/localhost_run].
**You need a SSH key to access this service.**
If you get a permission denied follow Gitlab's most excellent howto:
https://docs.gitlab.com/ee/ssh/
*Only rsa and ed25519 keys are supported*
To set up and manage custom domains go to https://admin.localhost.run/
More details on custom domains (and how to enable subdomains of your custom
domain) at https://localhost.run/docs/custom-domains
To explore using localhost.run visit the documentation site:
https://localhost.run/docs/
==============================================================
** your connection id is 4de07fb0-777c-43e0-9ec4-589d360XXXXXX, please mention it if you send me a message about an issue. **
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /data/ssh_keys/autossh_rsa_key RSA SHA256:HL7Z3tI+X/iCe1V5AjLxx0cPthbzTSdJbQX8KCHdt2g explicit
debug1: Server accepts key: /data/ssh_keys/autossh_rsa_key RSA SHA256:HL7Z3tI+X/iCe1V5AjLxx0cPthbzTSdJbQX8KCHdt2g explicit
debug1: Authentication succeeded (publickey).
Authenticated to localhost.run ([54.161.197.247]:22).
debug1: Remote connections from localhost.run:80 forwarded to local address 192.168.79.79:8123
debug1: Entering interactive session.
debug1: pledge: network
debug1: remote forward success for: listen localhost.run:80, connect 192.168.79.79:8123
debug1: All remote forwarding requests processed

As you can see, I can't get the subdomain name!
The log ends there.....

Hey, cool service.

I get your point but how do we best solve this? Where would you normally expect this subdomain name and do you have any clue how to read it?

So here is the thing. We use autossh to connect the tunnel. Any of the parameters probably hides the line you are missing. My suggestion is you install autossh, copy the command from the script, then try around to understand which command line argument is the culprit. Happy to help fixing the issue if you figure out what it is ;)

Here is the command:

COMMAND="/usr/bin/autossh "\
" -M 0 -N "\
"-o ServerAliveInterval=30 "\
"-o ServerAliveCountMax=3 "\
"-o StrictHostKeyChecking=no "\
"-o ExitOnForwardFailure=yes "\
"-p ${SSH_PORT} -t -t "\
"-i ${KEY_PATH}/autossh_rsa_key "\
"${USERNAME}@${HOSTNAME}"

Anything you wanna add?

Hello, I am back.

How can I test the command by removing the -N argument?

You don't have to test this from the Home Assistant host. Just try on your local machine. Alternatively there is a Terminal addon for home assistant, you could try with that. The goal is to play around with autossh

Hi, I was just going to inform you that -
Connection successful if -N argument is removed!

Executing command: /usr/bin/autossh -M 0 -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -p 22 -t -t -i /data/ssh_keys/autossh_rsa_key autossh@localhost.run -R 80:192.168.79.79:8123 -v

Log:

Welcome to localhost.run!
Follow your favourite reverse tunnel at [https://twitter.com/localhost_run].
**You need a SSH key to access this service.**
If you get a permission denied follow Gitlab's most excellent howto:
https://docs.gitlab.com/ee/ssh/
*Only rsa and ed25519 keys are supported*
To set up and manage custom domains go to https://admin.localhost.run/
More details on custom domains (and how to enable subdomains of your custom
domain) at https://localhost.run/docs/custom-domains
To explore using localhost.run visit the documentation site:
https://localhost.run/docs/
===============================================================================
** your connection id is 3f0645a6-653f-495a-8b64-XXXXXXXXXXXXX, please mention it if you send me a message about an issue. **
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /data/ssh_keys/autossh_rsa_key ED25519 SHA256:XXXXXXXXXXXXXXXXXX explicit
debug1: Server accepts key: /data/ssh_keys/autossh_rsa_key ED25519 SHA256:XXXXXXXXXXXXXXXXXXX explicit
Authenticated to localhost.run ([35.171.254.69]:22) using "publickey".
debug1: Remote connections from LOCALHOST:80 forwarded to local address 192.168.9.9:8123
debug1: ssh_init_forwarding: expecting replies for 1 forwards
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: remote forward success for: listen 80, connect 192.168.9.9:8123
debug1: forwarding_success: all expected forwarding replies received
debug1: ssh_tty_make_modes: no fd or tio
e3606f60fceXXX.lhrtunnel.link tunneled with tls termination, https://e3606f60fceXXX.lhrtunnel.link

I would like to request you to update your awesome and important plugin and move the -N argument as a toggle thing in configuration page or in 'other_ssh_options' text field.

P.S. In you documentation/manual, pls do mention that the 'remote_forwarding' should be like this - 80:HomeAssistantIP:8123

Thanks.

P.S. In you documentation/manual, pls do mention that the 'remote_forwarding' should be like this - 80:HomeAssistantIP:8123

Not sure about your suggestion, why is this not correct? https://github.com/ThomDietrich/home-assistant-addons/blob/master/autossh/DOCS.md#option-remote_forwarding=

Done in version 1.0.9 ๐Ÿ‘

Ah one more thing: It would be cool if you drafted a small passage for the README how this can be used with localhost.run. Please be subjective and mention potential risks or limitations...

Sure, I will help you.

I stopped using localhost.run service as technically its useless.
The temporary URL changes after random time interval.