Compare commits

..

1 commit

Author SHA1 Message Date
Matt Gaynor 2e492302a6
Merge 1815408e73 into 8c1a8a9ea6 2025-08-02 09:51:57 +02:00
2 changed files with 14 additions and 16 deletions

View file

@ -89,7 +89,7 @@ WORKDIR /opt/netbox/netbox
# Must set permissions for '/opt/netbox/netbox/media' directory # Must set permissions for '/opt/netbox/netbox/media' directory
# to g+w so that pictures can be uploaded to netbox. # to g+w so that pictures can be uploaded to netbox.
RUN mkdir -p static media /opt/unit/state/ /opt/unit/tmp/ \ RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \
&& chown -R unit:root /opt/unit/ media reports scripts \ && chown -R unit:root /opt/unit/ media reports scripts \
&& chmod -R g+w /opt/unit/ media reports scripts \ && chmod -R g+w /opt/unit/ media reports scripts \
&& cd /opt/netbox/ && SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python -m mkdocs build \ && cd /opt/netbox/ && SECRET_KEY="dummyKeyWithMinimumLength-------------------------" /opt/netbox/venv/bin/python -m mkdocs build \

View file

@ -64,21 +64,19 @@ if '*' not in ALLOWED_HOSTS and 'localhost' not in ALLOWED_HOSTS:
# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters: # PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
# https://docs.djangoproject.com/en/stable/ref/settings/#databases # https://docs.djangoproject.com/en/stable/ref/settings/#databases
DATABASES = { DATABASE = {
'default': { 'NAME': environ.get('DB_NAME', 'netbox'), # Database name
'NAME': environ.get('DB_NAME', 'netbox'), # Database name 'USER': environ.get('DB_USER', ''), # PostgreSQL username
'USER': environ.get('DB_USER', ''), # PostgreSQL username 'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')),
'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')), # PostgreSQL password
# PostgreSQL password 'HOST': environ.get('DB_HOST', 'localhost'), # Database server
'HOST': environ.get('DB_HOST', 'localhost'), # Database server 'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default)
'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default) 'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')},
'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')}, # Database connection SSLMODE
# Database connection SSLMODE 'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT),
'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT), # Max database connection age
# Max database connection age 'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL),
'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL), # Disable the use of server-side cursors transaction pooling
# Disable the use of server-side cursors transaction pooling
}
} }
# Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate # Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate