Commit Graph

8179 Commits

Author SHA1 Message Date
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
Owen W. Taylor
a2aad56cd7 tests: Add tests for https OCI remotes 2025-05-08 16:08:21 +00:00
Owen W. Taylor
c75ba1c7e1 common: Implement /etc/containers/certs.d for OCI registries
Docker and podman can be configured to use mutual TLS authentication
to the registry by dropping files into system-wide and user
directories. Implement this in a largely compatible way.

(Because of the limitations of our underlying libraries, we
can't support multiple certificates within the same host config,
but I don't expect anybody actually needs that.)

The certs.d handling is extended so that certificates are separately
looked up when downloading the look-aside index. This is mostly
to simplify our tests, so we can use one web server for both -
in actual operation, we expect the indexes to be unauthenticated.

Also for testing purposes, FLATPAK_CONTAINER_CERTS_D is supported
to override the standard search path.

Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-05-08 16:08:21 +00:00
Owen W. Taylor
f439e83f2a tests/oci-registry: Add support for SSL to client and server 2025-05-08 16:08:21 +00:00
Sebastian Wick
59c2186703 tests/oci-registry-server.py: Always get bytes for the response
And sent the Content-Length header.
2025-05-08 16:08:21 +00:00
Owen W. Taylor
199f7ccac5 tests/oci-registry-server.py: Convert to argparse 2025-05-08 16:08:21 +00:00
Sebastian Wick
5945a18d97 tests/oci-registry-server.py: Clean up Python style 2025-05-08 16:08:21 +00:00
Owen W. Taylor
05e2b083ed tests/oci-registry-client.py: Convert to argparse 2025-05-08 16:08:21 +00:00
Owen W. Taylor
34acb5799e tests/oci-registry-client.py: Parse URL parameter 2025-05-08 16:08:21 +00:00
Owen W. Taylor
82706e6d28 tests/oci-registry-client.py: Drop python2 compatibility 2025-05-08 16:08:21 +00:00