diff --git a/master.cfg b/master.cfg index 0e4302a..2ca1ae7 100644 --- a/master.cfg +++ b/master.cfg @@ -4,6 +4,7 @@ import os from buildbot.plugins import * +from buildbot.www.oauth2 import OAuth2Auth # This is a sample buildmaster config file. It must be installed as # 'master.cfg' in your buildmaster's base directory. @@ -15,6 +16,11 @@ c = BuildmasterConfig = {} GITEA_SECRET = os.environ.get("GITEA_SECRET") GITEA_TOKEN = os.environ.get("GITEA_TOKEN") +CLIENT_ID = os.environ.get("GITEA_CLIENT_ID") +assert CLIENT_ID +CLIENT_SECRET = os.environ.get("GITEA_CLIENT_SECRET") +assert CLIENT_SECRET + ####### WORKERS # The 'workers' list defines the set of recognized workers. Each element is @@ -174,6 +180,13 @@ c["www"] = { "console_view": {}, }, "change_hook_dialects": {}, + "auth": OAuth2Auth( + CLIENT_ID, + CLIENT_SECRET, + name="Gitea", + authUri="https://gitea.parrrate.ru/login/oauth/authorize", + tokenUri="https://gitea.parrrate.ru/login/oauth/access_token", + ), } if GITEA_SECRET: c["www"]["change_hook_dialects"]["gitea"] = { diff --git a/worker/Dockerfile b/worker/Dockerfile index 4f70eca..821bfd1 100644 --- a/worker/Dockerfile +++ b/worker/Dockerfile @@ -4,4 +4,5 @@ RUN bash worker-setup.sh USER buildbot WORKDIR /buildbot COPY buildbot.tac /buildbot/buildbot.tac +RUN rustup component add clippy CMD ["/usr/bin/dumb-init", "twistd", "--pidfile=", "-ny", "buildbot.tac"]