aboutsummaryrefslogtreecommitdiff
path: root/backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend.py')
-rw-r--r--backend.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/backend.py b/backend.py
index 79dde40..b0d9588 100644
--- a/backend.py
+++ b/backend.py
@@ -210,5 +210,32 @@ def zola():
return "ok"
[email protected]("/automate/cgit")
+def cgit():
+ result = subprocess.run(
+ [
+ "sh", "-c",
+ "cd /srv/docker/cgit && "
+ "docker compose down && "
+ "docker compose up -d"
+ ],
+ capture_output=True,
+ text=True,
+ )
+
+ if result.returncode != 0:
+ print(result.stdout)
+ print(result.stderr)
+ return "cgit restart failed", 500
+
+ subprocess.Popen([
+ "mpv",
+ "--no-video",
+ "--audio-device=pipewire",
+ "/srv/shares/public/Media/done.mp3",
+ ])
+
+ return "ok"
+
if __name__ == "__main__":
app.run(host="0.0.0.0", port=6732)