adding docker essentials. and finished unraid essentails

This commit is contained in:
2026-04-08 21:35:49 -04:00
parent 9a7a28055f
commit ae0054fd85
3 changed files with 378 additions and 40 deletions
+70 -39
View File
@@ -2,7 +2,7 @@
# ----------------------------------------------------------------------------------------------
# ---------------------------- Master Variables for unRAID scripts -----------------------------
# ----------------------------------------------------------------------------------------------
# ━━━ Host Configuration ━━━
# List the Hostnames of both servers
HOST1="unRAID-Gmer4Lfe"
@@ -11,16 +11,16 @@
# Must have its key added to HOST1_SSH_Key same applies for HOST2
HOST1_SSH_KEY="/root/.ssh/Gmer4Lfe-rsync-key"
HOST2_SSH_KEY="/root/.ssh/Jayred365-rsync-key"
# ━━━ Logging ━━━
ENABLE_LOGGING=true # false = only echo user-facing messages
# ━━━ Git, Pull & Execute Script ━━━
REPO_SSH="git@192.168.50.2:FailedProxy/Unraid_Scripts.git"
TARGET_DIR="/mnt/user/appdata/unraid_scripts"
GITEA_SSH_KEY="/root/.ssh/id_gitea_rsync"
SSH_PORT=221
REPO_SSH="git@192.168.50.2:FailedProxy/Unraid_Scripts.git"
TARGET_DIR="/mnt/user/appdata/unraid_scripts"
GITEA_SSH_KEY="/root/.ssh/id_gitea_rsync"
SSH_PORT=221
# ━━━ Rsync Script Defaults ━━━
# These are the fallback values used when no matching profile is found.
# Any share whose directory basename does not match a profile key below
@@ -39,38 +39,34 @@
# Directories to exclude during transfer
EXCLUDE_DIRS=()
# Default global rsync options
DEFAULT_RSYNC_OPTS=(-av --info=progress2 --human-readable --bwlimit="$BW_LIMIT" --inplace --no-whole-file)
DEFAULT_RSYNC_OPTS=(-av --info=progress2 --human-readable --bwlimit="$BW_LIMIT" --delete --inplace --no-whole-file)
# ━━━ Remote Health Checks ━━━
# Abort if remote rootfs usage is at or above this percentage.
# Protects against rsync writing to rootfs when the remote array is down or drives are missing.
# Recommended: 75 — gives headroom before the server becomes unstable
ROOTFS_WARN=75
# ━━━ Daily Sync Shares ━━━
# Shares synced once daily by Orchestrators/daily_sync.sh
# Add or remove paths here to manage what gets synced.
# These shares have no profile entry and fall through to DEFAULT_RSYNC_OPTS above.
DAILY_SYNC_SHARES=(
/mnt/user/Anime_Movies-Old
/mnt/user/Anime_Shows-Old
/mnt/user/Anime_Shows
/mnt/user/appdata-Failover/Gmer4Lfe/
/mnt/user/Intros
/mnt/user/Kids_Movies
/mnt/user/Kids_Tv_Shows
/mnt/user/Movies
/mnt/user/Music-New
/mnt/user/Music_Videos
/mnt/user/Nextcloud
/mnt/user/stand-up_comedy
/mnt/user/Tv_Shows
DAILY_SYNC_SHARES=(
/mnt/user/Anime_Movies-Old
/mnt/user/Anime_Shows-Old
/mnt/user/Anime_Shows
/mnt/user/Books
/mnt/user/Intros
/mnt/user/Kids_Movies
/mnt/user/Kids_Tv_Shows
/mnt/user/Movies
/mnt/user/Music_Videos
/mnt/user/Nextcloud
/mnt/user/stand-up_comedy
/mnt/user/Tv_Shows
)
# ━━━ unRAID Essential Scripts ━━━
# clear_logs.sh system log file paths
LOG_FILES=(/var/log/syslog /var/log/messages /var/log/dmesg)
# unRAID reboot script user warning time (seconds)
REBOOT_SLEEP=300
# unRAID mover stop script timeout (seconds)
@@ -81,7 +77,42 @@
PHP_CONF="/etc/php-fpm.d/www.conf"
# php_fpm_max_children.sh max children value
PHP_MAX_CHILDREN=250
# clear_logs.sh system log file paths
LOG_FILES=(/var/log/syslog /var/log/messages /var/log/dmesg)
# ━━━ Docker Watchdog ━━━
# Containers to monitor with their memory hard limits in MB
# 20GB=20480 16GB=16384 14GB=14336 12GB=12288 10GB=10240 8GB=8192 6GB=6144 4GB=4096 1GB=1024
declare -A WATCHDOG_CONTAINERS=(
["Emby"]=16384
["jellyfin_with_request"]=12288
["LidaTube"]=6144
["Tdarr"]=6144
["Code-Server"]=1024
)
# Containers to check for HTTP responsiveness — omit a container to skip its check
declare -A WATCHDOG_CONTAINER_URLS=(
["Emby"]="http://localhost:8096"
["Jellyfin-Gmer4Lfe"]="http://localhost:8095"
)
# State file for tracking CPU and responsiveness strikes between runs
# Lives in /tmp — resets on reboot which is correct behaviour for strike tracking
WATCHDOG_STATE_FILE="/tmp/container_watchdog_state.db"
# CPU thresholds — normalised against total core count automatically at runtime
SOFT_CPU_THRESHOLD=80 # warn at this % of total system CPU
HARD_CPU_THRESHOLD=85 # strike at this % of total system CPU
CPU_FAIL_LIMIT=2 # consecutive strikes before restart
# Memory threshold
SOFT_MEM_THRESHOLD=80 # warn at this % of per-container hard limit
# Responsiveness check settings
RESP_FAIL_LIMIT=2 # consecutive failures before restart
CURL_TIMEOUT=5 # seconds before curl gives up
# ━━━ Profile System ━━━
# Profiles are matched by directory basename (lowercased).
# Example: /mnt/user/appdata-Failover/Arrs_Stack → profile key = arrs_stack
@@ -98,7 +129,7 @@
#
# Note: PROFILE_RSYNC_OPTS does NOT inherit from DEFAULT_RSYNC_OPTS —
# if you define it for a profile you must list all desired options explicitly
# SPACE-SEPARATED STRINGS
declare -A PROFILE_RSYNC_OPTS=(
[arrs_stack]="-av --info=progress2 --human-readable --bwlimit=$BW_LIMIT --delete --inplace"
@@ -107,7 +138,7 @@ declare -A PROFILE_RSYNC_OPTS=(
[important-data]="-av --human-readable --bwlimit=$BW_LIMIT"
[emby]="-av --human-readable --bwlimit=$BW_LIMIT"
)
declare -A PROFILE_BW_LIMIT=(
[arrs_stack]=5000
[critical-data]=9500
@@ -115,7 +146,7 @@ declare -A PROFILE_BW_LIMIT=(
[important-data]=9500
[emby]=8000
)
declare -A PROFILE_RETRY_COUNT=(
[arrs_stack]=3
[critical-data]=3
@@ -123,7 +154,7 @@ declare -A PROFILE_RETRY_COUNT=(
[important-data]=3
[emby]=3
)
declare -A PROFILE_SLEEP=(
[arrs_stack]=300
[critical-data]=300
@@ -131,7 +162,7 @@ declare -A PROFILE_SLEEP=(
[important-data]=300
[emby]=300
)
# SPACE-SEPARATED STRINGS
declare -A PROFILE_CRITICAL_CONTAINER_NAMES=(
[arrs_stack]="Sonarr Lidarr Readarr Radarr Prowlarr Bazarr Pinchflat"
@@ -140,7 +171,7 @@ declare -A PROFILE_CRITICAL_CONTAINER_NAMES=(
[important-data]="Postgres-NextCloud NextCloud"
[emby]=""
)
# SPACE-SEPARATED STRINGS — containers that need a delay before starting
declare -A PROFILE_DELAYED_CONTAINERS=(
[arrs_stack]=""
@@ -149,7 +180,7 @@ declare -A PROFILE_DELAYED_CONTAINERS=(
[important-data]="NextCloud"
[emby]=""
)
declare -A PROFILE_CONTAINER_DELAY=(
[arrs_stack]=5
[critical-data]=10
@@ -157,7 +188,7 @@ declare -A PROFILE_CONTAINER_DELAY=(
[important-data]=10
[emby]=5
)
# SPACE-SEPARATED STRINGS
declare -A PROFILE_EXCLUDE_DIRS=(
[arrs_stack]="logs *.tmp"
@@ -168,4 +199,4 @@ declare -A PROFILE_EXCLUDE_DIRS=(
)
# ----------------------------------------------------------------------------------------------
# ---------------------- End Of User Variables, Please adjust above as needed ------------------
# ----------------------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------