Skip to content

Commit 7198ec2

Browse files
A6GibKmbilelmoussaoui
authored andcommitted
README: Add testing instructions
1 parent c0ce565 commit 7198ec2

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,80 @@ The repository consists of the following projects:
1212
- [portal](./portal/): [org.freedesktop.impl.portal.Secret](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.impl.portal.Secret.html) implementation
1313
- [server](./server/): [org.freedesktop.secrets](https://specifications.freedesktop.org/secret-service-spec/latest/) server implementation
1414

15+
## Hacking on oo7 services
16+
17+
### Testing oo7-daemon
18+
19+
The daemon can be testing by simply compiling and running the binary with
20+
21+
```sh
22+
cargo run --bin oo7-daemon -- --verbose --replace --login
23+
```
24+
25+
Note however that if `gnome-keyring-daemon` is running, it will need to be
26+
killed directly before running `oo7-daemon`, as it is not running as a systemd
27+
service.
28+
29+
### Testing oo7-portal
30+
31+
The oo7-portal service can be tested using [systemd-sysext][systemd-sysext].
32+
Directly running the binary is possible, but without a `oo7-portal.portal` file,
33+
`xdg-desktop-portal` will ignore it.
34+
35+
First build the services on its subdirectory:
36+
37+
```sh
38+
cd oo7-portal
39+
meson setup --prefix=/usr _build
40+
meson compile -C _build
41+
DESTDIR=oo7-extension meson install -C _build
42+
```
43+
44+
This will create a `oo7-extension` directory under `oo7-portal/_build`, which
45+
can be moved to `/run/extensions`, afterwards extensions can be reloaded via
46+
47+
```sh
48+
systemd-sysext refresh --force
49+
```
50+
51+
> [!WARNING]
52+
> In Fedora Silverblue one needs to disable SELinux via `setenforce 0` before
53+
> loading any system extensions.
54+
55+
The portal can be then started with:
56+
```sh
57+
/usr/libexec/oo7-portal --replace --verbose
58+
```
59+
60+
In order for `xdg-desktop-portal` to use `oo7-portal` as a server for
61+
`org.freedesktop.impl.portal.Secret` it needs to be configured via a
62+
[portals.conf][portals.conf] file at `/etc/xdg-desktop-portal/portals.conf`, see
63+
the `portals.conf(5)` man page.
64+
65+
This can be achieved by creating a file at
66+
`~/.config/xdg-desktop-portal/gnome-portals.conf` with contents:
67+
68+
``` toml
69+
[preferred]
70+
default=gnome;gtk;
71+
org.freedesktop.impl.portal.Secret=oo7-portal;gnome-keyring;
72+
```
73+
74+
and then, restarting `xdg-desktop-portal` via
75+
76+
```sh
77+
systemctl restart --user xdg-desktop-portal
78+
```
79+
80+
If more output is required, the later can be replaced with:
81+
82+
```sh
83+
/usr/libexec/xdg-desktop-portal --replace --verbose
84+
```
85+
1586
## License
1687

1788
The project is released under the MIT license.
89+
90+
[portals.conf]: https://flatpak.github.io/xdg-desktop-portal/docs/portals.conf.html
91+
[systemd-sysext]: https://www.freedesktop.org/software/systemd/man/latest/systemd-sysext.html

0 commit comments

Comments
 (0)