Search code examples
ngrok

Ngrok can't read config for ports


So, I'm currently setting up a Raspberry Pi to be my testing server and to host code backups over SFTP(I really don't like Git). After tussling with Hamachi for a bit, I was recommended Ngrok. Installing Ngrok, I was able to open a port just fine without a config file. It was at this point that I decided that I'd want multiple ports open. I read through the documentation, and wrote this config file.

authtoken:(REDACTED)
tunnels:
  httpnorm:
    proto: http
    addr: 80
  httptest:
    proto: http
    addr:69420
  sftp1:
    proto: tcp
    addr:22
  sftp2:
    proto:tcp
    addr: 21

Now, this is a completely fine YAML file, I've even checked it for error twice, so the formatting doesn't appear to be an issue. However, upon running the command "./ngrok start -config='ngroksetup.yml' sftp1", I get the following output.

ERROR: Tunnel 'sftp1' is not defined in the config files.
ERROR: Tunnels available:
ERROR: Config files read: [ngroksetup.yml]

That isn't correct, because ngroksetup.yml(which is on the root of the filesystem) clearly has listed tunnels. Why is it incorrectly interpreting the setup file?


Solution

  • User error. The issue would be obvious from the get go if I had included my auth token, but I didn't want my auth token being stolen for obvious reasons. Thankfully, the way I wrote it kind of gives it away. I needed a space between the : and the auth token itself, just like how I missed the space on the (REDACTED).