flatpak icon indicating copy to clipboard operation
flatpak copied to clipboard

supporting local path in --extra-data

Open kujeger opened this issue 8 years ago • 9 comments

I'm using flatpak to run various games using the linux installers from GOG. These installers can sometimes be quite large, and seem to be a good use case for the extra-data option.

However, extra-data currently only supports http(s) addresses, and these installers are not freely available for download. Being able to refer to local paths would make it possible to use flatpak to run these games without having to keep a full copy of the game in the (possibly local) repository.

kujeger avatar Apr 16 '17 21:04 kujeger

I don't see how you could use these outside your own machine though. That doesn't seem very useful.

alexlarsson avatar Apr 19 '17 16:04 alexlarsson

This is probably overkill for a limited use-case. But flatpak could expose a way for users to select local data.

TingPing avatar Apr 19 '17 17:04 TingPing

Any plans to revisit this now, when i386 multiarch extension has been added? I would love to get rid of these packages shipped by my distro, but I need it for games from Humble Bundle/GOG stores.

barthalion avatar Jun 21 '17 05:06 barthalion

The extra-data files are downloaded to BASE_DIR/extra-data/SHASUM/

And flatpak will skip the download if the file is already there.

So you can just put the file there inside a directory with the corresponding checksum. In my case BASE_DIR is ~/.local/share/flatpak/

manuq avatar Nov 08 '17 00:11 manuq

Is there any problem with adding this feature? I thinks it's critical - how else we could supply extra-data at install time which is not accessible over http? It's crucial functionality for various open-source installers for proprietary software, such as mentioned GOG games. As such, the installers themselves could be published on Flathub or other repositories, but they would be useless without this feature. Besides the trick @manuq provided (thinks for this!), I see two possibilities, neither of which work for now:

  • add path property for "extra-data" type
  • add "extra-data" source support for --extra-sources=SOURCE-DIR option:

When downloading sources (archives, files, git, bzr, svn), look in this directory for pre-existing copies and use them instead of downloading.

bam80 avatar Nov 12 '18 23:11 bam80

I use python3 -m http.server to ease testing of apply-extra, when the extra-data is too large or original source is too slow.

gasinvein avatar May 15 '19 13:05 gasinvein

Unfortunately, right now absence of this feature prevents my flatpak to be accepted: https://github.com/flathub/flathub/pull/994#issuecomment-492452901. This is very sad for me because I put much efforts into this. So I'm asking devs, please, consider to implement this feature. @manuq

bam80 avatar May 15 '19 14:05 bam80

Seems the restriction with http uris only in --extra-data was done intentionally due security reasons: https://github.com/flatpak/flatpak/blob/2b939282859143b0a86beed90574a791e877d4e1/common/flatpak-dir.c#L4798

I wonder if we could softening it by allowing file URIs with only certain dirs here, e.g XDG_DOWNLOAD_DIR?

bam80 avatar Jun 13 '19 22:06 bam80

@bam80: I agree with @TingPing on user experience. Rather, it is about adding a specific filesystem permission to an app, at least if it cannot work with the document portal. This seems to be more of a portal thing. There is already a discussion about this: https://github.com/flatpak/xdg-desktop-portal/discussions/1405.

Mikenux avatar Sep 05 '24 17:09 Mikenux