Add gerritbot-matrix identity lookup configuration
This change enables the bot to loopup gerrit identity on the matrix. Change-Id: I18d286e249cc02b83c97a575de564fe1a6d984aa
This commit is contained in:
parent
32a38a4b83
commit
16d57732b4
@ -22,3 +22,13 @@ Delete the token:
|
|||||||
.. code-block::
|
.. code-block::
|
||||||
|
|
||||||
curl -H "Authorization: Bearer ${MATRIX_TOKEN}" -X POST ${HOMESERVER_URL}/_matrix/client/r0/logout -d{}
|
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}"
|
||||||
|
@ -15,3 +15,5 @@ gerritbot_gerrit_user: "gerritbot"
|
|||||||
# matrix configuration
|
# matrix configuration
|
||||||
gerritbot_matrix_homeserver: "https://opendev.ems.host"
|
gerritbot_matrix_homeserver: "https://opendev.ems.host"
|
||||||
gerritbot_matrix_access_token: ""
|
gerritbot_matrix_access_token: ""
|
||||||
|
gerritbot_matrix_identityserver: "https://matrix.org"
|
||||||
|
gerritbot_matrix_identity_token: ""
|
||||||
|
@ -13,6 +13,7 @@ services:
|
|||||||
tag: "docker-matrix-gerritbot"
|
tag: "docker-matrix-gerritbot"
|
||||||
environment:
|
environment:
|
||||||
MATRIX_TOKEN: {{ gerritbot_matrix_access_token }}
|
MATRIX_TOKEN: {{ gerritbot_matrix_access_token }}
|
||||||
|
MATRIX_IDENTITY_TOKEN: {{ gerritbot_matrix_identity_token }}
|
||||||
volumes:
|
volumes:
|
||||||
- /var/lib/matrix-gerritbot/config:/config
|
- /var/lib/matrix-gerritbot/config:/config
|
||||||
- /var/lib/matrix-gerritbot/ssh:/root/.ssh
|
- /var/lib/matrix-gerritbot/ssh:/root/.ssh
|
||||||
@ -24,5 +25,6 @@ services:
|
|||||||
--gerrit-host {{ gerritbot_gerrit_host }}
|
--gerrit-host {{ gerritbot_gerrit_host }}
|
||||||
--gerrit-user {{ gerritbot_gerrit_user }}
|
--gerrit-user {{ gerritbot_gerrit_user }}
|
||||||
--homeserver-url {{ gerritbot_matrix_homeserver }}
|
--homeserver-url {{ gerritbot_matrix_homeserver }}
|
||||||
|
--identity-url {{ gerritbot_matrix_identityserver }}
|
||||||
--config-file /config/gerritbot.dhall
|
--config-file /config/gerritbot.dhall
|
||||||
--monitoring-port {{ gerritbot_matrix_prometheus_port }}
|
--monitoring-port {{ gerritbot_matrix_prometheus_port }}
|
||||||
|
Loading…
Reference in New Issue
Block a user