Make GitLab for Slack app support "socket mode" to allow air-gapped instances to use slash commands / chatops
Problem
Many self-hosted instances of GitLab are not publicly exposed on the web.
As such slash commands cannot be used as there is no way for Slack to reach the internal instance.
Proposal
However with the move to using the new slack app it would be possible to enable "socket mode" which opens a connection to slack which slack can send requests over. This would mean having a process / thread running keeping the socket open and responding / routing requests from slack.
From https://api.slack.com/apis/connections/socket:
Socket Mode allows your app to use the Events API and interactive features—without exposing a public HTTP Request URL.
This would also help testing of slack app integrations on developer machines as a socket can be opened to slack from the developer machine.
Limitations
- From the Slack docs: "Apps using Socket Mode are not currently allowed in the public Slack App Directory", which means this feature would be limited self managed and dedicated instances only
Note, the air-gapped GitLab instance will need to allow outgoing requests to slack.com
due to the OAuth 2.0 exchange with slack.com
required to set up the integration for a project.