Commit Graph

1819 Commits (469133f129a2d0493ab4a15650020e3600dfbfdc)
 

Author SHA1 Message Date
Alexander Larsson 469133f129 Add AX_COMPARE_VERSION to acinclude.m4 2016-09-09 10:03:27 +02:00
Alexander Larsson 5ef43f6ee3 builder: Bump manifest version to trigger rebuild with new mtimes
To make sure we're not using old caches with the previous mtime
timestamps encoded we bump the manifest version to force a rebuild.
2016-09-09 09:44:54 +02:00
Alexander Larsson 6689c5c7f1 Switch back to mtime==0 for ostree checkouts
OSTree upstream changed back from mtime 1
2016-09-09 09:22:56 +02:00
Alexander Larsson cd3cccf136 Require OSTree 2016.10 for mtime revert
It seems OSTree switched back to 0 for mtimes, so we have to switch
back too. We need to depend on this release to ensure that all
created repos gets things right.
2016-09-09 09:13:20 +02:00
Alexander Larsson a46f8ed1d3 Require bubblewrap 0.1.2 for system bwrap and update git submodule to that 2016-09-09 09:07:15 +02:00
Alexander Larsson 96f383198d flatpak-info: Move the instance specific data to a separate group
We don't want to confuse whats in the metadata file with this
runtime instance info.
2016-09-08 14:10:18 +02:00
Alexander Larsson 894df2ffb6 document portal: Rewrite sandboxed /app and /usr to the right place
This uses the sandboxed instance flatpak-info to find the actual
real files that are in use.
2016-09-08 12:54:54 +02:00
Alexander Larsson e16ca25a67 utils: Change flatpak_invocation_lookup_app_id to lookup_app_info
This lets you get the entire app info rather than just the id.
For host processes you'll get an empty info with just an empty
name.
2016-09-08 12:37:32 +02:00
Alexander Larsson 4408468e78 common: Remove leftover spew 2016-09-08 12:36:11 +02:00
Alexander Larsson b53b78b2a2 run: Drop/Hide --no-desktop option
This is no longer needed, as we don't hard-require systemd --user.
We keep the opion there, but hidden in order to be backwards compatible
with old code that used this.
2016-09-08 11:40:49 +02:00
Alexander Larsson 7f01e5113b run: Make cgroup (and the systemd --user requirements) optional
We no longer hard-depend on this, so if it fails, we just run on.
2016-09-08 11:37:17 +02:00
Alexander Larsson 0d22bad5e6 document-portal: Detect remote peer app id using flatpak-info
This drops the requirement on unprivileged cgroups, and thus the
dependency on systemd --user.
2016-09-08 11:24:10 +02:00
Alexander Larsson 352e761c0e run: Run dbus proxy under bubblewrap
This has two advantages. First of all (and most important) it
lets us put a /.flatpak-info file in it, so that the dbus peers
it talks to have the right "source" app id and sandboxed status.

Secondly, it lets us run the bus with readonly access to things,
thus being somewhat more secure.
2016-09-08 11:21:00 +02:00
Alexander Larsson e5ff76fa77 run: Fail hard if we can't create the flatpak-info file
We want to base security on this, so we need it to be there.
2016-09-08 10:16:40 +02:00
Alexander Larsson 5bf37574f1 flatpak-info: Flatten the metadata to make it more easy to parse
The info file is always standalone, as it never needs to stack on top
of another context. This means we can remove all "negative" attributes
such as "shared=!network", making it easier to parse this file.
2016-09-07 14:32:10 +02:00
Alexander Larsson e1ad3a7a3c flatpak-info: Add application branch info
Note: This is only available in flatpak run, not flatpak build, where
this info is not available.
2016-09-07 12:31:56 +02:00
Alexander Larsson 0fc06022c8 flatpak-info: Add runtime path 2016-09-07 12:19:13 +02:00
Alexander Larsson 32c571ae79 Move $XDG_RUNTIME_DIR/flatpak-info to /.flatpak-info and make it read-only
The old location keeps working because we create a symlink.

The interesting part of this is that the sandbox now can't modify,
remove or replace the file, and it is in a fixed position. This means
that given a sandboxed pid, we can find this file as
"/proc/$pid/root/.flatpak-info".

This is very nice for two reasons:
 * We can use this instead of the cgroup to find out if a pid is
   sandboxed or not. This means we can drop the dependency on
   systemd --user for this.
 * We can get more information about the peer process that the
   app id. For instance, we can see what permissions the sandboxed
   app has.
2016-09-07 11:53:05 +02:00
Alexander Larsson edb2749e3e Update bubblewrap to latest git with --ro-bind-data support 2016-09-07 11:46:19 +02:00
Alexander Larsson e256bf7570 remote-add: Make internal function static 2016-09-06 15:40:11 +02:00
Alexander Larsson 41443313ca session-helper: Move HostCommand to its own interface 2016-09-06 15:30:38 +02:00
Alexander Larsson 983b2a5db1 lib: Look for "bwrap" in PATH when launching from libflatpak
We forgot to look in the path, which made it fail when using
the system bwrap and not passing a full path.
2016-09-06 15:29:36 +02:00
Alexander Larsson e6a85a7fdd utils: Fix support for old glib without g_autoptr 2016-09-06 09:26:02 +02:00
Alexander Larsson fbca999cc9 Create /app/(.updated|.removed) file after update/uninstall
This way running apps can easily detect this and restart themselves.
2016-09-06 09:16:04 +02:00
Alexander Larsson e792686892 builder: Propagate build-args to shell sources
This way you can e.g. do network i/o in them.
Thats not a recommended way to do it though, as you work around
a lot of the feature in flatpak-builder like the caching and
verification.
2016-09-05 22:01:56 +02:00
Alexander Larsson c66e394266 builder: Use HostCommand calls if in sandbox 2016-09-05 21:41:14 +02:00
Alexander Larsson ddf05ef063 builder: Use flatpak_spawnv helper in a few more places
This is in preparation for it calling the new host-command.
2016-09-05 21:41:14 +02:00
Alexander Larsson c8df0e6208 SessionHelper: Add calls to spawn processes on the host
This lets any client, possibly in a sandbox if it has access to the
session helper, spawn a process on the host, outside any sandbox.

