feat: add companion service discovery - #2123
Open
ggrossetie wants to merge 1 commit into
Open
Conversation
Let a companion container not built into Kroki register itself as a new diagram type via a REST API under /services (register, heartbeat, get, list, unregister). Registrations are held in memory and expire without a heartbeat, since Kroki is stateless. Disabled by default (KROKI_ENABLE_COMPANION_DISCOVERY), and always disabled under KROKI_SAFE_MODE=SECURE (the default, including on kroki.io) regardless of that flag. The registration API can be gated with a bearer token (KROKI_COMPANION_REGISTRATION_TOKEN), and the host/port denylist can be extended per deployment (KROKI_COMPANION_BLOCKED_HOSTS). Closes yuzutech#1423 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/services(register, heartbeat, get, list, unregister) — closes Service discovery #1423KROKI_ENABLE_COMPANION_DISCOVERY), and always disabled underKROKI_SAFE_MODE=SECURE(the default, including on kroki.io) regardless of that flagKROKI_COMPANION_REGISTRATION_TOKEN), and the host/port denylist (loopback, link-local, private addresses, cloud metadata hostnames) can be extended per deployment (KROKI_COMPANION_BLOCKED_HOSTS)/health,/v1/health,/healthzand the homepage now reflect the live registry instead of a startup snapshot