mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
autodns: misc fixes/enh
This commit is contained in:
parent
7ab9889521
commit
c5a835c391
3 changed files with 19 additions and 8 deletions
|
@ -13,7 +13,7 @@ i18n = "domain_config"
|
||||||
[feature]
|
[feature]
|
||||||
|
|
||||||
[feature.mail]
|
[feature.mail]
|
||||||
services = ['postfix', 'dovecot']
|
#services = ['postfix', 'dovecot']
|
||||||
|
|
||||||
[feature.mail.mail_out]
|
[feature.mail.mail_out]
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
@ -23,11 +23,11 @@ i18n = "domain_config"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
default = 1
|
default = 1
|
||||||
|
|
||||||
[feature.mail.backup_mx]
|
#[feature.mail.backup_mx]
|
||||||
type = "tags"
|
#type = "tags"
|
||||||
default = []
|
#default = []
|
||||||
pattern.regexp = '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+((xn--)?[^\W_]{2,})$'
|
#pattern.regexp = '^([^\W_A-Z]+([-]*[^\W_A-Z]+)*\.)+((xn--)?[^\W_]{2,})$'
|
||||||
pattern.error = "pattern_error"
|
#pattern.error = "pattern_error"
|
||||||
|
|
||||||
[feature.xmpp]
|
[feature.xmpp]
|
||||||
|
|
||||||
|
|
|
@ -230,6 +230,8 @@
|
||||||
type = "string"
|
type = "string"
|
||||||
choices.rpc = "RPC"
|
choices.rpc = "RPC"
|
||||||
choices.rest = "REST"
|
choices.rest = "REST"
|
||||||
|
default = "rest"
|
||||||
|
visible = "false"
|
||||||
|
|
||||||
[gehirn]
|
[gehirn]
|
||||||
[gehirn.auth_token]
|
[gehirn.auth_token]
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import hashlib
|
|
||||||
|
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
@ -506,6 +505,15 @@ def _get_registrar_config_section(domain):
|
||||||
"ask": f"YunoHost automatically detected that this domain is handled by the registrar **{registrar}**. If you want, YunoHost will automatically configure this DNS zone, if you provide it with the appropriate API credentials. You can also manually configure your DNS records following the documentation as https://yunohost.org/dns.", # FIXME: i18n
|
"ask": f"YunoHost automatically detected that this domain is handled by the registrar **{registrar}**. If you want, YunoHost will automatically configure this DNS zone, if you provide it with the appropriate API credentials. You can also manually configure your DNS records following the documentation as https://yunohost.org/dns.", # FIXME: i18n
|
||||||
"value": registrar
|
"value": registrar
|
||||||
})
|
})
|
||||||
|
|
||||||
|
TESTED_REGISTRARS = ["ovh", "gandi"]
|
||||||
|
if registrar not in TESTED_REGISTRARS:
|
||||||
|
registrar_infos["experimental_disclaimer"] = OrderedDict({
|
||||||
|
"type": "alert",
|
||||||
|
"style": "danger",
|
||||||
|
"ask": f"So far, the interface with **{registrar}**'s API has not been properly tested and reviewed by the YunoHost's community. Support is **very experimental** - be careful!", # FIXME: i18n
|
||||||
|
})
|
||||||
|
|
||||||
# TODO : add a help tip with the link to the registar's API doc (c.f. Lexicon's README)
|
# TODO : add a help tip with the link to the registar's API doc (c.f. Lexicon's README)
|
||||||
registrar_list = read_toml(DOMAIN_REGISTRAR_LIST_PATH)
|
registrar_list = read_toml(DOMAIN_REGISTRAR_LIST_PATH)
|
||||||
registrar_credentials = registrar_list[registrar]
|
registrar_credentials = registrar_list[registrar]
|
||||||
|
@ -572,6 +580,7 @@ def domain_dns_push(operation_logger, domain, dry_run=False, force=False, purge=
|
||||||
# See https://github.com/AnalogJ/lexicon/issues/282 and https://github.com/AnalogJ/lexicon/pull/371
|
# See https://github.com/AnalogJ/lexicon/issues/282 and https://github.com/AnalogJ/lexicon/pull/371
|
||||||
# They say it's trivial to implement it!
|
# They say it's trivial to implement it!
|
||||||
# And yet, it is still not done/merged
|
# And yet, it is still not done/merged
|
||||||
|
# Update by Aleks: it works - at least with Gandi ?!
|
||||||
#wanted_records = [record for record in wanted_records if record["type"] != "CAA"]
|
#wanted_records = [record for record in wanted_records if record["type"] != "CAA"]
|
||||||
|
|
||||||
if purge:
|
if purge:
|
||||||
|
@ -756,7 +765,7 @@ def domain_dns_push(operation_logger, domain, dry_run=False, force=False, purge=
|
||||||
# If --force ain't used, we won't delete/update records not managed by yunohost
|
# If --force ain't used, we won't delete/update records not managed by yunohost
|
||||||
if not force:
|
if not force:
|
||||||
for action in ["delete", "update"]:
|
for action in ["delete", "update"]:
|
||||||
changes[action] = [r for r in changes[action] if not r["managed_by_yunohost"]]
|
changes[action] = [r for r in changes[action] if r["managed_by_yunohost"]]
|
||||||
|
|
||||||
def progress(info=""):
|
def progress(info=""):
|
||||||
progress.nb += 1
|
progress.nb += 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue