customize
This commit is contained in:
parent
e02119c15c
commit
c3727f5e4f
10
master.cfg
10
master.cfg
@ -5,6 +5,7 @@ import os
|
|||||||
|
|
||||||
from buildbot.plugins import *
|
from buildbot.plugins import *
|
||||||
from buildbot.www.oauth2 import OAuth2Auth
|
from buildbot.www.oauth2 import OAuth2Auth
|
||||||
|
from buildbot.www.authz.roles import RolesFromUsername
|
||||||
|
|
||||||
# This is a sample buildmaster config file. It must be installed as
|
# This is a sample buildmaster config file. It must be installed as
|
||||||
# 'master.cfg' in your buildmaster's base directory.
|
# 'master.cfg' in your buildmaster's base directory.
|
||||||
@ -173,6 +174,12 @@ c["titleURL"] = "https://gitea.parrrate.ru/PTV/radn-rs"
|
|||||||
c["buildbotURL"] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
|
c["buildbotURL"] = os.environ.get("BUILDBOT_WEB_URL", "http://localhost:8010/")
|
||||||
|
|
||||||
|
|
||||||
|
class RolesFromCustom(RolesFromUsername):
|
||||||
|
def getRolesFromUser(self, userDetails):
|
||||||
|
print(userDetails)
|
||||||
|
return super().getRolesFromUser(userDetails)
|
||||||
|
|
||||||
|
|
||||||
# minimalistic config to activate new web UI
|
# minimalistic config to activate new web UI
|
||||||
c["www"] = {
|
c["www"] = {
|
||||||
"port": os.environ.get("BUILDBOT_WEB_PORT", 8010),
|
"port": os.environ.get("BUILDBOT_WEB_PORT", 8010),
|
||||||
@ -187,7 +194,8 @@ c["www"] = {
|
|||||||
client_secret=CLIENT_SECRET,
|
client_secret=CLIENT_SECRET,
|
||||||
),
|
),
|
||||||
"authz": util.Authz(
|
"authz": util.Authz(
|
||||||
allowRules=[util.AnyControlEndpointMatcher(role="admins")], roleMatchers=[]
|
allowRules=[util.AnyControlEndpointMatcher(role="admins")],
|
||||||
|
roleMatchers=[RolesFromCustom(["admin"], ["timofey"])],
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
if GITEA_SECRET:
|
if GITEA_SECRET:
|
||||||
|
Loading…
Reference in New Issue
Block a user