integrations / slack

Bring your code to the conversations you care about with the GitHub and Slack integration
https://slack.github.com/
MIT License
3.07k stars 482 forks source link

Slack integration support for Github Enterprise Server behind a firewall #1702

Open isaac-moses opened 1 year ago

isaac-moses commented 1 year ago

Is your feature request related to a problem? Please describe. We have our Github Enterprise Server behind a firewall on a private network so the bi-directional integration with Slack will not work.

Describe the solution you'd like Define a small set of IPs that Slack will use to interact with Github Enterprise Server so we can whitelist them.

simonfiddaman commented 1 year ago

you can use Slack's Socket Mode to work from behind your firewall - it sets up an outgoing websocket to Slack and communicates over that channel so it doesn't need a public interface on your side. it's listed at the end of the installation instructions page https://github.com/integrations/slack#slack-socket-mode

isaac-moses commented 1 year ago

@simonfiddaman After following the instruction, I am able to see the command suggestions in my slack channel where I have installed the app

image

But I get the following error when I try to run the command /ghe subscribe

image

Any idea what is going wrong or suggestion on how do I troubleshoot this error ?

isaac-moses commented 1 year ago

@simonfiddaman @bkeepers @jonmagic @kdaigle I see that the ReadMe was updated

image

But the socket mode is still supported, right?

simonfiddaman commented 1 year ago

@isaac-moses I had found your issue when trying to solve the proxy issue with our org and my comment was before I understood how this integration is provided (as an opaque docker container running .NET which does not respect proxies when provided).

I followed one of our engineers trying to set this integration up and that's about when we got to the bottom of ".NET in docker does not respect proxies, this will never work unless the docker container / instance can receive unproxied internet".

The way our Slack integration is setup it's trying to use the Slack Manifests API to create its own Slack app configuration; what you've successfully done and what we tried was creating a Slack app with the same scopes (plus Socket Mode) and feeding that to the integration instance/container. However - the app code itself (in the container) needs to be connecting using Socket Mode (which it no doubt is not configured to do so); when I suggested Socket Mode I'd assumed you'd have access to the code to make that modification (ref: Slack API connections sockets).

As I now understand it, the instance provided from Github which powers this integration is:

I figure the work-around would involve the integration being updated to :

end guess/rant/opinion/observation

joshjohanning commented 9 months ago

But I get the following error when I try to run the command /ghe subscribe image

Any idea what is going wrong or suggestion on how do I troubleshoot this error ?

@isaac-moses I only got this when my GitHub Enterprise server was 1) still spinning after making the changes, and 2) I didn't go through GitHub to install the Slack app to my GitHub workspace yet.

Once everything finishes updating after saving the Slack settings in the management console, I'm able to go back to the management console and follow the link to install the slack app to my slack workspace. It has a link like

https://github.mycompany.com/_slack/

image

Then you can run the /ghe subscribe org/repo to subscribe a channel to a repo. It will prompt you to install a GitHub App on the org first.

image

image