Commit Graph

20 Commits (3ff6d312de1125e24ce958e3b31d49968bc73df1)

Author SHA1 Message Date
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 a3da0b3da8 extensions: Add add_ld_path property
If your extension points set this, then each extension will have
the corresponding subdirectory added to LD_LIBRARY_PATH.

We also support a priority property in the ExtensionOf group
in the extensions themselves to set the search order.
2017-02-01 19:46:25 +01:00
Alexander Larsson ab446ebac5 Make /etc writable when building a runtime
We make /etc just a symlink to /usr/etc when we're building a runtime
and /etc is supposed to be writable. Otherwise the bind-mount we
normally have there don't allow use to replace existing files in /etc.
2017-01-25 15:28:42 +01:00
Alexander Larsson 041d3eeb39 Add generic static permissions to metadata
This allows you do do something like
  flatpak build-finish --add-policy=subsystem.key=v1 --add-policy=subsystem.key=v2

Which maps to this metadata keys:

[Policy subsystem]
key=v1;v2;

You can also --remove-policy to remove values from a key.

The policy values are parsed from the app and runtime metadata, and
are overridable by per-app overrides and on the command line, however
the values are never used by flatpak. They do end up in the flatpak-info
file for the running application though, so external agents can look
at them.

These
2016-10-19 20:39:17 +02:00
Adrian Perez de Castro 6cbf3b6c01 Support mixed (multilib/multiarch) binaries in Flatpaks
This adds a new "multiarch" feature which allows bundling e.g. 32-bit
binaries to be run in a x86_64 environment. By default, the seccomp
filter is configured to allow only the native architecture. When the
"multiarch" feature is enabled, the filter will be configured to allow
running binaries of additional architectures supported. For x86_64, this
allows x86 32-bit binaries; and for Aarch64, allows 32-bit ARM binaries.

Application bundles can use the feature e.g. in order to ship 32-bit
binaries alongside with a mostly-64-bit application. This is particularly
interesting when for applications that might launch themselves prebuilt
programs for which 64-bit versions do not exist. For example, the Steam
application is available as a 64-bit executable, but some of the games
available are 32-bit only. A Flatpak bundle for the Steam application
with "multiarch" enabled is able launch the 32-bit games -- without the
feature enabled, the seccomp filter would prevent them from running.

Multiple-architecture support is enabled by adding the "multiarch" value
for the "features" key in the metadata file for a Flatpak:

  [Context]
  features=multiarch;

The corresponding "--allow=multiarch" command line option is supported
in "flatpak build-finish" as well.
2016-10-03 09:54:05 +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 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 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 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
Matthias Clasen 75218c4a65 Fix license headers
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Alexander Larsson 003ef9ee2e Revert "Set up logging to the journal" 2016-07-29 00:24:43 +02:00
Matthias Clasen d7da128818 Optionally redirect stdout and stderr to the journal
Arrange for stdout and stderr to be redirected to the systemd
journal, before exec'ing bwrap. This is under the control of
a pair of run flags. By default, we try to be smart and only
redirect if stderr is not a tty.
2016-07-25 10:36:00 -04: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
Alexander Larsson 33c0d49212 builder: Support permission ops with --run 2016-05-26 12:24:43 +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 edcf485dde run: More background fd issues fixed
This also simplifies the child_setup func by clearing CLOEXEC
on the needed fds.
2016-05-11 15:33:49 +02:00
Alexander Larsson 3f71025497 run: Fix running in the background
We need to keep all the fd:s needed for bubblewrap alive, so
neuter g_spawn_async:s close of fds and do our own.

Also, we need this so these fds can be closed in the launching app.
2016-05-11 15:14:11 +02:00
Alexander Larsson c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00