From 8bc77c1bc08fed47a238869a60f7631d8f4ffcfa Mon Sep 17 00:00:00 2001 From: erin Date: Fri, 27 Mar 2020 21:30:26 -0700 Subject: [PATCH 1/2] Add RELEASE_CHECK_URL to configuration and default env. --- configuration/configuration.py | 9 +++++++++ env/netbox.env | 1 + 2 files changed, 10 insertions(+) diff --git a/configuration/configuration.py b/configuration/configuration.py index af121d9..94534ae 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -170,6 +170,15 @@ PAGINATE_COUNT = int(os.environ.get('PAGINATE_COUNT', 50)) # When determining the primary IP address for a device, IPv6 is preferred over IPv4 by default. Set this to True to # prefer IPv4 instead. PREFER_IPV4 = os.environ.get('PREFER_IPV4', 'False').lower() == 'true' + +# This determines how often the GitHub API is called to check the latest release of NetBox. Must be at least 1 hour. +RELEASE_CHECK_TIMEOUT = os.environ.get('RELEASE_CHECK_TIMEOUT', 24 * 3600) + +# This repository is used to check whether there is a new release of NetBox available. Set to None to disable the +# version check or use the URL below to check for release in the official NetBox repository. +# https://api.github.com/repos/netbox-community/netbox/releases +RELEASE_CHECK_URL = os.environ.get('RELEASE_CHECK_URL', None) + # 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') diff --git a/env/netbox.env b/env/netbox.env index aaa7482..7f5e849 100644 --- a/env/netbox.env +++ b/env/netbox.env @@ -30,3 +30,4 @@ SUPERUSER_EMAIL=admin@example.com SUPERUSER_PASSWORD=admin SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567 WEBHOOKS_ENABLED=true +RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases From f87ffe7c3359638283169437dd1d8b4f35a6b548 Mon Sep 17 00:00:00 2001 From: nepeat Date: Sun, 29 Mar 2020 01:40:08 -0700 Subject: [PATCH 2/2] Update configuration/configuration.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Christian Mäder --- configuration/configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/configuration.py b/configuration/configuration.py index 94534ae..af5d3ba 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -171,7 +171,7 @@ PAGINATE_COUNT = int(os.environ.get('PAGINATE_COUNT', 50)) # prefer IPv4 instead. PREFER_IPV4 = os.environ.get('PREFER_IPV4', 'False').lower() == 'true' -# This determines how often the GitHub API is called to check the latest release of NetBox. Must be at least 1 hour. +# This determines how often the GitHub API is called to check the latest release of NetBox in seconds. Must be at least 1 hour. RELEASE_CHECK_TIMEOUT = os.environ.get('RELEASE_CHECK_TIMEOUT', 24 * 3600) # This repository is used to check whether there is a new release of NetBox available. Set to None to disable the