fix in deploy

This commit is contained in:
Mateusz Gruszczyński 2025-03-07 08:51:06 +01:00
parent aa0a0a0025
commit 0b3bf4a654

5
app.py
View File

@ -1182,7 +1182,7 @@ def deploy_user(user_id):
wrapped_content = wrap_content_with_comments(adjusted_content)
url = h.daemon_url.rstrip('/') + '/hosts'
headers = {"Authorization": h.daemon_token}
resp = requests.post(url, json={"hosts": wrapped_content}, headers=headers, timeout=10)
resp = requests.post(url, json={"hosts": wrapped_content}, headers=headers, timeout=10, verify=False)
if resp.status_code != 200:
raise Exception(f"Daemon POST error: {resp.status_code} - {resp.text}")
@ -1212,6 +1212,8 @@ def deploy_user(user_id):
except Exception as e:
db.session.add(DeployLog(
details=f'Failed to update {h.hostname}: {str(e)} for user {user_id}'
user_id=user_id
))
db.session.commit()
@ -1295,6 +1297,7 @@ def dashboard():
stats = get_statistics(user_id)
for log in logs:
log.details = log.details.replace(f" for user {user_id}", "")
#pass
return render_template('dashboard.html', user=user, logs=logs, stats=stats)