# ============================================================================= # NetBox Plugins Configuration # ============================================================================= # This file activates and configures NetBox plugins. # Mount this file to /etc/netbox/config/plugins.py # # IMPORTANT: netbox_branching MUST be the last plugin in the list # ============================================================================= import os # Plugin list - netbox_branching must be LAST PLUGINS = [ 'netbox_bgp', 'netbox_secrets', 'netbox_topology_views', # 'netbox_documents', # 'netbox_acls', # 'netbox_qrcode', # 'netbox_proxbox', 'netbox_branching', # MUST be last ] # Plugin configuration PLUGINS_CONFIG = { 'netbox_branching': {}, 'netbox_bgp': {}, 'netbox_secrets': {}, 'netbox_topology_views': {}, } # ============================================================================= # NetBox Branching - Database Configuration # ============================================================================= # Required for netbox-branching plugin to work properly. # See: https://netboxlabs.com/docs/extensions/branching/netbox-docker/ # ============================================================================= from netbox_branching.utilities import DynamicSchemaDict DATABASES = DynamicSchemaDict({ 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': os.environ.get('DB_NAME', 'netbox'), 'USER': os.environ.get('DB_USER', 'netbox'), 'PASSWORD': os.environ.get('DB_PASSWORD', ''), 'HOST': os.environ.get('DB_HOST', 'postgres'), 'PORT': os.environ.get('DB_PORT', ''), 'CONN_MAX_AGE': int(os.environ.get('DB_CONN_MAX_AGE', '300')), } }) DATABASE_ROUTERS = [ 'netbox_branching.database.BranchAwareRouter', ]