Files
sky-cam/sky-cam.conf
T
Claude be5735867e Remove all hardcoded deployment values; read from sky-cam.conf
- sunrise_video.10s.sh: use $TIMEZONE (was hardcoded America/New_York),
  $SUNRISE_PRE_MIN/$SUNRISE_POST_MIN for capture window, $SUNRISE_TARGET_SECS
  for output duration (was wrong value 8 in a script named 10s)
- fullday-video.sh: remove hardcoded FULLDAY_FPS/RETENTION_DAYS; both now
  come from sky-cam.conf
- 4-seasons.sh, montage-mvt.sh: export TIMEZONE after sourcing conf so
  season_info.py subprocess picks it up via env rather than falling back
  to its hardcoded America/New_York default
- sky-cam.conf: add SUNRISE_PRE_MIN, SUNRISE_POST_MIN, SUNRISE_TARGET_SECS,
  FULLDAY_FPS, RETENTION_DAYS

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
2026-04-19 00:14:59 +00:00

136 lines
7.1 KiB
Plaintext

# =============================================================================
# sky-cam.conf — master configuration for all sky-cam scripts
# =============================================================================
#
# This is the ONLY file you need to edit. After editing, run:
#
# ./install.sh # installs systemd timers (no root needed)
# ./install.sh --system # system-wide install (requires sudo)
#
# Re-run install.sh any time this file changes.
#
# -----------------------------------------------------------------------------
# MANUAL SYSTEMD SETUP (if you prefer not to use install.sh)
# -----------------------------------------------------------------------------
# After editing this file, generate the unit files:
#
# mkdir -p ~/.config/systemd/user
# cp systemd/*.service systemd/*.timer ~/.config/systemd/user/
#
# Then edit ExecStart= in each .service file to match your SCRIPT_DIR, then:
#
# systemctl --user daemon-reload
# systemctl --user enable --now sky-cam-sunrise.timer # 09:00 daily
# systemctl --user enable --now sky-cam-4seasons.timer # 01:00 daily
# systemctl --user enable --now sky-cam-fullday.timer # 02:00 daily
#
# Check status:
# systemctl --user list-timers 'sky-cam-*'
# journalctl --user -u sky-cam-4seasons.service -f
#
# System-wide (replace --user with no flag, prepend sudo):
# sudo cp systemd/*.service systemd/*.timer /etc/systemd/system/
# sudo systemctl daemon-reload && sudo systemctl enable --now sky-cam-*.timer
#
# -----------------------------------------------------------------------------
# SCRIPT MAP — what each file does and when it runs
# -----------------------------------------------------------------------------
#
# You run / schedule:
# sunrise_video.10s.sh — daily at 09:00 (via systemd)
# grabs today's sunrise images, makes a 10-second
# video, uploads it to Mattermost
#
# 4-seasons.sh — daily at 01:00 (via systemd)
# makes yesterday's daily clip sized to its share
# of the matching Vivaldi movement's music duration;
# on the last day of a movement, auto-triggers
# montage-mvt.sh
#
# fullday-video.sh — daily at 02:00 (via systemd)
# full-day timelapse at fixed fps; deletes files
# older than 10 days automatically
#
# install.sh — run once at setup, and again if this file changes
# generates and installs systemd units from conf
#
# stitch-cameras.py — run manually when needed
# stitches north + sunrise into a panorama
# usage: python3 stitch-cameras.py north.jpg sunrise.jpg prefix [focal]
#
# Auto-triggered (do not run directly):
# montage-mvt.sh — called by 4-seasons.sh on last day of each movement
# concatenates all daily clips for the movement,
# speed-adjusts to match music, overlays attribution,
# sends completion notification; on last Autumn
# movement also triggers year-end-join.sh
#
# year-end-join.sh — called by montage-mvt.sh at end of Autumn Mvt 3
# concatenates all 12 movement montages into one
# Four Seasons year video, sends notification
#
# Helpers (called by the scripts above, not run directly):
# notify.sh — sends notifications via ntfy / email / Mattermost
# season_info.py — outputs astronomical season/movement/year for a date
# sunrise.py — outputs today's sunrise time (used by sunrise_video)
# sunrise2mm.py — uploads the sunrise video to Mattermost
#
# =============================================================================
# ── Install location ──────────────────────────────────────────────────────────
# Full path to the directory containing this file and all the scripts.
SCRIPT_DIR=/home/motion/drives/local-2tb/sunrise-scripts
# Camera name — subfolder under BASE_DIR (images) and BASE_DIR/movies (videos).
# E.g. "sunrise" → images: $BASE_DIR/sunrise/YYYY-MM-DD/ videos: $BASE_DIR/movies/sunrise/
CAM_NAME=sunrise
# ── Storage ───────────────────────────────────────────────────────────────────
BASE_DIR=/home/motion/drives/local-2tb
MUSIC_DIR=/home/motion/drives/local-2tb/music/4 Seasons
# ── Location & timezone ───────────────────────────────────────────────────────
# Used by sunrise.py to calculate sunrise time each day.
# TIMEZONE must be a valid IANA name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
LATITUDE=38.123456
LONGITUDE=-97.654321
TIMEZONE=America/New_York
# ── Sunrise video tuning ──────────────────────────────────────────────────────
# How many minutes before/after sunrise to include in the daily clip.
SUNRISE_PRE_MIN=70
SUNRISE_POST_MIN=10
# Target duration (seconds) for the speed-adjusted sunrise video.
SUNRISE_TARGET_SECS=10
# ── Full-day timelapse tuning ─────────────────────────────────────────────────
FULLDAY_FPS=5 # frame rate of the timelapse video
RETENTION_DAYS=10 # delete full-day videos older than this many days
# ── Mattermost — daily sunrise upload ─────────────────────────────────────────
mattermost_url=https://your-mattermost-server.example.com
access_token=your-access-token-here
channel_id=your-daily-upload-channel-id-here
# ── Notifications — montage / year-end complete + any job failure ─────────────
# Notifications fire when a movement montage or the year video finishes.
# They also fire automatically via systemd OnFailure= if any daily job fails.
# Enable one or more methods below.
# ntfy — push notifications, zero signup required for self-hosted:
# https://docs.ntfy.sh/install/
# or use the free cloud tier at ntfy.sh (pick any topic name)
NTFY_ENABLED=false
NTFY_URL=https://ntfy.sh/your-topic-here
# Email — requires the 'mail' command on the system (package: mailutils or s-nail).
# For outbound SMTP configure /etc/ssmtp/ssmtp.conf or msmtp.
EMAIL_ENABLED=false
EMAIL_TO=you@example.com
EMAIL_FROM=skycam@localhost
# Mattermost text post — reuses the URL and token above, but posts to this
# channel (can be the same daily channel or a separate private/admin channel).
MM_NOTIFY_ENABLED=false
MM_NOTIFY_CHANNEL_ID=your-notify-channel-id-here