Clearly this is not something you typically want a sandboxed app to
do. However, it is sometimes very useful when using flatpak mainly
for distribution. For instance, an IDE needs to use this to launch a
flatpak build operation inside the sandbox. (Because otherwise recursive
calls to flatpak will not work.)
2016-09-05 21:41:14 +02:00
Alexander Larsson aafc0f3b66 run/metadata: Add support for --allow=devel
This enables support for ptrace and perf for the app, similar
to what run -d manually gave you before. This is nice to be
able to package an app like gnome-software.
2016-09-05 21:41:14 +02:00
Alexander Larsson a788965eec Support FLATPAK_USER_DIR env var 2016-09-05 21:41:14 +02:00
Alexander Larsson 39534d9212 Merge pull request #255 from piotrdrag/pl-update-160818
Updated Polish translation
2016-09-05 20:59:10 +02:00
Alexander Larsson f387d18d33 Merge pull request #285 from xjuan/doc-portal-runtime
document-portal: Fix the document portal for files outside /app
2016-09-05 20:58:12 +02:00
Juan Pablo Ugarte cd574cfbfe document-portal: Fix the document portal for files outside /app
Strip /newroot prefix from document path since validate_parent_dir()
depends on a system path to get the parent directory stat.
2016-09-05 15:44:02 -03:00
Alexander Larsson d10409cb3e document-portal: Fix the document portal
This was using libflatpak which is the public API, instead of the internal
library, so it was breaking in all sorts of mysterious ways. This is fixed
by just directly calling the lowlevel common/* APIs.

Also, it didn't properly handle the case where the sandboxed app passed a
path that was not in /app, this should be allowed if the fd validation
passes, that is the whole point of the checks after all.
2016-09-05 17:10:15 +02:00
Piotr Drąg ff2d6c7bde Updated Polish translation 2016-09-05 16:19:44 +02:00
Piotr Drąg 21a7bd532b Update POTFILES.in 2016-09-05 16:19:44 +02:00
Alexander Larsson 8475dfeee9 document-portal: Don't link to libflatpak.so 2016-09-05 16:18:26 +02:00
Alexander Larsson 0a20f28f89 session-helper: Add support for -r -v --help --version 2016-09-05 11:54:12 +02:00
Alexander Larsson ff6839a291 utils: Add flatpak_is_in_sandbox() helper 2016-09-05 11:54:12 +02:00
Alexander Larsson 3b90b00e39 build: Export a $XDG_RUN_DIR/flatpak-info file from flatpak build too
This way we know if we're in a sandbox or not even at build time,
and things like portal pickup etc, works.
2016-09-05 11:54:12 +02:00
Alexander Larsson 4865d1edd2 common: Export flatpak_run_add_app_info_args
We want to use this from flatpak build too
2016-09-05 11:54:12 +02:00
Alexander Larsson 3ec0ecba93 common: add_app_info_args() talk GFile *app_files instead of a deploy
We don't really need the full deploy anyway.
2016-09-05 11:54:12 +02:00
Alexander Larsson e50f7a363f build-update-repo: Reuse cache info from old summary
This makes rebuilding partial changes much faster.
2016-09-02 11:13:11 +02:00
Alexander Larsson ba377b29e6 common: Add utility function to load summary file from local repo 2016-09-02 11:10:29 +02:00
Alexander Larsson 0ca185c93f Merge pull request #280 from dbnicholson/G269-summary-optimization
Speed up summary regeneration
2016-09-02 10:31:29 +02:00
Dan Nicholson d2d9804187 utils: Only collect cache data once per revision
If there are multiple refs pointing to the same revision, then
collecting the size and metadata info for each of them is wasteful.
Maintain a hash table of the data so that it's only collected once per
revision.

This slightly widens an existing race where a ref could be updated
before the summary file is regenerated. In that case, the data in the
xa.cache variant would correspond to the wrong revision. I don't believe
this can be fixed unless there's locking at the ostree level.
2016-09-01 10:11:13 -07:00
Dan Nicholson e86ae01ba0 utils: Only update summary info for flatpak refs
If there are non-flatpak refs in the ostree repo, there's no use in
collecting size or metadata information for them. Instead, only operate
on refs in the appstream, app or runtime prefixes.
2016-09-01 10:11:13 -07:00
Dan Nicholson d304c4eca1 utils: Free list of refs in flatpak_repo_update
Although the data is owned by the hash table, the list storage needs to
be freed with g_list_free(). Use g_autoptr for that.
2016-09-01 10:11:07 -07:00
Alexander Larsson a5536d0420 update: Don't stop the entire update if one app fails 2016-09-01 11:45:27 +02:00
Alexander Larsson 509bb33a2b Merge pull request #237 from mwleeds/add-trace-msg
utils: Print a debug message when launching subprocesses
2016-08-30 09:22:02 +02:00