commit
cb847f8b8f
6
main.py
6
main.py
@ -35,7 +35,7 @@ def update_host(host: str) -> bool:
|
|||||||
print("Not correct node")
|
print("Not correct node")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
gen_command = f"docker exec -it {container_name} certbot --nginx --email emmtvv@gmail.com --agree-tos -d \"{host}\""
|
gen_command = f"docker exec {container_name} certbot --nginx --email emmtvv@gmail.com --agree-tos -d \"{host}\""
|
||||||
print(gen_command)
|
print(gen_command)
|
||||||
|
|
||||||
gen_cert = call(gen_command)
|
gen_cert = call(gen_command)
|
||||||
@ -43,12 +43,12 @@ def update_host(host: str) -> bool:
|
|||||||
print(f"failed generating certificate: {gen_cert.err}")
|
print(f"failed generating certificate: {gen_cert.err}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
fullchain_command = call(f"docker exec -it {container_name} cat /etc/letsencrypt/live/{host}/fullchain.pem")
|
fullchain_command = call(f"docker exec {container_name} cat /etc/letsencrypt/live/{host}/fullchain.pem")
|
||||||
if fullchain_command.code != 0:
|
if fullchain_command.code != 0:
|
||||||
print(f"failed getting fullchain: {fullchain_command.err}")
|
print(f"failed getting fullchain: {fullchain_command.err}")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
privkey_command = call(f"docker exec -it {container_name} cat /etc/letsencrypt/live/{host}/privkey.pem")
|
privkey_command = call(f"docker exec {container_name} cat /etc/letsencrypt/live/{host}/privkey.pem")
|
||||||
if privkey_command.code != 0:
|
if privkey_command.code != 0:
|
||||||
print(f"failed getting fullchain: {privkey_command.err}")
|
print(f"failed getting fullchain: {privkey_command.err}")
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user