From d6f2cca0738f84b0b7468e37ee03586949b94d13 Mon Sep 17 00:00:00 2001 From: shodan Date: Sun, 5 Apr 2026 13:20:52 +0000 Subject: [PATCH] . --- netbox/image/Dockerfile | 24 +++++++++++++++++++----- netbox/image/requirements-plugins.txt | 6 +++--- netbox/netbox.yaml | 17 +++++++++++++---- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/netbox/image/Dockerfile b/netbox/image/Dockerfile index ec7351e..24d40e6 100644 --- a/netbox/image/Dockerfile +++ b/netbox/image/Dockerfile @@ -1,11 +1,25 @@ -FROM ghcr.io/netbox-community/netbox:latest +FROM netboxcommunity/netbox:latest +# Switch to root to install packages and create directories USER root -RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img - -COPY requirements-plugins.txt /opt/netbox/plugin_requirements.txt +# Copy plugin requirements +COPY ./plugin_requirements.txt /opt/netbox/ +# Install plugins using uv (the official way in netbox-docker) +# THIS IS THE KEY - use /usr/local/bin/uv pip install, not plain pip! RUN /usr/local/bin/uv pip install -r /opt/netbox/plugin_requirements.txt -USER unit \ No newline at end of file +# Create required directory for Topology Views images +RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img && + chown -R unit:root /opt/netbox/netbox/static/netbox_topology_views + +# Collect static files +# SECRET_KEY must be 50+ characters! +RUN SECRET_KEY="dummyKeyWithMinimumLength-------------------------dsflgjkkljh3l4hkj6T#$%#alskjhdglhjkasdlkghjl" + /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input + +# Switch back to unit user +USER unit + +WORKDIR /opt/netbox/netbox \ No newline at end of file diff --git a/netbox/image/requirements-plugins.txt b/netbox/image/requirements-plugins.txt index 76b99fd..65103bb 100644 --- a/netbox/image/requirements-plugins.txt +++ b/netbox/image/requirements-plugins.txt @@ -1,3 +1,3 @@ -netbox-topology-views -netbox-plugin-dns -netbox-routing \ No newline at end of file +netbox-topology-views==4.4.0 +netbox-secrets==2.4.1 +pycryptodome \ No newline at end of file diff --git a/netbox/netbox.yaml b/netbox/netbox.yaml index 4803145..77c1a19 100644 --- a/netbox/netbox.yaml +++ b/netbox/netbox.yaml @@ -5,14 +5,23 @@ metadata: namespace: netbox data: plugins.py: | + # NetBox Plugins Configuration + PLUGINS = [ - "netbox_topology_views", - "netbox_dns", + 'netbox_topology_views', + 'netbox_secrets' ] PLUGINS_CONFIG = { - "netbox_topology_views": {}, - "netbox_dns": {}, + 'netbox_topology_views': { + 'static_image_directory': 'netbox_topology_views/img', + 'allow_coordinates_saving': True, + 'always_save_coordinates': True + }, + 'netbox_secrets': { + 'top_level_menu': True, + 'public_key_size': 2048 + } } --- apiVersion: v1