Commit Graph

8188 Commits

Author SHA1 Message Date
Ryan Brue
446afd82b0 formatting(flatpak-context): Fix a few wrong indentations
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2025-09-25 11:03:29 -05:00
Ryan Brue
02587b5676 flatpak-metadata: Note host-root symlink pitfalls
Following symlinks from /run/host/root naively (for example, with
realpath()) is wrong.

This commit warns about this problem, and provides examples of how to
avoid it when using the host-root permission, either by using
https://man7.org/linux/man-pages/man2/openat2.2.html for modern kernels,
or 65adfdd5fc/steam-runtime-tools/resolve-in-sysroot.c
for older kernels.

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2025-09-24 17:19:21 +00:00
Harald Sitter
0493219ca5 exports: add host-root
Adapted from: https://github.com/flatpak/flatpak/pull/6125

In systemd v259, /run/host/root will be a documented location
for bind mounting the host's root filesystem into a
container. Ref: https://github.com/systemd/systemd/pull/38384

host-root is the sledgehammer permission for file browsers
and similar apps that the user might want to give full access
to.

This works same as the existing host keywords by mounting into
/run/host/root. applications will need adjustments to essentially
treat that path as "root".

Since this opens the door to all sorts of malicious software, the
permission should be put under tight review in flatpak
repositories.

Resolves: #5723

Co-authored-by: Ryan Brue <ryanbrue.dev@gmail.com>
2025-09-24 17:19:21 +00:00
joj
f53cef0041 Enable VA-API extension for Intel GPUs if either i915 or xe is loaded
Xe module supports the discrete and new integrated GPUs (the Arc series) and
the i915 supports the older Intel integrated GPUs (Intel HD).

Closes: https://github.com/flatpak/flatpak/issues/5248
2025-09-10 22:44:52 +00:00
Simon McVittie
2409de5105 Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-08 20:39:51 +01:00
Mary Strodl
919d2922bf common: support reinstall option on bundle installations
Fixes #2489

Adds and wires up a `reinstall` option to
`flatpak_dir_install_bundle`. Previously, bundle install
transactions would silently drop the reinstall flag.
2025-09-08 12:57:40 +00:00
AsciiWolf
5eea330414 Update Czech translation 2025-09-02 15:02:10 +00:00
lumingzh
adfa84ab09 update Chinese translation 2025-09-02 15:01:49 +00:00
Jordan Petridis
16aaa8e3b3 ci: Use a regex to define the stable branches
Avoid doing it manually for each stable branch, and
needing extra steps to create a stable branch.

https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#filter-pattern-cheat-sheet
2025-09-02 15:01:11 +00:00
Sijmen
5d1eaacb26 i18n: Improve dutch translation consistency, with small fixes 2025-09-01 11:01:40 +00:00
Sijmen
f8474ea788 i18n: Update dutch translations 2025-09-01 11:01:40 +00:00
Sebastian Wick
3773617f30 oci: Actually only return the only manifest in get_only_manifest
Instead of using flatpak_oci_manifest_descriptor_get_ref which requires
the `org.opencontainers.image.ref.name` annotation, get any valid
manifest, and make sure to return NULL if there are multiple valid
manifests.

Closes: https://github.com/flatpak/flatpak/issues/6081
2025-09-01 10:59:29 +00:00
Sebastian Wick
d944d9afb6 dir: Propagate errors from flatpak_remote_state_fetch_image_source 2025-09-01 10:59:29 +00:00
Owen W. Taylor
2c7b9342cc image-source: Pass token to flatpak_image_source_new_remote()
Since flatpak_image_source_new_remote() already tries to load files
from the registry, having a separate flatpak_image_source_set_token()
doesn't work - when the token is set, it's already too late to
be passed along with the initial requests.
2025-09-01 10:59:29 +00:00
Georges Basile Stavracas Neto
76266177ab ci: Add flatpak-1.16.x to branch allowlist
This lets CI run for the flatpak-1.16.x branch. Needs backporting to
fully work.
2025-09-01 10:30:07 +00:00
Piotr Drąg
a832df659f Update Polish translation 2025-09-01 09:39:34 +00:00
Simon Chopin
7399dea960 testlib: add expected argument to fcntl(F_DUPFD)
The F_DUPFD and its relative F_DUPFD_CLOEXEC both expect an int argument
as extra argument, being the minimal value for the new FD. This argument
must be within the accepted range (see ulimit -H -n).

