Files
netbox-stack/configuration.py
Sven Luthi 6125d57e38 modified: .env
modified:   compose.yml
modified:   configuration.py
WIP. Not working
2026-07-20 14:35:03 +02:00

114 lines
3.0 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# configuration.py – NetBox local configuration
# Mount this file into the container at:
# /opt/netbox/netbox/netbox/configuration.py
# ============================================================
# ── Required settings ─────────────────────────────────────────
import os
ALLOWED_HOSTS = os.getenv("NETBOX_DOMAIN", "*").replace(" ", "").split(",")
#CSRF_TRUSTED_ORIGINS = [
# "http://:8085",
#]
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
DATABASE = {
"NAME": os.getenv("DB_NAME", "netbox"),
"USER": os.getenv("DB_USER", "netbox"),
"PASSWORD": os.getenv("DB_PASS", "netbox"),
"HOST": "localhost",
"PORT": "5432",
"CONN_MAX_AGE": 300,
}
REDIS = {
"tasks": {
"HOST": "localhost", # service name in your pod / compose
"PORT": 6379,
"PASSWORD": "",
"DATABASE": 0,
"SSL": False,
},
"caching": {
"HOST": "localhost",
"PORT": 6379,
"PASSWORD": "",
"DATABASE": 1,
"SSL": False,
},
}
SECRET_KEY = "CuUxP6Vg5(f^#Tk+QRgZ)Wt9x1NG##yv(c7BSmbZ+4v@Sd(ha0"
PLUGINS = [
"netbox_dns",
"netbox_dns_bridge"
]
# Plugin-specific configuration (optional)
PLUGINS_CONFIG = {
"netbox_dns_bridge": {
"notify_clients": True,
"tsig_keys": {
"_default_": {
"keyname": "_default_",
"algorithm": "hmac-sha256",
"secret": "yJrOo4c3rDnv3mIrNDfSpGXePsypavsUSpNGxSojcYM=",
}
}
},
}
# ── Custom validators ─────────────────────────────────────────
# Reference Python classes mounted via volume into the container.
# The classes must be importable (i.e. their directory must be on
# PYTHONPATH or placed inside netbox/netbox/).
CUSTOM_VALIDATORS = {
# "dcim.site": ["my_validators.SiteValidator"],
}
# ── Optional / commonly changed settings ──────────────────────
TIME_ZONE = "UTC"
DATE_FORMAT = "N j, Y"
TIME_FORMAT = "g:i a"
DATETIME_FORMAT = "N j, Y g:i a"
# Email
#EMAIL = {
# "SERVER": "localhost",
# "PORT": 25,
# "USERNAME": "",
# "PASSWORD": "",
# "USE_SSL": False,
# "USE_TLS": False,
# "TIMEOUT": 10,
# "FROM_EMAIL": "netbox@example.com",
#}
# Media & static files are stored inside the container (media volume)
MEDIA_ROOT = "/opt/netbox/netbox/media"
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
},
},
"root": {
"handlers": ["console"],
#"level": "WARNING",
"level": "DEBUG",
},
}
API_TOKEN_PEPPERS = {1: '2QLPiNVBUPaZtvYrVNdRAdqPVBFeM+zkHcOExnBVG6O53xK2FBoewbVRYvS+ygsrMwB69j5qulkl'}