feat: auto-manage external DNS records (Selectel) on proxy-host changes#5702
Open
vasyakrg wants to merge 30 commits into
Open
feat: auto-manage external DNS records (Selectel) on proxy-host changes#5702vasyakrg wants to merge 30 commits into
vasyakrg wants to merge 30 commits into
Conversation
Дизайн авто-управления DNS-записями при create/update/delete proxy-host через внешнего провайдера. Первый драйвер — Selectel DNS v2 API. Также добавлен CLAUDE.md (init). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Пошаговый TDD-план на 17 задач (9 фаз): backend vitest-инфра, миграция, модель, permissions, Selectel-драйвер, оркестрация записей, CRUD+API, хуки в proxy-host, frontend UI, e2e. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Mirrors access_list.js: HasOne owner, HasMany proxy_hosts, bool-field conversion for is_deleted. Wires dns_provider HasOne on ProxyHost and adds it to defaultAllowGraph.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Adds dns-provider-object/list components and per-method path files
for GET/POST /nginx/dns-providers, GET/PUT/DELETE
/nginx/dns-providers/{providerID}, and GET .../test, registered in
swagger.json. Schema-only; Task 12 routes will consume these via
getValidationSchema().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Adds /nginx/dns-providers REST endpoints (GET/POST collection, GET/PUT/DELETE/test item) mirroring access-lists, wired to internal/dns-provider.js and mounted in main.js.
Wire internalDnsRecord.sync/cleanup into the proxy-host create, update, and delete flows, and accept dns_provider_id in the POST/PUT schemas. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Adds the thin API-client wrappers (get/getAll/create/update/delete/test) and DnsProvider/DnsProviderCredentials types under frontend/src/api/backend, mirroring the AccessList client pattern. UI lands in a follow-up task. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Add the admin-only DNS Providers management UI: list page under /dns-providers (name/type/default IP/status columns, edit/delete), create/edit modal with Test connection, nav entry, and i18n keys. Consumes Task 14's api-client as-is; credentials are write-only so edit submits omit them unless the user actually types new values. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
Adds a DnsProviderField (mirrors AccessField/SSLCertificateField's react-select + Field pattern) to ProxyHostModal so a proxy host can be attached to a DNS Provider entity, plus a small badge showing meta.dnsSynced/meta.dnsErr sync status. dnsProviderId flows through the existing unfiltered Formik submit payload to dns_provider_id via humps.
…ision with certbot providers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
… status persistence
- selectel.js: Keystone auth host was cloud.api.selectel.ru (nonexistent) →
cloud.api.selcloud.ru per Selectel IAM docs. This is why sync/testConnection
failed even with valid credentials (DNS resolution failure, not auth).
- dns-provider.js: test() now persists {last_check_ok,last_check_error} into
provider.meta so the list Status column reflects the last connection check.
- DnsProviderModal: invalidate the providers list after Test connection so the
status updates immediately.
- EventFormatter: recognise "dns-provider" object type (name value + IconWorld)
instead of "UNKNOWN EVENT TYPE".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E7Yo1WeiFmKfEFJUmZWzRk
feat: auto-manage external DNS records (Selectel) on proxy-host changes
|
CI Error: |
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.
Base: develop ← Head: feature/dns-provider-integration
Body:
What
Adds a DNS Provider entity so that creating/updating/deleting a proxy host
automatically creates/syncs/deletes the matching DNS
Arecord in an externalprovider. First (and currently only) driver: Selectel DNS v2.
Previously you had to point a domain at the server manually before adding a
proxy host. Now NPM can do it for you.
How it works
Arecorddomain → default_ip, and records the result in the host'smeta.DNS failures never block the host operation — they surface as a status.
Provider credentials are admin-only, write-only (never returned by the
API), and omitted from audit logs.
Examples
Register a provider:
Test the connection:
Attach to a proxy host (existing endpoint, new optional field):
On failure the host is still created; status is exposed via
meta:UI: new DNS Providers admin page (list + modal with Test connection), plus
a DNS Provider selector and sync-status badge on the proxy-host form.
Scope
Testing
record sync/cleanup diff). vitest added to the backend package.
test/cypress/e2e/api/DnsProviders.cy.js.Follow-ups (non-blocking)
sync()discards partial progress on mid-batch multi-domain failure (possibleorphaned rrset) — narrow, surfaced via
dns_err.proxy-host-object.json/ GETexpandenum not yet documenting the new fields.