Skip to content

Add optional TLS support for secure LAN access#28

Merged
selfcontained merged 1 commit into
mainfrom
feature/tls-support
Mar 11, 2026
Merged

Add optional TLS support for secure LAN access#28
selfcontained merged 1 commit into
mainfrom
feature/tls-support

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds native HTTPS support to the Fastify server, enabled via TLS_CERT and TLS_KEY environment variables
  • When neither is set, the server starts on plain HTTP (no change for dev)
  • Updates all bin scripts (dispatch-deploy, dispatch-event, dispatch-stream, dispatch-share, dispatch-release, dispatch-server) to auto-detect HTTP/HTTPS and accept self-signed certs
  • Passes DISPATCH_SCHEME env var to agent subprocesses so bin scripts know which protocol to use

Setup

brew install mkcert
mkcert -install
mkdir -p ~/.dispatch/tls
mkcert -cert-file ~/.dispatch/tls/cert.pem -key-file ~/.dispatch/tls/key.pem <LAN-IP> localhost 127.0.0.1

Then add to production .env:

TLS_CERT=~/.dispatch/tls/cert.pem
TLS_KEY=~/.dispatch/tls/key.pem

Test plan

  • Verify server starts on HTTP when TLS env vars are unset (dev mode)
  • Verify server starts on HTTPS when TLS env vars point to valid cert/key
  • Verify error is thrown if only one of TLS_CERT/TLS_KEY is set
  • Verify deploy health check works with HTTPS enabled
  • Verify agent bin scripts (dispatch-event, dispatch-share, etc.) work over HTTPS

🤖 Generated with Claude Code

Enable native HTTPS on the Fastify server via TLS_CERT and TLS_KEY
environment variables. When unset, the server starts on plain HTTP
as before. All bin scripts (deploy, event, stream, share, release)
are updated to auto-detect the scheme and use -k for self-signed certs.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit bb20545 into main Mar 11, 2026
1 check passed
@selfcontained
selfcontained deleted the feature/tls-support branch April 9, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant