6318 Commits

Author SHA1 Message Date
Alexander Larsson
ab394ffd0e Update pofiles for release 1.9.3 2020-12-22 14:11:49 +01:00
Alexander Larsson
7ff93b00cf Update version to 1.9.3, including NEWS 2020-12-22 14:05:07 +01:00
Alexander Larsson
ebf01791dc Download the new digested summary index sig if there
We still load the old one as a backup.
2020-12-22 13:49:59 +01:00
Alexander Larsson
f479c0f1a4 update-repo: Create an digested version of the summary index signature
In addition to the old summary.idx.sig we now create an identical file
in `summaries/$DIGEST.idx.sig`, where the digest is of the summary
index itself. This means it will have a unique name and there will
never be issues where downloading the index and signature will race
during an update.

We keep the new and the previous digested sigs every update to avoid
removing the previous one while its in use.

As suggested by simon in https://github.com/flatpak/flatpak/issues/3983
and https://github.com/ostreedev/ostree/issues/2250
2020-12-22 13:49:59 +01:00
Alexander Larsson
500af2d0f6 CI: Don't build ostree (ppa is new enough now) 2020-12-21 13:46:11 +01:00
Alexander Larsson
f87ffe26a8 Fix leak in upgrade_deploy_data() 2020-12-21 10:30:22 +01:00
Phaedrus Leeds
84f6e1c61f common: Upgrade deploy data when necessary
Now that we have version 4 of deploy data, upgrade to it before trying
to use any of the pieces of data it guarantees the presence of.
2020-12-21 10:30:22 +01:00
Phaedrus Leeds
9ab02b38bc Ensure deploy files have complete metadata
Currently if a deploy file was created (because a flatpak is installed)
using an old Flatpak version (such as 0.10.1 that's in Endless 3.3.16),
it will not include every metadata key, such as "eol" and "eolr". Those
keys were added before deploy version 1. Then when the deploy file is
upgraded to version 3, the metadata is only copied so eol/eolr are still
missing even though they exist in the commit metadata.

So this commit adds deploy version 4 which ensures all metadata keys in
the deploy file are present (when they are present in the source data).
All existing deploy files will be upgraded with this code.

This change is important because we use the end-of-life information to
decide whether an unused runtime should be uninstalled, so without this
change we are not freeing up disk space that we should be.
2020-12-21 10:30:22 +01:00
David Hewitt
d762a2f536 flatpak-dir: Allow root to bypass parental controls
In elementary OS, we're building our images with some flatpaks pre-installed. To do this, we run noninteractive `flatpak install` commands in the chroot as part of the build scripts. We've bumped into some build failures recently after switching to a version of flatpak with malcontent support built in.

After some debugging, it turns out installations are failing the parental controls checks with errors like `Failed to install org.gnome.Epiphany: Could not connect: No such file or directory` message. I'm assuming this is a failure to connect to the system bus in this method (since there isn't one in the chroot).

Is it reasonable to assume that UID 0 should be allowed to install whatever they want regardless of parental controls? I believe this would fix our issue too.
2020-12-21 09:46:31 +01:00
Christian Kirbach
9bf4982202 Update German translation
Proof-read on https://l10n.gnome.org/vertimus/flatpak/master/po/de/
2020-12-21 09:11:32 +01:00
Phaedrus Leeds
c31dc54594 instance: Add missing nullable annotation 2020-12-21 09:11:08 +01:00
Phaedrus Leeds
91223477d4 app: Handle NULL flatpak_instance_get_app()
Gracefully handle flatpak_instance_get_app() returning NULL, which
happens for example when there is a shell in a runtime, e.g. flatpak run
--command=sh org.gnome.Platform
2020-12-21 09:11:08 +01:00
Haochen Tong
b0b42e70ff app: fix crash when killing a process without a name 2020-12-21 09:11:08 +01:00
David Hewitt
e1c094be15 flatpak-transaction: Mark commit param on operation_done nullable 2020-12-21 09:09:51 +01:00
Phaedrus Leeds
b663394a4d Remove LGTM.com infra
We're switching to a GitHub action with the same underlying technology;
see the previous commit.
2020-12-21 09:08:13 +01:00
Phaedrus Leeds
f47274d38b CI: Add action for CodeQL analysis
Use an Action instead of LGTM.com, as suggested here:
https://github.com/flatpak/flatpak/pull/3970#issuecomment-747658238

