Commit Graph

31 Commits

Author SHA1 Message Date
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
1fd3ecf7a3 Export fwupd_remote_get_agreement()
We need to show this agreement text in every fwupd frontend and exporting a
helper function allows us to do two things:

 * Share the semi-complicated code (and fallback) to avoid copy and pasting

 * Easily change the code in the future, for instance allowing merging Metainfo
   and AppStream metadata without updating all the front ends with new logic.
2018-04-16 16:44:27 +01:00
Richard Hughes
d29df0819f Allow specifying the reporting server in the remote key files 2018-01-11 20:20:00 +00:00
Richard Hughes
ec2df91c15 Support AppStream metadata with relative <location> URLs
If a remote like LVFS outputs <location>foo.cab</location> without a prepended
hostname and path then we should use the metadata URI hostname and path instead.

This allows us to trivially mirror a firmware repository, although clients using
older versions of libfwupd will not work without this patch. We should encourage
people to use `FirmwareBaseURI` for a long time yet.
2017-12-04 15:46:54 +00:00
Richard Hughes
8175f6d136 libfwupd: Remove a pointless call to fwupd_remote_build_uri() 2017-11-09 12:15:30 +00:00
Richard Hughes
e9c0a3c8cd trivial: Fix up some gtk-doc introspection issues in libfwupd 2017-10-05 10:32:05 +01:00
Richard Hughes
7f6d78fb1b Add fwupd_remote_get_checksum() to use in client programs 2017-09-28 09:23:52 +01:00
Richard Hughes
9342996e7e trivial: Use more defined result keys for FwupdRemote
Specifically here we want to use 'RemoteId' rather than just 'Id'...
2017-09-28 09:23:52 +01:00
Richard Hughes
b2fb80925c trivial: Remove fwupd_remote_get_filename()
The data for these was just being generated internally based on the ID and the
basename of the original URI, and that's easy for the calling application to do
itself.
2017-09-28 09:23:52 +01:00
Richard Hughes
e0bd53e439 trivial: Use standard _to_variant() and _from_variant() forms 2017-09-28 09:23:52 +01:00
Richard Hughes
5b20c18656 trivial: Convert FwupdRemote from a FINAL to DERIVABLE type
The latter is best-practice in a library so that objects can be superclassed by
client programs.
2017-09-28 09:23:52 +01:00
Richard Hughes
b86ef97b36 trivial: Remove fwupd_remote_build_uri()
This also removes the long-deprecated fwupd_remote_get_uri() and fwupd_remote_get_uri_asc()
2017-09-28 09:23:52 +01:00
Richard Hughes
8880cd09e4 trivial: Fix up some introspection issues 2017-09-19 09:54:16 +01:00
Richard Hughes
48ad97fd61 Add a human-readable title for each remote
This allows us to show something useful in a GUI.
2017-09-10 09:08:32 +01:00
Richard Hughes
b4fd0dfd7d Move deprecated symbols to a new header
This does two things:

 * Allows new users of the library to see only the supported symbols
 * Allows us to ensure we're not using deprecated API internally

I can also use this in gnome-software in CI to make sure we're not using
deprecated API too. I don't think we're ready for a soname bump so we have to
hang on to the deprecated code for now.
2017-09-08 13:31:01 +01:00
Richard Hughes
a6bd5580d3 Add ModifyRemote as an easy way to enable and disable remotes like the LVFS
For example:

    $ fwupdmgr modify-remote lvfs-testing Enabled true
2017-09-07 23:02:58 +01:00
Richard Hughes
ad1d9b1769 trivial: Fix a tiny leak in FwupdRemote 2017-08-31 20:07:06 +01:00
Richard Hughes
eb0b3ad71a libfwupd: Correctly set the ID ownership when using g_object_set()
Fixes half of https://github.com/hughsie/fwupd/issues/210
2017-08-30 10:34:59 +01:00
Richard Hughes
c6afb51e32 Add a FirmwareBaseURI parameter to the remote configs
This allows somebody to mirror the CDN without resigning the metadata files.

Fixes: https://github.com/hughsie/fwupd/issues/186
2017-08-23 14:22:12 +01:00
Richard Hughes
0dea1efb92 Use MetadataURI for both kinds of remote
I think this is clearer having one key for both types of remote.
2017-08-23 14:22:08 +01:00
Richard Hughes
3a0d3d5b58 trivial: Fix two introspection warnings 2017-08-22 10:37:26 +01:00
Richard Hughes
99e621d388 Save the metadata signature in the local cache
This is useful if the admin wants to re-verify the metadata, or if a public
key is removed or expires.
2017-08-16 13:42:10 +01:00
Richard Hughes
7403dc505f Optionally use GnuTLS to verify PKCS7 certificates
We can use this as an alternative for GPG. No PKCS7 certificates are currently
installed by fwupd and it's expected that the LVFS will still only provide GPG
detached signatures.

If an OEM distributor wants to sign firmware with a PKCS7 and the corresponding
certificate is provided then the firmware will be marked as valid.

Only firmware shipping with a .p7b file will use the PKCS7 functionality,
similarly remote metadata validation will default to GPG unless Keyring=pkcs7
is specified in the config file.
2017-08-14 09:42:48 +01:00
Richard Hughes
2d95a71a0c Support embedded devices with local firmware metadata
In this mode, both the metadata and firmware is stored on the local filesystem
and distributed using a distribution system like OSTree.

Fixes https://github.com/hughsie/fwupd/issues/162
2017-07-28 17:41:24 +01:00
Richard Hughes
b53ad36012 trivial: Fix up a number of FALSE/NULL return issues 2017-06-19 13:50:42 +01:00
Richard Hughes
cda1cdf606 Also watch the metadata cache filename for changes
If something changes the cache behind our back (e.g. deleting or updating the
file) we need to reload the list of remotes so that the age is correctly shown.
2017-06-16 21:49:37 +01:00
Richard Hughes
feb8027ee3 Show the age of the remote metadata in 'fwupdmgr get-remotes'
Note: we have to transfer the mtime (not the age) when creating the GVariant,
as we want calls to fwupd_remote_get_age() to update the value without getting
the remote from the daemon each time.
2017-06-16 20:24:41 +01:00
Richard Hughes
4c36970445 Move the remotes parsing from the client to the server
This allows us to load the metadata stores in a more sensible way in the future.
2017-06-16 15:31:40 +01:00
Richard Hughes
f0bde3e4af Add a get-remotes command to fwupdmgr
This allows the user to show the configured remotes.
2017-06-16 14:31:20 +01:00
Richard Hughes
a71e0a71f6 Allow ordering the metadata remotes
This allows us to load one metadata source file before or after another.
2017-06-16 12:40:24 +01:00
Richard Hughes
dfed515573 Allow downloading metadata from more than just the LVFS
Add the concept of 'remotes' that can dropped into /etc and used as firmware
metadata sources. This may be desirable when firmware is only accessable with
a valid support contract or from behind a VPN.
2017-06-02 13:19:05 +01:00