zulip / zulip-redmine-plugin

Redmine plugin for Zulip notifications on issue tracker changes
Apache License 2.0
12 stars 17 forks source link

Dons't connect to private zulip server #1

Closed wq163 closed 8 years ago

wq163 commented 9 years ago

I deploy a private zulip server, and zulip-redmine-plugin dons't send message to zulip. I found hard cord in zulip_hooks.rb :

http = Net::HTTP.new("api.zulip.com", 443)

and, zulip api path is api/v1/messages,but in zulip_hooks.rb :'req = Net::HTTP::Post.new("/v1/messages")'

I hope server and api can specify by users.

timabbott commented 9 years ago

Yeah this should be a pretty easy fix for someone who has a redmine setup -- just add an option to control this. PRs welcome!

ogg1e commented 8 years ago

I modified my zulip_hooks.rb to be:

        http = Net::HTTP.new("zulip.mycompany.com", 443)
                http.use_ssl = true
        req = Net::HTTP::Post.new("/api/v1/messages")

and reran "rake redmine:plugins:migrate RAILS_ENV=production" , but that didn't work. It's still throwing a 500 error. Is there more steps involved?

If I could figure out what needs to be done, I could create a PR quickly enough.

timabbott commented 8 years ago

A 500 on the Redmine server or the Zulip server? It'd be great if you had a traceback; one common issue with API apps talking to the Zulip server is that if you're using a self-signed SSL cert or didn't include the full certificate chain in the nginx configuration, you might be getting an SSL validation error...

ogg1e commented 8 years ago

500 on the redmine server. I have a valid cert, and it works on the zulip server since I have the jenkins plugin working with it.

Maybe I need to add the certs to apache (which is hosting redmine) like I did for the tomcat jvm in jenkins?

ogg1e commented 8 years ago

That was the problem. I had to add the certs to apache properly. FYI, I had to do this:

ogg1e commented 8 years ago

I created a pull request to allow the url and port to be specified in the admin settings.

https://github.com/zulip/zulip-redmine-plugin/pull/2

timabbott commented 8 years ago

Awesome, thanks for debugging this @ogg1e !

timabbott commented 8 years ago

PR #2 was merged so this is now fixed!