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

Support Flatpak installations #76

Closed
shayne opened this issue Jun 25, 2023 · 2 comments · Fixed by #86
Closed

Support Flatpak installations #76

shayne opened this issue Jun 25, 2023 · 2 comments · Fixed by #86
Assignees

Comments

@shayne
Copy link
Contributor

shayne commented Jun 25, 2023

To support Flatpak we'll need to run commands via flatpak-spawn --host <command>.

For detection, the env variables container=flatpak and FLATPAK_ID=com.visualstudio.code are set.

I tested flatpak-spawn --host pkexec tailscale status, and it provided the visual password prompt and the command worked as expected.

@marwan-at-work
Copy link
Contributor

After some digging, there is a larger issue: /var/run in flatpak is not the same as the host even though --filesystem=host. Tailscaled runs in /var/run/tailscale which is why tsrelay LocalClient can't find the unix socket

@marwan-at-work
Copy link
Contributor

Update:

  1. If we run flatpak override --user --filesystem=/var/run/tailscale <vscode>, flatpak ends up unable to run vscode in the first place due to this error: "bwrap: can't make symlink at /var/run: File exists" when /media is a symlink to /var/run/media flatpak/flatpak#3477 (comment) (comment is the solution to undo it).
  2. Given the error above, since /var/run is a symlink to /run, then mounting /run/tailscale actually made things work (along with the above suggested changes to run flatpak-spawn).

marwan-at-work added a commit that referenced this issue Jun 28, 2023
We currently check for existence of the `tailscale` binary just for
guessing at whether you have tailscale installed. However, we already
show a similar message when tsrelay returns a NOT_RUNNING state.

Furthermore, showing those pop ups on first install when we already have
a walkthrough to show you how to install Tailscale is not a pleasant
experience.

Therefore, this PR removes the manual checks for the binary and switches
the VSCode configuration to be for setting the unix socket

Updates #76
marwan-at-work added a commit that referenced this issue Jun 28, 2023
This PR checks the env vars to see if we're running inside of flatpak,
and if saw prepends the pkexec with flatpak-spawn in order rerun tsrelay
as sudo.

We also run `flatpak override` so the user doesn't have to. 

Fixes #76
tylersmalley pushed a commit that referenced this issue Jun 29, 2023
We currently check for existence of the `tailscale` binary just for
guessing at whether you have tailscale installed. However, we already
show a similar message when tsrelay returns a NOT_RUNNING state.

Furthermore, showing those pop ups on first install when we already have
a walkthrough to show you how to install Tailscale is not a pleasant
experience.

Therefore, this PR removes the manual checks for the binary and switches
the VSCode configuration to be for setting the unix socket

Updates #76

(cherry picked from commit cf36726)
tylersmalley pushed a commit that referenced this issue Jun 29, 2023
This PR checks the env vars to see if we're running inside of flatpak,
and if saw prepends the pkexec with flatpak-spawn in order rerun tsrelay
as sudo.

We also run `flatpak override` so the user doesn't have to.

Fixes #76

(cherry picked from commit cf322bb)
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 a pull request may close this issue.

2 participants