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

Add flatpak support #372

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

charlesneimog
Copy link

Hi,

I am in the process of implementing Flatpak support, but my knowledge in this area is limited. This pull request is a work in progress, and I am reaching out for assistance as I am facing challenges in comprehending the initiation of the Onedriver service within the Flatpak environment.

Additionally, it's worth noting that fusermount seems not available within Flatpak. Some insights would be highly valuable.

I hope this can help to make Onedriver available in flatpak soon.

@charlesneimog charlesneimog marked this pull request as draft December 1, 2023 01:51
@charlesneimog charlesneimog changed the title start to work on flatpak Add flatpak support Dec 1, 2023
@foopsss
Copy link
Contributor

foopsss commented Dec 2, 2023

If there's no FUSE2 package for Flatpak that's a hell of a problem, since onedriver won't be able to mount anything without it AFAIK. In such a case you would need to create a FUSE package first, assuming it's possible to do so.

Moreover, are sandboxed programs supposed to be able to mount virtual filesystems if they desire?

@foopsss
Copy link
Contributor

foopsss commented Dec 13, 2023

I've been researching this issue out of curiosity, and at first glance it seems that making a Flatpak package may not be possible at all because of FUSE, according to most answers on this reddit post. I wasn't able to gather much more information besides that.

However, one of the redditors that answered pointed OP to its work on packaging rclone, and it has some interesting stuff to say the least, including what seems to be a wrapper for fusermount and a module of some sort. I'm not completely sure if this is enough but the commits on the repo where the Flatpak package is hosted seem to indicate it builds fine, but make no mention of whether it works or not. Aside from that, I haven't seen any package for it available on Flathub or any other remote.

EDIT on 27/12/23: while reading a PR in the GitLab repo for File Roller I came across a comment from one of the maintainers that explains quite clearly the workaround being used in the links I added on my original comment to make fusermount work. Basically, programs that need FUSE are using a fake fusermount binary inside the sandbox to make a flatpak-spawn call that allows them to execute fusermount on the host, effectively escaping the sandbox.

Apparently, there's also another way that involves giving a Flatpak some permissions to allow it to punch a hole in the sandbox, either manually or by declaring it in its manifest file. I also have some doubts on regards to the fact that these approaches seemingly expect the user to have fusermount installed on its system already, which would be the case for fuse3 but not for fuse2, an unmaintained version that many distros don't ship by default and onedriver relies on right now. Wouldn't it create trouble since onedriver requires fuse2?

If using hacky methods is required to make a Flatpak package right now, I can't really say I think this is a good idea.

EDIT2 on 12/1/24: using these workarounds was also discussed on the Steam Flatpak repo almost three years ago.

@jstaf
Copy link
Owner

jstaf commented Jan 14, 2024

onedriver doesn't actually need fuse2, it can use fuse3 and fuse2 interchangeably. The only actual reason to use fuse2 was that older distros like debian 9, centos 7, and ubuntu 18.04 didn't have fuse3 yet if I recall correctly (these distros are now EOL though). We can probably just switch to fuse3 (the only actual use of the "fuse" packages is the userspace binaries in the systemd service file here: https://github.com/jstaf/onedriver/blob/master/pkg/resources/onedriver%40.service#L6). The actual fuse implementation onedriver uses is https://github.com/hanwen/go-fuse, which is neither fuse2 or fuse3, it's an entirely separate Go implementation of fuse.

But yeah any implementation of onedriver in a flatpak essentially involves punching a bunch of holes in the sandbox. I think it's ultimately possible to make a flatpak, there's just not much of a point to have a flatpak because there are packages for all widely used distros and the software itself is pretty easy to build binary packages for. It will take a lot of work to make one though, which is the main reason I never made one for onedriver so far.

@jstaf
Copy link
Owner

jstaf commented Jan 14, 2024

Actually... 😈 #379

@foopsss
Copy link
Contributor

foopsss commented Jan 14, 2024

A Flatpak package would make the most sense on inmutable distros, like Fedora Silverblue. Admittedly, you can still overlay onedriver on Silverblue and call it a day but Flatpaks are the main app installation method.

Installing onedriver on Toolbx never worked for me though, so I'd rule that method out. Maybe it works with distrobox but I'm not sure. I can't speak about other OSes like BlendOS or VanillaOS cause I haven't used them.

@foopsss foopsss mentioned this pull request Feb 14, 2024
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