Skip to content

Commit 2a14756

Browse files
committed
Move build instructions to a separate file
1 parent 1ca720e commit 2a14756

File tree

2 files changed

+185
-41
lines changed

2 files changed

+185
-41
lines changed

BUILDING.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Prerequisites
2+
3+
## Build system
4+
5+
This project uses Meson, Ninja, and Cargo.
6+
7+
We use Meson 1.5.0+. If your package manager has an older version, you can
8+
install a new version [using the pip module][meson-pip-install].
9+
10+
There is currently no documented minimum support Rust version (MSRV), but 1.83+
11+
should work.
12+
13+
[meson-pip-install]: https://mesonbuild.com/Quick-guide.html#installation-using-python
14+
15+
## Package requirements
16+
17+
- GTK4
18+
- gettext
19+
- libdbus-1
20+
- libssl/openssl
21+
- libudev
22+
- desktop-file-utils
23+
24+
Using the web extension also requires `python3-dbus-next`.
25+
26+
## Examples
27+
28+
### Debian/Ubuntu
29+
30+
```shell
31+
sudo apt update && sudo apt install \
32+
# Build dependencies
33+
curl git build-essential \
34+
# Meson/Ninja dependencies
35+
meson ninja-build \
36+
# project dependencies
37+
libgtk-4-dev gettext libdbus-1-dev libssl-dev libudev-dev \
38+
# packaging dependencies
39+
desktop-file-utils \
40+
# web extension dependencies
41+
python3-dbus-next
42+
```
43+
44+
### Fedora
45+
46+
```shell
47+
# Build dependencies
48+
sudo dnf groupinstall "Development Tools"
49+
sudo dnf install \
50+
curl git \
51+
# Meson/Ninja dependencies
52+
meson ninja-build \
53+
# project dependencies
54+
gtk4-devel gettext dbus-devel openssl-devel systemd-udev \
55+
# packaging dependencies
56+
desktop-file-utils \
57+
# web extension dependencies
58+
python3-dbus-next
59+
```
60+
61+
# For Installing/Testing
62+
63+
If you are interested in installing the program, you can use `meson install` to install the details.
64+
65+
```shell
66+
git clone https://github.com/linux-credentials/credentialsd
67+
cd credentialsd
68+
meson setup -Dprefix=/usr/local build-release
69+
cd build-release
70+
meson install
71+
```
72+
73+
Note that since it Meson is installing to `/usr/local`, Meson will ask you to use `sudo` to elevate privileges to install.
74+
75+
The first time you run this, you must log out and log back in again to restart the D-Bus session bus for it to automatically start the D-Bus services on-demand.
76+
77+
### Testing with Firefox Web Add-On
78+
79+
Note: If you are testing the Firefox web extension, you will need to link the native messaging manifest to your home directory, since Firefox does not read from `/usr/local`:
80+
81+
```shell
82+
mkdir -p ~/.mozilla/native-messaging-hosts/
83+
ln -s /usr/local/lib64/mozilla/native-messaging-hosts/xyz.iinuwa.credentialsd_helper.json ~/.mozilla/native-messaging-hosts/
84+
```
85+
86+
# For Development
87+
88+
```
89+
git clone https://github.com/linux-credentials/credentialsd
90+
cd credentialsd
91+
meson setup -Dprofile=development build
92+
ninja -C build
93+
```
94+
95+
## Running the server
96+
97+
To run the required services during development, you need to add some
98+
environment variables.
99+
100+
```shell
101+
# Run the server, with debug logging enabled
102+
export GSETTINGS_SCHEMA_DIR=build/credentialsd-ui/data
103+
export RUST_LOG=credentialsd=debug,credentials_ui=debug
104+
./build/credentialsd/target/debug/credentialsd &
105+
./build/credentialsd-ui/target/debug/credentialsd-ui
106+
```
107+
108+
# For Packaging
109+
110+
There are a few Meson options to control the build that may be useful for packagers.
111+
112+
```
113+
# list available options
114+
115+
> meson configure
116+
# ...
117+
Project options Default Value Possible Values Description
118+
----------------- ------------- --------------- -----------
119+
cargo_home The directory to
120+
store files
121+
downloaded by
122+
Cargo
123+
cargo_offline false [true, false] Whether to
124+
perform an
125+
offline build
126+
with Cargo.
127+
Defaults to false
128+
to download
129+
crates from
130+
registries.
131+
profile default [default, The build profile
132+
development] for Credential
133+
Manager. One of
134+
"default" or
135+
"development".
136+
```
137+
138+
> TODO: rename `default` profile to `release` to reduce confusion.
139+
140+
# Running Tests
141+
142+
Due to some unknown reason, tests hang unless you pass the `--interactive` flag to Meson, available since 1.5.0.
143+
144+
```
145+
cd build
146+
meson test --interactive
147+
```

