494 Commits

Author SHA1 Message Date
Alexander Larsson
a2810186b8 appstream update: Allow component ids not ending in .desktop
This is needed for runtimes
2017-01-18 13:22:56 +01:00
Alexander Larsson
902fb71399 Use seccomp to filter out TIOCSTI ioctl
This would otherwise let the sandbox add input to the controlling tty.
2017-01-17 16:36:56 +01:00
Alexander Larsson
8152331bd0 Make sure /var/tmp is not on tmpfs
Apps may rely on /var/tmp not being in ram, for instance when
downloading large files. See for instance:

  http://0pointer.net/blog/projects/tmp.html

We make /var/tmp point to ~/.var/app/cache/tmp so that each app get
its own instane, and so that its cleared whe removing xdg-cache-dir
for the app.
2017-01-16 13:04:55 +01:00
Alexander Larsson
4e1bf67bff Print a warning if the remote metadata cache is not found 2017-01-12 10:45:44 +01:00
Joaquim Rocha
5dd952e68e Fix downloading extra data when run from a different thread
The main loop that is initiated while the extra data is being downloaded
needs a different context to be the thread-default one, otherwise the
operations just hang when running from a different thread.
2017-01-12 00:23:39 +01:00
Alexander Larsson
4c686332a3 OCI: Create all-readable layer blobs
Otherwise we can't export these via http
2017-01-11 22:37:26 +01:00
Alexander Larsson
fed5cb3667 OCI: Stop using json-glib apis that don't exist in 1.0.x 2016-12-21 14:20:28 +01: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
82906a63bd Add support for the FLATPAK_CONFIG_DIR environment variable
This will be useful for testing purposes, so that we can provide
our own versions of the configuration files normally under
/etc/flatpak/installations.d.
2016-12-20 09:54:39 +01:00
Mario Sanchez Prada
15e7f14ca3 Adjusted internal representation for storage types of system installations
I set these as separate bits by mistake when there's no good reason for
them to be like that, as they are not flags that are meant to be combined,
but a list of exclusive values.
2016-12-20 09:52:03 +01:00
Alexander Larsson
5a12917a2f oci: Fix leak in flatpak_pull_from_oci 2016-12-19 14:19:41 +01:00
Alexander Larsson
f92f233758 flatpak_bundle_load: Fix leak 2016-12-19 14:19:41 +01:00
Mario Sanchez Prada
b704c385c8 Change file extension for installations configuration files to '.conf'
The old '.install' one was probably too specific, so let's move it to
a more generic (and common) extension before making the release.
2016-12-19 12:52:46 +01:00
Alexander Larsson
507e4dd355 flatpak_oci_registry_store_json: Don't leak GBytes 2016-12-19 11:16:27 +01:00
Alexander Larsson
b066d863bc Remove unused variables 2016-12-19 10:08:18 +01:00
Mario Sanchez Prada
ed1b0e2b23 Add internal API: flatpak_dir_get_name()
This will allow us to refactor some code using in the CLI, when
we want to print the name of a FlatpakDir for detailed listings.
2016-12-17 00:56:10 +00:00
Mario Sanchez Prada
d3a9982837 Give the default system installation values for all its properties
This will allow explicitly referring to the default installation
using the 'default' ID, as well as overriding its values via a
configuration file specifying that same ID.
2016-12-17 00:56:06 +00:00
Mario Sanchez Prada
7962d4d145 Ignore system installations configured with a duplicated ID
If a system installation with the same ID than the one being
considered has been added, print a warning and ignore.
2016-12-17 00:32:53 +00:00
Mario Sanchez Prada
a663e5ba73 Add public API: implement the other getters required by GNOME Software
Implemented the following functions along with the required internal APIs:

  * flatpak_installation_get_id ()
  * flatpak_installation_get_display_name ()
  * flatpak_installation_get_priority ()
  * flatpak_installation_get_storage_type ()
2016-12-17 00:32:53 +00:00
Mario Sanchez Prada
34cf626029 Support additional configuration fields for system installations
As per the discussion with GNOME Software maintainer Richard Hughes [1],
we need to support a few additional fields in the configuration files
for better integration with external clients. Thus, this commits adds
support for reading "DisplayName", "StorageType" and "Priority" values
from the configuration files, being all of them optional.

Note: priorities are currently used to sort the system installations
list statically stored in flatpak-dir.c (bigger number, bigger priority).

