Skip to main content

Production-ready NetBox plugin for UniFi synchronization

Project description

netbox_unifi_sync

[!WARNING]
We are aware that there are issues in the codebase.
Please remember that this is a hobby project maintained in our spare time.
Fixes and improvements will be addressed as time allows.
Your patience and understanding are appreciated.

netbox_unifi_sync is a NetBox 4.2+ plugin that runs UniFi -> NetBox sync jobs inside NetBox workers.

Visual Overview

netbox-unifi-sync overview

flowchart LR
    U["UniFi Controller(s)"] --> P["netbox_unifi_sync plugin<br/>NetBox Jobs (RQ)"]
    P --> N["NetBox DCIM/IPAM/Wireless"]
    A["Plugin UI<br/>Settings/Controllers/Mappings"] --> P

Features

  • Device sync (devices, interfaces, VLANs, prefixes, WLANs, uplink relations, IP assignments)
  • DHCP scope sync to NetBox IP Ranges
  • UniFi auth via API key or legacy login (username/password + optional MFA)
  • Manual and scheduled sync jobs
  • Runtime settings stored in plugin models (Settings, Controllers, Site mappings)

Quick Start

1. Install

pip install netbox-unifi-sync

PyPI project page: https://pypi.org/project/netbox-unifi-sync/

For netbox-docker, add the package to local_requirements.txt before build:

echo "netbox-unifi-sync" >> local_requirements.txt

2. Enable plugin in NetBox

PLUGINS = ["netbox_unifi_sync"]

PLUGINS_CONFIG = {
    "netbox_unifi_sync": {}
}

3. Apply migrations

python manage.py migrate

4. Configure in UI

Go to Plugins -> UniFi Sync and configure:

  1. Settings (tenant_name, netbox_roles, defaults)
  2. Controllers (URL, auth mode, credentials)
  3. Site mappings (if UniFi/NetBox site names differ)

5. Run first sync

  • UI: Plugins -> UniFi Sync -> Sync Dashboard -> Run now
  • CLI:
python manage.py netbox_unifi_sync_run --dry-run --json
python manage.py netbox_unifi_sync_run --cleanup

Credentials

Set credentials only in Plugins -> UniFi Sync -> Controllers. Do not store UniFi credentials in PLUGINS_CONFIG.

Documentation

Security Notes

  • SSL verification defaults to true
  • Secrets are redacted in run history and audit logs
  • Timeouts/retries/backoff are configurable

Maintainer: Release to PyPI

  1. Bump version in:
    • pyproject.toml ([project].version)
    • netbox_unifi_sync/version.py (__version__)
  2. Configure PyPI Trusted Publisher (OIDC) for this repository/workflow.
  3. Create and push tag vX.Y.Z:
    • git tag -a vX.Y.Z -m "Release vX.Y.Z"
    • git push origin vX.Y.Z
  4. release.yml creates GitHub Release.
  5. publish-python-package.yml publishes package to PyPI when release is published.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_unifi_sync-0.2.2.tar.gz (181.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_unifi_sync-0.2.2-py3-none-any.whl (147.7 kB view details)

Uploaded Python 3

File details

Details for the file netbox_unifi_sync-0.2.2.tar.gz.

File metadata

  • Download URL: netbox_unifi_sync-0.2.2.tar.gz
  • Upload date:
  • Size: 181.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for netbox_unifi_sync-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d0a1f1c28e234e0be5a25fa1467755f65179a1544738fd797b032971ab9263c3
MD5 24bf779b5a5b879f45d5b60ccbec2a02
BLAKE2b-256 d7ef039e059e34010ba091bd4ec6bc066f948a9268c940095a56e0b679119544

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_unifi_sync-0.2.2.tar.gz:

Publisher: publish-python-package.yml on unifi2netbox/netbox-unifi-sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbox_unifi_sync-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_unifi_sync-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f19605efee5c7a857716efba6d0e5adc8cabc95754b083e7a652796bf5d5ffbe
MD5 be613bb1ab1f164fa8d58f30f9be9b0f
BLAKE2b-256 6927ef4ef63a6131b7c79446898508b667a8f8ebc27f93bae16375013db5e471

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_unifi_sync-0.2.2-py3-none-any.whl:

Publisher: publish-python-package.yml on unifi2netbox/netbox-unifi-sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page