Files
Charon/backend/pkg/dnsprovider/builtin/init.go
GitHub Actions b86aa3921b feat(dns): add custom DNS provider plugin system
- Add plugin interface with lifecycle hooks (Init/Cleanup)
- Implement thread-safe provider registry
- Add plugin loader with SHA-256 signature verification
- Migrate 10 built-in providers to registry pattern
- Add multi-credential support to plugin interface
- Create plugin management UI with enable/disable controls
- Add dynamic credential fields based on provider metadata
- Include PowerDNS example plugin
- Add comprehensive user & developer documentation
- Fix frontend test hang (33min → 1.5min, 22x faster)

Platform: Linux/macOS only (Go plugin limitation)
Security: Signature verification, directory permission checks

Backend coverage: 85.1%
Frontend coverage: 85.31%

Closes: DNS Challenge Future Features - Phase 5
2026-01-07 02:54:01 +00:00

37 lines
989 B
Go

package builtin
import (
"github.com/Wikid82/charon/backend/internal/logger"
"github.com/Wikid82/charon/backend/pkg/dnsprovider"
)
// init automatically registers all built-in DNS provider plugins when the package is imported.
func init() {
providers := []dnsprovider.ProviderPlugin{
&CloudflareProvider{},
&Route53Provider{},
&DigitalOceanProvider{},
&GoogleCloudDNSProvider{},
&AzureProvider{},
&NamecheapProvider{},
&GoDaddyProvider{},
&HetznerProvider{},
&VultrProvider{},
&DNSimpleProvider{},
}
for _, provider := range providers {
if err := provider.Init(); err != nil {
logger.Log().WithError(err).Warnf("Failed to initialize built-in provider: %s", provider.Type())
continue
}
if err := dnsprovider.Global().Register(provider); err != nil {
logger.Log().WithError(err).Warnf("Failed to register built-in provider: %s", provider.Type())
continue
}
logger.Log().Debugf("Registered built-in DNS provider: %s", provider.Type())
}
}