问题
How do you configure Buildbot to prompt for username/password using basic access authentication?
I can't find anything in Buildbot's documentation that explicitly mentions this. It has a useHttpHeader option, but that doesn't seem to do anything.
My WebStatus config looks like:
authz_cfg = authz.Authz(
auth=auth.BasicAuth([("admin", "password")]),
useHttpHeader=True,
gracefulShutdown=False,
forceBuild='auth',
forceAllBuilds='auth',
pingBuilder=False,
stopBuild=True,
stopAllBuilds=True,
cancelPendingBuild=True,
)
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
I want to deploy a server running Buildbot. Unfortunately, by default, Buildbot gives anonymous users read-access to almost all pages, and I want to block access to bots and strangers.
回答1:
You need to add view = 'auth'
.
Indeed, this is almost impossible to find out via the Buildbot documentation. I'm not even sure where I learned that from (just double-checked my master.cfg
...)
来源:https://stackoverflow.com/questions/34618643/how-to-enable-basic-access-authentication-with-buildbot