From 52169f698c783e9e057b0be9df2cc0cdb47e72b5 Mon Sep 17 00:00:00 2001 From: Dominik Fahr Date: Mon, 12 Dec 2022 17:30:42 +0100 Subject: [PATCH 1/3] undo of commit a7f55de did not fix issue #1261 leaded into issue #1321 --- powerdnsadmin/lib/utils.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/powerdnsadmin/lib/utils.py b/powerdnsadmin/lib/utils.py index 5a62ee3..9e7cf20 100644 --- a/powerdnsadmin/lib/utils.py +++ b/powerdnsadmin/lib/utils.py @@ -119,16 +119,12 @@ def fetch_json(remote_url, def display_record_name(data): - # Check that the data argument is a tuple containing two elements - if isinstance(data, Iterable) and len(data) == 2: - record_name, domain_name = data - if record_name == domain_name: - return '@' - else: - return record_name + record_name, domain_name = data + if record_name == domain_name: + return '@' else: - # If data is not a tuple of length 2, return an empty string - return '' + return re.sub('\.{}$'.format(domain_name), '', record_name) + def display_master_name(data): """ From 97a79645b00d1d425f810e1b56b6cb721d81746b Mon Sep 17 00:00:00 2001 From: Dominik Fahr Date: Mon, 12 Dec 2022 17:31:32 +0100 Subject: [PATCH 2/3] fix of issue #1261 split record by "." idna.encode leads into full stop if the string starts with "_" or "-" --- powerdnsadmin/lib/utils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/powerdnsadmin/lib/utils.py b/powerdnsadmin/lib/utils.py index 9e7cf20..9a528dd 100644 --- a/powerdnsadmin/lib/utils.py +++ b/powerdnsadmin/lib/utils.py @@ -258,18 +258,24 @@ def pretty_domain_name(value): raise Exception('Require the Punycode in string format') def to_idna(value, action): - splits = value.split() + splits = value.split('.') result = [] if action == 'encode': for split in splits: try: # Try encoding to idna - result.append(idna.encode(split).decode()) + if not split.startswith('_') and not split.startswith('-'): + result.append(idna.encode(split).decode()) + else: + result.append(split) except idna.IDNAError: result.append(split) elif action == 'decode': for split in splits: - result.append(idna.decode(split)) + if not split.startswith('_') and not split.startswith('--'): + result.append(idna.decode(split)) + else: + result.append(split) else: raise Exception('No valid action received') - return ' '.join(result) + return '.'.join(result) From 650ea7660b6e1eb7f9f64c7d32cc54a502815d40 Mon Sep 17 00:00:00 2001 From: Dominik Fahr Date: Mon, 12 Dec 2022 19:24:46 +0100 Subject: [PATCH 3/3] updated image docker-compose.yml & deployment.yml Docker Hub Repository Moved! #1317 --- deploy/kubernetes/deployment.yml | 2 +- docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/kubernetes/deployment.yml b/deploy/kubernetes/deployment.yml index 1e5fea5..d3e4cfe 100644 --- a/deploy/kubernetes/deployment.yml +++ b/deploy/kubernetes/deployment.yml @@ -18,7 +18,7 @@ spec: spec: containers: - name: powerdnsadmin - image: ngoduykhanh/powerdns-admin + image: powerdnsadmin/pda-legacy ports: - containerPort: 80 protocol: TCP diff --git a/docker-compose.yml b/docker-compose.yml index e18d683..0f569c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: app: - image: ngoduykhanh/powerdns-admin:latest + image: powerdnsadmin/pda-legacy:latest container_name: powerdns_admin ports: - "9191:80"