Commit Graph

585 Commits (94d5f0a86e40543917a9ff7c0749b32cc2982d1b)

Author SHA1 Message Date
Alexander Larsson 8b13d3c5ee builder: Add progress reporing while downloading 2017-04-24 21:23:46 +02:00
Alexander Larsson 47062137a5 fixup! common: Add flatpak_build_file[_va] helper 2017-04-24 12:23:20 +02:00
Alexander Larsson 4a60c87958 common: Add flatpak_build_file[_va] helper
This makes it easy to construct GFiles
from a base dir and an argument list
of child elements.
2017-04-24 09:02:33 +02:00
Alexander Larsson b8cd12930a Report full version in http user agent
https://github.com/flatpak/flatpak/issues/635
2017-04-19 20:47:57 +02:00
Alexander Larsson fe56c08203 build: Always set personality to linux32 when cross-building
This means that autodetection during builds works much better.
Fixes https://github.com/flatpak/flatpak/issues/712
2017-04-19 19:36:55 +02:00
Alexander Larsson 7da0726514 build: Ensure we add the default dbus permissions
When using flatpak build, use the same default dbus
permissions (portal.*) as we do in flatpak run.

Fixes https://github.com/flatpak/flatpak/issues/717
2017-04-19 16:55:01 +02:00
Jonas Ådahl a1ff20ca0e run: Handle non-default WAYLAND_DISPLAY
WAYLAND_DISPLAY can be other than "wayland-0" for various reasons, such
as using a custom Wayland display server or the session display server
using a custom display name.

Note that for xdg-desktop-portal to support showing portal windows, the
xdg-desktop-portal service MUST use the same WAYLAND_DISPLAY.
2017-04-17 13:55:33 +08:00
Matthias Clasen 0824fc830a Fix a typo in a comment
This comment was obviously copy-pasted from
the previous case without updating it.
2017-04-14 14:21:28 -04:00
Alexander Larsson b426306884 appstream: Don't strip .desktop extension if thats the actual id
The telegram app is org.telegram.desktop, so we can't assume
the id in the appstream data that ends in .desktop is just a desktop
file extension.
2017-04-12 09:40:04 +02:00
Simon McVittie 646b4c468b Use correct format string for guint64 on 32-bit
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-04-04 12:17:28 +02:00
Emmanuele Bassi 8bbcf0b23b Use ostree's BARE_USER_ONLY flag (#674)
* Use ostree's BARE_USER_ONLY flag

Now that Ostree has a 'bare user only' mode for repositories, we should
use it.

This allows installing Flatpak run times inside different Docker layers.

Original patch by: Alexander Larsson <alexl@redhat.com>
Tested-by: Emmanuele Bassi <ebassi@gmail.com>

* Use the parent mode when creating a child repo

Instead of hard coding the repository mode, query the parent's mode.

* Gate bare-user-only repo creation behind an environment variable

We keep the default of bare-user repositories, but with an environment
variable we change new repositories to bare-user-only.
2017-04-03 16:31:18 +02:00
Alexander Larsson 0dcc7332f7 Handle uris better when detecting .flatpak[repo,ref] suffix
We fully parse the argument as (possibly) a uri, which means
we can handle an argument like:
 https://git.gnome.org/browse/gnome-apps-nightly/plain/gnome-builder.flatpakref?h=stable

Which doesn't work with a simple has_suffix call.
This is important because the flatpak.org site now references
these kinds of uris.

