Commit Graph

12 Commits

Author SHA1 Message Date
JaviPege
20be39799b Merge branch 'main' into feature/optional-services 2025-11-11 11:08:20 +01:00
Marco Marinho
7d29501741 Move from Overseerr to Seerr
Overseerr and Jellyseerr will be merged and be called Seerr, so let's prepare for it
2025-11-01 18:36:12 +00:00
JaviPege
afc6309fda Add sleep action and 10s delay after Decypharr healthcheck
Added sleep action to setup-executor.sh to allow waiting for services
to fully initialize after Docker healthcheck passes. Applied 10s delay
after Decypharr healthcheck in both radarr.json and sonarr.json to
ensure qBittorrent API on port 8283 is fully ready before attempting
to add download client.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 19:50:37 +02:00
JaviPege
aec0fe4aa3 fix: Replace ((i++)) with i=$((i + 1)) to avoid set -e issues
CRITICAL FIX: ((i++)) causes script termination with set -e

Problem:
- Bash arithmetic ((...)) returns the result of the expression
- ((i++)) increments i from 0 to 1 and returns 1 (the NEW value)
- With 'set -e', any command returning non-zero terminates the script
- This caused setup-executor to exit after first step completion

Solution:
- Use i=$((i + 1)) instead of ((i++))
- This always returns exit code 0
- Script can continue to subsequent steps

This was the final blocker preventing auto-configuration from working.
2025-10-22 18:56:55 +02:00
JaviPege
9b3a99c25a fix: Define ROOT_DIR in setup-executor.sh
- setup-executor.sh was failing silently when ROOT_DIR was undefined
- ROOT_DIR is used in recyclarr configuration but was never initialized
- Now defaults to /mediacenter if not set via environment variable
- Allows setup-executor.sh to run both from setup.sh and standalone
2025-10-22 18:46:06 +02:00
JaviPege
9c2a253945 feat: Integrate template system into setup.sh - MAJOR REFACTOR
Fully integrated the modular template system into setup.sh, reducing code
from 1426 to 1076 lines (-350 lines, -25% code).

**PHASE 1 - Configuration (Lines 170-198):**
- Added interactive template selector
- Default: core + plex + overseerr
- Custom: User selects media server and optional services
- Validates dependencies automatically
- Saves SELECTED_TEMPLATES to .env.install

**PHASE 2 - Summary (Lines 369-379):**
- Displays selected templates with descriptions
- Shows what will be installed before proceeding

**PHASE 3 - Installation (Lines 460-512):**
- Generates docker-compose.yml dynamically from templates
- Creates config directories based on selected services only
- Sets permissions dynamically for selected services only
- No more hardcoded service lists

**PHASE 4 - Auto-Configuration (Lines 889-917):**
- REPLACED ~350 lines of manual configuration code
- Single call to setup-executor.sh with selected templates
- setup-executor reads service JSONs and executes steps
- Automatic: API key extraction, root folders, download clients,
  indexers, Prowlarr sync, Recyclarr, etc.

**Service Validation (Lines 807-820):**
- Dynamic service list from selected templates
- Filters out setup-only services (recyclarr, networks, volumes)
- No more hardcoded EXPECTED_SERVICES array

**Helper Scripts Created:**
- scripts/get-services-list.sh: Extracts service names from templates
- scripts/get-config-dirs.sh: Returns services needing config dirs

**Benefits:**
 Modular: Users choose exactly what to install
 Maintainable: Add services = create JSON, no setup.sh changes
 Scalable: Easy to add new templates/services
 Less code: -350 lines (-25%)
 Dependencies: Automatically validated (e.g., Overseerr requires Plex)

**Testing:**
- Validates templates exist
- Checks JSON syntax
- Helper scripts tested with multiple template combinations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:15:46 +02:00
JaviPege
64820aeead feat: Add template selector with dependency validation
Created comprehensive template configuration system with dependency management:

**Template Configuration Files:**
- Created template.conf for all extras (8 total)
- Dependencies properly configured:
  * Plex-dependent: overseerr, tautulli, plextraktsync
  * Standalone: homarr, traefik, dashdot, pinchflat, watchtower

