Relationships
#3575 worker daemon enable has no --ca-cert or --concurrency (worker connect has both)
Opened by kagarmoe · 10/17/2026· Shipped 10/19/2026
Summary
swamp worker daemon enable has no --ca-cert (or --concurrency), though swamp worker connect has both. The service also starts with only SWAMP_CONFIG_DIR set, so a worker installed with daemon enable can't trust a private CA. It fails TLS against a serve that uses a private-CA certificate (for example, a tailnet-only serve) until the unit or plist is edited by hand, and that edit is lost the next time daemon enable runs.
Where (origin/main ab2d51aa)
swamp help worker connectoptions:--token --token-file --server-token --server-token-file --label --data-plane-url --cache-dir --no-reconnect --max-dispatches --idle-timeout --concurrency --ca-certswamp help worker daemon enableoptions:--user --token --token-file --server-token --server-token-file --label --cache-dir --data-plane-url --max-dispatches --idle-timeout --no-reconnect(no--concurrency, no--ca-cert)src/cli/commands/worker_daemon.ts:workerDaemonBaseEnv()returns onlySWAMP_CONFIG_DIR.collectWorkerEnv()maps only the options above, so neitherSWAMP_CA_CERTnorSWAMP_WORKER_CONCURRENCYcan reach the service, even when they're set in the shell that runsdaemon enable.
Reproduce
swamp serve --host <tailnet-ip> --cert-file server.pem --key-file server.key --auth-mode token, with the certificate signed by a private CA.swamp worker daemon enable wss://<host>:<port> --user --token-file … --server-token-file … --cache-dir …- The worker service fails the TLS handshake (unknown issuer).
- Workaround: add
SWAMP_CA_CERT=<ca.pem>to the plist'sEnvironmentVariablesor the unit'sEnvironment=by hand. Re-runningdaemon enableoverwrites it.
Proposed fix
- Add
--ca-cert <path>toworker daemon enable. Resolve it to an absolute path and check that it exists, as--cache-diris checked since #1414, so a relative path doesn't break under launchd or systemd. Write it to the service asSWAMP_CA_CERT. - Add
--concurrency, written asSWAMP_WORKER_CONCURRENCY. - Prevention: a test that every
worker connectoption either has aworker daemon enablecounterpart or is on an explicit exclusion list, so the two commands can't drift apart again.
Environment
swamp 20261016.021405.0-sha.b46b8895; worker daemons on Linux (systemd --user) and macOS (launchd agent).
Shipped
Click a lifecycle step above to view its details.
stack72 commented 10/19/2026, 3:20:29 PM
Thanks @kagarmoe for reporting this! We shipped: worker daemon enable reaches full parity with worker connect: add --ca-cert (absolute, existence-checked, SWAMP_CA_CERT) and --concurrency (SWAMP_WORKER_CONCURRENCY); carry SWAMP_SERVE_EXTRA_HEADERS from the enabling shell; make relative --token-file and --server-token-file absolute; refuse at enable time every value worker connect would refuse at start so a bad value no longer becomes a crash-looping service; encode newlines in systemd env values; add a parity test over both options and env vars so the commands cannot drift.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.