before massive master config update. whith emby address and api calls

This commit is contained in:
2026-04-22 21:59:30 -04:00
parent ce38b9de43
commit 9fb7188db6
+41 -39
View File
@@ -24,11 +24,18 @@
# ── RSYNC ──────────────────────────────────────────────────────────────────────────────────
# RSYNC DEFAULTS Global fallback rsync settings
# REMOTE HEALTH CHECKS Rootfs threshold for pre-flight abort
# DAILY SYNC SHARES Media shares synced by media_shares_sync.sh
# DAILY SYNC SHARES Media shares synced by media_shares_sync.sh (per-host)
# PERSONAL ENCRYPTED SHARES Per-user private shares — ZFS encrypted, synced separately
# RSYNC PROFILE SYSTEM Per-profile overrides (appdata profiles)
#
# ── FAILOVER ───────────────────────────────────────────────────────────────────────────────
# FAILOVER Mutual container failover between two servers
# FAILOVER TEST Simulated outage settings for failover_test.sh
# DDNS Script-controlled DDNS — absolute rules
# INTERNET LOSS Containers to stop when internet is lost
# TIERED CONTAINER LISTS What each server runs for the other per tier
# TIER DELAY SETTINGS How long before each tier activates (minutes)
# RSYNC WRITEBACK JOBS Appdata synced back to primary on handback
#
# ── DOCKER ESSENTIALS ──────────────────────────────────────────────────────────────────────
# DOCKER DAILY RESTART Containers restarted daily
@@ -49,9 +56,11 @@
# MEDIA CLEANER Anime and media folder lists and file patterns
# MEDIA MANAGEMENT Orchestrator job list for media_management.sh
# ARR CLEANUP Lidarr, Sonarr, Radarr orphan file cleanup
# ARR FAILED/STALLED RECOVERY Auto blocklist + re-search failed imports and stalled downloads
#
# ── TRANSCODES ─────────────────────────────────────────────────────────────────────────────
# TRANSCODE MANAGER Ramdisk and SSD fallback transcode management
# TRANSCODE SERVER ARRAY Multi-server session monitoring (Emby, Jellyfin, Plex)
#
# ── MONITORS ───────────────────────────────────────────────────────────────────────────────
# CERTIFICATE MONITOR SSL certificate expiry monitoring
@@ -60,6 +69,8 @@
# ZFS MEMORY SNAPSHOT Weekly ZFS health and memory diagnostic report
# BANDWIDTH MONITOR Daily rsync transfer logging and weekly summary
# HEALTH DIGEST Aggregated system health digest — always/smart/weekly
# CRITICAL SHARES MAINTENANCE Weekly clean sync + container updates (Emby + auth stack)
# EMBY Emby URL and API key — used by multiple scripts
# EMBY SESSION REPORT Weekly Emby usage statistics via API
#
# ── SYSTEM WATCHDOG ────────────────────────────────────────────────────────────────────────
@@ -177,15 +188,15 @@ HOST1_DAILY_SYNC_SHARES=(
/mnt/user/stand-up_comedy
/mnt/user/Sports
/mnt/user/Tv_Shows
/mnt/user/Anime_Shows-Old
/mnt/user/Anime_Movies-Old
)
# HOST2 truth shares — pushed from HOST2 to HOST1 nightly
# HOST2 is source of truth for anime — his arrs manage these shares
HOST2_DAILY_SYNC_SHARES=(
/mnt/user/Anime_Movies
/mnt/user/Anime_Movies-Old
/mnt/user/Anime_Shows
/mnt/user/Anime_Shows-Old
)
# ━━━ Personal Encrypted Shares ━━━
@@ -472,11 +483,11 @@ HOST2_DDNS_CONTAINERS=(
# Own DDNS handled separately above — list additional containers here if needed
# These stop when this server loses internet — regardless of remote state
FAILOVER_HOST1_STOP_ON_NO_NET=(
# "container-name" # add containers that should stop without internet
"Gmer4Lfe.com" # stop when HOST1 loses internet
)
FAILOVER_HOST2_STOP_ON_NO_NET=(
# "container-name"
"Gmer4Lfe.us" # stop when HOST2 loses internet
)
# ━━━ HOST1 runs these for HOST2 when HOST2 goes down ━━━
@@ -515,13 +526,6 @@ FAILOVER_HOST1_RUNS_FOR_HOST2_18HR=(
FAILOVER_HOST2_RUNS_FOR_HOST1_IMMEDIATE=(
"Gmer4Lfe.com" # HOST1's DDNS — start first, covers HOST1's domain
"Emby" # media server — users are actively watching
"NginxProxyManager" # reverse proxy — all services route through this
"Lldap-Gmer4Lfe" # auth directory — required by Authelia
"Mariadb-Authelia" # auth database — required by Authelia
"Redis-Authelia" # auth cache — required by Authelia
"Authelia" # authentication — required for all proxied services
"Authelia-Secondary" # auth redundancy
"Redis-Authelia-Secondary" # auth secondary cache
"VaultWarden-Gmer4Lfe" # password manager — critical, immediate access needed
"Dispatcharr" # Live TV — people are watching, cannot wait
"Dispatcharr-Basic" # Live TV basic profile
@@ -536,18 +540,13 @@ FAILOVER_HOST2_RUNS_FOR_HOST1_2HR=(
"NextCloud" # file access and collaboration
"PostgreSQL_Immich" # Immich database
"Immich-Gmer4Lfe" # photo management
"Jellyseerr" # media request management
# "container-placeholder"
)
# Tier 3 — starts after HOST1_TIER3_DELAY minutes
# Secondary services — useful but not immediately critical
FAILOVER_HOST2_RUNS_FOR_HOST1_6HR=(
"Organizrv2-Gmer4Lfe" # dashboard — nice to have
"AdGuard-Home" # DNS filtering
"UptimeKuma-Gmer4Lfe" # uptime monitoring
"Gitea" # git server
"Collabora-CODE" # document editing for NextCloud
# "container-placeholder"
)
@@ -576,14 +575,14 @@ FAILOVER_HOST2_RUNS_FOR_HOST1_18HR=(
# Adjust based on your tolerance for resource usage on the covering server
# Delays for HOST1's containers running on HOST2 (HOST1 is down)
HOST1_TIER2_DELAY=120 # 2 hours — NextCloud, Immich can wait
HOST1_TIER3_DELAY=360 # 6 hours — dashboard, monitoring, Gitea
HOST1_TIER4_DELAY=1080 # 18 hours — full workflow, arrs and downloaders
HOST1_TIER2_DELAY=240 # 4 hours — NextCloud, Immich can wait
HOST1_TIER3_DELAY=720 # 12 hours — secondary services
HOST1_TIER4_DELAY=1440 # 24 hours — full workflow, arrs and downloaders
# Delays for HOST2's containers running on HOST1 (HOST2 is down)
HOST2_TIER2_DELAY=120
HOST2_TIER3_DELAY=360
HOST2_TIER4_DELAY=1080
HOST2_TIER2_DELAY=240
HOST2_TIER3_DELAY=720
HOST2_TIER4_DELAY=1440
# ━━━ Rsync Writeback Jobs ━━━
# Run during handback — syncs critical appdata back to primary before containers restart.
@@ -630,8 +629,8 @@ HOST2_TIER1_WRITEBACK_DELAY=60 # minutes — skip Tier 1 writeback if outage un
# HOST1 writeback tiers — run by HOST2 during HOST1 handback
FAILOVER_HOST1_WRITEBACK_TIER1=(
"/mnt/user/Media_Server/Emby" # Emby userdata, playstates, metadata
"/mnt/user/appdata-Failover/Critical-Data" # auth stack — Authelia, Mariadb, Redis, LLDAP, NPM
"/mnt/user/Media_Server/Emby" # Emby userdata, playstates, metadata
# "location-placeholder"
)
FAILOVER_HOST1_WRITEBACK_TIER2=(
@@ -639,15 +638,13 @@ FAILOVER_HOST1_WRITEBACK_TIER2=(
)
FAILOVER_HOST1_WRITEBACK_TIER3=(
"/mnt/user/appdata-Failover/Gmer4Lfe" # server specific appdata — Organizr, UptimeKuma
# "location-placeholder"
)
FAILOVER_HOST1_WRITEBACK_TIER4=(
# Edge case paths outside of normal HOST1_DAILY_SYNC_SHARES
# Tier 4 automatically syncs HOST1_DAILY_SYNC_SHARES back — add extras here only
# Examples: a share that exists but isn't in the daily sync list,
# a special appdata path only relevant after extended outage
# "/mnt/user/SomeSpecialShare"
"/mnt/user/appdata-Failover/Arrs_Stack"
)
# HOST2 writeback tiers — run by HOST1 during HOST2 handback
@@ -661,13 +658,13 @@ FAILOVER_HOST2_WRITEBACK_TIER2=(
)
FAILOVER_HOST2_WRITEBACK_TIER3=(
# "/mnt/user/appdata-Failover/Jayred365"
# "location-placeholder"
)
FAILOVER_HOST2_WRITEBACK_TIER4=(
# Edge case paths outside of normal HOST2_DAILY_SYNC_SHARES
# Tier 4 automatically syncs HOST2_DAILY_SYNC_SHARES back — add extras here only
# "/mnt/user/SomeSpecialShare"
"/mnt/user/appdata-Failover/Arrs_Stack"
)
# ==============================================================================================
@@ -818,7 +815,8 @@ NETWORK_CONNECT_CONTAINERS=(
)
NETWORK_CONNECT_NETWORKS=(
"nextcloud-aio" # Docker network name — must exist before array start
"high-availability" # Docker network name — must exist before array start
# containers needing their own network but accessible from main custom network
)
# ==============================================================================================
@@ -1022,7 +1020,7 @@ RADARR_PROTECTED_PATTERNS=("*.jpg" "*.jpeg" "*.png" "*.nfo" "*.srt" "*.sub" "*.a
# ━━━ Arr Import Recovery ━━━
# Automatically blocklists and re-searches failed imports and stalled downloads.
# Runs every 6 hrs
# Runs daily at 5am — by this time overnight downloads are complete and any
# failures have had time to surface. Items under ARR_IMPORT_RECOVERY_AGE are
# skipped — gives the arr time to retry on its own before we intervene.
#
@@ -1040,7 +1038,7 @@ RADARR_PROTECTED_PATTERNS=("*.jpg" "*.jpeg" "*.png" "*.nfo" "*.srt" "*.sub" "*.a
# detect_hosts() selects correct URL and API key per server at runtime
# Lidarr runs on HOST1 only — exits cleanly on HOST2
ARR_IMPORT_RECOVERY_AGE=6 # hours — skip items newer than this, give arr time to retry
ARR_IMPORT_RECOVERY_AGE=12 # hours — skip items newer than this, give arr time to retry
# Per-arr enable/disable
HOST1_SONARR_RECOVERY=true # Tv_Shows import recovery
@@ -1070,13 +1068,13 @@ HOST2_RADARR_RECOVERY=true # Anime_Movies import recovery
# and new sessions land on SSD permanently for that container run.
RAMDISK_PATH="/mnt/ramdisk_transcodes" # tmpfs mount point created at array start
RAMDISK_SIZE="10G" # ceiling — tmpfs only uses RAM actually needed
RAMDISK_SIZE="8G" # ceiling — tmpfs only uses RAM actually needed
TRANSCODE_LINK="/mnt/ram-transcode" # symlink Emby points at — location never changes
TRANSCODE_SSD="/mnt/cache/Temp_Storage/Emby/Transcodes/" # SSD fallback location
# Usage thresholds in GB — hysteresis gap between WARN and LOW prevents flip-flop
RAMDISK_WARN_GB=8.8 # flip symlink to SSD at or above this usage
RAMDISK_LOW_GB=6.5 # flip symlink back to ramdisk when usage drops here
RAMDISK_WARN_GB=6.8 # flip symlink to SSD at or above this usage
RAMDISK_LOW_GB=5.5 # flip symlink back to ramdisk when usage drops here
RAMDISK_SSD_MIN_GB=20 # minimum free GB on SSD required before allowing flip to SSD
# Cleanup age thresholds — files must be older than these AND not open by any process
@@ -1252,10 +1250,12 @@ ZFS_REPORT_IGNORE_POOLS=(
CRITICAL_SYNC_UPDATES=true # pull container updates locally during maintenance
CRITICAL_SYNC_UPDATES_REMOTE=true # pull container updates on remote via SSH
# ━━━ Emby Session Report ━━━
# No persistent writes — queries fresh each run.
# ━━━ Emby ━━━
# Emby URL and API key used by multiple scripts:
# transcode_manager.sh, emby_session_report.sh, emby_database_repair.sh
# Each server has its own Emby instance with its own API key.
# detect_hosts() selects the correct URL and key at runtime.
# API key found in Emby Dashboard → API Keys → + New Key
HOST1_EMBY_URL="http://localhost:8096"
HOST1_EMBY_API_KEY="0c27448d93a7431f9ac63569f7655829"
@@ -1263,6 +1263,8 @@ HOST1_EMBY_API_KEY="0c27448d93a7431f9ac63569f7655829"
HOST2_EMBY_URL="http://localhost:8096" # same port — different server, different key
HOST2_EMBY_API_KEY="your-host2-emby-api-key"
# ━━━ Emby Session Report ━━━
# No persistent writes — queries fresh each run.
EMBY_REPORT_DAYS=7 # number of days to include in the report period
EMBY_REPORT_TOP_N=10 # number of top content items to show in report