mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-11-21 04:23:15 +01:00
23 lines
851 B
Python
23 lines
851 B
Python
from django.utils.translation import gettext_lazy as _
|
|||
|
|
|
||
|
|
# Every provider listed here must also be compiled into the Caddy image
|
||
|
|
# (see containers/caddy/Dockerfile-caddy). Field names must match the
|
||
|
|
# subdirectives accepted by the provider's Caddy DNS module, and the optional
|
||
|
|
# pattern should mirror the module's own validation, since an invalid value
|
||
|
|
# prevents Caddy from loading the configuration.
|
||
|
|
DNS_PROVIDERS = {
|
||
|
|
'cloudflare': {
|
||
|
|
'label': 'Cloudflare',
|
||
|
|
'fields': [
|
||
|
|
{
|
||
|
|
'name': 'api_token',
|
||
|
|
'label': _('API Token'),
|
||
|
|
'secret': True,
|
||
|
|
'pattern': r'^(cf(ut|at)_[A-Za-z0-9_-]{32,256}|[A-Za-z0-9_-]{35,50})$',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
}
|
||
|
|
|
||
|
|
DNS_PROVIDER_CHOICES = [(provider, provider_data['label']) for provider, provider_data in DNS_PROVIDERS.items()]
|