https://github.com/netboxlabs/netbox-branching
Official NetBox Labs plugin that implements git-like branching functionality for NetBox
https://github.com/netboxlabs/netbox-branching
netbox version-control
Last synced: 16 days ago
JSON representation
Official NetBox Labs plugin that implements git-like branching functionality for NetBox
- Host: GitHub
- URL: https://github.com/netboxlabs/netbox-branching
- Owner: netboxlabs
- License: other
- Created: 2024-07-19T17:17:23.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-18T17:52:08.000Z (about 1 month ago)
- Last Synced: 2025-03-31T05:03:14.764Z (23 days ago)
- Topics: netbox, version-control
- Language: Python
- Homepage: http://netboxlabs.com
- Size: 511 KB
- Stars: 87
- Watchers: 11
- Forks: 6
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-netbox - netboxlabs/netbox-branching - git-like branching functionality for NetBox (Plugins)
README
# NetBox Branching
This [NetBox](http://netboxlabs.com/oss/netbox/) plugin introduces branching functionality. A branch is a discrete, static snapshot of the NetBox database which can be modified independently and later merged back into the main database. This enables users to make "offline" changes to objects within NetBox and avoid interfering with its integrity as the network source of truth. It also provides the opportunity to review changes in bulk prior to their application.
## Requirements
* NetBox v4.1 or later
* PostgreSQL 12 or later## Installation
Brief installation instructions are provided below. For a complete installation guide, please refer to the included documentation.
1. Grant PostgreSQL permission for the NetBox database user to create schemas:
```postgresql
GRANT CREATE ON DATABASE $database TO $user;
```2. Activate the NetBox virtual environment:
```
$ source /opt/netbox/venv/bin/activate
```3. Install the plugin from [PyPI](https://pypi.org/project/netboxlabs-netbox-branching/):
```
$ pip install netboxlabs-netbox-branching
```4. Add `netbox_branching` to the end of `PLUGINS` in `configuration.py`. Note that `netbox_branching` **MUST** be the last plugin listed.
```python
PLUGINS = [
# ...
'netbox_branching',
]
```5. Create `local_settings.py` (in the same directory as `settings.py`) to override the `DATABASES` & `DATABASE_ROUTERS` settings. This enables dynamic schema support.
```python
from netbox_branching.utilities import DynamicSchemaDict
from .configuration import DATABASE# Wrap DATABASES with DynamicSchemaDict for dynamic schema support
DATABASES = DynamicSchemaDict({
'default': DATABASE,
})# Employ our custom database router
DATABASE_ROUTERS = [
'netbox_branching.database.BranchAwareRouter',
]
```6. Run NetBox migrations:
```
$ ./manage.py migrate
```