**Template Selector Script:**
- scripts/template-selector.sh: Interactive template selection
- Validates dependencies automatically
- Filters available options based on media server choice
- Shows proper descriptions from template.conf
- Returns space-separated list of templates

**Key Features:**
- Media server selection (Plex or None)
- Dynamic extras filtering based on dependencies
- If Plex not selected: Hides Overseerr, Tautulli, PlexTraktSync
- If Plex selected: Shows all compatible extras
- Summary confirmation before proceeding

**Testing:**
✓ With Plex: Shows 8 optional services
✓ Without Plex: Shows only 5 standalone services
✓ Dependency validation works correctly
✓ Output format correct for compose-generator

**Files Added:**
- scripts/template-selector.sh (executable)
- 8x templates/extras/*/template.conf
- 4x templates/extras/*/services.list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:07:31 +02:00
JaviPege
6b68c98201 feat: Complete per-service JSON configuration system
Completed the modular template system with per-service JSON configurations:

**Service JSON Files Created (13 total):**
- Core services: radarr, sonarr, prowlarr, zilean, decypharr, autoscan
- Setup-only: recyclarr (TRaSH Guide quality profiles)
- Optional services: plex, overseerr, tautulli, homarr, traefik, traefik-socket-proxy

**Key Features:**
- Each service has its own JSON defining setup steps
- services.list defines installation order (service names, not yml files)
- compose-generator maps service names to .yml files dynamically
- Supports setup-only services (recyclarr) with null compose_file
- Quality profile management: deletes defaults, then runs recyclarr

**Updated Components:**
- scripts/compose-generator.sh: Handles null compose_file, maps service names
- scripts/setup-executor.sh: execute_service_setup() for per-service execution
- All services.list files: Changed from .yml references to service names

**Setup Actions:**
- wait_for_service, extract_api_key, add_root_folder
- add_download_client, add_arr_to_prowlarr, add_indexer_to_prowlarr
- delete_default_quality_profiles, run_recyclarr
- log_info, log_success, log_warning

**Testing:**
✓ compose-generator: Generates docker-compose.yml correctly
✓ All JSON files validated with jq
✓ Successfully tested with core + mediaplayers/plex + extras

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:00:44 +02:00
JaviPege
fedcc1a6c8 Add JSON-based dynamic setup configuration system
**New System:**
- Declarative JSON configuration for template setup steps
- Dynamic execution engine that reads JSON and calls functions
- Centralized action reference documentation

**Components:**

1. **setup-executor.sh**
   - Parses setup.json files
   - Executes actions dynamically
   - Manages runtime variables (API keys, etc)
   - Supports 10+ configuration actions

2. **setup.json files per template**
   - core: 16 configuration steps
   - mediaplayers/plex: Simple service wait + info
   - extras/overseerr: Info display with API keys

3. **SETUP-ACTIONS.md**
   - Complete reference for all available actions
   - Parameter documentation
   - Usage examples for each action

**Supported Actions:**
- wait_for_service: Wait for service health
- extract_api_key: Extract and store API keys
- add_root_folder: Configure media folders
- add_download_client: Add download clients
- add_indexer_to_prowlarr: Add indexers
- add_arr_to_prowlarr: Connect *arr to Prowlarr
- delete_default_quality_profiles: Remove default profiles
- run_recyclarr: Create TRaSH Guide profiles
- log_info/success/warning: Display messages

**Benefits:**
- No hardcoded setup scripts per template
- Easy to add new templates - just create setup.json
- Reusable actions across all templates
- Variable expansion support (${RADARR_API_KEY}, etc)
- Maintainable: Change function signature once, works everywhere

**Example Usage:**
```bash
# Execute setup for core template
./scripts/setup-executor.sh core

# Execute multiple templates
./scripts/setup-executor.sh core mediaplayers/plex extras/overseerr
```

