How to enable basic access authentication with Buildbot

冷暖自知 提交于 2019-12-08 11:48:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!