infra/k8s/netbox/configs/extra.py
Finn b2dc0fef2a
All checks were successful
/ diff-and-deploy (push) Successful in 2m10s
netbox: fix extra.py mounting + other tweaks
2024-12-16 11:06:41 -08:00

28 lines
1.1 KiB
Python

# based on https://github.com/netbox-community/netbox-docker/blob/release/configuration/extra.py
import os
# workaround weirdness from netbox container
# https://github.com/netbox-community/netbox-docker/issues/1112#issuecomment-2094397332
from netbox.configuration.configuration import DATABASE
DATABASE['OPTIONS']['sslcertmode'] = 'disable'
# Remote authentication support
REMOTE_AUTH_ENABLED = True
REMOTE_AUTH_BACKEND = 'netbox.authentication.RemoteUserBackend'
REMOTE_AUTH_HEADER = 'HTTP_X_FORWARDED_USER'
REMOTE_AUTH_USER_FIRST_NAME = 'HTTP_X_FORWARDED_USER'
REMOTE_AUTH_USER_LAST_NAME = 'HTTP_REMOTE_USER_LAST_NAME'
REMOTE_AUTH_USER_EMAIL = 'HTTP_X_FORWARDED_EMAIL'
REMOTE_AUTH_AUTO_CREATE_USER = True
REMOTE_AUTH_DEFAULT_GROUPS = []
REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
# S3 storage
STORAGE_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
STORAGE_CONFIG = {
'AWS_ACCESS_KEY_ID': os.getenv("AWS_ACCESS_KEY_ID"),
'AWS_SECRET_ACCESS_KEY': os.getenv("AWS_SECRET_ACCESS_KEY"),
'AWS_STORAGE_BUCKET_NAME': 'netbox',
'AWS_S3_REGION_NAME': 'us-sea-1',
'AWS_S3_ENDPOINT_URL': 'https://storage.home.finn.io'
}