Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/sponsord/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,14 @@ release.
`github.com/decdn/decdn`, at the commit `Cargo.lock` pins
(`7f938e6b8437eba614e54375dcbc504de108379d`); `decdn.ref` and the sibling
checkout are gone.

### Fixed

- **Keystore credential in the systemd unit.**
`deploy/systemd/sponsord.service` copies the keystore credential to a `0600`
file under `/run/sponsord` before start. Some systemd versions (254+ on
Linux 6.4+, seen on 255) load credentials at `0440`, which the daemon
refused as an insecure keystore
([#36](https://github.com/decdn/sponsord/issues/36)). If you installed a copy
of the unit, take its new `RuntimeDirectory=`, `RuntimeDirectoryMode=`,
`ExecStartPre=` and `SPONSORD_TREASURY_KEYSTORE` lines.
10 changes: 9 additions & 1 deletion deploy/systemd/sponsord.service
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ LoadCredential=treasury-password:/etc/sponsord/treasury-password
LoadCredential=treasury-keystore.json:/etc/sponsord/treasury-keystore.json
Environment=SPONSORD_API_TOKEN_FILE=%d/api-token
Environment=SPONSORD_TREASURY_PASSWORD_FILE=%d/treasury-password
Environment=SPONSORD_TREASURY_KEYSTORE=%d/treasury-keystore.json
# Some systemd versions (254+ on Linux 6.4+, seen on 255) load credentials at
# mode 0440, and the daemon refuses a keystore with any group or other bit
# set. So copy it to a private 0600 file first. The copy is still the
# encrypted keystore, the password stays in %d, and systemd removes
# /run/sponsord when the service stops.
RuntimeDirectory=sponsord
RuntimeDirectoryMode=0700
ExecStartPre=/usr/bin/install -m 0600 %d/treasury-keystore.json %t/sponsord/treasury-keystore.json
Environment=SPONSORD_TREASURY_KEYSTORE=%t/sponsord/treasury-keystore.json
DynamicUser=yes
Restart=on-failure
RestartSec=5s
Expand Down
5 changes: 4 additions & 1 deletion docs/operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ For a different kind of check, see [integrator.md](integrator.md).
source with `docker compose build`
([`deploy/Dockerfile`](../deploy/Dockerfile)).
- **systemd:** [`deploy/systemd/`](../deploy/systemd) has a unit for each,
with secrets as `LoadCredential=` credentials.
with secrets as `LoadCredential=` credentials (systemd 252 or later). Some
systemd versions load credentials at mode `0440`, which the daemon refuses
for a keystore. So the daemon's unit copies the keystore to a `0600` file
under `/run/sponsord` before start.
- **Release binaries:** each `sponsord-vX.Y.Z` and `sponsord-onramp-vX.Y.Z`
GitHub Release has its binary for Linux x86_64 and aarch64, with a signed
`SHA256SUMS`.
Expand Down
Loading