feat: Add DNS provider documentation and enhance provider form with new fields
- Created a comprehensive documentation file for DNS provider types, including RFC 2136, Webhook, and Script providers, detailing their use cases, configurations, and security notes. - Updated the DNSProviderForm component to handle new field types including select and textarea for better user input management. - Enhanced the DNS provider schemas to include new fields for script execution, webhook authentication, and RFC 2136 configurations, improving flexibility and usability.
This commit is contained in:
@@ -216,11 +216,37 @@ export const defaultProviderSchemas: Record<DNSProviderType, Partial<DNSProvider
|
||||
name: 'Custom Script',
|
||||
fields: [
|
||||
{
|
||||
name: 'script_path',
|
||||
label: 'Script Path',
|
||||
name: 'create_script',
|
||||
label: 'Create Record Script',
|
||||
type: 'text',
|
||||
required: true,
|
||||
hint: 'Path to custom DNS update script',
|
||||
placeholder: '/path/to/create-dns.sh',
|
||||
hint: 'Path to script that creates DNS TXT records. Receives DOMAIN, TOKEN, and FQDN as environment variables.',
|
||||
},
|
||||
{
|
||||
name: 'delete_script',
|
||||
label: 'Delete Record Script',
|
||||
type: 'text',
|
||||
required: false,
|
||||
placeholder: '/path/to/delete-dns.sh',
|
||||
hint: 'Path to script that deletes DNS TXT records. If not set, create script is called with DELETE=true.',
|
||||
},
|
||||
{
|
||||
name: 'shell',
|
||||
label: 'Shell',
|
||||
type: 'text',
|
||||
required: false,
|
||||
default: '/bin/sh',
|
||||
placeholder: '/bin/sh',
|
||||
hint: 'Shell to execute scripts with.',
|
||||
},
|
||||
{
|
||||
name: 'env_vars',
|
||||
label: 'Environment Variables',
|
||||
type: 'textarea',
|
||||
required: false,
|
||||
placeholder: 'API_KEY=secret\nAPI_URL=https://api.example.com',
|
||||
hint: 'Additional environment variables to pass to scripts (one per line, KEY=VALUE format).',
|
||||
},
|
||||
],
|
||||
documentation_url: '',
|
||||
@@ -230,10 +256,54 @@ export const defaultProviderSchemas: Record<DNSProviderType, Partial<DNSProvider
|
||||
name: 'Webhook',
|
||||
fields: [
|
||||
{
|
||||
name: 'url',
|
||||
label: 'Webhook URL',
|
||||
name: 'create_url',
|
||||
label: 'Create Record URL',
|
||||
type: 'text',
|
||||
required: true,
|
||||
placeholder: 'https://api.example.com/dns/create',
|
||||
hint: 'HTTP endpoint to call when creating DNS records. Receives JSON payload with domain, token, and fqdn.',
|
||||
},
|
||||
{
|
||||
name: 'delete_url',
|
||||
label: 'Delete Record URL',
|
||||
type: 'text',
|
||||
required: false,
|
||||
placeholder: 'https://api.example.com/dns/delete',
|
||||
hint: 'HTTP endpoint to call when deleting DNS records. If not set, create URL is called with method DELETE.',
|
||||
},
|
||||
{
|
||||
name: 'auth_type',
|
||||
label: 'Authentication Type',
|
||||
type: 'select',
|
||||
required: false,
|
||||
default: 'none',
|
||||
options: [
|
||||
{ value: 'none', label: 'None' },
|
||||
{ value: 'bearer', label: 'Bearer Token' },
|
||||
{ value: 'basic', label: 'Basic Auth' },
|
||||
{ value: 'header', label: 'Custom Header' },
|
||||
],
|
||||
hint: 'Authentication method for webhook requests.',
|
||||
},
|
||||
{
|
||||
name: 'auth_value',
|
||||
label: 'Auth Value',
|
||||
type: 'password',
|
||||
required: false,
|
||||
placeholder: 'Bearer token, user:pass, or header value',
|
||||
hint: 'Authentication value (token, user:password for basic auth, or header value).',
|
||||
},
|
||||
{
|
||||
name: 'insecure_skip_verify',
|
||||
label: 'Skip TLS Verification',
|
||||
type: 'select',
|
||||
required: false,
|
||||
default: 'false',
|
||||
options: [
|
||||
{ value: 'false', label: 'No (Recommended)' },
|
||||
{ value: 'true', label: 'Yes (Insecure)' },
|
||||
],
|
||||
hint: 'Skip TLS certificate verification. Only enable for testing with self-signed certificates.',
|
||||
},
|
||||
],
|
||||
documentation_url: '',
|
||||
@@ -243,22 +313,50 @@ export const defaultProviderSchemas: Record<DNSProviderType, Partial<DNSProvider
|
||||
name: 'RFC2136 (Dynamic DNS)',
|
||||
fields: [
|
||||
{
|
||||
name: 'server',
|
||||
name: 'nameserver',
|
||||
label: 'DNS Server',
|
||||
type: 'text',
|
||||
required: true,
|
||||
placeholder: 'ns1.example.com:53',
|
||||
hint: 'DNS server address with port (e.g., ns1.example.com:53).',
|
||||
},
|
||||
{
|
||||
name: 'key_name',
|
||||
name: 'tsig_key_name',
|
||||
label: 'TSIG Key Name',
|
||||
type: 'text',
|
||||
required: true,
|
||||
placeholder: 'mykey.example.com.',
|
||||
hint: 'TSIG key name (should end with a dot).',
|
||||
},
|
||||
{
|
||||
name: 'key_secret',
|
||||
name: 'tsig_key_secret',
|
||||
label: 'TSIG Key Secret',
|
||||
type: 'password',
|
||||
required: true,
|
||||
hint: 'Base64-encoded TSIG key secret.',
|
||||
},
|
||||
{
|
||||
name: 'tsig_key_algorithm',
|
||||
label: 'TSIG Algorithm',
|
||||
type: 'select',
|
||||
required: true,
|
||||
default: 'hmac-sha256',
|
||||
options: [
|
||||
{ value: 'hmac-md5', label: 'HMAC-MD5 (Legacy)' },
|
||||
{ value: 'hmac-sha1', label: 'HMAC-SHA1' },
|
||||
{ value: 'hmac-sha256', label: 'HMAC-SHA256 (Recommended)' },
|
||||
{ value: 'hmac-sha512', label: 'HMAC-SHA512' },
|
||||
],
|
||||
hint: 'TSIG authentication algorithm. HMAC-SHA256 is recommended.',
|
||||
},
|
||||
{
|
||||
name: 'dns_timeout',
|
||||
label: 'DNS Timeout',
|
||||
type: 'text',
|
||||
required: false,
|
||||
default: '10s',
|
||||
placeholder: '10s',
|
||||
hint: 'Timeout for DNS operations (e.g., 10s, 30s).',
|
||||
},
|
||||
],
|
||||
documentation_url: 'https://tools.ietf.org/html/rfc2136',
|
||||
|
||||
Reference in New Issue
Block a user