Assorted shell and Python scripts

Fix resend_borg_error.py

Changed files
+13 -10
+13 -10
resend_borg_error.py
···
-
#!/usr/bin/env nix-shell
-
#! nix-shell -i python3 --packages python3 python312Packages.resend
+
# /// script
+
# dependencies = [
+
# "resend",
+
# ]
+
# ///
-
import resend
import subprocess
+
from pathlib import Path
-
resend.api_key = subprocess.run(
-
["kwallet-query", "-r", "resend_api_key", "default", "-f", "Passwords"],
-
capture_output=True,
-
text=True,
-
).stdout.strip("\n")
+
import resend
+
+
resend.api_key = (
+
Path("/usr/local/etc/resend_api_key.txt").read_text().strip("\n")
+
)
params: resend.Emails.SendParams = {
-
"from": "Borgmatic <onboarding@resend.dev>",
-
"to": ["hyperreal@fedoraproject.org"],
+
"from": "Borgmatic <admin@hyperreal.coffee>",
+
"to": ["hyperreal@moonshadow.dev"],
"subject": "[moonshadow] Error running Borgmatic",
"text": "There was an error running your Borgmatic backup on moonshadow. Please investigate.",
}