README.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,54 @@ A Linux Credential Manager API.
44

55
(Previously called `linux-webauthn-platform-api`.)
66

7-
## How to run
7+
## How to install
88

9-
### Build Requirements
9+
### From packages
1010

11-
This project uses Meson and Ninja.
11+
We have [precompiled RPM packages for Fedora and openSUSE][obs-packages] hosted
12+
by Open Build Services (OBS). We also copy these for released versions to the
13+
[release page][release-page].
1214

13-
Package requirements:
15+
There are several sub-packages:
1416

15-
- GTK4
16-
- gettext
17-
- libdbus-1
18-
- libssl/openssl
19-
- libudev
20-
- desktop-file-utils
17+
- `credentialsd`: The core credential service
18+
- `credentialsd-ui`: The reference implementation of the UI component for
19+
credentialsd.
20+
- `credentialsd-webextension`: Binaries and manifest files required for the
21+
Firefox add-on to function
2122

22-
Using the web extension also requires `python3-dbus-next`.
23+
[obs-packages]: https://build.opensuse.org/package/show/home:MSirringhaus:webauthn_devel/credentialsd
24+
[release-page]: https://github.com/linux-credentials/credentialsd/releases
2325

24-
For example, on Ubuntu:
26+
### From source
2527

26-
```shell
27-
sudo apt update && sudo apt install \
28-
# Build dependencies
29-
curl git build-essential \
30-
# Meson/Ninja dependencies
31-
python3 python3-pip python3-setuptools python3-wheel ninja-build \
32-
# project dependencies
33-
libgtk-4-dev gettext libdbus-1-dev libssl-dev libudev-dev \
34-
# packaging dependencies
35-
desktop-file-utils \
36-
```
28+
Alternatively, you can build the project yourself using the instructions in
29+
[BUILDING.md](/BUILDING.md).
3730

38-
### Compiling
31+
## How to use
3932

40-
```shell
41-
git clone https://github.com/linux-credentials/credentialsd
42-
cd credentialsd
43-
meson setup build -Dprofile=development
44-
ninja -C build
45-
```
33+
Right now, there are two ways to use this service.
4634

47-
### Running the server
35+
### Experimental Firefox Add-On
4836

49-
```shell
50-
# Run the server, with debug logging enabled
51-
export GSETTINGS_SCHEMA_DIR=build/credentialsd-ui/data
52-
export RUST_LOG=credentialsd=debug,credentials_ui=debug
53-
./build/credentialsd/target/debug/credentialsd &
54-
./build/credentialsd-ui/target/debug/credentialsd-ui
55-
```
37+
There is an add-on that you can install in Firefox 140+ that allows you to test
38+
`credentialsd` without a custom Firefox build. You can get the XPI from the
39+
[releases page][release-page] for the corresponding version of
40+
`credentialsd-webextension` package that you installed.
41+
42+
Currently, this add-on only works for https://webauthn.io and
43+
https://demo.yubico.com, but can be used to test various WebAuthn options and
44+
hardware.
45+
46+
### Experimental Firefox Build
47+
48+
There is also an experimental Firefox build that contains a patch to interact
49+
with `credentialsd` directly without an add-on. You can access a
50+
[Flatpak package for it on OBS][firefox-patch-flatpak] as well.
51+
52+
[firefox-patch-flatpak]: https://download.opensuse.org/repositories/home:/MSirringhaus:/webauthn_devel/openSUSE_Factory_flatpak/
5653

57-
### Clients
54+
## Clients
5855

5956
There is a demo client in the `demo_client`. It mimics an RP, saving the created public keys to a local file and verifying assertions against it.
6057

@@ -64,7 +61,7 @@ cd demo_client/
6461
./main.py get
6562
```
6663

67-
There is also a demo web extension that can be used to test the service in Firefox. Instructions are in [webext/README.md]().
64+
There is also a demo web extension that can be used to test the service in Firefox. Instructions are in [/webext/README.md]().
6865

6966
## Goals
7067

@@ -109,4 +106,4 @@ Alternatively, lock out the credential based on incorrect attempts.
109106

110107
# License
111108

112-
See the [LICENSE.md](LICENSE.md) file for license rights and limitations (LGPL-3.0-only).
109+
See the [LICENSE.md](/LICENSE.md) file for license rights and limitations (LGPL-3.0-only).

0 commit comments

Comments
 (0)