init stacks

This commit is contained in:
tan-docker
2026-03-21 14:12:55 +01:00
commit d3e8da2e25
1919 changed files with 200787 additions and 0 deletions
@@ -0,0 +1,5 @@
from datetime import datetime
def log_alert(message: str):
ts = datetime.now().strftime("%Y-%m-%d %H:%M")
print(f"[ALERTE][{ts}]\n{message}\n")
@@ -0,0 +1,15 @@
import smtplib
from email.message import EmailMessage
import os
def send_mail(body: str):
msg = EmailMessage()
msg["Subject"] = "Alerte Infrastructure"
msg["From"] = os.getenv("SMTP_USER")
msg["To"] = os.getenv("MAIL_TO")
msg.set_content(body)
with smtplib.SMTP(os.getenv("SMTP_HOST"), int(os.getenv("SMTP_PORT"))) as s:
s.starttls()
s.login(os.getenv("SMTP_USER"), os.getenv("SMTP_PASS"))
s.send_message(msg)