configuration.example.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. #########################
  2. # #
  3. # Required settings #
  4. # #
  5. #########################
  6. # This is a list of valid fully-qualified domain names (FQDNs) for the NetBox server. NetBox will not permit write
  7. # access to the server via any other hostnames. The first FQDN in the list will be treated as the preferred name.
  8. #
  9. # Example: ALLOWED_HOSTS = ['netbox.example.com', 'netbox.internal.local']
  10. ALLOWED_HOSTS = []
  11. # PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
  12. # https://docs.djangoproject.com/en/stable/ref/settings/#databases
  13. DATABASE = {
  14. 'NAME': 'netbox', # Database name
  15. 'USER': '', # PostgreSQL username
  16. 'PASSWORD': '', # PostgreSQL password
  17. 'HOST': 'localhost', # Database server
  18. 'PORT': '', # Database port (leave blank for default)
  19. 'CONN_MAX_AGE': 300, # Max database connection age
  20. }
  21. # Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate
  22. # configuration exists for each. Full connection details are required in both sections, and it is strongly recommended
  23. # to use two separate database IDs.
  24. REDIS = {
  25. 'tasks': {
  26. 'HOST': 'localhost',
  27. 'PORT': 6379,
  28. # Comment out `HOST` and `PORT` lines and uncomment the following if using Redis Sentinel
  29. # 'SENTINELS': [('mysentinel.redis.example.com', 6379)],
  30. # 'SENTINEL_SERVICE': 'netbox',
  31. 'PASSWORD': '',
  32. 'DATABASE': 0,
  33. 'SSL': False,
  34. # Set this to True to skip TLS certificate verification
  35. # This can expose the connection to attacks, be careful
  36. # 'INSECURE_SKIP_TLS_VERIFY': False,
  37. },
  38. 'caching': {
  39. 'HOST': 'localhost',
  40. 'PORT': 6379,
  41. # Comment out `HOST` and `PORT` lines and uncomment the following if using Redis Sentinel
  42. # 'SENTINELS': [('mysentinel.redis.example.com', 6379)],
  43. # 'SENTINEL_SERVICE': 'netbox',
  44. 'PASSWORD': '',
  45. 'DATABASE': 1,
  46. 'SSL': False,
  47. # Set this to True to skip TLS certificate verification
  48. # This can expose the connection to attacks, be careful
  49. # 'INSECURE_SKIP_TLS_VERIFY': False,
  50. }
  51. }
  52. # This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.
  53. # For optimal security, SECRET_KEY should be at least 50 characters in length and contain a mix of letters, numbers, and
  54. # symbols. NetBox will not run without this defined. For more information, see
  55. # https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-SECRET_KEY
  56. SECRET_KEY = ''
  57. #########################
  58. # #
  59. # Optional settings #
  60. # #
  61. #########################
  62. # Specify one or more name and email address tuples representing NetBox administrators. These people will be notified of
  63. # application errors (assuming correct email settings are provided).
  64. ADMINS = [
  65. # ['John Doe', 'jdoe@example.com'],
  66. ]
  67. # URL schemes that are allowed within links in NetBox
  68. ALLOWED_URL_SCHEMES = (
  69. 'file', 'ftp', 'ftps', 'http', 'https', 'irc', 'mailto', 'sftp', 'ssh', 'tel', 'telnet', 'tftp', 'vnc', 'xmpp',
  70. )
  71. # Optionally display a persistent banner at the top and/or bottom of every page. HTML is allowed. To display the same
  72. # content in both banners, define BANNER_TOP and set BANNER_BOTTOM = BANNER_TOP.
  73. BANNER_TOP = ''
  74. BANNER_BOTTOM = ''
  75. # Text to include on the login page above the login form. HTML is allowed.
  76. BANNER_LOGIN = ''
  77. # Base URL path if accessing NetBox within a directory. For example, if installed at https://example.com/netbox/, set:
  78. # BASE_PATH = 'netbox/'
  79. BASE_PATH = ''
  80. # Cache timeout in seconds. Defaults to zero (disabled).
  81. CACHE_TIMEOUT = 0
  82. # Maximum number of days to retain logged changes. Set to 0 to retain changes indefinitely. (Default: 90)
  83. CHANGELOG_RETENTION = 90
  84. # API Cross-Origin Resource Sharing (CORS) settings. If CORS_ORIGIN_ALLOW_ALL is set to True, all origins will be
  85. # allowed. Otherwise, define a list of allowed origins using either CORS_ORIGIN_WHITELIST or
  86. # CORS_ORIGIN_REGEX_WHITELIST. For more information, see https://github.com/ottoyiu/django-cors-headers
  87. CORS_ORIGIN_ALLOW_ALL = False
  88. CORS_ORIGIN_WHITELIST = [
  89. # 'https://hostname.example.com',
  90. ]
  91. CORS_ORIGIN_REGEX_WHITELIST = [
  92. # r'^(https?://)?(\w+\.)?example\.com$',
  93. ]
  94. # Set to True to enable server debugging. WARNING: Debugging introduces a substantial performance penalty and may reveal
  95. # sensitive information about your installation. Only enable debugging while performing testing. Never enable debugging
  96. # on a production system.
  97. DEBUG = False
  98. # Email settings
  99. EMAIL = {
  100. 'SERVER': 'localhost',
  101. 'PORT': 25,
  102. 'USERNAME': '',
  103. 'PASSWORD': '',
  104. 'USE_SSL': False,
  105. 'USE_TLS': False,
  106. 'TIMEOUT': 10, # seconds
  107. 'FROM_EMAIL': '',
  108. }
  109. # Enforcement of unique IP space can be toggled on a per-VRF basis. To enforce unique IP space within the global table
  110. # (all prefixes and IP addresses not assigned to a VRF), set ENFORCE_GLOBAL_UNIQUE to True.
  111. ENFORCE_GLOBAL_UNIQUE = False
  112. # Exempt certain models from the enforcement of view permissions. Models listed here will be viewable by all users and
  113. # by anonymous users. List models in the form `<app>.<model>`. Add '*' to this list to exempt all models.
  114. EXEMPT_VIEW_PERMISSIONS = [
  115. # 'dcim.site',
  116. # 'dcim.region',
  117. # 'ipam.prefix',
  118. ]
  119. # HTTP proxies NetBox should use when sending outbound HTTP requests (e.g. for webhooks).
  120. # HTTP_PROXIES = {
  121. # 'http': 'http://10.10.1.10:3128',
  122. # 'https': 'http://10.10.1.10:1080',
  123. # }
  124. # IP addresses recognized as internal to the system. The debugging toolbar will be available only to clients accessing
  125. # NetBox from an internal IP.
  126. INTERNAL_IPS = ('127.0.0.1', '::1')
  127. # Enable custom logging. Please see the Django documentation for detailed guidance on configuring custom logs:
  128. # https://docs.djangoproject.com/en/stable/topics/logging/
  129. LOGGING = {}
  130. # Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users
  131. # are permitted to access most data in NetBox (excluding secrets) but not make any changes.
  132. LOGIN_REQUIRED = False
  133. # The length of time (in seconds) for which a user will remain logged into the web UI before being prompted to
  134. # re-authenticate. (Default: 1209600 [14 days])
  135. LOGIN_TIMEOUT = None
  136. # Setting this to True will display a "maintenance mode" banner at the top of every page.
  137. MAINTENANCE_MODE = False
  138. # The URL to use when mapping physical addresses or GPS coordinates
  139. MAPS_URL = 'https://maps.google.com/?q='
  140. # An API consumer can request an arbitrary number of objects =by appending the "limit" parameter to the URL (e.g.
  141. # "?limit=1000"). This setting defines the maximum limit. Setting it to 0 or None will allow an API consumer to request
  142. # all objects by specifying "?limit=0".
  143. MAX_PAGE_SIZE = 1000
  144. # The file path where uploaded media such as image attachments are stored. A trailing slash is not needed. Note that
  145. # the default value of this setting is derived from the installed location.
  146. # MEDIA_ROOT = '/opt/netbox/netbox/media'
  147. # By default uploaded media is stored on the local filesystem. Using Django-storages is also supported. Provide the
  148. # class path of the storage driver in STORAGE_BACKEND and any configuration options in STORAGE_CONFIG. For example:
  149. # STORAGE_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
  150. # STORAGE_CONFIG = {
  151. # 'AWS_ACCESS_KEY_ID': 'Key ID',
  152. # 'AWS_SECRET_ACCESS_KEY': 'Secret',
  153. # 'AWS_STORAGE_BUCKET_NAME': 'netbox',
  154. # 'AWS_S3_REGION_NAME': 'eu-west-1',
  155. # }
  156. # Expose Prometheus monitoring metrics at the HTTP endpoint '/metrics'
  157. METRICS_ENABLED = False
  158. # Credentials that NetBox will uses to authenticate to devices when connecting via NAPALM.
  159. NAPALM_USERNAME = ''
  160. NAPALM_PASSWORD = ''
  161. # NAPALM timeout (in seconds). (Default: 30)
  162. NAPALM_TIMEOUT = 30
  163. # NAPALM optional arguments (see https://napalm.readthedocs.io/en/latest/support/#optional-arguments). Arguments must
  164. # be provided as a dictionary.
  165. NAPALM_ARGS = {}
  166. # Determine how many objects to display per page within a list. (Default: 50)
  167. PAGINATE_COUNT = 50
  168. # Enable installed plugins. Add the name of each plugin to the list.
  169. PLUGINS = []
  170. # Plugins configuration settings. These settings are used by various plugins that the user may have installed.
  171. # Each key in the dictionary is the name of an installed plugin and its value is a dictionary of settings.
  172. # PLUGINS_CONFIG = {
  173. # 'my_plugin': {
  174. # 'foo': 'bar',
  175. # 'buzz': 'bazz'
  176. # }
  177. # }
  178. # When determining the primary IP address for a device, IPv6 is preferred over IPv4 by default. Set this to True to
  179. # prefer IPv4 instead.
  180. PREFER_IPV4 = False
  181. # Rack elevation size defaults, in pixels. For best results, the ratio of width to height should be roughly 10:1.
  182. RACK_ELEVATION_DEFAULT_UNIT_HEIGHT = 22
  183. RACK_ELEVATION_DEFAULT_UNIT_WIDTH = 220
  184. # Remote authentication support
  185. REMOTE_AUTH_ENABLED = False
  186. REMOTE_AUTH_BACKEND = 'netbox.authentication.RemoteUserBackend'
  187. REMOTE_AUTH_HEADER = 'HTTP_REMOTE_USER'
  188. REMOTE_AUTH_AUTO_CREATE_USER = True
  189. REMOTE_AUTH_DEFAULT_GROUPS = []
  190. REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
  191. # This determines how often the GitHub API is called to check the latest release of NetBox. Must be at least 1 hour.
  192. RELEASE_CHECK_TIMEOUT = 24 * 3600
  193. # This repository is used to check whether there is a new release of NetBox available. Set to None to disable the
  194. # version check or use the URL below to check for release in the official NetBox repository.
  195. RELEASE_CHECK_URL = None
  196. # RELEASE_CHECK_URL = 'https://api.github.com/repos/netbox-community/netbox/releases'
  197. # The file path where custom reports will be stored. A trailing slash is not needed. Note that the default value of
  198. # this setting is derived from the installed location.
  199. # REPORTS_ROOT = '/opt/netbox/netbox/reports'
  200. # Maximum execution time for background tasks, in seconds.
  201. RQ_DEFAULT_TIMEOUT = 300
  202. # The file path where custom scripts will be stored. A trailing slash is not needed. Note that the default value of
  203. # this setting is derived from the installed location.
  204. # SCRIPTS_ROOT = '/opt/netbox/netbox/scripts'
  205. # The name to use for the session cookie.
  206. SESSION_COOKIE_NAME = 'sessionid'
  207. # By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
  208. # local file storage instead. (This can be useful for enabling authentication on a standby instance with read-only
  209. # database access.) Note that the user as which NetBox runs must have read and write permissions to this path.
  210. SESSION_FILE_PATH = None
  211. # Time zone (default: UTC)
  212. TIME_ZONE = 'UTC'
  213. # Date/time formatting. See the following link for supported formats:
  214. # https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date
  215. DATE_FORMAT = 'N j, Y'
  216. SHORT_DATE_FORMAT = 'Y-m-d'
  217. TIME_FORMAT = 'g:i a'
  218. SHORT_TIME_FORMAT = 'H:i:s'
  219. DATETIME_FORMAT = 'N j, Y g:i a'
  220. SHORT_DATETIME_FORMAT = 'Y-m-d H:i'