Browse Source

allow access restriction for admin users

master
parent
commit
84a855c81a
2 changed files with 12 additions and 0 deletions
  1. +2
    -0
      defaults/main.yaml
  2. +10
    -0
      templates/buildbot/master.cfg.j2

+ 2
- 0
defaults/main.yaml View File

@@ -21,3 +21,5 @@ buildbot_title_url: "{{ buildbot_base_url }}"
buildbot_base_url: https://{{buildbot_server_name}}/ buildbot_base_url: https://{{buildbot_server_name}}/


buildbot_with_gitea_auth: false buildbot_with_gitea_auth: false

buildbot_admin_usernames: []

+ 10
- 0
templates/buildbot/master.cfg.j2 View File

@@ -49,8 +49,18 @@ c['www']['auth'] = util.GiteaAuth(
client_id='{{buildbot_gitea_auth_client_id}}', client_id='{{buildbot_gitea_auth_client_id}}',
client_secret='{{buildbot_gitea_auth_client_secret}}', client_secret='{{buildbot_gitea_auth_client_secret}}',
) )
c['www']['authz'] = util.Authz(
allowRules=[
#util.AnyControlEndpointMatcher(role="admins"),
util.AnyEndpointMatcher(role="admins"),
],
roleMatchers=[
util.RolesFromUsername(roles=["admins"], usernames={{buildbot_admin_usernames|to_json}}),
]
)
{% endif %} {% endif %}



c['db'] = { c['db'] = {
'db_url' : "{{buildbot_database_url}}", 'db_url' : "{{buildbot_database_url}}",
} }


Loading…
Cancel
Save