Skip to content

config: make enabled endpoints configurable#79

Merged
0xFelix merged 2 commits intomainfrom
configurable-endpoints
Apr 18, 2026
Merged

config: make enabled endpoints configurable#79
0xFelix merged 2 commits intomainfrom
configurable-endpoints

Conversation

@0xFelix
Copy link
Copy Markdown
Owner

@0xFelix 0xFelix commented Apr 18, 2026

Summary

  • Adds an Endpoints struct to Config with bool fields for each endpoint group: plain, nic, acmedns, httpreq, directadmin
  • All endpoints are enabled by default (no behavior change without config)
  • Custom UnmarshalYAML on Endpoints ensures consistent semantics: if the endpoints: key is present in YAML, only explicitly-set-true fields are enabled — matching the env var behavior
  • New ENDPOINTS env var accepts a comma-separated list (e.g. ENDPOINTS=plain,nic); if unset, all endpoints remain active
  • Extracted envRateLimit and envLockout helpers to stay within the cyclomatic complexity limit

Configuration examples

YAML:

endpoints:
  plain: true
  nic: true

Environment:

ENDPOINTS=plain,nic

Both have identical semantics: if specified, only listed endpoints are registered; if omitted entirely, all are active.

Test plan

  • make lint — 0 issues
  • make test — 18/18 passed
  • make functest — 68/68 passed

🤖 Generated with Claude Code

0xFelix added 2 commits April 18, 2026 18:28
Add an Endpoints struct to Config with bool fields for each endpoint
group (plain, nic, acmedns, httpreq, directadmin). All endpoints are
enabled by default. A custom UnmarshalYAML implementation ensures that
explicitly listing endpoints in YAML disables all others, matching the
env var semantics of ENDPOINTS=plain,nic.

Also extract envRateLimit and envLockout helpers to stay within the
cyclomatic complexity limit.

Signed-off-by: Felix Matouschek <felix@matouschek.org>
Signed-off-by: 0xFelix <felix@matouschek.org>
Signed-off-by: Felix Matouschek <felix@matouschek.org>
Signed-off-by: 0xFelix <felix@matouschek.org>
@0xFelix 0xFelix merged commit 911333e into main Apr 18, 2026
5 checks passed
@0xFelix 0xFelix deleted the configurable-endpoints branch April 18, 2026 16:43
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