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

Ship GUI app only as flatpak? #224

Open
GabMus opened this issue Nov 27, 2023 · 4 comments
Open

Ship GUI app only as flatpak? #224

GabMus opened this issue Nov 27, 2023 · 4 comments

Comments

@GabMus
Copy link
Contributor

GabMus commented Nov 27, 2023

Hey, regarding the issues with building #222 I asked for suggestions to some GNOME devs and if we want to merge it the best solution is to basically ignore the distro's packages for the GUI portion of the app, which inevitably leads to flatpak.

Considering that LACT is already split using a client/server architecture (great idea by the way, avoids having to run the app entirely as root), the idea would be to

  1. ship only the server part (systemd service) as a native package
  2. ship only the GUI as a flatpak (as well as other compatible distros like arch, nix... no harm in that)

It's fiddly but in theory it should work. We could also have some sort of first-time setup wizard in the GUI that lets you install the native package.

If you like the idea, I'm fairly sure I can do most of the work, so just let me know what you think.

@ilya-zlobintsev
Copy link
Owner

I'm not opposed to the idea, I do like Flatpak as a way to distribute "typical" desktop applications, and I've tried to make it work for the lact daemon, but it doesn't seem possible. See #11 for previous attempts.

The split packaging for the daemon and GUI could work, but the most important part of it would be to explain to users what they need to do and why. It can be pretty confusing for a new user who sees that there is a flatpak available, installs it, it doesn't work, and then decides that either the program or flatpak itself doesn't work for them. This is something that commonly happens with the wireshark flatpak package, which doesn't support capturing packets. See flathub/org.wireshark.Wireshark#4.

But if people find it useful and most users have the right expectations (for most people on recent distros the easier way would still be the native package, as it would only require installing one thing), I don't have a problem with it. Though it would probably be better to first figure out packaging for a distro-agnostic daemon - either as a fully static binary, or as a docker container. It would also be useful regardless of the GUI for headless systems or for people who just want to make custom scripts that connect to the daemon.

Another thing I've been working on is support for listening on TCP in addition to the current unix socket - this would also increase the usefulness of the gui-only flatpak, as you could connect to remote machines running the daemon.

If you want to do it, I'd probably recommend waiting for the previously listed things to get implemented first.

@GabMus
Copy link
Contributor Author

GabMus commented Nov 27, 2023

and I've tried to make it work for the lact daemon

Sure enough, there is no way to distribute a system level systemd service via flatpak, see below

but the most important part of it would be to explain to users what they need to do and why

I think that making a very simple setup wizard would likely work, here's a rough sketch of how it could work:

  • start LACT gui (flatpak or not)
  • gui checks if the unix socket (exposable via flatpak) is available: if so, everthing works as normal
  • if the socket is not available then a setup wizard window shows up: "Setup LACT: LACT requires a system package to be installed on your system, this wizard will guide you through the install process"
  • wizard tries to detect distro, if it works it downloads the latest relevant package from github releases and runs something like pkexec pacman -U my_lact_daemon.tar.zst
    • pkexec is like sudo, except it spawns a graphical window asking for the password
    • you can still run host commands from a flatpak if your app has the appropriate permission with flatpak spawn --host <command>
  • if it can't autodetect we ask the user what their distro is
  • if it's not on the list we either give them distro agnostic instructions (make && make install?) or tell them that the distro just isn't supported
  • after the daemon is installed we do pkexec systemctl enable --now lact-daemon.service
  • the app starts as normal

I think this is pretty much foolproof

figure out packaging for a distro-agnostic daemon

I think the daemon can still be shipped as multiple regular distro-specific packages as the full LACT package is currently being shipped

listening on TCP in addition to the current unix socket

I think it's a bit out of scope in relation to this issue, but I don't think exposing a service with root privileges (albeit a rust app that's likely memory safe) is necessarely a good idea (just my 2 cents here, I'm not really too invested on this point)

@ilya-zlobintsev
Copy link
Owner

Headless builds are now provided: https://github.com/ilya-zlobintsev/LACT/releases/tag/test-build

@Froggy232
Copy link

Hi,
Any news on this?
I think it would be an awesome improvement to only install the daemon natively and use flatpak for GUI, it seems to be the logical way in my very humble opinion.
Thanks for your software!

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

No branches or pull requests

3 participants