DeedleFake / trayscale

An unofficial GUI wrapper around the Tailscale CLI client.
MIT License
392 stars 14 forks source link

Can't enter a Control Server URL due to permission issues #103

Open dariusarnold opened 3 months ago

dariusarnold commented 3 months ago

Hi, I wanted to try Trayscale as a tailscale GUI client on my laptop. I have experienced the following issue when entering a custom Control Server URL:

Steps to reproduce:

  1. On a default (not configured install)
  2. Open the preferences with the hamburger menu
  3. Try to enter any text in the Control Server URL Box in the Advanced section

Observed behaviour:

  1. Every character is immediately deleted after it is typed. The characters just flash up once and are gone after ~50 ms. It seems like they are actually deleted and not just invisible, since entering my Control Server URL and accepting by pressing the checkmark still does not let me connect (I am unable to toggle the slider in the top left of the screen).

Expected behaviour:

  1. Characters are not deleted when typing the the Control Server URL box.

Further analysis results

I collected the following logs:

flatpak run dev.deedles.Trayscale
2024/03/20 22:28:49 systray error: failed to request name: org.freedesktop.DBus.Error.ServiceUnknown
2024/03/20 22:28:49 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:28:49 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita
2024/03/20 22:28:49 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:28:49 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""
2024/03/20 22:28:49 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""
2024/03/20 22:28:54 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:28:54 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""
2024/03/20 22:28:59 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:28:59 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""
2024/03/20 22:29:00 WARN No IM module matching GTK_IM_MODULE=cedilla found priority=4 code_file=../gtk/gtkimmodule.c code_line=212 code_func=_gtk_im_module_get_default_context_id glib_domain=Gtk
2024/03/20 22:29:04 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:29:04 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""
2024/03/20 22:29:09 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:29:09 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""
2024/03/20 22:29:14 ERROR get waiting files err="Access denied: file access denied"
2024/03/20 22:29:14 ERROR update control plane server URL err="start local client: Access denied: access denied" url=""

The lines with access denied are printed every time the characters get deleted.

Information about my system: I installed Trayscale using flatpak and tailscale from the Tumbleweed repository using zypper, this is the version information:

flatpak info dev.deedles.Trayscale

DeedleFake - An unofficial GUI wrapper around the Tailscale CLI.

          ID: dev.deedles.Trayscale
         Ref: app/dev.deedles.Trayscale/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: v0.11.0
     License: MIT
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 59.4 MB
     Runtime: org.gnome.Platform/x86_64/45
         Sdk: org.gnome.Sdk/x86_64/45

      Commit: 5f476f7e2e10c30971d4e2d500b060c28b9bd056e5ab2a8f692c3b7dac5cc36b
      Parent: cd8261a185aa75acdc856668649a1fd9db43acc4e1512229ba243a834578a216
     Subject: update Tailscale to v1.62.0 (#22) (85bdfce3)
        Date: 2024-03-18 15:11:46 +0000
tailscale --version
1.62.0
  tailscale commit: cc950c079140abfdaaf69777fa171f0bcfa63598-dirty
  go version: go1.22.1

My system: KDE Plasma Version 6.0.2 with X11 KDE Frameworks Version 6.0.0 Qt Version 6.6.2

lsb_release -a
LSB Version:    n/a
Distributor ID: openSUSE
Description:    openSUSE Tumbleweed
Release:    20240315
Codename:   n/a
uname -a
Linux pygmy 6.7.7-1-default #1 SMP PREEMPT_DYNAMIC Fri Mar  1 13:51:21 UTC 2024 (1ff84c5) x86_64 x86_64 x86_64 GNU/Linux
DeedleFake commented 3 months ago

Hmmm... The URL that it sends you to for authentication is given to Trayscale by the Tailscale daemon. This may be a bit of a chicken and egg problem, as the login server can only be set when starting the server, unlike most options. There's a TODO in Tailscale's code to make it work like the other ones, but at the moment it does not.

Can you try changing the URL manually and then restarting Trayscale? It should be

$ tailscale up --login-server <URL>

It might complain about not setting other options that are already set. If so, just copy the options that it tells you about and add them to the above command. There is also a possibility that it'll need to be brought down manually with tailscale down first.

dariusarnold commented 3 months ago

If I set the URL using tailscale command and then start Trayscale, the URL will be shown in preferences. Trying to connect opens the browser with the custom URL passed in the command. So that is a valid workaround. I think it deserves mentioning in the README like the operator flag. Otherwise new users who try to setup the GUI first will run into this.

I experienced a minor issue when I first had a typo in the URL, making it not being resolved by DNS: Trayscale shows a modal popup asking me to confirm opening the Browser for the authentication. Confirming it shows a error message related to not being able to launch the browser (it was previously able to). This is the screenshot of the error: image

The following is logged to console:

2024/03/22 20:39:55 systray error: failed to request name: org.freedesktop.DBus.Error.ServiceUnknown
2024/03/22 20:39:55 ERROR get waiting files err="Access denied: file access denied"
2024/03/22 20:39:55 ERROR adw_application_window_set_content: assertion 'gtk_widget_get_parent (content) == NULL' failed glib_old_log_api=1 priority=4 glib_domain=Adwaita
2024/03/22 20:39:55 ERROR get waiting files err="Access denied: file access denied"
2024/03/22 20:40:00 ERROR get waiting files err="Access denied: file access denied"
2024/03/22 20:40:02 WARN No IM module matching GTK_IM_MODULE=cedilla found priority=4 code_file=../gtk/gtkimmodule.c code_line=212 code_func=_gtk_im_module_get_default_context_id glib_domain=Gtk
2024/03/22 20:40:05 ERROR get waiting files err="Access denied: file access denied"
2024/03/22 20:40:10 ERROR get waiting files err="Access denied: file access denied"
2024/03/22 20:40:15 ERROR get waiting files err="Access denied: file access denied"
2024/03/22 20:40:20 ERROR get waiting files err="Access denied: file access denied"

The last line is then repeated infinitely every 5 s. I noticed ratelimits to bootstrapDNS in the tailscaled log and noticed the typo. But maybe the error message could show the URL it is failing to open.