Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hookshot webhook listener moved to /webhook #1723

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HarHarLinks
Copy link
Contributor

fixes #1681, introduced in matrix-org/matrix-hookshot#227

@HarHarLinks
Copy link
Contributor Author

HarHarLinks commented Mar 31, 2022

Upstream hookshot now prefers to listen at /webhook instead of /.
The playbook default is currently to listen on (some common prefix plus) /webhooks, see

matrix_hookshot_webhook_endpoint: "{{ matrix_hookshot_public_endpoint }}/webhooks"

I think it would be preferable to update our proxied endpoint to match upstream to avoid confusion for new users, but it would be necessary to also be backward-compatible to our old setup in my opinion so admins don't have to manually intervene (set that variable to the old default, or update all their configured services).

This is not a big problem to do with nginx locations, we can simply update the regex to webhooks? to match the s optionally and thus proxy both to the new /webhook endpoint on hookshot side.

However I am not certain on the hookshot side: this variable is used by the playbook to define some config like the following

matrix_hookshot_github_oauth_endpoint: "{{ matrix_hookshot_webhook_endpoint }}/oauth"
matrix_hookshot_github_oauth_uri: "https://{{ matrix_server_fqn_matrix }}{{ matrix_hookshot_github_oauth_endpoint }}"

redirect_uri: {{ matrix_hookshot_github_oauth_uri }}

@Half-Shot please advice: I fear that if the playbook's "canonical" default were to be update to /webhook and this hookshot configuration done with this uri, then even though the nginx proxy accepts /webhooks/oauth and forwards it to hookshot, hookshot may not accept it, but only accept /webhook/oauth.

@HarHarLinks
Copy link
Contributor Author

HarHarLinks commented Mar 31, 2022

I may have misunderstood the upstream change, got confused by the exact confusing Half-Shot tried to eliminate. Are GitHub, GitLab, oauth, etc webhooks supposed to go to /webhook now, or still go to / while only generics go to /webhook?

Edit: I received an answer out of band: Half-Shot confirmed the latter. I'll redo the PR entirely at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hookshot - Generic webhooks will be routed to /webhook
1 participant