Commit 2ed79b82 authored by Ziirish's avatar Ziirish

rename standalone option + fix ACL auto-reload issue

parent 3c42f3e0
......@@ -25,7 +25,7 @@ G_BIND = u'::'
G_REFRESH = 180
G_LIVEREFRESH = 5
G_SSL = False
G_STANDALONE = True
G_SINGLE = True
G_SSLCERT = u''
G_SSLKEY = u''
G_VERSION = 2
......@@ -59,7 +59,8 @@ class BUIServer(Flask):
'port': G_PORT,
'bind': G_BIND,
'ssl': G_SSL,
'standalone': G_STANDALONE,
'standalone': G_SINGLE,
'single': G_SINGLE,
'sslcert': G_SSLCERT,
'sslkey': G_SSLKEY,
'version': G_VERSION,
......@@ -160,8 +161,11 @@ class BUIServer(Flask):
'ssl',
'boolean'
)
# option standalone has been renamed for less confusion
key = 'standalone' if 'standalone' in \
self.conf.conf.get(self.conf.section, {}) else 'single'
self.standalone = self.config['STANDALONE'] = self.conf.safe_get(
'standalone',
key,
'boolean'
)
self.sslcert = self.config['BUI_SSLCERT'] = self.conf.safe_get(
......@@ -351,9 +355,9 @@ class BUIServer(Flask):
ACLloader = mod.ACLloader
self.acl_handler = ACLloader(self)
# for development purpose only
from .misc.acl.interface import BUIacl
self.acl = BUIacl
self.acl = self.acl_handler.acl
# from .misc.acl.interface import BUIacl
# self.acl = BUIacl
# self.acl = self.acl_handler.acl
except Exception as e:
self.logger.critical(
'Import Exception, module \'{0}\': {1}'.format(
......@@ -394,6 +398,19 @@ class BUIServer(Flask):
)
sys.exit(2)
@property
def acl(self):
"""ACL module
:returns: :class:`burpui.misc.acl.interface.BUIacl`
"""
if self.acl_engine and self.acl_engine.lower() != 'none':
# refresh acl to detect config changes
from .misc.acl.interface import BUIacl # noqa
acl = self.acl_handler.acl # type: BUIacl
return acl
return None
def get_send_file_max_age(self, name):
"""Provides default cache_timeout for the send_file() functions."""
if name:
......
......@@ -7,7 +7,7 @@ version = 2
# Handle multiple bui-servers or not
# If set to 'false', you will need to declare at least one 'Agent' section (see
# bellow)
standalone = true
single = true
# authentication plugin (mandatory)
# list the misc/auth directory to see the available backends
# to disable authentication you can set "auth = none"
......@@ -220,11 +220,11 @@ noserverrestore = false
## You can also overwrite the default behavior by specifying which clients a
## user can access
#user3 = '["client4", "client5"]'
## In case you are not in a standalone mode, you can also specify which clients
## In case you are not in a single mode, you can also specify which clients
## a user can access on a specific Agent
#user4 = '{"agent2": ["client8"], "agent1": ["client6", "client7"]}'
## If you set standalone to 'false', add at least one section like this per
## If you set single to 'false', add at least one section like this per
## bui-agent
#[Agent:agent1]
## bui-agent address
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment