feat: slskd reconnect guard in downloaders_reset, mass v2 sync
- downloaders_reset: connection check block before slskd API sections; triggers PUT /api/v0/server reconnect if disconnected, polls 60s, gates Stuck Searches and Dead Transfer Records on SLSKD_CONNECTED - Sync all modified/new/deleted files from v2 refactor across Docker_Essentials, Media, Monitors, Partnership, Rsync, Tools, Transcodes, unRAID_Essentials, common.sh, master confs, and new Manual/README docs
This commit is contained in:
@@ -2,46 +2,100 @@
|
||||
# ==============================================================================================
|
||||
# ================================= Docker Network Connect =====================================
|
||||
# ==============================================================================================
|
||||
# Ensures custom Docker networks exist then connects specified containers to them.
|
||||
# Run once at array start via ARRAY_START_SCRIPTS — idempotent, safe to re-run anytime.
|
||||
#
|
||||
# ── WHAT IT DOES ──────────────────────────────────────────────────────────────────────────────
|
||||
# For each network in NETWORK_CONNECT_NETWORKS:
|
||||
# 1. Check if network exists
|
||||
# → missing → create it (bridge driver, Docker assigns subnet automatically)
|
||||
# notifies on creation — unexpected, usually means unRAID wiped networks
|
||||
# → exists → skip creation silently
|
||||
# 2. Connect each container in NETWORK_CONNECT_CONTAINERS to the network
|
||||
# → already connected → skip cleanly
|
||||
# → not connected → connect it
|
||||
# → container not found → warn and skip (not an error — may not be running yet)
|
||||
# PURPOSE
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# Ensures custom Docker networks exist and connects configured containers to
|
||||
# them at every array start.
|
||||
#
|
||||
# ── USE CASE ──────────────────────────────────────────────────────────────────────────────────
|
||||
# high-availability is the main custom network — shared by most containers.
|
||||
# After a unRAID update wipes custom networks → recreated automatically at next array start.
|
||||
# Containers on their own networks (NextCloud AIO etc.) can be added to
|
||||
# NETWORK_CONNECT_CONTAINERS so they also join high-availability without touching their
|
||||
# primary network configuration.
|
||||
# Called via ARRAY_START_SCRIPTS — runs early in the array start sequence,
|
||||
# before watchdogs begin their first cycle. Idempotent: safe to re-run at any
|
||||
# time. Silent when everything is already correct. Notifies when a network had
|
||||
# to be created — that only happens after a unRAID update wipes custom networks,
|
||||
# and it is worth knowing when it does.
|
||||
#
|
||||
# ── SAFEGUARDS ────────────────────────────────────────────────────────────────────────────────
|
||||
# Docker daemon check — verifies daemon is responsive before any network operations
|
||||
# Command validation — validates unRAID notify script before use
|
||||
# Timeout protection — all docker commands wrapped in timeout — daemon hangs cannot stall
|
||||
# Empty array guards — warns and exits cleanly if arrays are unconfigured
|
||||
# Silent by default — only warnings and errors produce output (v3.4 standard)
|
||||
# network creation always warns — unexpected, means networks were wiped
|
||||
# Idempotent — safe to run multiple times, skips what is already correct
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL MODEL
|
||||
# ==============================================================================================
|
||||
#
|
||||
# ── CONFIGURATION (master_host*.conf) ─────────────────────────────────────────────────────────
|
||||
# HOST*_NETWORK_CONNECT_NETWORKS — networks to ensure exist
|
||||
# HOST*_NETWORK_CONNECT_CONTAINERS — containers to connect to each network
|
||||
# Aliased by detect_hosts() — script uses unprefixed names
|
||||
# For each configured network:
|
||||
#
|
||||
# 1. Does the network exist?
|
||||
# NO → create it (bridge driver, Docker assigns subnet automatically)
|
||||
# → send notification — creation is unexpected outside post-update recovery
|
||||
# YES → skip silently
|
||||
#
|
||||
# 2. For each configured container:
|
||||
# Already connected → skip silently
|
||||
# Not connected → connect it
|
||||
# Container missing → warn and skip — may not be running yet, not fatal
|
||||
#
|
||||
# ==============================================================================================
|
||||
# DESIGN PRINCIPLES
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Idempotent by Design
|
||||
# Running this script multiple times produces the same result as running it
|
||||
# once. Skips anything already in the correct state without error or noise.
|
||||
#
|
||||
# Silent When Correct
|
||||
# Produces no output on a clean run. The absence of output is confirmation
|
||||
# that everything is already correct.
|
||||
#
|
||||
# Notify on Creation
|
||||
# Network creation is always notified because it should only happen after a
|
||||
# unRAID update. If it happens regularly something is misconfigured and the
|
||||
# operator needs to know.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL SAFEGUARDS
|
||||
# ==============================================================================================
|
||||
#
|
||||
# Docker Daemon Check
|
||||
# Verifies daemon is responsive before any network operations. Network
|
||||
# commands against a hung daemon hang indefinitely.
|
||||
#
|
||||
# Timeout Protection
|
||||
# All docker commands wrapped in timeout. Daemon hangs cannot stall the
|
||||
# array start sequence.
|
||||
#
|
||||
# Empty Array Guards
|
||||
# Warns and exits cleanly if NETWORK_CONNECT_NETWORKS or
|
||||
# NETWORK_CONNECT_CONTAINERS are unconfigured.
|
||||
#
|
||||
# Command Validation
|
||||
# Validates unRAID notify script before use.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# CONFIGURATION
|
||||
# ==============================================================================================
|
||||
#
|
||||
# master_host*.conf
|
||||
#
|
||||
# HOST*_NETWORK_CONNECT_NETWORKS
|
||||
# Networks to ensure exist at array start. Aliased by detect_hosts() →
|
||||
# NETWORK_CONNECT_NETWORKS
|
||||
#
|
||||
# HOST*_NETWORK_CONNECT_CONTAINERS
|
||||
# Containers to connect to every configured network. Aliased by
|
||||
# detect_hosts() → NETWORK_CONNECT_CONTAINERS
|
||||
#
|
||||
# ==============================================================================================
|
||||
# RUNTIME MODES
|
||||
# ==============================================================================================
|
||||
#
|
||||
# docker_network_connect.sh
|
||||
# Ensure all configured networks exist and containers are connected
|
||||
#
|
||||
# docker_network_connect.sh --dry-run
|
||||
# Preview what would be created or connected without making changes
|
||||
#
|
||||
# docker_network_connect.sh --status
|
||||
# Show current network state and container connection status
|
||||
#
|
||||
# docker_network_connect.sh --log
|
||||
# Verbose per-network per-container output
|
||||
#
|
||||
# ── USAGE ─────────────────────────────────────────────────────────────────────────────────────
|
||||
# docker_network_connect.sh — normal run
|
||||
# docker_network_connect.sh --dry-run — preview without making changes
|
||||
# docker_network_connect.sh --log — verbose output
|
||||
# docker_network_connect.sh --status — show current network state and exit
|
||||
# ==============================================================================================
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
Reference in New Issue
Block a user