29 lines
820 B
Python
29 lines
820 B
Python
#!/usr/bin/env python3
|
|
"""acme-deploy.py — Deploy hook for acme.sh (Vacuum Wall).
|
|
|
|
Called by acme.sh after every successful certificate issue or renewal.
|
|
Reloads nginx via the daemon API so acme.sh never touches sudo directly.
|
|
"""
|
|
|
|
import logging
|
|
import os
|
|
import sys
|
|
|
|
try:
|
|
import requests_unixsocket
|
|
|
|
from daemon.client import post
|
|
from daemon.iface import POST_NGINX_RELOAD
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
project_dir = os.environ.get("INSTALL_DIR", os.path.dirname(os.path.dirname(__file__)))
|
|
socket_path = os.environ.get(
|
|
"VACUUM_WALLD_SOCKET",
|
|
os.path.join(project_dir, "data", "daemon.sock"),
|
|
)
|
|
post(POST_NGINX_RELOAD, socket_path=socket_path)
|
|
sys.exit(0)
|
|
except Exception as exc:
|
|
logging.error("acme-deploy hook failed: %s", exc)
|
|
sys.exit(0)
|