Commit Graph

52 Commits

Author SHA1 Message Date
Matthias Clasen
331a883b7b Clarify object paths and bus names for portals
These portals are under their own bus name and
object path, clarify this in the docs. For the
document portal, this is just a sync-up with
the master copy in the xdg-desktop-portal repo.

Closes: #2074
Approved by: alexlarsson
2018-09-05 06:58:34 +00:00
Matthias Clasen
47cc37f174 Sync the document store interface description
There have been some minor edits in the official version
of this in xdg-desktop-portal. Sync up the version here.

Closes: #2064
Approved by: alexlarsson
2018-09-03 10:41:44 +00:00
Matthias Clasen
1831ac1974 Flatpak portal: Documentation improvement
Explain what exposes are allowed.

Closes: https://github.com/flatpak/flatpak/issues/1955

Closes: #2029
Approved by: alexlarsson
2018-08-28 07:50:13 +00:00
Alexander Larsson
7b8e9ea4a1 dbus xml: Delete -- from docs
Apparently -- is not valid XML, so a nonbreakable space was added, but
that breaks gdbus-codegen, so lets just drop the dashes totally.

Closes: #1988
Approved by: alexlarsson
2018-08-20 13:17:40 +00:00
Matthew Leeds
8292732e65 Add a system-helper UpdateSummary method
This system-helper method will allow flatpak to update the ostree repo
summary while running as a non-root user that's in the "sudo" group.
This will allow the `flatpak create-usb` command to work without
requiring the user to first run `sudo ostree summary -u`, and without
requiring the system to have `core.auto-update-summary` set to true in
the ostree repo config. This is also much more efficient than
`core.auto-update-summary` because it allows us to only update the
summary when we need it rather than after every transaction.

Generating the summary basically just involves traversing the repo to
enumerate all the refs and putting this information into a file, so I
don't think there are security concerns with allowing it to happen
without authentication.

Closes: #1945
Approved by: alexlarsson
2018-08-08 14:42:16 +00:00
Alexander Larsson
0d19e60ce3 system-helper: Add EnsureRepo operation
This is used to create the /var/lib/flatpak repo if
needed so that other later operations work. We have
some partial support for it not working in various
operations (using the allow_empty argument) but
this is in no way complete. For example, this
can easily happen if you have a per-user installation
but no system one and then you run flatpak install
with no --user, then it will try to figure out
which one to use and die.
2018-07-07 16:37:44 +02:00
Matthias Clasen
848dd88a34 Fix a copy-paste error
RevokePermissions revokes permissions, not grants them.

Closes: #1837
Approved by: alexlarsson
2018-06-29 11:52:40 +00:00
Matthias Clasen
a8cca2ebe1 Add the permission store interface
This adds the xml interface definition for
org.freedesktop.impl.portal.PermissionStore.
Subsequent commits will use this interface.

Closes: #1837
Approved by: alexlarsson
2018-06-29 11:52:40 +00:00
Alexander Larsson
b4bb890516 session-helper: Add new more generic helper start method
This does the same as RequestMonitor, but returns the status via a
a{sv} so that its more extensible.

Closes: #1757
Approved by: alexlarsson
2018-06-07 12:25:21 +00:00
Alexander Larsson
3e47247425 Batch running triggers
This moves the triggers from out of flatpak_install/update/uninstall
and instead calls them manually at all the sites that call this.

This allows FlatpakTransaction to only run the triggers once for the
entire operation.

Closes: #1743
Approved by: alexlarsson
2018-06-01 11:41:56 +00:00
Matthias Clasen
18e9aae7a3 portal: Document the interface
Document the flatpak portal in the same style as
other portals are.

Closes: #1619
Approved by: alexlarsson
2018-04-27 11:03:34 +00:00
Alexander Larsson
11ef9999b6 Add flatpak portal
This listens to org.freedesktop.portal.Flatpak and lets flatpak
sandboxes do flatpak specific things.