Fixes https://github.com/flatpak/flatpak/issues/659
2017-04-03 10:02:28 +02:00
Alexander Larsson 3ff6d312de update: Only allow downgrades if a commit is explicitly specified
If you run "flatpak update" then we will never update to
a commit that is older than the currently installed one. This
protects against a man-in-the-middle attack that would otherwise
let the attacker downgrade to a previously signed version that
may have some vulnerability.
2017-04-03 09:45:45 +02:00
Alexander Larsson 266b9cb6f0 system-helper: Fix check for downgrade
We never want the system-helper to downgrade. If you want to run
not-the-latest version you need to be "real root". However, the
check for this was broken, as it compared the new commit with the
new commit, which was always ok. Instead check the timestamp
on the new commit with the current one.
2017-04-03 08:53:44 +02:00
Alexander Larsson 41d9717113 Fix unused variable errors reported by clang 2017-03-30 10:01:24 +02:00
Alexander Larsson f42a4d735b Fix ostree autoptr checks for git master
The export g_autoptr changes in ostree will be in the release 2017.4,
but the gnome CI is currently failing due to them also being in current
git master which is called 2017.3 atm. We fix this by checking against
2017.3 instead, which is safe, because the actual OSTREE_CHECK_VERSION
macro was added after the 2017.3 release too.
2017-03-30 10:01:24 +02:00
Colin Walters d40df323b4 utils: Prepare for libostree 2017.4 defining autocleanups
See: https://github.com/ostreedev/ostree/pull/756
2017-03-29 21:06:09 +02:00
Alexander Larsson 7a6a109720 OCI: Fix signature checks on updates
We can't support updating to a specified digest, we must
always look in the index so that we can find the signature.
2017-03-29 18:04:13 +02:00
Alexander Larsson 5b0ad227e8 OCI: Verify signatures 2017-03-29 17:14:36 +02:00
Alexander Larsson a7216cedd2 OCI: Add json format for atomic-based signatures 2017-03-29 17:14:36 +02:00
Alexander Larsson 5aeec78311 OCI: Add support for strict and mandatory json properties
Strict means there must be no unknown properties, and
mandatory means a property must be in the json object.
2017-03-29 17:14:36 +02:00
Alexander Larsson ea803f1f80 OCI: Add flatpak_oci_sign_data 2017-03-29 17:14:36 +02:00
Alexander Larsson b5c6140c58 update: Don't check for update short-circuit if we're not pulling
There is no need to do this, its just a waste of network bandwidth.
2017-03-29 17:14:19 +02:00
Alexander Larsson 11943e7e40 OCI: Support OCI with system-helper by mirroring OCI repo
This allows us (when we later add signatures) to verify
the signatures of the OCI manifest, and can thus support
the system-helper.
2017-03-29 17:14:19 +02:00
Alexander Larsson 759eee8cea OCI: Verify layer checksum while applying
This means we verify the exact data we use, which is
what was signed. In particular, this means in the
system-helper we don't open us up to the user
manipulating the file while it is being applied.
2017-03-29 17:14:19 +02:00
Alexander Larsson 980bd48f0e OCI: flatpak_pull_from_oci - verify manifest ref
This ensures the actual manifest ref matches what was specified
in the index. This is required as the goal is to sign/trust
the manifest, but not necessarily the index.
2017-03-29 17:14:19 +02:00
Alexander Larsson c81e115bb2 OCI: Add flatpak_archive_read_open_fd_with_checksum
This will let us do the layer sha256 checksum during
layer apply, which means we don't read it multiple times,
and that its not modified inbetween.
2017-03-29 17:14:19 +02:00
Alexander Larsson 8b01230673 OCI: Add flatpak_oci_registry_mirror_blob
This lets you mirror a blob from a (possibly remote)
OCI registry into a local one. This will be the base
for the system-helper work for OCI.
2017-03-29 17:14:19 +02:00
Alexander Larsson 4a8d77d9af OCI: fstat in local_open_file helper
This verifies that all files are regular,
and avoid each caller having to fstat themselves.
2017-03-29 17:14:19 +02:00
Alexander Larsson d39491b5fb oci: Break out get_digest_subpath helper function 2017-03-29 17:14:19 +02:00
Alexander Larsson cac65fb6a1 FlatpakDir: Break out helper flatpak_dir_lookup_ref_from_summary
This just extracts some shared code into a helper funcion
2017-03-29 17:14:19 +02:00
Alexander Larsson ff3f459e67 Add flatpak_oci_registry_get_uri 2017-03-29 17:14:19 +02:00
Alexander Larsson 23b2eb6383 OCI: Verify that loaded OCI blobs have the correct checksum 2017-03-27 15:02:55 +02:00
Alexander Larsson 82aad1ccb1 Correctly find system unmaintained extensions
We should not terminate the extension search just because
an earlier directory succeeds. Even non-existant directories
succeed, and anyway we should continue searching even if it
wasn't empty, because multiple subdir extensions may match.