**JSON Format:**
```json
{
  "name": "template-name",
  "description": "Template description",
  "steps": [
    {
      "action": "wait_for_service",
      "description": "Human-readable description",
      "params": {
        "service": "radarr",
        "port": 7878
      }
    }
  ]
}
```

**Next Steps:**
- Integrate setup-executor.sh into main setup.sh
- Add more optional templates with setup.json
- Create interactive template selector

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 17:50:46 +02:00
JaviPege
65596c2a10 Add modular template system for service deployment
**New Features:**
- Template-based deployment system for modular stack configuration
- Automatic dependency resolution
- Dynamic docker-compose.yml generation

**Template Structure:**
```
templates/
├── core/                 # Required base stack (*arr + dependencies)
├── mediaplayers/         # Media server options (plex, jellyfin)
└── extras/               # Optional services (overseerr, tautulli, etc)
```

**Templates Created:**
- core: Minimal *arr stack (11 services)
  - Infrastructure, Zurg, Rclone, Radarr, Sonarr, Prowlarr, Zilean, Decypharr, Autoscan
- mediaplayers/plex: Plex Media Server
- extras/overseerr: Request management (depends on plex)
- extras/tautulli: Plex analytics
- extras/homarr: Dashboard
- extras/traefik: Reverse proxy with HTTPS

**Compose Generator (compose-generator.sh):**
- Reads template metadata and dependencies
- Resolves dependency tree automatically
- Merges services.list files in correct order
- Generates categorized docker-compose.yml with comments
- Prevents duplicate service includes

**Usage:**
```bash
# Core only
./scripts/compose-generator.sh core

# Plex + Overseerr (auto-includes core dependency)
./scripts/compose-generator.sh mediaplayers/plex extras/overseerr

# Full stack
./scripts/compose-generator.sh core mediaplayers/plex extras/overseerr extras/tautulli extras/homarr
```

**Template Configuration:**
Each template contains:
- template.conf: Metadata (name, description, dependencies, category)
- services.list: Docker Compose service files to include
- setup.sh (future): Post-deployment configuration script

**Next Steps:**
- Integrate with setup.sh to prompt user for template selection
- Create setup.sh scripts for each template
- Add more optional templates (dashdot, pinchflat, watchtower, etc)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 17:43:25 +02:00
JaviPege
72704fd0a3 Update Recyclarr HDR Custom Format IDs to current TRaSH Guides
**Problem:**
Recyclarr was showing warnings about 9 obsolete HDR Custom Format IDs
that no longer exist in TRaSH Guides:
- e23edd2482476e595fb990b12e7c609c # DV HDR10 (old)
- 58d6a88f13e2db7f5059c41047876f00 # DV (old)
- 55d53828b9d81cbe20b02efd00aa0efd # DV HLG (old)
- a3e19f8f627608af0211acd02bf89735 # DV SDR (old)
- dfb86d5941bc9075d6af23b09c2aeecd # HDR10 (old)
- e61e28db95d22bedcadf030b8f156d96 # HDR (old)
- 2a4d9069cc1fe3242ff9bdaebed239bb # HDR (undefined) (old)
- 08d6d8834ad9ec87b1dc7ec8148e7a1f # PQ (old)
- 9364dd386c9b4a1100dde8264690add7 # HLG (old)

TRaSH Guides reorganized HDR Custom Formats with new IDs.

**Solution:**
1. Updated config/recyclarr.yml with current HDR format IDs
2. Replaced 9 obsolete IDs with 12 current IDs matching Sonarr config
3. Added UHD Streaming Boost and Cut formats
4. Fixed recyclarr-sync.sh API key injection using AWK instead of sed

**Changes:**
- config/recyclarr.yml: Updated Radarr HDR Custom Format IDs
- scripts/recyclarr-sync.sh: Fixed API key injection for both services

**Testing:**
Recyclarr sync now completes successfully without HDR-related warnings.
Both Radarr and Sonarr profiles updated correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 14:54:59 +02:00
JaviPege
fd087235d4 Reorganize project structure into logical subdirectories 2025-10-22 10:58:05 +02:00