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 #114

Closed
FlorianUekermann opened this issue Aug 1, 2016 · 39 comments
Closed

Add flatpak support #114

FlorianUekermann opened this issue Aug 1, 2016 · 39 comments
Labels
invalid Not strictly a bug or enhancement from project's POV packaging
Milestone

Comments

@FlorianUekermann
Copy link

Snap is pretty Ubuntu specific (and partly proprietary). Please add a flatpak package, since that seems to be where the rest of the Linux world is headed for distribution independent apps.

@szszszsz
Copy link
Member

http://flatpak.org

@szszszsz
Copy link
Member

szszszsz commented Apr 7, 2017

Since the App is now integrated into most major distributions use of Snap or Flatpak loses on importance. Are there any special reasons for supporting it anyway?

@FlorianUekermann
Copy link
Author

Just ine example: The update frequency of this app is on a much shorter timescale than distributions release. This kind of decoupling from dists is why flatpak exists. In the long run you may even want to drop distribution packages.

@szszszsz
Copy link
Member

szszszsz commented Apr 7, 2017

App is updated through official repositories as usual package shortly after release and is managed by OS (Arch, Ubuntu, Fedora to name a few). There is no need to wait for next distribution release.
Is Flatpack:

  • Supported on Debian?
  • Packages its dependencies with application?

The only practical use I see now is running it on distributions with old Qt library (hello stable Debian).
App is not really much in dynamically development when it would need a daily build. Stable releases were in past once a month at most.

@FlorianUekermann
Copy link
Author

That is not how many mainstream distribution​s update packages. There are often several years between releases and plenty of people end up running half a decade old releases at some point. Package repositories are not app stores, that is what snap and flatpak are for. After release many dists don't update packages, so once a month would outpace their frequency by a factor 40 or something like that.
Yes, all distributions I know of are working on support for flatpak and yes dependencies can be packaged. Also what about users of dists you dont have packages for?
Even support for new products that are not backwards compatible will become a problem.

@szszszsz
Copy link
Member

szszszsz commented Apr 7, 2017

I am not sure you know how the package update works. Distribution updates its own packages mainly and vendors/maintainers do their own. We have shipped v0.6.3 to Ubuntu (own PPA) and Fedora (main AFAIK) both 3 versions back without problems. I do not think the frequency factor example is real.
Let's talk concretely:

  • What widely used distributions do you mean to be half-a-decade old? Debian, Centos? The latter is not supported by Flatpak because of old kernel anyway. The other ones would share similar issues probably.
  • What backward compatibility problems do you mean?
  • Are you sure Flatpak would not generate issues by itself? (Snap did)

It is true that we cannot support all distributions. I think most vendors can't. However large count are clones (sharing package or repository with mainline) and if someone use the original he/she is possibly a power user well accustomed to compiling applications.
At least for the sake of Debian we could create such package (if it would make it work there).

@FlorianUekermann
Copy link
Author

I'm not following. You seem to have packages in official repos, so you don't control the release cycle. Let's make an example. After the freeze of the testing repo Debian releases after about 7 months and it usually takes about 24-30 months until the next release. That means people will use about 3 years old software at the end of a cycle. There is also little reason for some people to upgrade immediately, since LTS is supposed to last for at least 5 years, possibly much longer.
That means if you need to support a new firmware version that has interface changes (like the recent protocol change) or new hardware, people will need to install a new app from somewhere else than the official dist repo.
Many other dists work similarly, although the exact times may differ.

Also, maintaining all these packages is a lot of work, why would you want to do that in the long term? This app is exactly why snap and flatpak where invented (multiple reasons, not just updates).

It's nice to have packages for now, because flatpak support is just now becoming the norm. But for upcoming releases it gives you an easy way for cross dist releases.

Also don't forget that some people are just users, not admins. A great number of users can not install dist packages at work.

@jans23
Copy link
Member

jans23 commented Apr 7, 2017 via email

@FlorianUekermann
Copy link
Author

Absolutely, this shouldn't be a priority, especially since a lot of people are not familiar with flatpak yet. Regarding outdated packages: Debian started the code freeze in February, so the next chance to get 1.0 into Debian stable is a couple of years away.