This was detected in Ubuntu during testing against the latest glibc,
stracing resulted in:

107244 fcntl(1, F_DUPFD_CLOEXEC, 1847846346272) = -1 EINVAL (Invalid argument)

On the system in question (ppc64el machine running Ubuntu Questing), the
relevant limit is 524288.

For the fix we use 3 as a reasonable floor value, as in the first one
after stderr. It also happens to be the one used in revokefs/main.c.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2121039
2025-08-28 11:21:18 +00:00
Sebastian Wick
37d6fbe033 oci-registry: Fix leak in unpack_archive by freeing the archive path 2025-08-28 11:20:01 +00:00
Sebastian Wick
5a80ac679d oci-registry: Fix leak by freeing certificates in finalize 2025-08-28 11:20:01 +00:00
Piotr Drąg
5d35f0deba Update POTFILES.in 2025-08-27 15:50:24 +00:00
Kalev Lember
d10e11482d Add initial support for preinstalling flatpaks
This adds new FlatpakTransaction API, and a new top level CLI command to
preinstall flatpaks, that is to install flatpaks that are considered
part of the operating system.

A new drop-in directory /etc/flatpak/preinstall.d/ allows configuring
what apps should be preinstalled, and a new flatpak preinstall command
installs and removes apps based on the current configuration.

A drop-in loupe.preinstall file can look something like this:

[Flatpak Preinstall org.gnome.Loupe]
Branch=stable
IsRuntime=false

The corresponding API is flatpak_transaction_add_sync_preinstalled()
which can be implemented by GUI clients to drive the actual installs
on system startup.

Resolves: https://github.com/flatpak/flatpak/issues/5579
Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-08-26 11:51:07 +00:00
Sebastian Wick
555e9200d9 libtest.sh: Add have_working_bwrap to skip over parts of a test 2025-08-26 11:51:07 +00:00
Sebastian Wick
667ad4c57b glib-backports: Add g_set_str from 2.84.1 2025-08-26 11:51:07 +00:00
Owen W. Taylor
555d676cc0 Enable collection IDs for OCI remotes
We want to use collection IDs to specify what remote to install from
when processing /etc/flatpak/preinstall.d; in order for this to work
for OCI remotes, we need to permit collection IDs.

 - In flatpakrepo files, don't require a GPGKey for a OCI remote
   with a collection - we don't have signature verification for GPG remotes.
 - Don't validate that the collection ID appears in the summary -
   the image index doesn't currently contain an image ID
2025-08-25 18:49:34 +00:00
Owen W. Taylor
609f0ce0a1 common: Move delta_url into the FlatpakImageSource
Instead of passing the delta URL along with the image source, when
we create an image source for a remote registry, if we find a delta
URL in the metadata, set it on the FlatpakImageSource for later use.

Centralize duplicated code for creating an image source for a remote
repository based on a summary lookup into one place.
2025-08-25 15:56:20 +00:00
Owen W. Taylor
a460dd5069 image-source: Support oci-archive: image sources
Add support for `oci-archive:` image sources by temporarily
unpacking the archive using libarchive.

Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-08-25 15:56:20 +00:00
Sebastian Wick
74e4c2a601 oci-registry: Allow passing a NULL URI 2025-08-25 15:56:20 +00:00
Sebastian Wick
3824aba911 oci-registry: Remove a bunch of double newlines 2025-08-25 15:56:20 +00:00
Owen W. Taylor
eee21d5a27 builtins/install: Allow direct installation from OCI images
Similar to bundle installs, add:

 flatpak install [--image] docker://registry.example.com/image:latest
 flatpak install [--image] oci:/path/to/image

These is useful for testing purposes and in certain cases when installing
Flatpaks on disconnected systems.
2025-08-25 15:56:20 +00:00
Sebastian Wick
ee9d25dfe2 builtins/install: Create install transaction in common function 2025-08-25 15:56:20 +00:00
Owen W. Taylor
806fc83cd6 common: Add OCI image installation support 2025-08-25 15:56:20 +00:00
Owen W. Taylor
dc56bda820 image-source: Add flatpak_image_source_new_for_location
Which allows one to create an image source from a container location.

It also adds a new FlatpakDockerReference to access different parts of a
docker reference and changes to FlatpakOciIndex to get a manifest for a
specific architecture.

