From 9d9a3639e186734e0650a8bec5bc2a7033295cc9 Mon Sep 17 00:00:00 2001 From: Simonmicro Date: Wed, 8 Jul 2020 22:45:44 +0200 Subject: [PATCH] Added IPv6 support (#73) * Added IPv6 support * Updated docker images to IPv6 usage * Reverted commented entry point from testing. Sry. --- docker/docker-py3-kms-minimal/Dockerfile | 2 +- docker/docker-py3-kms/Dockerfile | 6 +++--- py-kms/pykms_Server.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/docker-py3-kms-minimal/Dockerfile b/docker/docker-py3-kms-minimal/Dockerfile index 0080f37..e34ebf7 100644 --- a/docker/docker-py3-kms-minimal/Dockerfile +++ b/docker/docker-py3-kms-minimal/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.8 -ENV IP 0.0.0.0 +ENV IP :: ENV PORT 1688 ENV EPID "" ENV LCID 1033 diff --git a/docker/docker-py3-kms/Dockerfile b/docker/docker-py3-kms/Dockerfile index 607460e..138003f 100644 --- a/docker/docker-py3-kms/Dockerfile +++ b/docker/docker-py3-kms/Dockerfile @@ -9,8 +9,8 @@ FROM alpine:3.8 # EN: IP-address # RU: IP-адрес -ENV IP 0.0.0.0 -# The IP address to listen on. The default is "0.0.0.0" (all interfaces). +ENV IP :: +# The IP address to listen on. The default is "::" (all interfaces). # EN: TCP-port # RU: TCP-порт @@ -115,4 +115,4 @@ WORKDIR /home/py-kms EXPOSE ${PORT}/tcp # Entry point -ENTRYPOINT ["/usr/bin/start.sh"] \ No newline at end of file +ENTRYPOINT ["/usr/bin/start.sh"] diff --git a/py-kms/pykms_Server.py b/py-kms/pykms_Server.py index af99091..694bdbd 100755 --- a/py-kms/pykms_Server.py +++ b/py-kms/pykms_Server.py @@ -36,6 +36,7 @@ class KeyServer(socketserver.ThreadingMixIn, socketserver.TCPServer): allow_reuse_address = True def __init__(self, server_address, RequestHandlerClass): + self.address_family = socket.AF_INET6 # This call make sure the server creates an IPv6 socket and NOT an IPv4 by default socketserver.TCPServer.__init__(self, server_address, RequestHandlerClass) self.__shutdown_request = False self.r_service, self.w_service = os.pipe()