Consolidate config into sky-cam.conf; systemd failure notifications
sky-cam.conf (new) - Single file replaces mattermost_config.txt reference, notify_config.txt, and the hardcoded BASE_DIR/MUSIC_DIR/TIMEZONE scattered across scripts - Bash-sourceable and Python key=value readable (same format) All .sh scripts - source sky-cam.conf at startup; BASE_DIR / MUSIC_DIR from config sunrise2mm.py - Reads sky-cam.conf relative to script location; no hardcoded path notify.sh - Sources sky-cam.conf; Mattermost credentials come from there directly, no separate mattermost_config.txt lookup needed systemd/sky-cam-notify-failure@.service (new) - Template unit called by OnFailure= in each service - Sends notification via notify.sh when any sky-cam job fails - All three .service units now have OnFailure=sky-cam-notify-failure@%n.service Removed: notify_config.txt, sky-cam.crontab (superseded) https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
+5
-2
@@ -2,8 +2,11 @@ import requests
|
||||
import os
|
||||
from datetime import datetime
|
||||
|
||||
# Configuration file path (update the path to where your mattermost_config.txt is located)
|
||||
config_file_path = '/home/motion/drives/local-2tb/sunrise-scripts/mattermost_config.txt'
|
||||
import pathlib
|
||||
|
||||
# Locate sky-cam.conf next to this script (works regardless of cwd).
|
||||
_here = pathlib.Path(__file__).resolve().parent
|
||||
config_file_path = str(_here / 'sky-cam.conf')
|
||||
|
||||
# Function to read configuration from the config file
|
||||
def read_config(config_file_path):
|
||||
|
||||
Reference in New Issue
Block a user