[1] https://mail.gnome.org/archives/gnome-software-list/2016-December/msg00000.html
2016-12-17 00:32:52 +00: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
Mario Sanchez Prada
81492a352a Migrate flatpak-<utils|transaction>.c to flatpak_dir_get_system_list()
We need to traverse now the full list of system directories, as
defined in /etc/flatpak/installations.d, not just the default one.
2016-12-17 00:32:45 +00:00
Mario Sanchez Prada
9d97382f82 Add internal API: flatpak_dir_get_system_by_id()
It will return a FlatpakDir by ID, according to the configuration.
2016-12-17 00:32:44 +00:00
Mario Sanchez Prada
1858b8987d Add internal API: flatpak_dir_get_id()
This will be used both from the CLI commands and the public API.
2016-12-17 00:32:44 +00:00
Mario Sanchez Prada
d7de3225cc Store the ID for a FlatpakDir when reading the configuration files
This information will be used when querying system-wide installations,
so that we can refer to those pre-configured installations by the id
defined in the configuration files under /etc/flatpak/installations.d
2016-12-17 00:32:43 +00:00
Mario Sanchez Prada
d27270635a Add internal API: flatpak_dir_get_system_list()
This will return an array of FlatpakDir instances with all the system
installations configured via key files in an optional drop-in directory
under FLATPAK_CONFIGDIR/installations.d, plus the default one.
2016-12-17 00:32:38 +00:00
Mario Sanchez Prada
22e3f83fb6 Remove internal API flatpak_dir_get(gboolean user)
User and system installations is no longer a binary decision, so remove
this API to force explicit calls to either flatpak_dir_get_system_default()
or flatpak_dir_get_system_list() when dealing with system installations.
2016-12-16 19:17:18 +00:00
Mario Sanchez Prada
44a2d73c98 Rename flatpak_get_system_base_dir_location(void) for the default case
It will be called flatpak_get_system_default_base_dir_location() now, to
distinguish it from the one that retrieves all the system directories.
2016-12-16 19:17:16 +00:00
Mario Sanchez Prada
521c3fcd4b Rename flatpak_dir_get_system() into flatpak_dir_get_system_default()
There will be a way to retrieve the list of all system installations,
not just the default one, so we rename this for backward compatibility.

Note that some (most?) of the places where we will be now using this
renamed function will likely have to migrate to using specific system
installations, but we don't have the necessary APIs yet so we do this
as an initial step to all the incremental changes that will come next.
2016-12-16 19:17:13 +00:00
Alexander Larsson
e1bf3eff52 Flatpak[ref|repo]: Add Version field
If this is set it has to be 1, or we fail.
This lets us later introduce incompatible changes.
2016-12-13 15:54:14 +01:00
Alexander Larsson
f3b188cef3 flatpak-json: Correctly handle NULL in json_to_node 2016-12-13 13:52:09 +01:00
Alexander Larsson
da897250cc Avoid interactive prompts when redirected, assume no 2016-12-13 11:45:16 +01:00
Alexander Larsson
1e854ddc11 Fix all clang warnings 2016-12-13 10:20:28 +01:00
Alexander Larsson
c756534b19 utils: Add and use FLATPAK_VARIANT_DICT_INITIALIZER
This fixes warnings on some versions of glib due to a private struct
change.
2016-12-13 10:08:26 +01:00
Alexander Larsson
9ddc4aca48 Support flatpak install --oci to install apps from OCI 2016-12-12 16:22:16 +01:00
Alexander Larsson
53c28de636 utils: Add VARIANT_BUILDER_INITIALIZER and new_empty_string_dict 2016-12-12 12:23:13 +01:00
Alexander Larsson
cf0cd287c6 Add flatpak_table_printer_add_column_len 2016-12-12 12:22:50 +01:00
Alexander Larsson
aa9640af7e Add flatpak_pull_from_oci helper 2016-12-09 14:44:25 +01:00
Alexander Larsson
63c1aace83 Import OCI initial support to common/* 2016-12-08 17:43:03 +01:00
Alexander Larsson
186ff0f002 Add flatpak_download_http_uri util function 2016-12-08 16:41:20 +01:00
Alexander Larsson
9865ed8989 utils: Disable automatic gzip content decoding in session
This was interacting badly with the OCI layer downloading, by
automatically uncompressing the gzip:ed layers.
2016-12-08 16:41:20 +01:00
Alexander Larsson
e514dc2e14 Add flatpak_create_soup_session 2016-12-08 16:41:20 +01:00
Alexander Larsson
d3715463f2 Don't export symlinks from the host into /usr and /app
These make no sense, we don't want to modify the runtime, and
we can't create parent directories there anyway which can cause
issues like https://github.com/flatpak/flatpak/pull/433
2016-12-07 19:50:14 +01:00
Alexander Larsson
efc8458165 run: Record in the flatpak-info file if dbus is proxied 2016-12-07 11:31:45 +01:00
Alexander Larsson
c5856dd4e5 run: Fix xauth support
We need to lseek the fd *after* the fclose has
flushed the output.
2016-12-07 11:18:27 +01:00
Alexander Larsson
bb6e1d535f install: Support RuntimeRepo= key in flatpakref files
This allows an app to point to the repo where the runtime it uses
comes from, and the user will be asked to add that if its not
already configured.
2016-12-02 16:31:14 +01:00
Alexander Larsson
8a152b7bb0 dir: Make flatpak_dir_remote_fetch_summary error if there is no summary
This was manully checked in some places, which can now be dropped, but
also the places that didn't check it before were buggy and needed
to check this, so better just fail early.
2016-12-01 09:39:57 +01:00
Alexander Larsson
6a5d6d4970 Json autoptr stuff was added in 1.1.2, not 1.2.0 2016-11-30 11:30:40 +01:00
Alexander Larsson
31ca19eb99 pull: Exit early on error without aborting transaction
At this point we have not set up repo yet, so aborting would crash.
2016-11-29 16:59:48 +01:00
Alexander Larsson
b744cd2493 Add backport of g_autoptr support for json-glib 2016-11-29 10:14:33 +01:00