diff --git a/docs/configuration/optional-settings.md b/docs/configuration/optional-settings.md index 84b8ea576..2a58ad807 100644 --- a/docs/configuration/optional-settings.md +++ b/docs/configuration/optional-settings.md @@ -165,24 +165,6 @@ Enforcement of unique IP space can be toggled on a per-VRF basis. To enforce uni --- -## UPDATE_REPO_URL - -Default: None - -The releases of this repository are checked to detect new releases, which are shown on the home page of the web interface. You can change this to your own fork of the NetBox repository, or set it to `None` to disable the check. The URL provided **must** be compatible with the GitHub API. - -Use `'https://api.github.com/repos/netbox-community/netbox'` to check for release in the official NetBox repository. - ---- - -## UPDATE_CACHE_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). - ---- - ## LOGGING By default, all messages of INFO severity or higher will be logged to the console. Additionally, if `DEBUG` is False and email access has been configured, ERROR and CRITICAL messages will be emailed to the users defined in `ADMINS`. @@ -369,6 +351,24 @@ The time zone NetBox will use when dealing with dates and times. It is recommend --- +## UPDATE_CACHE_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). + +--- + +## UPDATE_REPO_URL + +Default: None + +The releases of this repository are checked to detect new releases, which are shown on the home page of the web interface. You can change this to your own fork of the NetBox repository, or set it to `None` to disable the check. The URL provided **must** be compatible with the GitHub API. + +Use `'https://api.github.com/repos/netbox-community/netbox/releases'` to check for release in the official NetBox repository. + +--- + ## Date and Time Formatting You may define custom formatting for date and times. For detailed instructions on writing format strings, please see [the Django documentation](https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date). diff --git a/netbox/netbox/configuration.example.py b/netbox/netbox/configuration.example.py index 3c7de6128..136c7c828 100644 --- a/netbox/netbox/configuration.example.py +++ b/netbox/netbox/configuration.example.py @@ -124,14 +124,6 @@ EXEMPT_VIEW_PERMISSIONS = [ # 'ipam.prefix', ] -# 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. -UPDATE_REPO_URL = None -# UPDATE_REPO_URL = 'https://api.github.com/repos/netbox-community/netbox' - -# This determines how often the GitHub API is called to check the latest release of NetBox. Must be at least 1 hour. -UPDATE_CACHE_TIMEOUT = 24 * 3600 - # Enable custom logging. Please see the Django documentation for detailed guidance on configuring custom logs: # https://docs.djangoproject.com/en/stable/topics/logging/ LOGGING = {} @@ -203,6 +195,14 @@ SESSION_FILE_PATH = None # Time zone (default: UTC) TIME_ZONE = 'UTC' +# This determines how often the GitHub API is called to check the latest release of NetBox. Must be at least 1 hour. +UPDATE_CACHE_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. +UPDATE_REPO_URL = None +# UPDATE_REPO_URL = 'https://api.github.com/repos/netbox-community/netbox/releases' + # Date/time formatting. See the following link for supported formats: # https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date DATE_FORMAT = 'N j, Y' diff --git a/netbox/utilities/background_tasks.py b/netbox/utilities/background_tasks.py index 9254c39f7..a2c1310c7 100644 --- a/netbox/utilities/background_tasks.py +++ b/netbox/utilities/background_tasks.py @@ -12,7 +12,7 @@ logger = logging.getLogger('netbox.releases') @job def get_releases(pre_releases=False): - url = '{}/releases'.format(settings.UPDATE_REPO_URL) + url = settings.UPDATE_REPO_URL headers = { 'Accept': 'application/vnd.github.v3+json', }