1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

added config option to disable plugins

This commit is contained in:
John Anderson
2020-03-01 03:42:05 -05:00
parent 71a8a13644
commit 5f5edbc10e
2 changed files with 54 additions and 40 deletions

View File

@ -187,6 +187,18 @@ PREFER_IPV4 = False
# this setting is derived from the installed location.
# SCRIPTS_ROOT = '/opt/netbox/netbox/scripts'
# Enable plugin support in netbox. This setting must be enabled for any installed plugins to function.
PLUGINS_ENABLED = False
# Plugins configuration settings. These settings are used by various plugins that the user may have installed.
# Each key in the dictionary is the name of an installed plugin and its value is a dictionary of settings.
# PLUGINS_CONFIG = {
# 'my_plugin': {
# 'foo': 'bar',
# 'buzz': 'bazz'
# }
# }
# By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
# local file storage instead. (This can be useful for enabling authentication on a standby instance with read-only
# database access.) Note that the user as which NetBox runs must have read and write permissions to this path.

View File

@ -95,6 +95,7 @@ NAPALM_TIMEOUT = getattr(configuration, 'NAPALM_TIMEOUT', 30)
NAPALM_USERNAME = getattr(configuration, 'NAPALM_USERNAME', '')
PAGINATE_COUNT = getattr(configuration, 'PAGINATE_COUNT', 50)
PLUGINS_CONFIG = getattr(configuration, 'PLUGINS_CONFIG', {})
PLUGINS_ENABLED = getattr(configuration, 'PLUGINS_ENABLED', False)
PREFER_IPV4 = getattr(configuration, 'PREFER_IPV4', False)
REPORTS_ROOT = getattr(configuration, 'REPORTS_ROOT', os.path.join(BASE_DIR, 'reports')).rstrip('/')
SCRIPTS_ROOT = getattr(configuration, 'SCRIPTS_ROOT', os.path.join(BASE_DIR, 'scripts')).rstrip('/')
@ -601,7 +602,8 @@ if PAGINATE_COUNT not in PER_PAGE_DEFAULTS:
#
PLUGINS = []
for entry_point in iter_entry_points(group='netbox.plugin', name=None):
if PLUGINS_ENABLED:
for entry_point in iter_entry_points(group='netbox.plugin', name=None):
plugin = entry_point.module_name
PLUGINS.append(plugin)
INSTALLED_APPS.append(plugin)