|
| 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`. |
0 commit comments