Working implementation of webhooks using new 'redis' container

This commit is contained in:
Brady Lamprecht 2018-08-10 17:55:09 -06:00
parent 6b5a4cf1db
commit b88974ef9f
6 changed files with 62 additions and 3 deletions

View file

@ -139,6 +139,19 @@ PAGINATE_COUNT = int(os.environ.get('PAGINATE_COUNT', 50))
# prefer IPv4 instead.
PREFER_IPV4 = os.environ.get('PREFER_IPV4', 'False').lower() == 'true'
# 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', 'True').lower() == 'true'
# Redis database settings (optional). A Redis database is required only if the webhooks backend is enabled.
REDIS = {
'HOST': os.environ.get('REDIS_HOST', 'localhost'),
'PORT': os.environ.get('REDIS_PORT', '6379'),
'PASSWORD': os.environ.get('REDIS_PASSWORD', ''),
'DATABASE': os.environ.get('REDIS_DATABASE', '0'),
'DEFAULT_TIMEOUT': os.environ.get('REDIS_TIMEOUT', '300'),
}
# The file path where custom reports will be stored. A trailing slash is not needed. Note that the default value of
# this setting is derived from the installed location.
REPORTS_ROOT = os.environ.get('REPORTS_ROOT', '/etc/netbox/reports')

View file

@ -0,0 +1,16 @@
[supervisord]
nodaemon=true
[supervisorctl]
[program:netbox]
command = gunicorn -c /etc/netbox/config/gunicorn_config.py netbox.wsgi
directory = /opt/netbox/netbox/
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
user = nobody
[program:netbox-rqworker]
command = python3 /opt/netbox/netbox/manage.py rqworker
directory = /opt/netbox/netbox/
user = nobody