Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

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 connect options: --token --token-file --server-token --server-token-file --label --data-plane-url --cache-dir --no-reconnect --max-dispatches --idle-timeout --concurrency --ca-cert
  • swamp help worker daemon enable options: --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 only SWAMP_CONFIG_DIR.
    • collectWorkerEnv() maps only the options above, so neither SWAMP_CA_CERT nor SWAMP_WORKER_CONCURRENCY can reach the service, even when they're set in the shell that runs daemon enable.

Reproduce

  1. swamp serve --host <tailnet-ip> --cert-file server.pem --key-file server.key --auth-mode token, with the certificate signed by a private CA.
  2. swamp worker daemon enable wss://<host>:<port> --user --token-file … --server-token-file … --cache-dir …
  3. The worker service fails the TLS handshake (unknown issuer).
  4. Workaround: add SWAMP_CA_CERT=<ca.pem> to the plist's EnvironmentVariables or the unit's Environment= by hand. Re-running daemon enable overwrites it.

Proposed fix

  1. Add --ca-cert <path> to worker daemon enable. Resolve it to an absolute path and check that it exists, as --cache-dir is checked since #1414, so a relative path doesn't break under launchd or systemd. Write it to the service as SWAMP_CA_CERT.
  2. Add --concurrency, written as SWAMP_WORKER_CONCURRENCY.
  3. Prevention: a test that every worker connect option either has a worker daemon enable counterpart 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).

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 7 MOREREVIEW+ 11 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

10/19/2026, 3:20:25 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/19/2026, 2:22:52 PM
Editable. Press Enter to edit.

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.