tralph3 / ZeroTier-GUI

A Linux front-end for ZeroTier
GNU General Public License v3.0
211 stars 32 forks source link

Flatpak Version #5

Open ripper81 opened 3 years ago

ripper81 commented 3 years ago

Hi,

it is good to see that someone tries to create a GUI for ZeroTier on linux. It would be great to have this available as a flatpak for easy installing and updating.

Thank you for your work.

Best regards

Heiko Gimbel

pktiuk commented 3 years ago

I think a regular python package installed via pip would be a bit more convenient.

tralph3 commented 3 years ago

Right now I have a script that creates a deb package on the fly. It's not the same as automatic updates, but it's better than what it was. I'm not a fan of flatpak tbh, I'd rather keep those things out of my computer. But, if somebody else wants to package it, I have no problem with that.

Can202 commented 3 years ago

Hi,

it is good to see that someone tries to create a GUI for ZeroTier on linux. It would be great to have this available as a flatpak for easy installing and updating.

Thank you for your work.

Best regards

Heiko Gimbel

I made a script in bash that install this ZeroTierGUI (ZeroTierGUI is an amazing work) and the ZeroTier. the idea is that it be an easy installation. Repository (run in terminal)

it's not flatpak, but it's easy to install, in my opinion

the updates would technically work, if you want to update you open the script again, since it uses the direct repository of ZeroTierGUI

tralph3 commented 3 years ago

Thanks, but It's not recommended to run graphical applcations as root. The GUI will ask for permission if needed, but it should otherwise run as an unauthorized user.

csc-chicken commented 1 year ago

I think for beginner friendly purpose it is necessary to make it to flatpak, for example hamachi has a flatpak app call haguichi . However, I faced issue that it won't build in gnome builder in order to export to flatpak. Maybe someone know better for flatpak support can help 圖片

RiemaruKarurosu commented 1 year ago

Experimenting with builder and flatpak, by it's nature, i think this app it's not possible to package as flatpak, sandbox permissions don't allow access to /var/lib (it's blacklisted) or outside commands as mention in Flatpak docs, zerotier-one lives in /var/lib directory, zerotier-one doesn't have any dbus methods to access.

The only way this could work is moving the authtoken.secret where the flatpak app could read this file:

sudo cp /var/lib/zerotier-one/authtoken.secret /home/user/.zeroTierOneAuthToken chown user /home/user/.zeroTierOneAuthToken chmod 0600 /home/user/.zeroTierOneAuthToken as mention in ZeroTierOne

or telling the user to sudo cat /var/lib/zerotier-one/authtoken.secret and give it to the app (also not possible to do inside the flatpak).

Botw implementations won't work until the new zerotier-gui it's ready.

I personally think this defeats the purpose of making a flatpak app.

RiemaruKarurosu commented 7 months ago

Experimenting with builder and flatpak, by it's nature, i think this app it's not possible to package as flatpak, sandbox permissions don't allow access to /var/lib (it's blacklisted) or outside commands as mention in Flatpak docs, zerotier-one lives in /var/lib directory, zerotier-one doesn't have any dbus methods to access.

The only way this could work is moving the authtoken.secret where the flatpak app could read this file:

OK, I found out something that could help with the flatpak version, you could execute external commands in flatpak with flatpak-spawn --host (some reddit forums tell not to do it because it defeats the flatpak purpose) but with this you could get access to the authtoken.secret and use it in the new zerotier-gui implementation, you only need to give the session bus access to org.freedesktop.Flatpak.

tralph3 commented 7 months ago

Hi. I'm currently testing GTK with my other program Steam-Metadata-Editor. I'm liking it much better already.

Once that's finished, I'll likely port ZT GUI to Gtk as well, and I'll switch from running CLI commands to interact with zerotier to using its api. I already ran some tests locally and it works great.

To use the API, I still need to auth token, but it needs to be sent as a header along with the request to the API, meaning that the authtoken can be supplied in any number of ways. Be it asking for it within the program, setting an env variable, or making a copy somewhere where the flatpak version can access.

With that, a Flatpak version is certainly possible.

RiemaruKarurosu commented 7 months ago

Once that's finished, I'll likely port ZT GUI to Gtk as well, and I'll switch from running CLI commands to interact with zerotier to using its api. I already ran some tests locally and it works great.

To use the API, I still need to auth token, but it needs to be sent as a header along with the request to the API, meaning that the authtoken can be supplied in any number of ways. Be it asking for it within the program, setting an env variable, or making a copy somewhere where the flatpak version can access.

With that, a Flatpak version is certainly possible.

I've a start of the GTK version with flatpak a long time ago, if it help in something https://github.com/RiemaruKarurosu/ZeroTier-GTK, actually I don't have so much time, but it's a work in progress, feel free to grab the usefull things from it.

tralph3 commented 7 months ago

Yes, I remember! Thank you, it'll most likely be useful.

djsiropchik commented 2 months ago

Right now I have a script that creates a deb package on the fly. It's not the same as automatic updates, but it's better than what it was. I'm not a fan of flatpak tbh, I'd rather keep those things out of my computer. But, if somebody else wants to package it, I have no problem with that.

Normally. I had the same opinion before, but in the result it's a good idea to install all apps with the close source via flatpak for security and to protect the system from the dependencies. And your system will be clear longer. So if it's possible it's a universal way for all distr's. Thanks for your great job anyway.