From 7c6e5a68d92ab1ed64be4b651c3ead20db44970d Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 7 Jul 2021 21:55:07 -0400 Subject: [PATCH] Remove the RELEASE_CHECK_TIMEOUT parameter --- docs/configuration/optional-settings.md | 10 +--------- netbox/netbox/configuration.example.py | 3 --- netbox/netbox/settings.py | 13 +++++++------ 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/docs/configuration/optional-settings.md b/docs/configuration/optional-settings.md index 8a9924bca..46c08bdc1 100644 --- a/docs/configuration/optional-settings.md +++ b/docs/configuration/optional-settings.md @@ -478,19 +478,11 @@ When remote user authentication is in use, this is the name of the HTTP header w --- -## RELEASE_CHECK_TIMEOUT - -Default: 86,400 (24 hours) - -The number of seconds to retain the latest version that is fetched from the GitHub API before automatically invalidating it and fetching it from the API again. This must be set to at least one hour (3600 seconds). - ---- - ## RELEASE_CHECK_URL Default: None (disabled) -This parameter defines the URL of the repository that will be checked periodically for new NetBox releases. When a new release is detected, a message will be displayed to administrative users on the home page. This can be set to the official repository (`'https://api.github.com/repos/netbox-community/netbox/releases'`) or a custom fork. Set this to `None` to disable automatic update checks. +This parameter defines the URL of the repository that will be checked for new NetBox releases. When a new release is detected, a message will be displayed to administrative users on the home page. This can be set to the official repository (`'https://api.github.com/repos/netbox-community/netbox/releases'`) or a custom fork. Set this to `None` to disable automatic update checks. !!! note The URL provided **must** be compatible with the [GitHub REST API](https://docs.github.com/en/rest). diff --git a/netbox/netbox/configuration.example.py b/netbox/netbox/configuration.example.py index 9491db27d..ebbb05891 100644 --- a/netbox/netbox/configuration.example.py +++ b/netbox/netbox/configuration.example.py @@ -241,9 +241,6 @@ REMOTE_AUTH_AUTO_CREATE_USER = True REMOTE_AUTH_DEFAULT_GROUPS = [] REMOTE_AUTH_DEFAULT_PERMISSIONS = {} -# 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 = 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. RELEASE_CHECK_URL = None diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 2ba1a047a..1ec20af24 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -47,7 +47,13 @@ except ModuleNotFoundError as e: # Warn on removed config parameters if hasattr(configuration, 'CACHE_TIMEOUT'): - warnings.warn("The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.") + warnings.warn( + "The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect." + ) +if hasattr(configuration, 'RELEASE_CHECK_TIMEOUT'): + warnings.warn( + "The RELEASE_CHECK_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect." + ) # Enforce required configuration parameters for parameter in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY', 'REDIS']: @@ -114,7 +120,6 @@ REMOTE_AUTH_DEFAULT_PERMISSIONS = getattr(configuration, 'REMOTE_AUTH_DEFAULT_PE REMOTE_AUTH_ENABLED = getattr(configuration, 'REMOTE_AUTH_ENABLED', False) REMOTE_AUTH_HEADER = getattr(configuration, 'REMOTE_AUTH_HEADER', 'HTTP_REMOTE_USER') RELEASE_CHECK_URL = getattr(configuration, 'RELEASE_CHECK_URL', None) -RELEASE_CHECK_TIMEOUT = getattr(configuration, 'RELEASE_CHECK_TIMEOUT', 24 * 3600) REPORTS_ROOT = getattr(configuration, 'REPORTS_ROOT', os.path.join(BASE_DIR, 'reports')).rstrip('/') RQ_DEFAULT_TIMEOUT = getattr(configuration, 'RQ_DEFAULT_TIMEOUT', 300) SCRIPTS_ROOT = getattr(configuration, 'SCRIPTS_ROOT', os.path.join(BASE_DIR, 'scripts')).rstrip('/') @@ -141,10 +146,6 @@ if RELEASE_CHECK_URL: except ValidationError as err: raise ImproperlyConfigured(str(err)) -# Enforce a minimum cache timeout for update checks -if RELEASE_CHECK_TIMEOUT < 3600: - raise ImproperlyConfigured("RELEASE_CHECK_TIMEOUT has to be at least 3600 seconds (1 hour)") - # # Database