@jans23 jans23 added this to the backlog milestone Apr 26, 2017
@szszszsz
Copy link
Member

szszszsz commented Oct 5, 2017

To investigate would using flatpack help to distribute App on Centos 6/7.
CC @techge

@techge
Copy link

techge commented Oct 5, 2017

As far as I can see neither flatpack nor snapd support CentOS/RedHat yet. Snapd status is "in progress" though.

@szszszsz szszszsz added invalid Not strictly a bug or enhancement from project's POV packaging labels Nov 3, 2017
@jans23
Copy link
Member

jans23 commented Apr 20, 2018

Note that Nitrokey App 1.3 is available as AppImage.

@4jNsY6fCVqZv
Copy link

Hi, this is a very old issue I see. But for me it has great relevance. My current Linux distro is thinking about preferring flatpaks as sources. Could you imagine providing Flatpaks and sharing them on https://flathub.org/ for example?

@rugk
Copy link

rugk commented Oct 5, 2019

Yeah…
same with Fedora Silverblue.

Flatpaks are a new software distribution mechanism for Linux distros, can thus installed on any distro and are easy to update.

Here is how to get started.

@quiescentnexus
Copy link

We've been working on Flatpak builds recently and the latest one seems to be working fine, so it has been added to the 1.4 release on GitHub: https://github.com/Nitrokey/nitrokey-app/releases/tag/v1.4

Future releases will get Flatpak packages immediately.

We're hoping to release it on Flathub soon as well but Flatpak makes it just as easy to install a manually downloaded package, so you can get it right now and don't have to wait.

@4jNsY6fCVqZv
Copy link

4jNsY6fCVqZv commented Oct 9, 2019

@enleth Thank you for your work! Will this Flatpak be officially created and maintained by Nitrokey when it appears on Flathub?

Can this issue then be closed?

p.s. I read that the Nitrokey app communicates with udev. And I heard from the developers of another software that Flatpak can't handle udev and therefore their camera function doesn't work. How did you solve this?

@rugk
Copy link

rugk commented Oct 9, 2019

Can this issue then be closed?

IMHO only close it when it is on Flathub.

Here is how to publish it: https://github.com/flathub/flathub/wiki/App-Submission

The big advantage is that you get automatic updates this way, manual installation is only a fallback IMHO.

@quiescentnexus
Copy link

Indeed, it's too early to close this issue.

@rugk thanks. We've actually done some research already, we're just working on a new CI/CD platform that would, in addition to building binaries, also do automatic commits and pull requests to all git-based "hubs" such as FlatHub, brew or AppImageHub.

@enleth Thank you for your work! Will this Flatpak be officially created and maintained by Nitrokey when it appears on Flathub?

That's the plan.

p.s. I read that the Nitrokey app communicates with udev. And I heard from the developers of another software that Flatpak can't handle udev and therefore their camera function doesn't work. How did you solve this?

Using this: https://github.com/flathub/shared-modules/tree/master/udev along with --device=all permission. As soon as Flatpak introduces a method to allow access to specific devices, we'll use it to restrict the permissions, but right now this is the only way.

@4jNsY6fCVqZv
Copy link

@enleth

As soon as Flatpak introduces a method to allow access to specific devices, we'll use it to restrict the permissions, but right now this is the only way.

Have you opened a ticket for it in the Flatpak repository or can you do it so that it can be realized in the foreseeable future?

How critical do you see a --device=all permission for use in Nitrokey? Because you're all about security, aren't you?

@quiescentnexus
Copy link

Have you opened a ticket for it in the Flatpak repository

There is one: flatpak/xdg-desktop-portal#227

or can you do it so that it can be realized in the foreseeable future?

This is far too complex of an issue for an outside contributor to solve properly (or at all, I think).

How critical do you see a --device=all permission for use in Nitrokey? Because you're all about security, aren't you?

That's not a serious question, is it? Obviously, the whole point of the Nitrokey App and the only reason to use it is to configure a USB device, so a way to access the device is critical. Also obviously, Nitrokey App doesn't need access to all devices, just USB devices with specific VID/PID pairs, so accessing all devices is completely unnecessary.

