Commit Graph

284 Commits (52178851087fff5a56830112d82a6438ceb5d245)

Author SHA1 Message Date
Alexander Larsson 43dbf96f7c Merge pull request #148 from matthiasclasen/journal
make journal logging work in the sandbox
2016-06-27 11:14:11 +02:00
Simon McVittie ee99e8afff Add BWRAP and --with-system-bubblewrap configure arguments
This lets distributors share a system copy of bubblewrap (>= 0.1.0)
between Flatpak and any other projects that benefit from it, if they are
careful to keep new versions in sync. The default is still to use the
bundled submodule, ensuring compatibility and simplifying dependencies.

Enable $PATH search everywhere that runs bwrap, so that $BWRAP doesn't
necessarily need to be a fully-qualified path.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 11:09:03 +01:00
Simon McVittie 58bd3e3ec8 Downgrade failure to get document portal from warning to message
Otherwise, the tests all abort when run without FUSE.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:09 +01:00
Matthias Clasen 5fb066bf90 Add an option for journal sockets
Untested, I couldn't find a runtime that has systemd-cat or a similar
tool in it.
2016-06-24 01:52:55 -04:00
Alexander Larsson f9ce1b16ed Make finding refs handle multi-arch
If opt_arch is not specified:
 * find_xxx_refs now return refs for all supported arches
 * find_xxx_ref looks at each supported arch in prio order
