agrinman / tunnelto

Expose your local web server to the internet with a public URL.
https://tunnelto.dev
MIT License
2.1k stars 114 forks source link

Failed to save authentication key file #27

Open bbros-dev opened 4 years ago

bbros-dev commented 4 years ago

I have a subscription with 5 subdomains set, and use the provided key in the following command. Running the following as sudo succeeds. However, run as the ordinary user:

tunnelto set-auth --key <redacted>

Produces this error report:

name = 'tunnelto'
operating_system = 'unix:Ubuntu'
crate_version = '0.1.12'
explanation = '''
Panic occurred in file 'tunnelto/src/config.rs' at line 86
'''
cause = 'Failed to save authentication key file.: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }'
method = 'Panic'
backtrace = '''

   0: 0x5637bba6e2c8 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hcd1fa878e1b8802a
   1: 0x5637bbad800b - tokio::runtime::enter::Enter::block_on::h95d34c6dc245a0d5
   2: 0x5637bbaeda97 - tokio::runtime::context::enter::h186f41ed33a1603c
   3: 0x5637bbac58cf - tokio::runtime::handle::Handle::enter::hd6854b6249e24b90
   4: 0x5637bbab5b67 - tunnelto::main::h8cef60dfb4b7b7ab
   5: 0x5637bbafb743 - std::rt::lang_start::{{closure}}::ha5936fcca8ddcd9e
   6: 0x5637bbd627a8 - std::rt::lang_start_internal::{{closure}}::h6d21eebfa4beaf70
                at src/libstd/rt.rs:52
                 - std::panicking::try::do_call::h560a27b87db38b9c
                at src/libstd/panicking.rs:297
                 - std::panicking::try::h453d4afd696011f9
                at src/libstd/panicking.rs:274
                 - std::panic::catch_unwind::h211d02671f23030f
                at src/libstd/panic.rs:394
                 - std::rt::lang_start_internal::h464df2bbf46c7e7c
                at src/libstd/rt.rs:51
   7: 0x5637bbab5c72 - main
   8: 0x7fd61a7e0b97 - __libc_start_main
   9: 0x5637bba340ca - _start
  10:        0x0 - <unknown>'''

I'm having trouble working out the folder and file that are being written to.

agrinman commented 4 years ago

It tries to create a .tunnelto/ in your home directory (i.e run ls ~/.tunnelto/)

agrinman commented 4 years ago

Thanks for the error report, it shouldn't panic -- it should error in friendly way :)

bbros-dev commented 4 years ago

OK, could you consider prioritizing the XDG convention of using location ~/.config/tunnelto/. Then, if ~/.config/ does not exist and XDG_* are not set, fallback to ~/.tunnelto/ ?

Siilwyn commented 3 years ago

Would be great indeed!

Can use dirs::config_dir or dirs::data_dir for that. Would you accept a PR for this @agrinman?

agrinman commented 3 years ago

hi sorry, missed this! yes a PR for this would be great!

Siilwyn commented 3 years ago

Ah it seems I can't use it without paying unless I spin up my own server, not sure if I will pick this up. So for anybody else, feel free to do so.