From: Pieter Lexis Date: Mon, 9 Nov 2020 16:35:25 +0000 (+0100) Subject: startup.py: stop using tabs X-Git-Tag: dnsdist-1.6.0-alpha0~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=654b1265511e41d15e71f7484c2b63d31ea65848;p=thirdparty%2Fpdns.git startup.py: stop using tabs --- diff --git a/dockerdata/startup.py b/dockerdata/startup.py index 8f21433aac..47685b3879 100755 --- a/dockerdata/startup.py +++ b/dockerdata/startup.py @@ -11,40 +11,40 @@ apiconftemplate = None args = [] if product == 'pdns_recursor': - args = ['--disable-syslog'] - apiconffile = '/etc/powerdns-api.conf' - apienvvar = 'PDNS_RECURSOR_API_KEY' - apiconftemplate = """webserver + args = ['--disable-syslog'] + apiconffile = '/etc/powerdns-api.conf' + apienvvar = 'PDNS_RECURSOR_API_KEY' + apiconftemplate = """webserver api-key={apikey} webserver-address=0.0.0.0 webserver-allow-from=0.0.0.0/0 webserver-password={apikey} -""" + """ elif product == 'pdns_server': - args = ['--disable-syslog'] - apiconffile = '/etc/powerdns-api.conf' - apienvvar = 'PDNS_AUTH_API_KEY' - apiconftemplate = """webserver + args = ['--disable-syslog'] + apiconffile = '/etc/powerdns-api.conf' + apienvvar = 'PDNS_AUTH_API_KEY' + apiconftemplate = """webserver api api-key={apikey} webserver-address=0.0.0.0 webserver-allow-from=0.0.0.0/0 webserver-password={apikey} -""" + """ elif product == 'dnsdist': - args = ['--supervised', '--disable-syslog'] - apiconffile = '/etc/dnsdist-api.conf' - apienvvar = 'DNSDIST_API_KEY' - apiconftemplate = """webserver("0.0.0.0:8083", '{apikey}', '{apikey}', {{}}, '0.0.0.0/0') + args = ['--supervised', '--disable-syslog'] + apiconffile = '/etc/dnsdist-api.conf' + apienvvar = 'DNSDIST_API_KEY' + apiconftemplate = """webserver("0.0.0.0:8083", '{apikey}', '{apikey}', {{}}, '0.0.0.0/0') controlSocket('0.0.0.0:5199') setKey('{apikey}') setConsoleACL('0.0.0.0/0') -""" + """ apikey = os.getenv(apienvvar) print("apikey=", apikey) if apikey is not None: - with open(apiconffile, 'w') as conf: - conf.write(apiconftemplate.format(apikey=apikey)) + with open(apiconffile, 'w') as conf: + conf.write(apiconftemplate.format(apikey=apikey)) os.execv(program, [program]+args+sys.argv[1:])