diff --git a/Dockerfile-Plugins b/Dockerfile-Plugins new file mode 100644 index 0000000..fffe950 --- /dev/null +++ b/Dockerfile-Plugins @@ -0,0 +1,11 @@ +FROM netboxcommunity/netbox:latest + +COPY ./plugin_requirements.txt /opt/netbox/ +RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /opt/netbox/plugin_requirements.txt + +# These lines are only required if your plugin has its own static files. +COPY configuration/configuration.py /etc/netbox/config/configuration.py +COPY configuration/plugins.py /etc/netbox/config/plugins.py +COPY netbox-local_settings.py /opt/netbox/netbox/netbox/local_settings.py +#RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py migrate +RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input diff --git a/build-latest.sh b/build-latest.sh old mode 100755 new mode 100644 diff --git a/build.sh b/build.sh old mode 100755 new mode 100644 diff --git a/configuration/plugins.py b/configuration/plugins.py index c0b1a1f..01081d5 100644 --- a/configuration/plugins.py +++ b/configuration/plugins.py @@ -4,10 +4,60 @@ # To learn how to build images with your required plugins # See https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins -# PLUGINS = ["netbox_bgp"] +PLUGINS = [ + "netbox_secrets", + "netbox_qrcode", + "netbox_diode_plugin", + "netbox_branching", + "netbox_inventory", +] -# PLUGINS_CONFIG = { -# "netbox_bgp": { -# ADD YOUR SETTINGS HERE -# } -# } +PLUGINS_CONFIG = { + #"netbox_diode_plugin": { + # # Auto-provision users for Diode plugin + # "auto_provision_users": False, + # + # # Diode gRPC target for communication with Diode server + # "diode_target_override": "grpc://localhost:8080/diode", + # + # # User allowed for Diode to NetBox communication + # "diode_to_netbox_username": "diode-to-netbox", + # + # # User allowed for NetBox to Diode communication + # "netbox_to_diode_username": "netbox-to-diode", + # + # # User allowed for data ingestion + # "diode_username": "diode-ingestion", + #}, + + 'netbox_qrcode': { + 'with_text': True, + 'text_fields': ['name', 'serial'], + 'font': 'CourierNewBold', + 'font_size': 0, # If the value is 0 or the line does not exist, then the text is automatically adjusted + 'custom_text': 'Under control of Skyworks\nContact Before Operation', + 'text_location': 'right', + 'qr_version': 1, + 'qr_error_correction': 2, + 'qr_box_size': 4, + 'qr_border': 4, + # per object options + 'cable': { + 'qr_box_size': 2, + 'qr_border': 6, + }, + 'rack': { + 'text_fields': [ + #'site', + 'name', + 'facility_id', + 'tenant', + 'cf.cf_name' + ] + }, + 'device': { + 'qr_box_size': 6, + 'custom_text': None, + } + }, +} diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh old mode 100755 new mode 100644 diff --git a/docker/housekeeping.sh b/docker/housekeeping.sh old mode 100755 new mode 100644 diff --git a/docker/launch-netbox.sh b/docker/launch-netbox.sh old mode 100755 new mode 100644 diff --git a/netbox-local_settings.py b/netbox-local_settings.py new file mode 100644 index 0000000..10de74b --- /dev/null +++ b/netbox-local_settings.py @@ -0,0 +1,12 @@ +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', +] diff --git a/plugin_requirements.txt b/plugin_requirements.txt new file mode 100644 index 0000000..a1de886 --- /dev/null +++ b/plugin_requirements.txt @@ -0,0 +1,5 @@ +netbox-secrets +netbox_qrcode +netboxlabs-diode-netbox-plugin +netboxlabs-netbox-branching +netbox-inventory diff --git a/release.sh b/release.sh old mode 100755 new mode 100644 diff --git a/test.sh b/test.sh old mode 100755 new mode 100644