redmine-slack
redmine-slack copied to clipboard
Add support for connecting to Slack through a proxy
Any idea how to solve it? This plugin is accessing Incoming WebHooks (url), which in my network has to be done through proxy. I am using bitnami redmine image, and I know I had to set up on bunch of places proxy settings (git, curl etc...). Any idea where should I set proxy settings for this plugin (or redmine) in order to give it chance to work? :) I am not familiar either with Ubuntu, Ruby or Redmine ;)
@ajevic thanks for the reprot! This plugin uses the standard HTTPClient library without any special parameters to connect to Slack. If you need support for this, there's probably a way to have it use a proxy, but I am not familiar enough with Redmine to know how you would set that up. If you are able to find a workaround, please post it here.
I edited lib/redmine_slack/listener.rb
as following, which worked just fine to me.
--- listener.rb.original 2018-05-17 11:24:50.565061795 +0900
+++ listener.rb 2018-05-17 11:19:23.554062064 +0900
@@ -151,7 +151,8 @@
end
begin
- client = HTTPClient.new
+ proxy = "http://<your-proxy-url>:<port>"
+ client = HTTPClient.new(proxy)
client.ssl_config.cert_store.set_default_paths
client.ssl_config.ssl_version = :auto
client.post_async url, {:payload => params.to_json}
@veracosta I tried the same thing as you suggested but still not getting slack notification. Background- I am able to send notification to slack from redmine server using curl method. Initially it was not working but then I set proxy and it worked. So I guess there is something to do with proxy in my case.
It worked actually. I made some other configuration changes to test. After reverting them to original and updating listener.rb file, notifications start to come. Thanks !!
could you make it like you can configure the proxy in settings and then if proxy set - use proxy, if not set - don't use proxy ? This way the proxy is not hardcoded and it would be working for both proxy/noproxy users.