Commit Graph

8163 Commits

Author SHA1 Message Date
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
Siteshwar Vashisht
4c33b3cec3 profile: fix a shellcheck warning
Error: SHELLCHECK_WARNING (CWE-758): [#def1]
/etc/profile.d/flatpak.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

Resolves: https://openscanhub.fedoraproject.org/task/51962/log/flatpak-1.16.0-3.fc43/scan-results.html#def1

Signed-off-by: Siteshwar Vashisht <svashisht@redhat.com>
2025-05-07 17:54:28 +00:00
Simon McVittie
fb5264327a Update NEWS
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-05-06 12:12:15 +01:00
Sebastian Wick
d0a5125d38 run: Use the instance id in the cgroup name
The systemd Desktop Environments conventions for cgroup names is

  app[-<launcher>]-<ApplicationID>-<RANDOM>.scope

where RANDOM should ensure that multiple instances of the application
can be launched. Currently flatpak uses the PID of itself but the
instance fullfills this convention and is a bit more useful for matching
the cgroup to a flatpak instance.

There are cases where flatpak is doing some internal work (apply extra
data) where there is no instance id, and more philosophically also no
app instance. In those cases we simply do not move the process to the
cgroup with the XDG convention.
2025-04-30 14:16:11 +00:00
filmsi
3ecf90cd02 Create sl.po
50 % translated sl.po
2025-04-30 14:12:15 +00:00
filmsi
2856498ba0 Update LINGUAS + add sl.po
Adding Slovenian translation to flatpak.
2025-04-30 14:12:15 +00:00
Bartłomiej Piotrowski
b6836ee865 prune: Move locking operations to execute only outside dry run
The original idea behind this code was that the initial lockless scan
of reachable objects will make the locking one fast enough that
it won't matter to software managing flatpak repos like flat-manager.
Few years later I can say this is not true, and the locking variant
of scan does take too long and affects Flathub's publishing process.

By keeping only the lockless variant in dry run, we can run it on a
weekly schedule without affecting operations, and issue actual pruning
with flat-manager which will hold a lock in external system and avoid
executing any actions requiring locking to avoid errors/timeouts.
2025-04-30 14:00:20 +00:00
Ekaterine Papava
7d0927d27a Update Georgian translation 2025-04-30 13:59:38 +00:00
Anders Jonsson
c9275d543d Update Swedish translation 2025-04-30 13:57:28 +00:00
Álvaro Burns
f2c5cf44c4 Update Brazilian Portuguese translation 2025-04-30 13:56:58 +00:00
Georges Basile Stavracas Neto
ff9f509682 ci: Cosmetics
- Properly title-case some job names
2025-04-30 13:46:06 +00:00
Jordan Petridis
ff2f18cb42 ci: Do not build with ASAN on older ubuntu
We already build and test with asan with the newer
toolchain in the ubuntu 24.04 job. Sometimes the older
toolchain found in 22.04 or the asan version will
trigger issues that are either false positive or that
have been already against in newer versions.
2025-04-30 13:46:06 +00:00
Georges Basile Stavracas Neto
7005191459 ci: Install missing dependencies
- libxau-dev
- libgdk-pixbuf2.0-dev
2025-04-30 13:46:06 +00:00
Georges Basile Stavracas Neto
9c92d97ef4 ci: Don't build appstream
Ubuntu 24.04 comes with appstream 0.16.2 which is recent enough.
2025-04-30 13:46:06 +00:00
Georges Basile Stavracas Neto
14fd224301 ci: Update Ubuntu versions
Use Ubuntu 22.04 for the older check, and 24.04 for the regular ones.
2025-04-30 13:46:06 +00:00
Philip Withnall
2ae9cfd950 dir: Allow app updates without consulting parental controls
Currently, app installs and updates are treated the same from the point
of view of the parental controls permissions checks. This was intended so
that parents have to re-check each app update to make sure it’s still
appropriate for their children.

In practice, though, parents are not that hands-on, and there are a lot of
regular app updates. The tradeoff between app updates (which bring
security fixes and features) and not changing so much in apps that a
parent’s initial assessment of their suitability for their child is
probably skewed the wrong way. We should be preferring updates (in
particular, so we get security updates), and assuming that if an app is
OK to begin with, it’s probably not going to change so radically as to
become unsuitable for a child with an update.

As a data point, Google Play’s parental controls will allow apps to be
automatically updated even if a child account can’t install new apps.

So, implement this by splitting the existing
`org.freedesktop.Flatpak.override-parental-controls` polkit action in
two: the existing action for _installs_, and a new
`org.freedesktop.Flatpak.override-parental-controls-update` action for
_updates_. `FlatpakDir` is changed to use the appropriate action
depending on whether an app is being installed from scratch or updated.
The default policies for the two actions differ.

Users/Distros who disagree with the new default policy can provide their
own polkit rules to change the behaviour of
`override-parental-controls-update` so that it matches
`override-parental-controls`, to bring back the old behaviour.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: https://github.com/flatpak/flatpak/issues/5552
2025-03-31 13:47:28 +00:00
Sebastian Wick
bc8b40613c run: Add udmabuf to --device=dri
udmabuf allows clients to allocate virtual memory as dmabufs,
which then potentially can be imported by other dma subsystems -
most importantly GPU drivers and KMS. This can avoid copies and
thus increase performance.

Unlike other dmabuf allocators like e.g. dma heaps this doesn't
have known issues relevant for sandboxing. Notably memory accounting
works as expected, so apps can't use udmabuf to escape resource
limitations. For this reason systemd, since version 257[1], grants
"uaccess" access to udmabuf by default, considering it as "safe".

With udmabuf increasingly being availably by default, various apps
and libraries start making use of it - examples include libcamera,
mesa llvmpipe and Gstreamer. Thus let's grant access to it in Flatpak
as well.

For now limit it to "dri" access as sharing buffers with GPUs is
the most common use-case. There is no strong reason to not lift
restrictions further if the need arises, though.

1: https://github.com/systemd/systemd/pull/33738

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
2025-03-31 13:46:20 +00:00