Skip to content

feat: auto-HTTPS and graceful shutdown fix#22

Merged
DENFNC merged 5 commits into
mainfrom
feat/auto-https
May 29, 2026
Merged

feat: auto-HTTPS and graceful shutdown fix#22
DENFNC merged 5 commits into
mainfrom
feat/auto-https

Conversation

@GaIsBAX
Copy link
Copy Markdown
Owner

@GaIsBAX GaIsBAX commented May 27, 2026

Changes

fix: graceful shutdown

Shutdown was called with an already-cancelled context, so context.WithTimeout(ctx, 10s) produced an immediately-cancelled child context - the server never got its 10-second grace window and always did a hard kill. Fixed by using context.Background() instead.

feat: auto-HTTPS via Let's Encrypt

When WEBHIX_TLS_DOMAIN is set, Webhix handles TLS itself - no nginx or Caddy required.

  • Listens on :443 (HTTPS) and :80 (HTTP → HTTPS redirect + ACME challenge)
  • Certificate is obtained and renewed automatically via Let's Encrypt
  • WEBHIX_ADDR is ignored when TLS is active
  • WEBHIX_TLS_CACHE_DIR controls where certs are cached (default: ./data/certs)

Usage:

WEBHIX_TLS_DOMAIN=hooks.example.com
WEBHIX_BASE_URL=https://hooks.example.com

@GaIsBAX GaIsBAX requested a review from DENFNC May 27, 2026 08:18
@DENFNC DENFNC merged commit 0fa97b3 into main May 29, 2026
1 check passed
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.

2 participants