From 18b556a8167655265f4fa7bd3d694ae6a4f525e0 Mon Sep 17 00:00:00 2001 From: Mauricio Teixeira <1847440+badnetmask@users.noreply.github.com> Date: Sat, 20 Nov 2021 19:21:51 -0500 Subject: [PATCH 1/6] - update image to alpine 3.14 - install package 'cargo' on the image (required to build 'cryptography') - update flaskapp.py to add support for additional nsgroup:delegation (required for https://github.com/infobloxopen/infoblox-ansible/pull/56) --- Dockerfile | 4 ++-- flaskapp.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf44deb..a526459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.6 +FROM alpine:3.14 ADD flaskapp.py /root/flaskapp.py ADD requirements.txt /root/requirements.txt -RUN apk add --no-cache build-base openssl-dev libffi-dev python3 python3-dev py3-pip +RUN apk add --no-cache build-base openssl-dev libffi-dev python3 python3-dev py3-pip cargo RUN pip3 install -r /root/requirements.txt EXPOSE 443 CMD /usr/bin/python3 /root/flaskapp.py diff --git a/flaskapp.py b/flaskapp.py index bf1d6e6..4d933b8 100755 --- a/flaskapp.py +++ b/flaskapp.py @@ -56,6 +56,7 @@ class NetworkView(object): grid_primary = None grid_secondaries = None ns_group = None + delegate_to = [] def __init__(self, uid=None, isdefault=False, name=None, viewtype='network', network=None, comment=None): # `ZG5zLm5ldHdvcmskMS4wLjAuMC8yNC8w` == `dns.network$1.0.0.0/24/0` @@ -230,7 +231,8 @@ def to_dict(self, fields=[]): 'zone_format': self.zone_format, 'grid_primary': self.grid_primary, 'grid_secondaries': self.grid_secondaries, - 'ns_group': self.ns_group + 'ns_group': self.ns_group, + 'delegate_to': self.delegate_to } if fields: for x in fields: @@ -266,7 +268,8 @@ def __init__(self): 'record:mx': [], 'record:srv': [], 'record:naptr': [], - 'record:txt': [] + 'record:txt': [], + 'nsgroup:delegation': [], } # ZG5zLm5ldHdvcmtfdmlldyQw == dns.network_view$0 # ZG5zLm5ldHdvcmskZmU4MDo6LzY0LzA == dns.network$fe80::/64 From 12b25a123cc2b611dac56cf7df566440916e7257 Mon Sep 17 00:00:00 2001 From: Mauricio Teixeira <1847440+badnetmask@users.noreply.github.com> Date: Sat, 20 Nov 2021 20:06:25 -0500 Subject: [PATCH 2/6] add more nsgroup objects, required for https://github.com/infobloxopen/infoblox-ansible/pull/56 --- flaskapp.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flaskapp.py b/flaskapp.py index 4d933b8..06c02ee 100755 --- a/flaskapp.py +++ b/flaskapp.py @@ -57,6 +57,9 @@ class NetworkView(object): grid_secondaries = None ns_group = None delegate_to = [] + forwarding_servers = [] + external_servers = [] + stub_members = [] def __init__(self, uid=None, isdefault=False, name=None, viewtype='network', network=None, comment=None): # `ZG5zLm5ldHdvcmskMS4wLjAuMC8yNC8w` == `dns.network$1.0.0.0/24/0` @@ -232,7 +235,10 @@ def to_dict(self, fields=[]): 'grid_primary': self.grid_primary, 'grid_secondaries': self.grid_secondaries, 'ns_group': self.ns_group, - 'delegate_to': self.delegate_to + 'delegate_to': self.delegate_to, + 'forwarding_servers': self.forwarding_servers, + 'external_servers': self.external_servers, + 'stub_members': self.stub_members } if fields: for x in fields: @@ -270,6 +276,9 @@ def __init__(self): 'record:naptr': [], 'record:txt': [], 'nsgroup:delegation': [], + 'nsgroup:forwardingmember': [], + 'nsgroup:forwardstubserver': [], + 'nsgroup:stubmember': [] } # ZG5zLm5ldHdvcmtfdmlldyQw == dns.network_view$0 # ZG5zLm5ldHdvcmskZmU4MDo6LzY0LzA == dns.network$fe80::/64 From f60f1b795653e2685dd52f7aff76de68e5b1a457 Mon Sep 17 00:00:00 2001 From: Mauricio Teixeira <1847440+badnetmask@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:46:20 -0500 Subject: [PATCH 3/6] Update flaskapp.py Co-authored-by: Matt Clay --- flaskapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaskapp.py b/flaskapp.py index 06c02ee..00dc34a 100755 --- a/flaskapp.py +++ b/flaskapp.py @@ -278,7 +278,7 @@ def __init__(self): 'nsgroup:delegation': [], 'nsgroup:forwardingmember': [], 'nsgroup:forwardstubserver': [], - 'nsgroup:stubmember': [] + 'nsgroup:stubmember': [], } # ZG5zLm5ldHdvcmtfdmlldyQw == dns.network_view$0 # ZG5zLm5ldHdvcmskZmU4MDo6LzY0LzA == dns.network$fe80::/64 From 59f78c58e88202c9afd72c77cb8ef407e3fbf591 Mon Sep 17 00:00:00 2001 From: Mauricio Teixeira <1847440+badnetmask@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:46:25 -0500 Subject: [PATCH 4/6] Update Dockerfile Co-authored-by: Matt Clay --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a526459..2155018 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.14 ADD flaskapp.py /root/flaskapp.py ADD requirements.txt /root/requirements.txt -RUN apk add --no-cache build-base openssl-dev libffi-dev python3 python3-dev py3-pip cargo +RUN apk add --no-cache build-base python3 py3-wheel py3-pip py3-cryptography RUN pip3 install -r /root/requirements.txt EXPOSE 443 CMD /usr/bin/python3 /root/flaskapp.py From b4c1372adeeae7dc6f2da49b8033c6c6ed5231f8 Mon Sep 17 00:00:00 2001 From: Mauricio Teixeira <1847440+badnetmask@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:46:39 -0500 Subject: [PATCH 5/6] Update flaskapp.py Co-authored-by: Matt Clay --- flaskapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaskapp.py b/flaskapp.py index 00dc34a..1a02e79 100755 --- a/flaskapp.py +++ b/flaskapp.py @@ -238,7 +238,7 @@ def to_dict(self, fields=[]): 'delegate_to': self.delegate_to, 'forwarding_servers': self.forwarding_servers, 'external_servers': self.external_servers, - 'stub_members': self.stub_members + 'stub_members': self.stub_members, } if fields: for x in fields: From d3ff92d50500a38fd208835682e1e704650c019d Mon Sep 17 00:00:00 2001 From: Mauricio Teixeira <1847440+badnetmask@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:48:09 -0500 Subject: [PATCH 6/6] update Dockerfile to use alpine 3.15 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2155018..a640cf1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.14 +FROM alpine:3.15 ADD flaskapp.py /root/flaskapp.py ADD requirements.txt /root/requirements.txt