Initially this only allows access to "Spawn", which lets you start a
new copy of the current or latest version of the calling app,
optionally with sandboxing.

This allows the app to re-start itself with the latest version after
an update, and the sandboxing is useful for apps that want to manually
sandbox part of themselves.

You can also expose one or more subdirectories of
~/.var/app/$appid/sandbox/ to the app, read-write or read-only. This is
useful to communicate with the sandbox.
2018-04-04 17:25:59 +02:00
Alexander Larsson
f2a6c1db8d Remove document portal
This is now in xdg-desktop-portal. We keep a version of the document
portal dbus XML so that we avoid weird build dependencies.

Flatpak itself is technically not dependent on the document portal,
but it is very much recommended that you use it.

Closes: #1398
Approved by: alexlarsson
2018-02-09 09:23:26 +00:00
Jan Grulich
c226288dd6 Document portal: implement add_named_full() function
This is a convenient function which can be used with flags, adding option to return
real path of the file we are trying to open in case the sandboxed app has access
to it. It also registers this file automatically to document store so there is no
need to call grant_permission() afterwards.

Closes: #1335
Approved by: alexlarsson
2018-01-25 09:22:21 +00:00
Jan Grulich
a7c0d4ce56 Add DBus annotations
Closes: #1332
Approved by: alexlarsson
2018-01-23 09:30:19 +00:00
Alexander Larsson
b18d1c2321 Add system-helper support for configuring language.
Closes: #1123
Approved by: alexlarsson
2017-10-20 20:06:38 +00:00
Sam Spilsbury
d0af046a2f system-helper: Add PruneLocalRepo method
We might want to prune the repo from within the library or
the command line and may not be in a privileged context, so
we'll need to jump through the system helper to prune the refs.

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
3f91b4d883 system-helper: Add RemoveLocalRef helper function
This depends on the modify-repo privilege

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Matthias Clasen
5d610b9ddd document store: Document as-needed functionality of AddFull
Mention the new flag and its functionality in the portal API
documentation.
2017-05-29 09:43:35 -04:00
Matthias Clasen
9564da53f8 Small documentation improvements
Add some missing newlines, and document that
AddFull was added in version 2.
2017-05-22 09:26:42 +02:00
Alexander Larsson
6ce8521b64 document-portal: Add AddFull() operation
This allows you to add multiple paths at the same time, plus
grant an app access to it, plus it returns the fuse mount path.

This allows you to avoid a lot of roundtrip in common cases.
2017-05-19 17:01:46 +02:00
Alexander Larsson
bda7575e79 Add version property to all dbus interfaces 2017-05-19 14:38:22 +02:00
Alexander Larsson
9896005ad0 remote-modify: Implement --update-metadata as a system-helper method
We download the summary and send it to the system helper, it verifies
the checksum and applies the changes, with the same polkit permissions
required as for an app update (i.e. typically none).

This allows us to update metadata automatically, without permission
requests.
2017-05-09 13:25:21 +02:00
Alexander Larsson
f20e5f7823 bundles: Support dependencies and runtime-repo
If the bundle contains an origin link we can now install related
things from it, such as locale data.

You can also build the bundle with --runtime-repo=URL, where the url
points to a flatpakrepo file for a repo with runtimes. This works
similar to the RuntimeRepo= feature in flatpakref files.
2016-12-20 16:27:57 +01:00
Mario Sanchez Prada
719616f086 Add support for multiple installations in the system helper
Allow passing an extra string parameter specifying the ID of a
system installation to refer to it, or an empty string for the
default one.
2016-12-17 00:32:50 +00:00
Alexander Larsson
41443313ca session-helper: Move HostCommand to its own interface 2016-09-06 15:30:38 +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
Matthias Clasen
86d7dd73f9 Document the permission store API
Add doc comments to the xml.
2016-07-12 00:00:45 -04:00
Matthias Clasen
6743d0122c Document the document portal API
Add doc comments to the XML.
2016-07-11 23:19:48 -04:00
Matthias Clasen
8bada3a819 document portal: Add a more api
We want to let the flatpak command show more information.
These functions will not be allowed from inside the sandbox
to prevent leaking information to sandboxed applications.
  Lookup: go from a file (handed in via an fd) to a document id
  Info: return origin and permissions for an id
  List: return information about all exported documents
