auto_deploy: use HTTP to avoid SSL on NAS

This commit is contained in:
2026-05-25 08:26:10 +08:00
parent 71dd9d7e8f
commit b70d814b6d
+3 -1
View File
@@ -31,7 +31,9 @@ logger = logging.getLogger('auto_deploy')
def get_remote_head(repo_url, branch): def get_remote_head(repo_url, branch):
"""Fetch the latest commit hash from Gitea API.""" """Fetch the latest commit hash from Gitea API."""
# repo_url like: https://www.1415243231.top:8418/panda/daily_publish # repo_url like: https://www.1415243231.top:8418/panda/daily_publish
api_url = f"{repo_url}/raw/commit/{branch}" # Use HTTP to avoid SSL issues on NAS
http_url = repo_url.replace('https://', 'http://')
api_url = f"{http_url}/raw/commit/{branch}"
try: try:
req = urllib.request.Request(api_url, headers={'User-Agent': 'auto-deploy'}) req = urllib.request.Request(api_url, headers={'User-Agent': 'auto-deploy'})
with urllib.request.urlopen(req, timeout=10) as resp: with urllib.request.urlopen(req, timeout=10) as resp: