Commit Graph

706 Commits

Author SHA1 Message Date
Alexander Larsson
c12f4a5b21 Fix build/dist of API docs
We don't want to dist the stamp files, because they are not actually
created.

Also include the AuthenticatorRequest dbus interface in the docs
2020-11-19 11:01:03 +01:00
Alexander Larsson
e5fac1feb8 Add docs for --subset=SUBSET 2020-11-13 10:32:19 +01:00
Alexander Larsson
a0dd41d8c4 docs: Add initial document describing the flatpak summary files. 2020-10-29 17:19:47 +01:00
Simon McVittie
7c29fc6fd6 doc: Include D-Bus APIs in the API reference documentation
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-10-01 11:11:30 +02:00
Phaedrus Leeds
7cd1990196 Automatically pin explicitly installed runtimes
If a runtime is installed explicitly rather than as a dependency, pin it
so it doesn't get automatically removed when unused runtimes are being
removed. We do this because the runtime might be installed for
development or other uses.

This commit also rearranges some code in the mask and pin commands, and
adds a unit test.
2020-08-31 16:29:03 +02:00
Phaedrus Leeds
2325b81401 Minor fixes for mask command 2020-08-31 16:29:03 +02:00
Matthew Leeds
d2d5397cc1 Add pin command to keep unused runtimes
As discussed here [1], we want a way to mark runtimes to be kept even
when they are unused by any apps and we are removing such runtimes.
Currently this is a command that can be run manually; a subsequent
commit will pin runtimes automatically if they are installed
independently of any app.

A unit test is included.

[1] https://github.com/flatpak/flatpak/issues/2639#issuecomment-662311756
2020-08-31 16:29:03 +02:00
Phaedrus Leeds
3f19950936 doc/update: Fix formatting 2020-08-31 16:26:12 +02:00
Simon McVittie
09424423b9 context: Normalize home/path to ~/path, and ~ to home
Historically we didn't accept them, but there's no real reason why not.
They're normalized to the form in which earlier Flatpak releases would
want to see them.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-08-27 17:48:50 +02:00
Matthew Leeds
1aeceb0caf doc: Clarify remote no-enumerate docs 2020-08-17 09:21:30 +02:00
Matthew Leeds
845a877ce1 Prioritize an app's origin for its runtime
Currently when searching for a remote to provide the runtime for an app,
we search remotes in priority order. This commit makes it so we search
the remote providing the app before others with the same priority, and
otherwise still search in priority order.  This means for the common
case where every remote has the default priority of 1, the app's origin
will have the first chance to provide the runtime. This behavior seems
logical, but the impetus for this change was also to keep a unit test
passing in eos-updater[1] after a port to FlatpakTransaction.

Originally the eos-updater unit test was written to prioritize the
origin remote regardless of the priorities on any other remote, but
during code review it was decided to let higher priority remotes stay
above the app's origin.

In practice it's usually true that only one remote provides a runtime
and priorities aren't set at all, so this is an edge case that probably
doesn't come up much.

A unit test and documentation updates are included.

[1] eede0a8b9c/tests/test-update-install-flatpaks.c (L1919)
2020-08-17 09:21:30 +02:00
Phaedrus Leeds
2612e9df18 doc: Update create-usb for sideloading
Update the create-usb man page to reflect the re-worked implementation
that landed in 1.7.1.
2020-08-11 15:22:57 +02:00
Jan Tojnar
eb57c7c07b Unify DocBook DTDs
Previously, there were three different DTDs used. Let's switch to a single one.

We will go with 4.5, since it is latest version that does not have any backwards incompatible changes.
2020-08-10 15:14:38 +02:00
Luca Boccassi
7872935e12 run: implement sandbox host os-release interface
If available, always read-only bind-mount /etc/os-release as
/run/host/os-release (or /usr/lib/os-release as fallback)
as suggested by the os-release specification:

https://www.freedesktop.org/software/systemd/man/os-release.html
2020-07-24 10:28:30 +02:00
Matthew Leeds
01a0f4ffa7 doc: Fix a typo in build-export --include docs 2020-07-21 09:03:21 +02:00
Matthew Leeds
4c198d3c98 doc: Clarify build-bundle docs with respect to format 2020-07-21 09:02:52 +02:00
Matthew Leeds
7584be3944 doc: Tweak remote-ls docs 2020-07-21 09:02:00 +02:00
Matthew Leeds
5a646117c9 Don't mention $FLATPAK_RUN_DIR in docs
We only want the run dir to be overridable in unit tests because we
depend on it being /run/flatpak in flatpak-create-sideload-symlinks.sh,
so don't mention it in the flatpak man page.
2020-06-23 09:37:10 +02:00
Matthew Leeds
e84b75629d Allow sideload-repos to link to the root of a USB
Currently we only support links in /var/lib/flatpak/sideload-repos,
/run/flatpak/sideload-repos, etc. to be actual ostree repos, but this
commit makes it so you can also link to the root directory of a USB,
and Flatpak will check the subpaths "ostree/repo", ".ostree/repo", and
".ostree/repos.d" for compatibility with "flatpak create-usb". This will
allow the logic in the following commit to be much simpler, where we're
linking to hot-plugged drives in a script run by systemd.