Re-use the clang build action for resource efficiency.
2020-12-21 09:08:13 +01:00
Phaedrus Leeds
f2b2ce997d Merge pull request #4025 from pwithnall/git-clone
check: Limit clone depth for clones done as part of CI builds
2020-12-15 07:45:42 -08:00
Philip Withnall
3a83cc3df4 check: Bump OSTree dependency to v2020.8
This avoids having to download `master` and then check out a specific
commit. v2020.8 includes the commit which we were previously building.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-15 09:57:41 +00:00
Philip Withnall
dafc5ed5d8 Merge pull request #4028 from tintou/master
flatpak-installed-ref: Add annotation to content rating table
2020-12-15 09:56:09 +00:00
Corentin Noël
348ccb9565 flatpak-installed-ref: Add annotation to content rating table 2020-12-14 11:25:16 +01:00
Philip Withnall
1b391485f6 check: Limit clone depth for clones done as part of CI builds
There’s no need to fetch the entire git history for OSTree or malcontent
for each CI job. Do shallow clones and don’t fetch tags. This reduces
the bandwidth requirement for clones in a CI job by roughly a factor of
8.5 (from 19.5MB to 2.3MB)

See https://tecnocode.co.uk/2020/07/09/easily-speed-up-ci-by-reducing-download-size/

