Skip to content

Conversation

@Rubiss
Copy link

@Rubiss Rubiss commented Dec 9, 2025

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

This PR adds support for Uptime Kuma v2.x while maintaining backwards compatibility with v1.x through a new environment variable UPTIME_KUMA_API_VERSION.

Changes:

  • Added UPTIME_KUMA_API_VERSION environment variable (defaults to 1)
  • When set to 1 (default): installs uptime-kuma-api package for Uptime Kuma v1.x
  • When set to 2: installs uptime-kuma-api-v2 package for Uptime Kuma v2.x
  • Updated README with new environment variable documentation
  • Updated API library references in documentation

Benefits of this PR and context:

Uptime Kuma v2.x was released with breaking API changes. The original uptime-kuma-api package by lucasheld is no longer maintained and doesn't support v2.x.

This PR:

  • Allows users running Uptime Kuma v2.x to use this mod by setting UPTIME_KUMA_API_VERSION=2
  • Maintains full backwards compatibility - existing users on v1.x don't need to change anything
  • Uses uptime-kuma-api-v2 package (a maintained fork) for v2 support

How Has This Been Tested?

Tested manually with both Uptime Kuma versions:

Uptime Kuma Version API Package Result
v1.x (latest) uptime-kuma-api ✅ Works
v2.0.2 uptime-kuma-api-v2 ✅ Works

Test process:

  1. Started Uptime Kuma container (tested both v1 and v2)
  2. Ran the auto-uptime-kuma script with sample containers
  3. Verified monitors were created correctly in Uptime Kuma dashboard
  4. Verified group creation functionality works

Source / References:

Copilot AI review requested due to automatic review settings December 9, 2025 04:37
@LinuxServer-CI LinuxServer-CI moved this to PRs Ready For Team Review in Issue & PR Tracker Dec 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Uptime Kuma v2.x while maintaining backwards compatibility with v1.x through a new environment variable UPTIME_KUMA_API_VERSION. The change allows users to select between the original uptime-kuma-api package (v1) and the maintained uptime-kuma-api-v2 fork (v2) based on their Uptime Kuma server version.

Key Changes:

  • Added conditional package installation logic based on UPTIME_KUMA_API_VERSION environment variable (defaults to 1 for backwards compatibility)
  • Updated documentation to include the new environment variable and reference both API libraries
  • Modified installation messages to reflect the new dynamic package selection

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
root/etc/s6-overlay/s6-rc.d/init-mod-swag-auto-uptime-kuma-add-package/run Added version detection logic and conditional package selection between uptime-kuma-api (v1) and uptime-kuma-api-v2 (v2)
README.md Added UPTIME_KUMA_API_VERSION to environment variables table and updated API library references in documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add UPTIME_KUMA_API_VERSION environment variable to support both Uptime Kuma v1.x and v2.x.

- Default to v1 (uptime-kuma-api) for backwards compatibility
- Set UPTIME_KUMA_API_VERSION=2 to use v2 (uptime-kuma-api-v2)
- Updated README with new environment variable documentation
- Updated library references in documentation

Signed-off-by: Ben Lawson <rubiss@gmail.com>
@Rubiss Rubiss force-pushed the swag-auto-uptime-kuma branch from 668aeca to 0759888 Compare December 9, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: PRs Ready For Team Review

Development

Successfully merging this pull request may close these issues.

1 participant