But all Flatpak offers now is --device=all, the official documentation confirms it, and the Flatpak developers tell people to use that - that is, when they respond to such issues at all.

Honestly, I'm not sure what sort of answer you actually expected here.

@4jNsY6fCVqZv
Copy link

That's not a serious question, is it?

Yes, it is. I'm interested in whether the use of these extended privileges can or will compromise my desired additional security through the Nitrokeys.
Because then I should consider whether I really want to install the Nitrokey App as Flatpak over Flathub. However, I cannot technically assess and judge this. That is why I am asking.

@quiescentnexus
Copy link

quiescentnexus commented Oct 17, 2019

You mean as opposed to installing it using regular distribution repository?

The Flatpak privilege system defines restrictions - and restrictions only. The sandboxed application still runs under your user account and, in the end, is still just a normal POSIX process subject to normal system-wide permission checks. Flatpak's device=all does not mean "magically give this application run by a regular user FULL ACCCESS TO ALL THE DEVICES" [read in Mike Meyers' voice for intended effect], it only means "do not impose extra device access restrictions on top of what this user account can do outside of Flatpak". There are no "extended" privileges in play here, at most it's "unrestricted".

Thus, at the moment, Nitrokey App Flatpak gets exactly as much device access as Nitrokey App installed as a DEB package, not a bit more.

I suppose Flatpak's naming for the privilege levels could be a bit better as to not be misleading in this manner.

@4jNsY6fCVqZv
Copy link

There is problem with publishing via Flathub. Flathub is a platform that also offers proprietary packages. Since I switched to Linux to only find free software in my Software Center, installing the Nitrokey-App Flatpak unfortunately takes me away from this goal. When I install an app via Flathub, the proprietary apps I don't want are suddenly displayed in my Software Center. I don't want that. Therefore I ask you to offer an official version for download via your website as an alternative for people who are looking for 100% Free Software.

@szszszsz
Copy link
Member

I think it is intended (to confirm) to be also distributed through Github releases, as here for v1.4: https://github.com/Nitrokey/nitrokey-app/releases/tag/v1.4

@4jNsY6fCVqZv
Copy link

Thanks for your answer! Does downloading via GitHub mean that the package will receive automatic updates via my Software Center as soon as there is a new release tag in your GitHub repository?

That leaves one point that worries me. GitHub uses Amazon Server to host the packages. Your website runs on servers of a small Berlin company. Would it be possible to offer an Amazon free download with a non-US server location?

@4jNsY6fCVqZv
Copy link

I'm a little irritated about the Flatpak file in your release repo.
The name seems to be "nitrokey-app-1.4.0.flatpak".
My system doesn't recognize it as Flatpak. Different than with LibreOffice.
https://www.libreoffice.org/download/flatpak/
There the filename is LibreOffice.flatpakref. I would expect the file extension of the Nitrokey app to be similar to that of LibreOffice!

@alex-nitrokey
Copy link
Contributor

If you want to have automatic update via the Software Center you need to install the App via your Software Center or install our ppa as explained here.

If you do not want to or can not install it over the Software Center because of whatever reason, you can either install the flatpak via Flathub (as soon it is published there) or install the App via snap. Both possibilities provide automatic updates though not over the Software Center as far as I know.

If this also is not possible for you for whatever reason you need to update the App yourself. You can watch this repo for releases only and thus get informed about new releases. This applies for using the AppImage or installing the .deb file attached to every release.

@4jNsY6fCVqZv
Copy link

4jNsY6fCVqZv commented Nov 27, 2019

@alex-nitrokey Thanks for your feedback! What can you tell me about your GitHub Flatpak file format? "nitrokey-app-1.4.0.flatpak" doesn't seem to be valid. I would expect a "nitrokey-app-1.4.0.flatpakref" file. Flathub even looks a little different flatpak install flathub com.domainname.appname.

If this also is not possible for you for whatever reason

I am clearly concerned about ethical reasons! see above.

@alex-nitrokey
Copy link
Contributor

