Skip to content

feat: add UniFi Dream Machine (UDM/UDR) device support - #8

Merged
ryanmcafee merged 1 commit into
mainfrom
feature/support-udm-controller
Jan 27, 2026
Merged

ryanmcafee merged 1 commit into
mainfrom
feature/support-udm-controller

Conversation

@ryanmcafee

Copy link
Copy Markdown
Owner

Summary

  • Add DeviceType configuration to support UDM/UDR devices which use different API paths
  • UDM login endpoint: /api/auth/login (vs /api/login for standard)
  • UDM port forward endpoint: /proxy/network/api/s/{site}/rest/portforward (vs /api/s/{site}/rest/portforward)
  • Default device type is "standard" for backward compatibility

Changes

  • pkg/unifi/client.go: Add DeviceType type and path helper methods
  • cmd/manager/main.go: Parse ROUTER_DEVICE_TYPE environment variable
  • pkg/unifi/client_test.go: Add 7 new tests for UDM path functionality
  • Helm chart: Add router.deviceType configuration option

Usage

For UDM/UDR devices:

router:
  deviceType: "udm"
  url: "https://192.168.0.1"
  apiKey: "your-api-key"
  skipTlsVerification: true

Test plan

  • Unit tests pass (make test)
  • Helm lint passes (make helm-test)
  • New UDM-specific tests added and passing

Closes #7

UDM/UDR devices use different API paths than legacy UniFi Controller:
- Login: /api/auth/login (vs /api/login)
- Port forwards: /proxy/network/api/s/{site}/rest/portforward

Changes:
- Add DeviceType field to Client struct with "standard" and "udm" options
- Add path helper methods for dynamic endpoint construction
- Parse ROUTER_DEVICE_TYPE env var in manager (accepts "udm" or "udr")
- Update Helm chart with deviceType configuration
- Add comprehensive tests for UDM paths

Closes #7
@ryanmcafee
ryanmcafee merged commit b0c8807 into main Jan 27, 2026
5 checks passed
@ryanmcafee
ryanmcafee deleted the feature/support-udm-controller branch January 27, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for UniFi Dream Machine (UDM/UDR) API paths

1 participant