Note that we still only allow actual repos in the other places where a
sideload path can be specified, such as the --sideload-repo CLI option.
2020-06-23 09:37:10 +02:00
Matthew Leeds
6397200247 Update documentation for sideload-repos
It is no longer a config option; it was changed to be a directory.
2020-06-18 13:51:16 -07:00
Matthew Leeds
bd04b09f9b create-usb: Include partial commits
Commits 32194f2d2 and b8d2196c2 made create-usb detect partially
installed commits and omit them except when --allow-partial is specified
(and in the case of extensions of related refs omit them
unconditionally). The reasoning was that if on the other computer using
the USB for an installation you need a different subpath of a commit
(such as a different language of a locale extension), the installation
will fail. But in most real world cases the users on both ends will
speak the same language so it will not often be an issue.  Also, if you
are offline and have only your own language's subpaths for your locale
extensions, it makes sense to put them on the USB because you have no
way to get the full locale extension and the receiver probably wants the
same subpath as you.

The way "flatpak create-usb" is most often used in Endless is via
gnome-software which calls it under the hood. So while we could have it
pass --allow-partial that would not accomplish much; it doesn't solve
the problems above.

For the online case we may want to attempt to download the full locale
extensions before copying to the USB, but that is for a later commit.

Fixes https://github.com/flatpak/flatpak/issues/3491
2020-06-15 10:08:34 +02:00
Ryan Gonzalez
f687f6b2eb run: Add --instance-id-fd 2020-06-09 13:51:02 +02:00
Matthew Leeds
a994cdb30e tree-wide: Replace usages of whitelist/blacklist
The terms whitelist and blacklist are hurtful to some people, and per
our code of conduct Flatpak is an inclusive community. Replace them with
allowlist and blocklist which are also more clear. This terminology
change is being implemented more broadly in the software industry; see
e.g. https://go-review.googlesource.com/c/go/+/236857/
2020-06-09 09:24:48 +02:00
Bartłomiej Piotrowski
6d9f9273c8 remote-add: Add --no-follow-redirect 2020-06-08 12:13:20 +02:00
Bartłomiej Piotrowski
5a82a599b1 remote-modify: Add --follow-redirect and --no-follow-redirect 2020-06-08 12:13:20 +02:00
Alexander Larsson
bfa71e208a Add FlatpakZstdDecompressor converter (and libzstd dep)
We will need this to decompress oci deltas.
2020-06-05 09:35:30 +02:00
Matthew Leeds
0ed5477a22 doc: Fix typo in build-update-repo page 2020-05-22 11:12:55 -07:00
Yiannis
e459703b38 Added flatpak remote-modify reference
`flatpak remote-modify --collection-id= ` can be use to set the collection ID of the remote server.
I spent quite a while trying to find how to set it, until I found this blog post:
https://blogs.gnome.org/mclasen/2018/08/26/about-flatpak-installations/
2020-04-01 23:08:20 +03:00
Alexander Larsson
b28271bb5e Merge pull request #3498 from alexlarsson/use-symlinks-for-sideload-config
Use symlinks instead of xa.sideload-repos config option
2020-03-30 16:03:54 +02:00
Alexander Larsson
bae8eef87d docs: Tweaks to sideload repo docs 2020-03-30 15:37:45 +02:00
Abderrahim Kitouni
192d31d315 Add a FlatpakProgress object
To avoid the complexities of passing (and chaining) OstreeAsyncProgress
objects around, we only create one just before calling to ostree.
The rest of flatpak only ever uses the new FlatpakProgress object.

Co-authored by: Philip Chimento <philip@endlessm.com>
2020-03-26 21:09:19 +01:00
Alexander Larsson
15c761d482 Use symlinks instead of xa.sideload-repos config option
Instead of having a global config option we scan a directory for
symlinks into the sideload repos. These come from
/var/lib/flatpak/sideload-repos and /run/flatpak/sideload-repos (for
default system installation).

This is much easier to update atomically, and the two different
options are useful for persistant (the first) or dynamic (the second)
usescase.

