Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sudo-prompt to re-run tsrelay in Linux #64

Merged
merged 10 commits into from
Jun 21, 2023
Merged

Conversation

marwan-at-work
Copy link
Contributor

@marwan-at-work marwan-at-work commented Jun 14, 2023

This (draft) PR prompts the user to enter their password for Linux when tsrelay is needed to run with sudo.

Note that for now it assumes Linux already has pkexec installed.
Currently, it keeps the same nonce and port so that we don't need to let the client reconfigure its attributes.

@marwan-at-work marwan-at-work marked this pull request as draft June 14, 2023 21:35
@marwan-at-work marwan-at-work marked this pull request as ready for review June 15, 2023 21:46
@shayne
Copy link
Contributor

shayne commented Jun 19, 2023

image
This is all that is visible when running this branch on Linux

@marwan-at-work
Copy link
Contributor Author

@shayne what do the logs show? And what was your Linux set up?

@shayne
Copy link
Contributor

shayne commented Jun 19, 2023

Was just stock Ubuntu Jammy amd64. Away from keyboard now so I don’t have logs. Were you able to test this in your VM prior to putting up the PR?

@marwan-at-work
Copy link
Contributor Author

@shayne yep Ubuntu QEMU 7.2 ARM VM:

Screenshot 2023-06-19 at 6 31 26 PM

@shayne
Copy link
Contributor

shayne commented Jun 20, 2023

image

This is the error

@marwan-at-work
Copy link
Contributor Author

@shayne thanks for the logs, I think the nonce was being set from an empty variable so I pushed a fix for that. Please try again when you get a chance ✌🏼 thanks!

src/tailscale/cli.ts Outdated Show resolved Hide resolved
src/tailscale/cli.ts Outdated Show resolved Hide resolved
src/tailscale/cli.ts Outdated Show resolved Hide resolved
src/tailscale/cli.ts Outdated Show resolved Hide resolved
src/tailscale/cli.ts Outdated Show resolved Hide resolved
@tylersmalley tylersmalley merged commit 84715e0 into main Jun 21, 2023
@tylersmalley tylersmalley deleted the marwan/sudoprompt branch June 21, 2023 18:54
tylersmalley pushed a commit that referenced this pull request Jun 21, 2023
This (draft) PR prompts the user to enter their password for Linux when
tsrelay is needed to run with `sudo`.

Note that for now it assumes Linux already has `pkexec` installed. 
Currently, it keeps the same nonce and port so that we don't need to let
the client reconfigure its attributes.
@shayne
Copy link
Contributor

shayne commented Jun 25, 2023

Follow up.
I tested this today using various distros and desktop environments.

Distros tested:

  • Debian
  • EndeavourOS (Arch)
  • Fedora Silverblue
  • linuxmint
  • Pop!_OS
  • Ubuntu

Desktops environments tested:

  • Gnome
  • Plasma (KDE)
  • Xfce
  • LXDE
  • Cinnamon
  • MATE
  • Openbox

Good news:

  • If the extension is running as a snap or installed from deb
  • and the version of VS Code is new enough
  • the password prompt worked across the board (with one exception)

Bad news:

  • Unless you're installing from the deb on the VS Code site, the distro version is probably too old for the extension. We should look at supporting older VS Code versions. See Minimum VS Code version #75
  • If you're running inside a flatpak the extension doesn't work and puts you in an "Install Tailscale" loop. We should add support for flatpak. See Support Flatpak installations #76
  • If you're running Openbox, the authenticator does not work. We do show an error message letting you know. We don't need to address this right now.

cc @samlinville

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants