2011-11-12 18:20:07 +00:00
|
|
|
"""
|
|
|
|
This module returns the given status handlers to enable for the
|
|
|
|
buildbot master.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from buildbot.status import html
|
|
|
|
from buildbot.status.web.authz import Authz
|
2011-11-13 00:09:30 +00:00
|
|
|
from buildbot.status.web.auth import BasicAuth
|
2011-11-12 18:20:07 +00:00
|
|
|
|
|
|
|
def get_status(options):
|
|
|
|
"""
|
|
|
|
Returns a list of status targets for the build master.
|
|
|
|
"""
|
2011-11-13 00:09:30 +00:00
|
|
|
# Load the users that are allowed to perform authenticated
|
|
|
|
# actions from the configuration
|
|
|
|
auth_users = []
|
|
|
|
if options.http_users is not None:
|
|
|
|
for pair in options.http_users.split(","):
|
|
|
|
user, password = pair.split(":")
|
|
|
|
auth_users.append((user, password))
|
|
|
|
|
|
|
|
# Setup the rules for who can do what to the WebStatus
|
2011-11-12 18:20:07 +00:00
|
|
|
authz = Authz(
|
2011-11-13 00:09:30 +00:00
|
|
|
auth = BasicAuth(auth_users),
|
|
|
|
gracefulShutdown = False,
|
|
|
|
forceBuild = 'auth',
|
|
|
|
forceAllBuilds = 'auth',
|
2011-11-12 18:20:07 +00:00
|
|
|
pingBuilder = True,
|
2011-11-13 00:09:30 +00:00
|
|
|
stopBuild = 'auth',
|
|
|
|
stopAllBuilds = 'auth',
|
|
|
|
cancelPendingBuild = 'auth',
|
|
|
|
stopChange = 'auth',
|
|
|
|
cleanShutdown= False
|
2011-11-12 18:20:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
web_status = html.WebStatus(
|
|
|
|
http_port = options.web_port,
|
2011-11-13 00:09:30 +00:00
|
|
|
authz = authz,
|
2011-11-12 21:14:16 +00:00
|
|
|
order_console_by_time = True,
|
|
|
|
change_hook_dialects=dict(github=True)
|
2011-11-12 18:20:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
return [web_status]
|