integrations - acme without shared folder when using k8s/swarm

This commit is contained in:
bunkerity
2021-10-12 16:58:13 +02:00
parent 00d91dcaaa
commit 4e45fa3874
8 changed files with 30 additions and 26 deletions

View File

@@ -4,7 +4,7 @@ import os, socket, sys, stat
VALIDATION = os.getenv("CERTBOT_VALIDATION", None)
TOKEN = os.getenv("CERTBOT_TOKEN", None)
if VALIDATION == None or TOKEN = None :
if VALIDATION == None or TOKEN == None :
sys.exit(1)
try :
@@ -17,18 +17,10 @@ try :
if os.path.exists("/tmp/autoconf.sock") and stat.S_ISSOCK(os.stat("/tmp/autoconf.sock").st_mode) :
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect("/tmp/autoconf.sock")
sock.sendall(b"lock")
data = sock.recv(512)
if data != b"ok" :
raise Exception("can't lock")
sock.sendall(b"acme")
data = sock.recv(512)
if data != b"ok" :
raise Exception("can't acme")
sock.sendall(b"unlock")
data = sock.recv(512)
if data != b"ok" :
raise Exception("can't unlock")
sock.sendall(b"close")
except :
sys.exit(3)