mirror of
https://codeberg.org/hyperreal/bin
synced 2025-01-18 08:13:44 +01:00
Fix resend_borg_error.py
This commit is contained in:
parent
532359f356
commit
91fa93f2cc
@ -1,18 +1,21 @@
|
|||||||
#!/usr/bin/env nix-shell
|
# /// script
|
||||||
#! nix-shell -i python3 --packages python3 python312Packages.resend
|
# dependencies = [
|
||||||
|
# "resend",
|
||||||
|
# ]
|
||||||
|
# ///
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import resend
|
import resend
|
||||||
import subprocess
|
|
||||||
|
|
||||||
resend.api_key = subprocess.run(
|
resend.api_key = (
|
||||||
["kwallet-query", "-r", "resend_api_key", "default", "-f", "Passwords"],
|
Path("/usr/local/etc/resend_api_key.txt").read_text().strip("\n")
|
||||||
capture_output=True,
|
)
|
||||||
text=True,
|
|
||||||
).stdout.strip("\n")
|
|
||||||
|
|
||||||
params: resend.Emails.SendParams = {
|
params: resend.Emails.SendParams = {
|
||||||
"from": "Borgmatic <onboarding@resend.dev>",
|
"from": "Borgmatic <admin@hyperreal.coffee>",
|
||||||
"to": ["hyperreal@fedoraproject.org"],
|
"to": ["hyperreal@moonshadow.dev"],
|
||||||
"subject": "[moonshadow] Error running Borgmatic",
|
"subject": "[moonshadow] Error running Borgmatic",
|
||||||
"text": "There was an error running your Borgmatic backup on moonshadow. Please investigate.",
|
"text": "There was an error running your Borgmatic backup on moonshadow. Please investigate.",
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user