Fixes https://github.com/flatpak/flatpak/issues/3494
2020-03-26 11:50:54 +01:00
Simon McVittie
6ba07613b4 installation: Formally deprecate deprecated methods
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-03-25 12:56:56 +00:00
Alexander Larsson
a843d2d594 sideload: Add api and CLI support to specify sideload repos dynamically 2020-03-24 14:01:20 +01:00
Alexander Larsson
b8d2196c2e create-usb: Add --allow-partial option
If you really want to export partial refs you can use this switch.
2020-03-24 12:51:12 +01:00
Alexander Larsson
d30e902d9f Add build-update-repo --deploy-sideload-collection-id option
This is a new version of --deploy-collection-id that only applies
the collection id update for new (1.7.x+) version of flatpak clients.
This allows you to enable collection ids for sideload use but not
affect older clients where the p2p codepaths are not as tested.
2020-03-23 17:58:04 +01:00
Zetrov (Zhengchao)
194ef58fb9 Update flatpak-build-init.xml 2020-03-16 09:27:20 +01:00
Zetrov (Zhengchao)
8b0a1936c0 typo 2020-03-16 09:27:20 +01:00
Zetrov (Zhengchao)
d99af85f05 Improvements for new users & fix example
New users who jump directly into this command might think this command is to init a project or application dictionary but it actually creates somehow a  directory for *built* app to run inside. 

plus, fix not working example

Sorry for such minor and boring commit.
2020-03-16 09:27:20 +01:00
Simon McVittie
fe2536b844 exports: Add host-etc and host-os keywords
These are subsets of the host keyword, which provide access to operating
system files but not to users' personal files.

In particular, the experimental support for namespace-based sandboxes
in the Steam Runtime[1] uses the graphics stack from the host system,
which requires access to the host /usr/libQUAL, /libQUAL (even if the
host OS has undergone the /usr merge, the canonical paths of ELF
interpreters start with /lib), /etc/ld.so.cache, and for some libraries
on Debian-based systems, /etc/alternatives. It will not be possible to
do similar things in Flatpak without either allowing full host
filesystem access (which exposes personal files, and in any case cannot
be done by the Steam app because it is incompatible with --persist=.),
or adding the ability to expose /usr and related directories without
including the rest of the host filesystem.

To the best of my knowledge, host-etc is not necessary for anything;
I've mainly provided it for symmetry, since it's the other significant
thing that we mount in /run/host and cannot get via --filesystem=/path.

Some notes on the security/privacy implications of the new keywords:

- Neither new keyword allows anything that was not already allowed
  by "host".
- Neither new keyword can allow anything that was not already allowed
  to the user outside the sandbox.
- "host-os" allows enumeration of the installed packages on the host
  system, and often their version numbers too. A malicious app could
  use this to look for exploitable security vulnerabilities on the
  host system. An app could also use this for fingerprinting, although
  this is not a regression, because the systemd/D-Bus machine ID,
  MAC addresses, hostname, kernel boot UUID, DMI product ID and many
  other unique or relatively unique properties are already available
  inside the sandbox.
- "host-os" allows read access, and possibly write access (if the user
  has it outside the sandbox, for example members of group 'staff' in
  older Debian installations), to /usr/local.
- "host-etc" allows reading configuration files whose contents might
  be considered sensitive, such as /etc/passwd.

[1] https://steamcommunity.com/app/221410/discussions/0/1638675549018366706/

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-02-14 15:41:59 +01:00
Simon McVittie
851a34b355 doc: Point to flatpak-metadata(5) for the meanings of filesystem keywords
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-01-23 18:40:01 +00:00
Alexander Larsson
b735344644 Correct filename in docs 2020-01-17 11:47:04 +01:00
Alexander Larsson
39903eab40 Add --device=shm permission
This new permission exposes the host /dev, which is normally not visible
even with --device=all, as it is not really a device node but rather
a bunch of shared memory blocks available on the host.

This access is needed by jack, as explained at:
https://github.com/flatpak/flatpak/issues/1509

Long term I think a better solution for pro audio (like pipewire) is
a better solution, but for now we should at least allow jack apps to work.
2020-01-17 11:47:04 +01:00
Alexander Larsson
8e4b0d156d remote add/modify: Add --[no-]authenticator-install options
This enables or disables auto-installation of autenticators for a remote.
If it is unset it defaults to whatever the remote wants.
2019-12-19 10:33:21 +01:00
Alexander Larsson
85a53947b3 man: Document the authentcator options
This adds --authenticator-name and --authenticator-opion to remote-add
and remote-modify docs.
2019-12-17 15:25:42 +01:00
Jan Grulich
a61f61870e Add support for CUPS socket 2019-12-13 17:56:22 +01:00
Matthias Clasen
1957d4473e doc: Add an example for permission-set
This shows how --data formatting works on the commandline.
2019-12-12 12:45:53 -05:00
Matthias Clasen
cdf3c33293 permission-set: Add an option to set data
This is useful for debugging permission store functionality
and will be more so when the openuri portal starts using
per-entry data.
2019-12-11 17:21:36 +01:00
Matthew Leeds
e0e9996370 doc/flatpak-build-bundle: Add an example for the user installation 2019-12-10 14:36:58 +01:00
Matthias Clasen
2166913eb1 Update flatpak ps docs
Mention the new columns.
2019-12-04 13:33:52 +01:00