2016-06-16 15:04:28 -04:00
Alexander Larsson
e769af8661 system-helper: Handle installing bundles 2016-06-03 16:04:10 +02:00
Alexander Larsson
1504f7bd7f system-helper: Support add/modify/delete of remotes 2016-05-13 16:23:43 +02:00
Alexander Larsson
5407b8efc6 system-helper: Support uninstall 2016-05-12 21:23:36 +02:00
Alexander Larsson
1877f0be8d system-helper: Add support for updating appstream branch 2016-05-11 10:35:24 +02:00
Alexander Larsson
28b549156a Split out permission store from session helper
This is now available as org.freedesktop.impl.portal.PermissionStore
2016-05-09 14:07:22 +02:00
Alexander Larsson
8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson
b2b05e1175 update/install: Handle deploy using the system service 2016-04-25 18:59:17 +02:00
Alexander Larsson
8ac40150a6 Initial (empty) version of system helper 2016-04-25 18:59:17 +02:00
Alexander Larsson
30a536f6dc Add change notification for the permissions store 2016-03-14 14:26:35 +01:00
Alexander Larsson
3ce0c6f7f9 document portal: Add AddNamed method for host-side use
This is needed for the "save as" file selector portal
2015-12-02 15:55:41 +01:00
Alexander Larsson
3a47f0b282 Install dbus introspection files 2015-10-21 09:52:55 +02:00
Alexander Larsson
6e1c211a5c Correct capitalization on dbus interface filename 2015-10-21 09:48:53 +02:00
Alexander Larsson
eec8798f5e document portal: Add support for transient documents
These are useful for passing temporary files.
2015-09-17 20:09:50 +02:00
Alexander Larsson
7ad47c74ea document-portals: Support unique documents
These document id will not be shared for multiple users. The main
difference is this this makes it safe for the creating app to delete
the document if he wants to (i.e. for temporary docs), and thus we can
grant this additional permission for the calling app.
2015-09-04 14:46:02 +02:00
Alexander Larsson
04879fdea5 Store and verify parent dir dev/ino and pass O_PATH fds
In order to be robust against symlink attacks (i.e. make a document
for a path, then replace it with a symlink somewhere else and have the
portal read that instead) we store the parent dev/ino when we create
the document id and always verify that (atomically with the *at
syscalls) on each use.

Also, we pass O_PATH fds when creating documents, as it allows us
to be a bit safer. For instance we can verify that the fd is a O_PATH
fd before doing any ops on it, and it makes it possible to avoid other
symlink trickery.

Also, we drop the double add methods, and just use the O_PATH version.
2015-09-03 22:17:00 +02:00
Alexander Larsson
b6355e1acb Document portal: Store paths, not uris
There is no way to do this for generic uris anyway, lets not
pretend we're solving a larger problem.
2015-08-27 10:38:22 +02:00
Alexander Larsson
0c25376657 Switch document portal to use strings for document ids 2015-08-26 17:26:53 +02:00
Alexander Larsson
a3f4342b5a Initial version of permission store
This is a generalized store for permissions, which also will
be used by the document portal.
2015-08-26 17:11:31 +02:00
Alexander Larsson
ffa1acea75 Rename dbus file to org.freedesktop.XdgApp 2015-08-25 09:27:35 +02:00
Alexander Larsson
4c4c66fc2d Add GetMountPoint method for document portal
This is both to get the mount path and to have a nice way
to activate the mount.
2015-07-10 17:02:38 +02:00