1 parent
98b65945f6
commit
0b6dcbd547
13 files changed
+417
-68
No files matched your search
+11
-4
@@ -67,7 +67,8 @@ type Hooks struct {
|
||||
DomainCheck func(name string) (any, error)
|
||||
// Resolve runs one query through the live pipeline and reports the
|
||||
// outcome, so the console can test the server it is talking to.
|
||||
Resolve func(ctx context.Context, name, qtype string) (any, error)
|
||||
Resolve func(ctx context.Context, name, qtype string) (any, error)
|
||||
ResolveUpstream func(ctx context.Context, name, qtype, upstream string) (any, error)
|
||||
// ListDomains pages the compiled rules.
|
||||
ListDomains func(q DomainQuery) (any, error)
|
||||
// AddDomain adds an inline rule and persists it.
|
||||
@@ -75,9 +76,12 @@ type Hooks struct {
|
||||
// DeleteDomain removes a rule and persists the change.
|
||||
DeleteDomain func(ctx context.Context, name, action, list string) error
|
||||
// LocalZones lists, saves and deletes UI-managed DNS master files.
|
||||
LocalZones func(ctx context.Context) ([]ZoneFile, error)
|
||||
SaveLocalZone func(ctx context.Context, name, content string) error
|
||||
DeleteLocalZone func(ctx context.Context, name string) error
|
||||
LocalZones func(ctx context.Context) ([]ZoneFile, error)
|
||||
SaveLocalZone func(ctx context.Context, name, content string) error
|
||||
DeleteLocalZone func(ctx context.Context, name string) error
|
||||
AddressOverrides func(ctx context.Context) (any, error)
|
||||
SaveAddressOverride func(ctx context.Context, domain, address string) error
|
||||
DeleteAddressOverride func(ctx context.Context, domain string) error
|
||||
// ListZones returns the compiled local zones with their records and
|
||||
// delegations, and whether the API may rewrite them.
|
||||
ListZones func() (any, error)
|
||||
@@ -290,6 +294,9 @@ func (s *Server) routes(cfg *config.Config) *http.ServeMux {
|
||||
mux.Handle("DELETE "+base+"domains/{name...}", s.authed(s.handleDomainDelete, true))
|
||||
mux.Handle("GET "+base+"domains/check", s.authed(s.handleDomainCheck, false))
|
||||
mux.Handle("POST "+base+"dns/test", s.authed(s.handleDNSTest, false))
|
||||
mux.Handle("GET "+base+"address-overrides", s.authed(s.handleAddressOverrides, false))
|
||||
mux.Handle("PUT "+base+"address-overrides", s.authed(s.handleAddressOverridePut, true))
|
||||
mux.Handle("DELETE "+base+"address-overrides/{domain}", s.authed(s.handleAddressOverrideDelete, true))
|
||||
mux.Handle("GET "+base+"local-zones", s.authed(s.handleLocalZones, false))
|
||||
mux.Handle("PUT "+base+"local-zones/{name}", s.authed(s.handleLocalZonePut, true))
|
||||
mux.Handle("DELETE "+base+"local-zones/{name}", s.authed(s.handleLocalZoneDelete, true))
|
||||
|
||||
Reference in new issue
Block a user