Skip to content

Turn your unRAID XML files into docker-compose.yml and add AutoKuma labels to your docker-compose.yml files.

Notifications You must be signed in to change notification settings

baxterblk/unraid-2-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unRAID XML to Docker Compose Converter

unRAID XML to Docker Compose Converter

A web-based tool to convert unRAID Docker container XML configurations to Docker Compose YAML format, with support for AutoKuma monitoring labels.

Features

XML Converter

  • Convert unRAID Docker container XML data to Docker Compose YAML format
  • Preserves container settings:
    • Image and container name
    • Environment variables
    • Volume mounts (with read-only flags)
    • Port mappings (with protocols)
    • Network configuration
    • CPU and memory limits
    • Privileged mode
    • Restart policy
    • WebUI, Support, and Project URLs (as labels)
  • Copy the generated YAML to clipboard or download as a file

AutoKuma Labels

  • Add Uptime Kuma monitoring labels to existing Docker Compose configurations
  • Support for multiple monitor types:
    • Group monitors for organizing your monitoring
    • Docker container monitors
    • HTTP endpoint monitors
    • Port monitors
  • Configurable monitor settings:
    • Check intervals
    • Retry intervals
    • Max retries
    • Timeouts
    • Keywords (for HTTP monitors)
  • Apply labels to specific services
  • Preview, copy, and download the modified Docker Compose YAML

Installation

Prerequisites

  • Python 3.7+
  • Flask
  • PyYAML

Installation Methods

Method 1: Local Installation

  1. Clone the repository:
git clone https://git.blakbox.vip/baxterblk/unraid-to-compose.git
cd unraid-to-compose
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py

The application will be available at http://localhost:5000

Method 2: Docker Deployment (Recommended)

Option A: Build from repository
  1. Clone the repository:
git clone https://git.blakbox.vip/baxterblk/unraid-to-compose.git
cd unraid-to-compose
  1. Build and start the Docker container:
docker-compose up -d --build

Alternatively, you can use the following commands:

docker build -t unraid-to-compose .
docker run -d -p 8080:5000 --name unraid-to-compose unraid-to-compose
Option B: Direct Docker Deployment (No local repository clone needed)

If you prefer not to clone the repository locally, you can build directly from the Git repository URL:

  1. Create a docker-compose.yml file with the following content:
services:
  unraid-to-compose:
    build:
      context: https://git.blakbox.vip/baxterblk/unraid-to-compose.git
    ports:
      - "8080:5000"
    restart: unless-stopped
  1. Run the container:
docker-compose up -d

This approach will automatically:

  1. Pull the source code from the Git repository
  2. Build the Docker image locally
  3. Start the container

The application will be available at http://localhost:8080

Method 3: unRAID Docker Template

To run this application directly on your unRAID server:

  1. In the unRAID Docker tab, click "Add Container"
  2. In the "Template" dropdown, select "... Show more templates"
  3. Search for "unraid-to-compose" or add a template URL if available
  4. Adjust port mappings if needed (default is 8080)
  5. Click "Apply"

The application will be available at http://your-unraid-ip:8080

Usage Guide

Converting unRAID XML to Docker Compose

  1. Navigate to the XML Converter tab
  2. Obtain your unRAID Docker container XML:
    • In unRAID, go to Docker tab
    • Click on the container you want to convert
    • View the XML data in the container details
    • Copy the entire XML content
  3. Paste the XML data into the input box
  4. Click "Convert"
  5. Review the generated Docker Compose YAML
  6. Use the "Copy to Clipboard" or "Download as docker-compose.yml" buttons to save the result

Adding AutoKuma Labels

  1. Navigate to the AutoKuma Labels tab

  2. Paste your existing docker-compose.yml content into the input box

  3. Choose one of the following options:

    Option A: Auto Populate Monitors

    • Click the "Auto Populate Monitors" button to automatically create monitors based on your docker-compose.yml
    • The tool will:
      • Create a Docker Services group
      • Add Docker monitors for each service
      • Add Port monitors for exposed ports
      • Create HTTP monitors for any detected web interfaces (from labels)
    • Review and customize the generated monitors if needed

    Option B: Manual Configuration

    • Configure monitors by using the buttons to add different monitor types:
      • Group monitors: Organize your monitors in logical groups
      • Docker monitors: Monitor container state
      • HTTP monitors: Check web endpoints
      • Port monitors: Verify if a port is open and responding
    • For each monitor, fill in the required fields:
      • All monitors require an ID and Name
      • Docker monitors require a container name
      • HTTP monitors require a URL
      • Port monitors require hostname and port number
  4. Specify which service to apply the labels to (optional)

  5. Click "Generate Compose with Labels" to add the configured monitors to your compose file

  6. Review the generated YAML with AutoKuma labels

  7. Use the "Copy to Clipboard" or "Download as docker-compose.yml" buttons to save the result

Understanding AutoKuma Labels

Uptime Kuma is a fantastic open-source monitoring tool, and AutoKuma extends it by allowing Docker containers to self-register for monitoring via Docker labels.

This tool helps you create those labels in the correct format. Common label patterns include:

Group Monitor

labels:
  - "kuma.group.id=services-group"
  - "kuma.group.name=Web Services"
  - "kuma.group.description=Web application services"

Docker Container Monitor

labels:
  - "kuma.monitor.type=docker"
  - "kuma.monitor.id=webapp-container"
  - "kuma.monitor.name=Web App Container"
  - "kuma.monitor.description=Monitors the web app container status"
  - "kuma.monitor.parent=services-group"
  - "kuma.monitor.docker.host=1"
  - "kuma.monitor.docker.container=webapp"
  - "kuma.monitor.interval=60"
  - "kuma.monitor.retry.interval=30"
  - "kuma.monitor.max.retries=3"

HTTP Endpoint Monitor

labels:
  - "kuma.monitor.type=http"
  - "kuma.monitor.id=webapp-web"
  - "kuma.monitor.name=Web App Interface"
  - "kuma.monitor.description=Monitors the web app interface"
  - "kuma.monitor.parent=services-group"
  - "kuma.monitor.http.url=http://example.com:8080"
  - "kuma.monitor.interval=60"
  - "kuma.monitor.retry.interval=30"
  - "kuma.monitor.max.retries=3"
  - "kuma.monitor.http.timeout=10"

Port Monitor

labels:
  - "kuma.monitor.type=port"
  - "kuma.monitor.id=db-port"
  - "kuma.monitor.name=Database Port"
  - "kuma.monitor.description=Monitors the database port"
  - "kuma.monitor.parent=database-group"
  - "kuma.monitor.port.hostname=localhost"
  - "kuma.monitor.port.port=3306"
  - "kuma.monitor.interval=60"
  - "kuma.monitor.retry.interval=30"
  - "kuma.monitor.max.retries=3"

License

This project is open source and available under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Screenshots

Below are screenshots demonstrating the key features of the unRAID XML to Docker Compose Converter:

XML Converter Interface

XML Converter Interface

AutoKuma Labels Configuration

AutoKuma Labels Configuration

About

Turn your unRAID XML files into docker-compose.yml and add AutoKuma labels to your docker-compose.yml files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published