Fixes https://github.com/flatpak/flatpak/issues/654
2017-03-27 11:18:16 +02:00
Colin Walters 2618a19716 Import ostree's compiler warnings, fix up callers
In ostree I maintain what I consider a "baseline" set of compiler
warnings that should *always* be fatal for a modern C project.

I noticed while working on a previous patch that a `-Werror=format`
warning wasn't fatal.

There are a few that are really, really important like
`-Werror=missing-prototypes`. I also take some like `-Werror=misleading-indentation`
which already caught some bugs.  See also https://lwn.net/Articles/678019/
2017-03-27 10:42:36 +02:00
Colin Walters 64fd2c2a8d Bump libglnx, use new glnx_throw(), fix callers
One benefit here becomes immediately obvious - `flatpak_fail()` was lacking
`G_GNUC_PRINTF` which meant we missed a lot of type checking. Fix up the
callers.
2017-03-27 10:42:36 +02:00
Alexander Larsson 3385c9dc5c Fix some warnings reported by clang 2017-03-15 10:17:26 +01:00
André Klitzing 567802749c Fix some issues with musl
* Use realpath instead of canonicalize_file_name
* Add missing include
2017-03-15 10:14:39 +01:00
Alexander Larsson 248a603e6a build: Allow dbus proxy access if explicitly given
If you do something like:
 flatpak build --talk-name=org.foo.Bar appdir
Then we now spawn a dbus proxy for the app.
However, we don't do this by default, even if the
runtime or the app metadata allows this, because
we want builds to normally be disconnected from
the build host.
2017-03-14 16:20:33 +01:00
Alexander Larsson 49b5304589 Update OCI support to latest version of spec
This is a major change in the OCI support, as the format of the OCI image
registries changed. Instead of now having a "ref" file for each image
in the repo it has a single index json file, where the ref name is now
a per-image annotation.

This allows us to support OCI much better, as we can now use the actual
flatpak ref as the OCI ref name, and we can find all the flatpak refs
in a remote.

So, with this you can just use:
 flatpak remote-add --oci remote-name URL

and then you can use the regular flatpak operations on the remote.
2017-03-13 14:31:36 +01:00
Georges Basile Stavracas Neto d73090cc96 Split extra-data setup and fetch
By splitting the extra-data setup - where we set the number of
extra-data downloads and auxiliary information - and download -
where we actually fetch the extra-data - we can have more precise
progress reports.
2017-03-08 15:37:28 +01:00
Alexander Larsson 7d1a8f69f6 appstream: Don't add runtime to flatpak bundle tag for runtimes 2017-03-08 12:31:44 +01:00
Alexander Larsson 640a02315b extensions: Support multiple versions
This means an extension point can include extensions of multiple
(specified) versions. This is useful for e.g. the GL extensions,
where we want a single extension for all the essentially unversioned
GL extensions (like the nvidia one) that is used by all the
runtimes.
2017-03-06 14:36:20 +01:00
Alexander Larsson 3122d1c014 flatpak_list_extensions: Break out code into helper
This is a minor restructure to make the code more readable
and extensible.
2017-03-06 14:36:20 +01:00
Richard Hughes d6f4ea424d Allow specifying an ISO-8601 timestamp when using build-export
This allows us to build reproducable repo summaries, for instance in self tests.
2017-03-06 11:38:26 +01:00
Alexander Larsson 62286cf779 Support runtime-less extra-data
This is going to be needed for the nvidia driver to solve
https://github.com/flatpak/flatpak/issues/595
2017-02-28 18:10:06 +01:00
Alexander Larsson 78b5c2fbf5 Fix error check when loading configuration 2017-02-28 11:06:06 +01:00
Alexander Larsson 9d9bd184c7 zero-mtime: Handle error when enumerating directory 2017-02-28 11:02:32 +01:00
Alexander Larsson d24c5f1423 run: Handle error when enumerating /etc 2017-02-28 11:00:01 +01:00
Alexander Larsson 4db1e74090 utils: Fix flatpak_bundle_load typo
If we failed to look up the app metadata we would
clear out a different out argument instead.
2017-02-28 10:46:56 +01:00