Setting up GitLab, GitHub, JIRA and Webhooks Integrations With the Installer
In Element EnterpriseServer On-Premise,Suite, our GitLab, GitHub, and JIRA integrationsextensions
are provided by the hookshot package. This documentation explains how to
configure the installer to install hookshot and then how to interact with
hookshot once installed.hookshot.
Configuring Hookshot with the Installer
config-sample/hookshot/hookshot.ymlFrom the installerInstaller's directoryIntegrations topage, click "Install" ~/.element-onpremise-config/hookshot
On the filefirst withscreen here, we can set the following values :
logging_levelhookshot_fqdnhookshot.<fqdn.tld>passkeyTo -use opensslhookshot, genrsa -out key.pem 4096
provisioning_secretbot_display_namebot_avatarmxc://verify_tlsdisallowed_ip_rangesEnabling GitHub Integration
On GitHub
https://<hookshot_fqdn>/oauthgenrsa -out passkey.pem 4096
which enablewill generate output similar to this:
RequestGenerating userRSA authorizationprivate key, 4096 bit long modulus (OAuth)2 duringprimes)
installation..................++++
..............++++
https://<hookshot_fqdn>/65537 (Once endingthis /)
pwgen 32 1On the installation
config-sample/hookshot/github.ymlpasskey.pem ~/.element-onpremise-config/hookshotgithub_auth_idgithub_key_fileGenerate a private keyPrivate keysgithub_webhook_secretgithub_oauth_client_idgithub_oauth_client_secretgithub_oauth_default_optionsIn Element's room
github loginEnabling GitLab integration
On GitLab
https://<hookshot_fqdn>/pwgen 32 1If you wish to triggerchange on.the hookshot provisioning secret, you can, but you can also leave this alone as it is randomly generated by the installer.
Next, we get to a set of settings that allow us to make changes to the Hookshot currentlybot's supports:appearance.
There
In this form, we have the installationability
config-sample/hookshot/gitlab.ymlincorporated into rooms (the defaults are usually fine) and to set a list of Disallowed IP ranges wherein widgets will not load if the homeserver IP falls in the remove ~/.element-onpremise-config/hookshotthat range Next, we have the option to enable Gitlab, which shows us the following valuessettings:
gitlab_instancesThe Awebhook mappingsecret ofis randomly generated and does not need to be changed. You can also add Gitlab instances by specifying an instance name and pasting the GitLabURL.
Next,
git.example.orgurlIn
here,gitlab_webhook_secretIn Element's room
gitlab personaltoken instancename personaltokensecret to connect to !hookshot gitlab project https://mydomain/my/project!gl helpEnabling JIRA integration
On JIRA
https://<hookshot_fqdn>/?secret=<jira_webhook_secret>pwgen 32 1Enable OAuth
steps:
The JIRA service currently only supports atlassian.com (JIRA SaaS) when handling user authentication. Support for on-prem deployments is hoping to land soon.
- You'll first need to head to https://developer.atlassian.com/console/myapps/create-3lo-app/ to create a "OAuth 2.0 (3LO)" integration.
- Once named and created, you will need to:
- Enable the User REST, JIRA Platform REST and User Identity APIs under Permissions.
- Use rotating tokens under Authorisation.
- Set a callback url. This will be the public URL to hookshot with a path of /jira/oauth.
- Copy the client ID and Secret from Settings
On
Once you've set these, you'll notice that a webhook secret has been randomly generated for you. You can leave this alone or edit it if you desire.
Next, let's look at configuring Webhooks:
You can set whether or not webhooks are enabled and whether they allow JS Transformation functions. It is good to leave these enabled per the installationdefaults.
config-sample/hookshot/jira.ymlwebhook_ then each new webhook will appear in a room with a username starting with webhook_.
Next, let's look at configuring Github:
This bridge requires a GitHub App. You will need to create one. Once you have created this, you'll be able to fill in the installerAuth directoryID and OAuth Client ID. You will also need to generate a ~/.element-onpremise-config/hookshot
On this screen, we have the fileoption to change how we call the bot and other minor settings. We also have the ability to select which hooks we provide notifications for, what labels we wish to exclude, and then which hooks we will ignore completely.
Now we have the ability to add a list of labels that we want to match. This has the impact of the integration only notifying you of issues with a specifc set of labels.
We then have the followingability valuesto :add
jira_webhook_secretjira_oauth_client_idThen we have the ability to enable showing diffs in the room when a PR is enabled,created.
Moving along, we can configure how workflow run results are configured in the bot, including matching specific workflows and including or excluding specific workflows.
Finishing Configuration
You furrther have the ability to click "Advanced" and set any kubernetes specific settings for how this pod is run. Once you have set everything up on this page, you can click "Continue" to go back to the ClientIDIntegrations page.
When you have finished running the installer and the hookshot pod is up and running, there are some configurations to handle in Jira'sthe AppElement page.client Else,itself in the rooms that you canwish keepthe it empty.
jira_oauth_client_secretIn Element's room
As an administratoradmin, ofyou thewill room,need to invite the hookshot bot
Once you have setupinvited Integrator,the bot into the room, you can use the integration"Add managerwidgets, bridges, & bots" functionality to add a bridge to JIRA. There is currently a limitation - it only works for public rooms.
Enabling generic webhooks integration
On the installation
"Hookshot config-sample/hookshot/generic.yml ~/.element-onpremise-config/hookshotgeneric_enabledtruegeneric_allow_js_transformation_functionstruegeneric_user_id_prefixIn Element's room
!hookshot webhook <name of the webhook>Content-Type