This will become useful in the next commit when we're going to add
support for installing OCI images.
2025-08-25 15:56:20 +00:00
Sebastian Wick
0bfc82a8a3 transaction: Use g_clear_pointer/object functions for op finalize 2025-08-25 15:56:20 +00:00
Sebastian Wick
15560e87e0 transaction: Typedef structs directly 2025-08-25 15:56:20 +00:00
Owen W. Taylor
5950438ca7 image-source: Replace flatpak_oci_parse_commit_labels with getters
Instead of having one function with a pile of out arguments in
arbitrary order, add getters to FlatpakImageSource.
2025-08-25 15:56:20 +00:00
Owen W. Taylor
59ad08e78c image-source: Refactor - add FlatpakImageSource type
To avoid passing around combinations of a FlaptakOciRegistry with
repository and digest, add a FlatpakImageSource type.

This also reduces duplicated code where every place that did
this independently retrieved the repository and image config.
2025-08-25 15:56:20 +00:00
Kasumicic
1c57883321 po(ru): Update Russian translation
Updated Russian translation from Damned Lies.
2025-08-20 19:05:57 +00:00
taoky
dd2a04f978 utils: Don't pass NULL remote to ostree_repo_get_remote_option
Fixes: #4662
2025-08-20 18:27:33 +00:00
Johannes Maibaum
054f4f4a7b flatpak-build: Add empty /run/host/font-dirs.xml
flatpak run writes /run/host/font-dirs.xml, but flatpak build so far
didn't.  This resulted in fontconfig writing:

Fontconfig error: Cannot load config file "/run/host/font-dirs.xml": No such file: /run/host/font-dirs.xml

to the stderr of all processes utilizing fontconfig and run during
flatpak build, as /run/host/font-dirs.xml is included via
/etc/fonts/50-flatpak.conf. This could cause issues for tests run during
building an application, for example.

Closes #6137
2025-08-20 18:24:33 +00:00
filmsi
7333c307a6 i18n: Update sl.po (Slovenian)
With this change flatpak is now fully localized into Slovenian.
2025-08-20 18:23:18 +00:00
Sebastian Wick
786df5b09b ci: Work around AppArmor userns restriction breaking bwrap
CI currently skips a lot of tests. This is due to AppArmor restricting
user namespacing to specific executables with a profile. We however
build bwrap ourselves and that makes it hard to have a profile for it.

Let's just turn the restriction off entirely.
2025-08-20 18:22:27 +00:00
taoky
b5f9d6e18a run: Add directory forwarding support
Use document portal's AddFull interface to forward dirs to sandboxed
apps. Requires version 4 of AddFull.

Closes: #4799
2025-08-06 18:16:03 +00:00
yu shuoqi
51452a7bf5 list, uninstall: Add simple output to two commands
Closes: https://github.com/flatpak/flatpak/issues/6197
2025-08-06 11:14:44 +00:00
Ryan Brue
98726a70ee CONTRIBUTING: Remove mention of Autotools
Autotools support was removed as of commit 8e63eda,
remove mention of the Autotools support in the CONTRIBUTING file

Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
2025-07-29 21:22:44 -05:00
Martin Schwenke
cd80e84343 session-helper: Avoid a memory leak
Apply the fix suggested more than a year ago in:

  https://github.com/flatpak/flatpak/issues/5821#issuecomment-2121673464

Signed-off-by: Martin Schwenke <martin@meltin.net>

Fixes: https://github.com/flatpak/flatpak/issues/5821
2025-07-22 17:28:15 +00:00
Michael Catanzaro
0152272d6c doc: update documentation of flatpak-spawn --watch-bus
The current documentation is misleading, and confused multiple
experienced developers for the past two years.

Fixes #5501
2025-06-25 13:16:08 +00:00
Georges Basile Stavracas Neto
66b038e148 Update SECURITY.md
1.16.x is the latest stable release, and ≤ 1.15 is unsupported.
2025-05-10 23:54:21 -03:00
Georges Basile Stavracas Neto
8283034f4c Post-branching version bump 2025-05-10 23:46:23 -03:00
Georges Basile Stavracas Neto
b676905d91 Update translation files for 1.16.0 1.16.1 2025-05-11 02:28:03 +00:00
Georges Basile Stavracas Neto
29a4e5506a Update NEWS for 1.16.1 2025-05-11 02:28:03 +00:00