Skip to content

Commit d8b49c2

Browse files
committed
Add initial packaging documentation
1 parent e45fbe9 commit d8b49c2

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

PACKAGING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Packaging `upki`
2+
When distributed in a package, these are the main goals:
3+
4+
## Provide a system-wide configuration file
5+
`upki` looks for this at `/etc/xdg/upki/config.toml` (before falling back to typical
6+
per-user XDG locations.) An example looks like:
7+
8+
```
9+
cache-dir = "/var/cache/upki"
10+
11+
[revocation]
12+
fetch-url = "https://example.com/"
13+
```
14+
15+
`cache-dir` points `upki` at where to find its data files. These should be
16+
durable, but losing them only means more network traffic on the next `upki fetch` run.
17+
18+
`[revocation].fetch-url` is a HTTPS webserver where the data files should be made
19+
available. Notes on this:
20+
21+
- `upki` does not communicate with any server other than the configured one.
22+
- You may wish to run your own mirror for your package or distribution.
23+
- Your users may wish to run a site- or network-local mirror of their own.
24+
- `upki` uses the installed CA certificates to establish the connection,
25+
so your package should have these as a dependency.
26+
27+
## Run `upki fetch` regularly
28+
Currently the data is updated every twelve hours. We would suggest running
29+
`upki fetch` every two hours or so; the exact timing is a trade-off between
30+
efficiency and latency.
31+
32+
Ideally it should also be run shortly after network-up events.
33+
34+
You may also consider running it during package installation.
35+
36+
Running `upki fetch` when there is nothing to do downloads a ~1.5KB JSON file.
37+
This is usually very fast.
38+
39+
Running `upki fetch` when the cache is empty downloads up to ~10MB of data.
40+
41+
# Packaging checklist
42+
43+
- The executable `upki`, built in release mode.
44+
- A system-wide configuration file at `/etc/xdg/upki/config.toml` which points
45+
at a `cache-dir` that may be read by any user needing to use `upki`.
46+
- Arrangements to regularly run `upki fetch` as a low-privilege user who
47+
can write to the configured `cache-dir`.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This is for checking revocation status for certificates issued by publicly-trust
1717
authorities. It uses [crlite-clubcard](https://eprint.iacr.org/2025/610). This requires
1818
a data set that updates several times per day. `upki` therefore includes a synchronization
1919
component, which fetches updated data. You can run `upki fetch` to do this at any time,
20-
but ideally it is run system-wide as arranged by packagers.
20+
but ideally it is run system-wide as [arranged by packagers](PACKAGING.md).
2121

2222
There are a number of interfaces available:
2323

@@ -41,6 +41,10 @@ TODO
4141

4242
TODO
4343

44+
# Packaging
45+
46+
See [PACKAGING.md](PACKAGING.md).
47+
4448
# License
4549

4650
upki is distributed under the following two licenses:

0 commit comments

Comments
 (0)