Prepare for Netbox 2.7
This commit is contained in:
parent
40ef427336
commit
355f9d4cf7
|
@ -26,7 +26,9 @@ RUN pip install --prefix="/install" --no-warn-script-location \
|
||||||
# ruamel is used in startup_scripts
|
# ruamel is used in startup_scripts
|
||||||
'ruamel.yaml>=0.15,<0.16' \
|
'ruamel.yaml>=0.15,<0.16' \
|
||||||
# django_auth_ldap is required for ldap
|
# django_auth_ldap is required for ldap
|
||||||
django_auth_ldap
|
django_auth_ldap \
|
||||||
|
# django-storages was introduced in 2.7 and is optional
|
||||||
|
django-storages
|
||||||
|
|
||||||
ARG NETBOX_PATH
|
ARG NETBOX_PATH
|
||||||
COPY ${NETBOX_PATH}/requirements.txt /
|
COPY ${NETBOX_PATH}/requirements.txt /
|
||||||
|
|
|
@ -37,9 +37,9 @@ DATABASE = {
|
||||||
# PostgreSQL password
|
# PostgreSQL password
|
||||||
'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server
|
'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server
|
||||||
'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default)
|
'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default)
|
||||||
'OPTIONS': {'sslmode': os.environ.get('DB_SSLMODE', 'prefer')},
|
'OPTIONS': {'sslmode': os.environ.get('DB_SSLMODE', 'prefer')},
|
||||||
# Database connection SSLMODE
|
# Database connection SSLMODE
|
||||||
'CONN_MAX_AGE': int(os.environ.get('DB_CONN_MAX_AGE', '300')),
|
'CONN_MAX_AGE': int(os.environ.get('DB_CONN_MAX_AGE', '300')),
|
||||||
# Database connection persistence
|
# Database connection persistence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,13 +51,22 @@ SECRET_KEY = os.environ.get('SECRET_KEY', read_secret('secret_key'))
|
||||||
|
|
||||||
# Redis database settings. The Redis database is used for caching and background processing such as webhooks
|
# Redis database settings. The Redis database is used for caching and background processing such as webhooks
|
||||||
REDIS = {
|
REDIS = {
|
||||||
'HOST': os.environ.get('REDIS_HOST', 'localhost'),
|
'webhooks': {
|
||||||
'PORT': int(os.environ.get('REDIS_PORT', 6379)),
|
'HOST': os.environ.get('REDIS_HOST', 'localhost'),
|
||||||
'PASSWORD': os.environ.get('REDIS_PASSWORD', read_secret('redis_password')),
|
'PORT': int(os.environ.get('REDIS_PORT', 6379)),
|
||||||
'DATABASE': os.environ.get('REDIS_DATABASE', '0'),
|
'PASSWORD': os.environ.get('REDIS_PASSWORD', read_secret('redis_password')),
|
||||||
'CACHE_DATABASE': os.environ.get('REDIS_CACHE_DATABASE', '1'),
|
'DATABASE': int(os.environ.get('REDIS_DATABASE', 0)),
|
||||||
'DEFAULT_TIMEOUT': os.environ.get('REDIS_TIMEOUT', '300'),
|
'DEFAULT_TIMEOUT': int(os.environ.get('REDIS_TIMEOUT', 300)),
|
||||||
'SSL': os.environ.get('REDIS_SSL', 'False').lower() == 'true',
|
'SSL': os.environ.get('REDIS_SSL', 'False').lower() == 'true',
|
||||||
|
},
|
||||||
|
'caching': {
|
||||||
|
'HOST': os.environ.get('REDIS_CACHE_HOST', os.environ.get('REDIS_HOST', 'localhost')),
|
||||||
|
'PORT': int(os.environ.get('REDIS_CACHE_PORT', os.environ.get('REDIS_PORT', 6379))),
|
||||||
|
'PASSWORD': os.environ.get('REDIS_CACHE_PASSWORD', os.environ.get('REDIS_PASSWORD', read_secret('redis_cache_password'))),
|
||||||
|
'DATABASE': int(os.environ.get('REDIS_CACHE_DATABASE', 1)),
|
||||||
|
'DEFAULT_TIMEOUT': int(os.environ.get('REDIS_CACHE_TIMEOUT', os.environ.get('REDIS_TIMEOUT', 300))),
|
||||||
|
'SSL': os.environ.get('REDIS_CACHE_SSL', os.environ.get('REDIS_SSL', 'False')).lower() == 'true',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
|
@ -172,10 +181,6 @@ SCRIPTS_ROOT = os.environ.get('SCRIPTS_ROOT', '/etc/netbox/scripts')
|
||||||
# Time zone (default: UTC)
|
# Time zone (default: UTC)
|
||||||
TIME_ZONE = os.environ.get('TIME_ZONE', 'UTC')
|
TIME_ZONE = os.environ.get('TIME_ZONE', 'UTC')
|
||||||
|
|
||||||
# The Webhook event backend is disabled by default. Set this to True to enable it. Note that this requires a Redis
|
|
||||||
# database be configured and accessible by NetBox (see `REDIS` below).
|
|
||||||
WEBHOOKS_ENABLED = os.environ.get('WEBHOOKS_ENABLED', 'False').lower() == 'true'
|
|
||||||
|
|
||||||
# Date/time formatting. See the following link for supported formats:
|
# Date/time formatting. See the following link for supported formats:
|
||||||
# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||||
DATE_FORMAT = os.environ.get('DATE_FORMAT', 'N j, Y')
|
DATE_FORMAT = os.environ.get('DATE_FORMAT', 'N j, Y')
|
||||||
|
|
|
@ -5,6 +5,7 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
|
- redis-cache
|
||||||
- netbox-worker
|
- netbox-worker
|
||||||
env_file: env/netbox.env
|
env_file: env/netbox.env
|
||||||
user: '101'
|
user: '101'
|
||||||
|
@ -50,6 +51,13 @@ services:
|
||||||
env_file: env/redis.env
|
env_file: env/redis.env
|
||||||
volumes:
|
volumes:
|
||||||
- netbox-redis-data:/data
|
- netbox-redis-data:/data
|
||||||
|
redis-cache:
|
||||||
|
image: redis:5-alpine
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c # this is to evaluate the $REDIS_PASSWORD from the env
|
||||||
|
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
|
||||||
|
env_file: env/redis.env
|
||||||
volumes:
|
volumes:
|
||||||
netbox-static-files:
|
netbox-static-files:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
|
@ -17,8 +17,11 @@ MAX_PAGE_SIZE=1000
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
REDIS_PASSWORD=H733Kdjndks81
|
REDIS_PASSWORD=H733Kdjndks81
|
||||||
REDIS_DATABASE=0
|
REDIS_DATABASE=0
|
||||||
REDIS_CACHE_DATABASE=1
|
|
||||||
REDIS_SSL=false
|
REDIS_SSL=false
|
||||||
|
REDIS_CACHE_HOST=redis-cache
|
||||||
|
REDIS_CACHE_PASSWORD=t4Ph722qJ5QHeQ1qfu36
|
||||||
|
REDIS_CACHE_DATABASE=0
|
||||||
|
REDIS_CACHE_SSL=false
|
||||||
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
|
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
|
||||||
SKIP_STARTUP_SCRIPTS=false
|
SKIP_STARTUP_SCRIPTS=false
|
||||||
SKIP_SUPERUSER=false
|
SKIP_SUPERUSER=false
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
REDIS_PASSWORD=t4Ph722qJ5QHeQ1qfu36
|
Loading…
Reference in New Issue