This is slightly complicated by the fact that OSTree is currently being
built from a relatively-recent git commit. Once the flatpak CI can
depend on a tagged OSTree release (say, 2020.8),
```
--branch master --shallow-since 2020-10-27
```
can be changed to
```
--branch v2020.8 --depth 1
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-12 17:06:40 +00:00
Alexander Larsson
b3321e9179 extra-data: Resolve runtime from the target installation
When installing to an installation we need to find the runtime to use
for the apply-extra-data script from the installation we're targeting,
because that is the one that FlatpakTransaction guaranteed has the
required dependencies (although its possible they came from the
default dependency source too, i.e. the system repos).

In particular, we run into this issue if nothing is installed
anywhere, and then we install an extra-data app into a custom
directory. The transaction will download the runtime, and it
will not be anywhere else. Without this change flatpak only
looked for the dependency in the systam an regular user dirs
where it isn't.
2020-12-09 16:12:25 +01:00
Philip Withnall
a9f5c124c1 flatpak-installation: Add default dep sources to list installed refs
It seems that all `FlatpakTransaction`s add the default dep sources, so
the internal transaction used to list installed refs for updates should
do the same.

This fixes a bug where
`flatpak_installation_list_installed_refs_for_update()` would return an
error saying “The application x requires the runtime y which was not
found” if the app was installed in the user repo, the runtime was
installed in the system repo, and no remote was configured (or one was
configured `xa.noenumerate=true`) in the user repo to provide the
runtime. If a remote was configured, the error wouldn’t be returned, but
the app would be spuriously listed for an update as its runtime couldn’t
be found.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-12-09 09:05:13 +01:00
Phaedrus Leeds
2a8602ed88 app: Swap order of rebase/uninstall calls
In case the second of these two fails, the first will still have been
added to the transaction. And since it's better to install the renamed
app but not uninstall the old one, than to uninstall the old one but not
install the new one, swap the order.

See also https://github.com/flatpak/flatpak/issues/3991
2020-12-09 09:03:31 +01:00
Simon McVittie
ac15566672 portal: Log a message when a fd cannot be exposed in the sandbox
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:44:27 +01:00
Simon McVittie
1fb8a68020 portal: Negative handles are an error
Always treat a negative handle as being out-of-range.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:44:27 +01:00
Simon McVittie
5562c921e8 portal: Raise an error if fds are out of range
Previously, we'd silently ignore remapped or sandbox-exposed fds that
were not included with the D-Bus message, which seems unlikely to
work as intended.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:44:27 +01:00
Simon McVittie
fe450d54ba test: Return G_DBUS_METHOD_INVOCATION_HANDLED where appropriate
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:34:19 +01:00
Simon McVittie
86dd000dd1 system-helper: Return G_DBUS_METHOD_INVOCATION_HANDLED where appropriate
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:34:19 +01:00
Simon McVittie
7eedd219e9 session-helper: Return G_DBUS_METHOD_INVOCATION_HANDLED where appropriate
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:34:19 +01:00
Simon McVittie
c704685ecf oci-authenticator: Return G_DBUS_METHOD_INVOCATION_HANDLED where appropriate
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:34:19 +01:00
Simon McVittie
e41e04cee3 portal: Return G_DBUS_METHOD_INVOCATION_HANDLED where appropriate
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:34:19 +01:00
Simon McVittie
cc7f863707 common: Add a backport of G_DBUS_METHOD_INVOCATION_HANDLED
This is syntactic sugar added in GLib 2.67.0, which makes it more clearly
correct when we return TRUE after a GDBus error.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-12-09 08:34:19 +01:00
Alexander Larsson
97d1eb8478 Update common/flatpak-exports.c
Co-authored-by: Simon McVittie <smcv@debian.org>
2020-12-09 08:31:45 +01:00
Casey Jao
3aaea7d206 Expose /var/usrlocal if "--filesystem=host" is specified.
As /usr/local points to ../var/usrlocal on Silverblue,
/run/host/usr/local was previously a broken link inside the
sandbox. This patch checks if /var/usrlocal exists and bind-mounts it
to /run/host/var/usrlocal.

See bug #4010.
2020-12-09 08:31:45 +01:00
Gustavo Costa
9311ae9b4d Update Brazilian Portuguese translation 2020-12-07 16:05:00 +01:00
Kukuh Syafaat
25fecb706b Update Indonesian translation 2020-12-07 16:04:50 +01:00
Phaedrus Leeds
77509d865d Merge pull request #4009 from perlpunk/doc-typo
docs: Fix typo in flatpak-search usage
2020-12-06 08:25:17 -08:00
Tina Müller
297076cd4e docs: Fix typo in flatpak-search usage 2020-12-04 20:42:48 +01:00
Alexander Larsson
e08e8344db Tweak NEWS 2020-11-20 15:48:20 +01:00
Alexander Larsson
aafe1f632c Update pofiles 1.9.2 2020-11-20 15:36:30 +01:00
Alexander Larsson
e03f319f19 Bump version to 1.9.2 2020-11-20 15:23:38 +01:00
Alexander Larsson
c2ee7ac9f5 Update NEWS 2020-11-20 15:23:32 +01:00
Alexander Larsson
a03c2739df Add back the ostree.commit.timestamp per-ref metadata for summary
The old summary had a ostree.commit.timestamp in the per-ref metadata
dict. However, since this was not used anymore by flatpak I removed it.
However, it turns out that flathub has infra that depends on this,
so I'm adding it back.

We reuse the data in the old summary for unchanged refs when
rebuilding the summary, to avoid having to read all the commits. In
the new world the new format summaries are used for this, which means
we have to keep the timestamp in that too. However, to not be
unnecessary large its now using a shorter key name, as this is
duplicated for each ref in the summary.
2020-11-20 15:20:15 +01:00
Alexander Larsson
ecda7757bb Fix multiarch support
A typo was causing us to pass the app id as arch, breaking (at least)
multiarch support.
2020-11-20 15:08:58 +01:00
Alexander Larsson
ea116809d1 remote-metadata-update: Don't clean caches if nothing changed
This was causing us to never cache the summary in user installations
2020-11-20 14:01:42 +01:00
Alexander Larsson
07f36b2e90 Fix test-summaries on non-x86-64 2020-11-20 09:27:17 +01:00
Alexander Larsson
a43c617870 tests: Don't hardcode x86-64 2020-11-20 09:27:17 +01:00
Phaedrus Leeds
1f53e73bf3 dir: Fix spurious permission denied errors
Currently this error is happening on the eos3.9 dev branch of Endless
OS:

Nov 19 12:05:55 endless eos-updater-flatpak-installer[464]:
eos-updater-flatpak-installer: Couldn’t apply some flatpak update
actions for this boot: Error opening directory
'/root/.local/share/flatpak/app': Permission denied

The reason is that we have a check in flatpak_dir_list_unused_refs() to
check if the per-user installation exists and only try to list the refs
there if so, but the existence check falsely succeeds due to the systemd
sandboxing on eos-updater-flatpak-installer.service, and
flatpak_dir_list_refs() then fails in find_used_refs(). Specifically the
ProtectHome=yes systemd service option makes /root inaccessible, and due
to a bug in GLib[1] this makes g_file_query_exists() falsely return TRUE
for any paths under /root.

So, check for not found and permission denied errors rather than doing
an existence check, as we should be doing anyway to avoid a
time-of-check/time-of-use race, as explained in the
g_file_query_exists() documentation.

[1] https://gitlab.gnome.org/GNOME/glib/-/issues/1237
2020-11-20 09:16:57 +01:00
Alexander Larsson
09b470c0fd transaction: Add more details to the ABORTED error
This is reported when we reported an error to the user via
::operation-error signal and the app told us to not continue.

If this happens in some weird case and we see the results its nice
to have access to the original error message.
2020-11-19 18:31:40 +01:00