Handle plugins + add healtcheck plugin

Support the installation of plugins, and add the healthcheck plugin,
which we use for status reports to the reverse proxy servers, as a first
one.

Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
This commit is contained in:
Georg Pfuetzenreuter 2025-01-10 10:33:47 +01:00
parent 80b217abc8
commit ff467efbe3
No known key found for this signature in database
GPG Key ID: 1ED2F138E7E6FF57
3 changed files with 17 additions and 0 deletions

View File

@ -66,6 +66,18 @@ COPY docker/launch-netbox.sh /opt/netbox/launch-netbox.sh
COPY configuration/ /etc/netbox/config/ COPY configuration/ /etc/netbox/config/
COPY docker/nginx-unit.json /etc/unit/ COPY docker/nginx-unit.json /etc/unit/
# Plugins and plugin configuration
COPY ./plugin_requirements.txt /opt/netbox/
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py
# Plugin configuration only possible via settings.py
COPY ./local_settings.py /opt/netbox/netbox/netbox/
# Install plugins
RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /opt/netbox/plugin_requirements.txt
RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
WORKDIR /opt/netbox/netbox WORKDIR /opt/netbox/netbox
# Must set permissions for '/opt/netbox/netbox/media' directory # Must set permissions for '/opt/netbox/netbox/media' directory

4
local_settings.py Normal file
View File

@ -0,0 +1,4 @@
from os import environ
from urllib.parse import quote
REDIS_URL = f"redis://:{quote(environ.get('REDIS_PASSWORD', ''))}@{environ.get('REDIS_HOST', 'localhost')}:{environ.get('REDIS_PORT', '6379')}/{environ.get('REDIS_DATABASE', '1')}"

1
plugin_requirements.txt Normal file
View File

@ -0,0 +1 @@
git+https://github.com/netbox-community/netbox-healthcheck-plugin