2016-06-23 12:52:55 +02:00
Alexander Larsson 9915e3740b Disable static deltas for system-helper updates
Due to an issue with ostree (https://github.com/ostreedev/ostree/pull/362)
applying non-from-scratch deltas fail when using parent_repo such as
in the system-helper case. We fix this temporarily by disabling the
use of deltas for that case.
2016-06-23 12:16:02 +02:00
Alexander Larsson 34faddfa8f common: Make some internal functions static 2016-06-23 11:31:19 +02:00
Alexander Larsson bde74d25d4 common: Add flatpak_get_arches() helper 2016-06-23 11:05:42 +02:00
Alexander Larsson e86ae478f7 Fix --dev=all support
As pointed out by Jasper, we need to --dev-bind for devices to work.
2016-06-18 22:52:39 +02:00
Alexander Larsson 6cbc9a7932 dbus proxy: Don't store the temporary sockets in $XDG_RUN_DIR/bus-proxy
This just causes us to leave this empty directory around. Instead we
use hidden files directly in $XDG_RUN_DIR/.
2016-06-16 22:30:48 +02:00
Alexander Larsson cbe35fedbc system-helper: Correctly copy the system config when modifying a repo
We were accidentally using the passed in copy of the rest of the config
when we should be using the one we read.
2016-06-16 19:56:50 +02:00
Alexander Larsson de13e496c1 sandbox: Make /var/tmp and /tmp different dirs, not symlinks
This means you can use either or both of --filesystem=/tmp and
--filesystem=/var/tmp to share the host tmpdirs.
2016-06-16 01:33:28 +02:00
Alexander Larsson a84f725211 Support --device=all
This gives the application full access to the host /dev. Obviously
this is not great in terms of sandboxing, but its nice for applications
that use flatpak mostly as a way to do distribution of the app.

Also, its not like the app has full access to anything, its still
limited to the access right of the user.
2016-06-14 22:33:14 +02:00
Simon McVittie c18626f11c common: don't distribute generated GDBus files in tarballs
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
Alexander Larsson 874fbbff34 Fix various leaks 2016-06-10 12:59:30 +02:00
Alexander Larsson 5e95d81d45 Allow access to all portals 2016-06-09 16:03:54 +02:00
Matthias Clasen 26b083333a Fix a case of NULL<>FALSE confusion
This causes a compiler warning.
2016-06-08 20:05:26 -04:00
Alexander Larsson 70093d426f lib: Fix crash on install/update due to uninitialized dir->repo 2016-06-08 13:49:01 +02:00
Alexander Larsson cc08083543 common: Add flatpak_zero_mtime helper
This recursively sets the mtime to 0.
2016-06-08 11:11:01 +02:00
Alexander Larsson cfef57e343 Properly handle subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson 77f1d7660c Don't abort on errors when pruning
This could happen for local partial pulls, due to a bug in ostree
where it didn't create commitpartial state files during local pulls.
2016-06-07 22:12:51 +02:00
Simon McVittie 9b7c339ca6 flatpak-run: don't fail if there are no system fonts
In a minimal environment (like the one where we run installed-tests
in Debian), we might not have /usr/share/fonts.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-04 22:38:32 +01:00
Alexander Larsson a0358c8785 Handle non-existing dirs when deploying a subpath 2016-06-03 18:03:23 +02:00
Alexander Larsson e769af8661 system-helper: Handle installing bundles 2016-06-03 16:04:10 +02:00
Alexander Larsson 8ef84cc3d1 Move shared bundle install code to flatpak_dir_install_bundle 2016-06-03 14:30:25 +02:00
Alexander Larsson 21ab14b19a Improve deployment of appstream data
This has several improvements:
 * Writes to a temporary location and renames at the end, so
   we never end up with partial checkouts.
 * Don't fsync each file during checkout, instead syncfs() at
   the end
 * Pre-create the target deployment directory so that we get the right
   permissions for it.
2016-06-03 14:30:25 +02:00
Alexander Larsson 72118a40b6 Merge pull request #67 from smspillaz/fix-gh-56
completion: Don't show one-time switches already in use
2016-06-02 17:23:01 +02:00
Sam Spilsbury 7bd6c9b277 completion: Don't show one-time switches already in use 2016-06-02 21:38:16 +08:00
Sam Spilsbury 082821288e completion: Store original argv and argc
We deep-free the original argv here, since it isn't modified.
2016-06-02 21:38:16 +08:00
Alexander Larsson 13707f6b18 system-helper: Support directly pulling local remotes
For a local (file:// uri) remote, do an (untrusted) direct pull instead
of pulling into the users cached repo first. This way we do less copies,
as well as guaranteeing the source of the data. The later means its
mostly safe to also allow this for non-gpg signed remotes.
2016-06-02 15:30:08 +02:00
Alexander Larsson 5c23f9bd9d Don't create empty "repo*" directories in the CWD
We were using the wrong dirfd, so we created empty files in the
current directory.
2016-06-01 10:23:52 +02:00
Sam Spilsbury 4fb1ae0b45 remote: Make the error message when summary_bytes == NULL more informative
It seems like one common user-error that could cause this is when
the remote URL was invalid.
2016-06-01 06:03:47 +00:00
Sam Spilsbury c533e1aee6 summary: Make flatpak_cache_dir_summary static void
This function always returned NULL, and the return value was never
checked.
2016-06-01 05:59:54 +00:00
Sam Spilsbury d9ec859878 summary: Don't cache summary if none was returned
ostree_repo_remote_fetch_summary can set out_summary to NULL but
still return TRUE according to the documentation, so don't assume
that *out_summary will always be set.
2016-06-01 05:58:21 +00:00
Alexander Larsson 733a28c9c4 Deply: Disable per-file fsync and do a single syncfs when deploy is done
This should perform a lot better
2016-05-31 14:41:04 +02:00
Alexander Larsson bd7cf1af93 install: Better check for pre-existing installation
We need an actual active installation, not just the base directory.

This caused a failure if the user had tried to install and app but the
installation failed. After that installation failed due to it claiming
to be installed, while uninstall failed due it it *not* being
installed.
2016-05-30 16:35:50 +02:00
Alexander Larsson 8533f06dc0 Add more completions 2016-05-30 14:54:22 +02:00
Alexander Larsson eeaa832095 Replace bash completion shell script with C-based version
This doesn't do everything yet, but its got the basics covered.
2016-05-27 16:30:13 +02:00
Josh Soref c33b5b52d7 spelling: whether 2016-05-27 06:49:26 +00:00
Josh Soref 8412bcf4c1 spelling: whereas 2016-05-27 06:49:15 +00:00
Josh Soref da0d6f052d spelling: running 2016-05-27 06:46:11 +00:00
Josh Soref 56e61e6a4a spelling: deployments 2016-05-27 06:39:17 +00:00
Alexander Larsson 1d8408e381 uninstall: When uninstalling the current branch, make other version current (if any) 2016-05-26 20:03:51 +02:00
Alexander Larsson c48272c6db uninstall: Default to whatever branch is installed 2016-05-26 19:08:46 +02:00
Alexander Larsson bf294fb7c5 install: Be smarter about choosing the default branch name
We look for any matching ref on the remote and use that if there is a single match.
2016-05-26 19:06:51 +02:00
Alexander Larsson 33c0d49212 builder: Support permission ops with --run 2016-05-26 12:24:43 +02:00
Alexander Larsson bde6fa52dc build: Handle setting LD_LIBRARY_PATH when bwrap is setuid
We need to pass LD_LIBRARY_PATH as --setennv, because the setuid
helper strips that. We did this already for run, but this moves it
so its used by build too.
2016-05-26 09:43:56 +02:00
Alexander Larsson 282709d9ec Fix resolv.conf in "flatpak build"
This regressed when we moved to bubblewrap. We need to always use
a direct bind for building, because it may not necessarily happen
in a real user session where the session-helper works.
2016-05-25 16:38:50 +02:00
Alexander Larsson 3703837336 run: Don't crash if referencing an xdg-dir that is not configured 2016-05-25 14:12:36 +02:00
Alexander Larsson b85e7f0de7 Don't use a local child repo of the system one if root
This is unnecessary, and risks creating files as root in the users
home directory if run under sudo.
2016-05-24 09:55:50 +02:00