As stated above, our App is not at Flathub yet (afaik). Thus, flatpak install flathub ... won't work. As far as I can see you can use flatpak install <flatpakg-file> where <flatpak-file> is the file found in our release page.

I can not tell you any more, as I am not using flatpak. If you have a specific technical problem with the flatpak file, please let us know. Otherwise, I kindly ask you to change to our support forum as your questions may be of interest for other users as well and may are not development related.

I am clearly concerned about ethical reasons! see above.

I proposed multiple solutions above which should be no problem regarding ethical considerations. Please choose the one you like most.

@4jNsY6fCVqZv
Copy link

4jNsY6fCVqZv commented Nov 28, 2019

So my request is about an Flatpak alternative in addition to Flathub. At least for the transition until Flathub also works for users like me.
I know it's extra work and I'm very grateful for what you're doing now!
Nevertheless, my wish remains that Nitrokey, not only appreciate my use case, but also actively support my attitude (to go for 100% Free Software) wherever possible.

If you can set up your publishing system so that the Flatpak is available at https://www.nitrokey.com/download, that would be very supportive and solves my ethical dilemma!

But still, I have a problem with the Flatpak in your GitHub repo. #114 (comment)
My system doesn't recognize it as Flatpak. To my knowledge the file should end in .flatpakref. Can you please look into it? @szszszsz @enleth

@4jNsY6fCVqZv
Copy link

The problem with the unrecognized Flatpak repo file still exists. Is there someone at Nitrokey or in the community who can check it?

@szszszsz
Copy link
Member

szszszsz commented Nov 12, 2020

Hi!
I am sorry this takes so long. Indeed the Gnome Software is not working with this file directly, thus confusing the user. This should be fixed on the next release at most (hopefully earlier). In the meantime please use command line interface to install the application. I have made a quick demo using it here:

Edit: demo is no longer available unfortunately - from what I remember I was just using flatpak install ./nitrokey-app.flatpak, flatpak run ... and flatpak uninstall.

@rugk
Copy link

rugk commented Nov 13, 2020

Hmm, still confused. This just shows the uninstallation. The flatpak is still also not available on Flathub.org, and I also cannot find it on https://www.nitrokey.com/download, so hmm...
So at least a self-hosted flatpak repo would be great for automatic updates, or (or "and") publishing it on the existing Flathub infrastructure.

@4jNsY6fCVqZv
Copy link

4jNsY6fCVqZv commented Nov 13, 2020

@rugk As I see the video, both the installation and the uninstallation process are addressed.

@szszszsz Thanks for getting your feedback! What concerns me:

  1. What exactly is the source of the installation? Is it hosted & signed by Nitrokey itself and the Flatpak distributed over it?
  2. What does it take to fix this?
  3. Would a point release be possible?

@szszszsz
Copy link
Member

Connected: flathub/flathub#2081

@szszszsz
Copy link
Member

Hi @4jNsY6fCVqZv! Sorry for the delay.

The binary we have on Github release page right now is built by us, however it is not easily discoverable by the GNOME Software. We have applied to Flathub for that, which compiles and distributes the binaries by itself.
If one wants to use the binary built by us, then it needs to be downloaded by hand and installed using CLI at the moment. If there would be a demand, perhaps we could offer own Flatpak repo (idea to discuss).

cc @daringer

@daringer
Copy link
Contributor

Good news, the nitrokey-app is now available via the official flathub repository: https://flathub.org/apps/details/com.nitrokey.nitrokey-app

closing this issue, feel free to open a new one if you encounter issues...

@4jNsY6fCVqZv
Copy link

@szszszsz @daringer Thanks for working on Flatpak support!

If one wants to use the binary built by us, then it needs to be downloaded by hand and installed using CLI at the moment. If there would be a demand, perhaps we could offer own Flatpak repo (idea to discuss).

For our company, this is still a current concern yes. Would you like to have a new issue for discussion? Then I will open one.

@szszszsz
Copy link
Member

szszszsz commented Feb 3, 2021

@4jNsY6fCVqZv Please make a new one if possible, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Not strictly a bug or enhancement from project's POV packaging
Projects
None yet
Development

No branches or pull requests

9 participants