Skip to content

02. Configuration

engels74 edited this page Oct 13, 2024 · 3 revisions

⚙️ Configuration Guide

This guide explains how to configure the Custom Format Sync tool for your Radarr and Sonarr instances.

🔐 GitHub Secrets

GitHub Secrets are used to securely store sensitive information like URLs and API keys. You'll need to set up secrets for each Radarr and Sonarr instance you want to sync.

🔑 Required Secrets

For each instance, you need to set up two secrets:

  1. URL Secret: RADARR_XXX_URL or SONARR_XXX_URL
  2. API Key Secret: RADARR_XXX_API_KEY or SONARR_XXX_API_KEY

Where:

  • XXX is a three-digit number starting from 001

📝 Example Secrets

RADARR_001_URL
RADARR_001_API_KEY
SONARR_001_URL
SONARR_001_API_KEY
RADARR_002_URL
RADARR_002_API_KEY
SONARR_002_URL
SONARR_002_API_KEY

🔒 How to Set GitHub Secrets

  1. Go to your GitHub repository
  2. Click on "Settings" > "Secrets and variables" > "Actions"
  3. Click "New repository secret"
  4. Enter the name of the secret (e.g., RADARR_001_URL)
  5. Enter the value (e.g., https://radarr.example.com)
  6. Click "Add secret"
  7. Repeat for each URL and API key

📁 Custom Formats Configuration

For detailed information on configuring custom formats, including file structure and key fields, please refer to the 📘 Usage Guide.

⏱️ Workflow Configuration

The sync workflow is configured in the .github/workflows/sync-custom-formats.yml file.

🔄 Sync Triggers

By default, the sync process runs:

  1. On pushes to the main branch that affect files in the custom_formats/ directory
  2. Daily at midnight UTC
  3. Manually when triggered through the GitHub Actions UI

✏️ Modifying the Workflow

To change when the sync runs:

  1. Open .github/workflows/sync-custom-formats.yml
  2. Modify the on section:
on:
  push:
    branches:
      - main
    paths:
      - 'custom_formats/**'
  schedule:
    - cron: '0 0 * * *'  # Daily at midnight UTC
  workflow_dispatch:  # Allows manual triggering

📌 Version Tracking

The version.json file in the root of your repository tracks the last synced version of each custom format. This file is automatically updated by the sync script.

⚠️ Important: Do not manually edit version.json. It's managed automatically by the sync process.

🔍 Logging

Logging is configured in the sync_script.py file. By default, it's set to the INFO level.

To change the log level:

  1. Open sync_script.py
  2. Find the line: logging.basicConfig(level=logging.INFO, ...)
  3. Change INFO to your desired level (e.g., DEBUG for more detailed logs)

For more information on using the Custom Format Sync tool, please refer to the 📘 Usage page. If you encounter any issues, check the 🔧 Troubleshooting page.