Merge "Add gerritbot-matrix identity lookup configuration"

This commit is contained in:
Zuul 2021-08-20 17:43:49 +00:00 committed by Gerrit Code Review
commit 883111ed08
3 changed files with 14 additions and 0 deletions

View File

@ -22,3 +22,13 @@ Delete the token:
.. code-block::
curl -H "Authorization: Bearer ${MATRIX_TOKEN}" -X POST ${HOMESERVER_URL}/_matrix/client/r0/logout -d{}
Create the *gerritbot_matrix_identity_token* with this command:
.. code-block::
MATRIX_OPENID=$(curl -XPOST ${HOMESERVER_URL}/_matrix/client/r0/user/${USER}/openid/request_token -H "Authorization: Bearer ${MATRIX_TOKEN}" -d '{}')
IDENTITY_URL="https://matrix.org"
export MATRIX_IDENTITY_TOKEN=$(curl -XPOST ${IDENTITY_URL}/_matrix/identity/v2/account/register -d "${MATRIX_OPENID}" | jq -r '.access_token')
echo "gerritbot_matrix_identity_token: ${MATRIX_IDENTITY_TOKEN}"

View File

@ -15,3 +15,5 @@ gerritbot_gerrit_user: "gerritbot"
# matrix configuration
gerritbot_matrix_homeserver: "https://opendev.ems.host"
gerritbot_matrix_access_token: ""
gerritbot_matrix_identityserver: "https://matrix.org"
gerritbot_matrix_identity_token: ""

View File

@ -13,6 +13,7 @@ services:
tag: "docker-matrix-gerritbot"
environment:
MATRIX_TOKEN: {{ gerritbot_matrix_access_token }}
MATRIX_IDENTITY_TOKEN: {{ gerritbot_matrix_identity_token }}
volumes:
- /var/lib/matrix-gerritbot/config:/config
- /var/lib/matrix-gerritbot/ssh:/root/.ssh
@ -24,5 +25,6 @@ services:
--gerrit-host {{ gerritbot_gerrit_host }}
--gerrit-user {{ gerritbot_gerrit_user }}
--homeserver-url {{ gerritbot_matrix_homeserver }}
--identity-url {{ gerritbot_matrix_identityserver }}
--config-file /config/gerritbot.dhall
--monitoring-port {{ gerritbot_matrix_prometheus_port }}