Hi,
I am attempting to set up Bitbucket Server to run the plugin "Discuss that code for Bitbucket Server" against a HipChat Server deployment.
Some versions:
Discuss That Code for Bitbucket Server Version 1.2.2
Atlassian Bitbucket v4.12.0 (server)
Atlassian HipChat 2.1.3 (2016.12.08.212350) OVA (vmware)
The HipChat server and Bitbucket is up and running. I installed the plugin, and the next step is configuring the HipChat v1 Administration token. I attempted to create this under "group admin"->"API"-> select type Admin, gave it a name. (https://HIPCHAT.SERVERNAME.GOES.HERE/admin/api) I then continue to copy this hash to the "Discuss that code"-hook setup on one of the repositories in Bitbucket (on url https://BITBUCKET.SERVERNAME.GOES HERE/projects/PROJECTNAME/repos/dashboard/settings/hooks) as show on the top picture in the documentaion here: https://mibexsoftware.atlassian.net/wiki/display/DTC/Usage
When trying to enable the hook, i get error:
Token not valid: 401: Unauthorized (Auth token invalid. Please see: https://www.hipchat.com/docs/api/auth)
Something i noted: When looking at the link to generate a token, this goes to hipchat.com, not our local HipChat server, making me think the plugin tries to verify the token against the cloud instance rather than our local server.
I also verified that this plugin indeed was for the server version of Bitbucket, not cloud, but i seem to get no further.
Does anyone else manage to make this work?
I started with unpacking the dtc-122.jar and recursively searching for hipchat.com, found a few matches.
I added these lines to /etc/hosts (pure guesses):
<IP.TO.OUR.HIPCHAT.SERVER> www.hipchat.com hipchat.com
And tried again, still claimed the API token was invalid, so I setup a tcpdump session:
root@<MY.FANCY.BITBUCKET.SERVER>:~# tcpdump -vvvv -s5000 -ieth0 | grep hipchat tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 5000 bytes BITBUCKET.SERVER.NAME.HERE.33765 > OUR.DNS.SERVER.NAME.HERE.domain: [bad udp cksum 0x6c6f -> 0xab6b!] 17552+ A? api.hipchat.com. (33) BITBUCKET.SERVER.NAME.HERE.33765 > OUR.DNS.SERVER.NAME.HERE.domain: [bad udp cksum 0x6c6f -> 0xee2d!] 59085+ AAAA? api.hipchat.com. (33) OUR.DNS.SERVER.NAME.HERE.domain > BITBUCKET.SERVER.NAME.HERE.33765: [udp sum ok] 59085 q: AAAA? api.hipchat.com. 0/1/0 ns: hipchat.com. [3m33s] SOA ns-127.awsdns-15.com. awsdns-hostmaster.amazon.com. 2 7200 900 1209600 300 (111) OUR.DNS.SERVER.NAME.HERE.domain > BITBUCKET.SERVER.NAME.HERE.33765: [udp sum ok] 17552*- q: A? api.hipchat.com. 3/4/0 api.hipchat.com. [1m] A 52.0.176.89, api.hipchat.com. [1m] A 52.45.32.139, api.hipchat.com. [1m] A 52.54.231.92 ns: hipchat.com. [1h] NS ns-1217.awsdns-24.org., hipchat.com. [1h] NS ns-127.awsdns-15.com., hipchat.com. [1h] NS ns-1947.awsdns-51.co.uk., hipchat.com. [1h] NS ns-867.awsdns-44.net. (218) ^C212 packets captured 214 packets received by filter 0 packets dropped by kernel
Seeing that it was talking to api.hipchat.com, i added this subdomain to the /etc/hosts to.
Turns out the API end-points are the same between Cloud and Server version, it started working
I did a handful of attempts to diskediting the ./com/zaneli/escalade/hipchat/HttpExecutor\$class.class which contains the hardcoded references to api.hipchat.com, and repackage the jar but after a few fails i figured that this lame workaround is enough for my proof of concept.
Hope this helps someone else.
Kind regards
Jonas
Amazing work, Jonas! Thanks for sharing and Happy New Year!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Arbi, you too!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jonas,
I have done a bit of research and came across https://www.pixsoftware.nl/fr_BE/shop/product/36041?category=562.
Although the plugin is for Bitbucket Server as you indicated, the plugin vendor mentions:
Please also note that the add-on currently only supports HipChat cloud and not HipChat server.
So your observation about hipchat.com makes sense.
Thanks.
Arbi Dridi
Premier Support Engineer | Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wonderful! If you don't mind, would please share it here for the community?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
LOL, just hacked my way around this. Their plugin now works against HipChat Server
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hahaha, thanks Jonas :) Unfortunately, there's not much we can since this is a third party plugin. However, I'm pretty sure you can seek help from Pix Software as I would think adapting it to HipChat Server shouldn't be complex. They certainly know more, though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hahhaa Hi Arib, i actually wanted to ask you on our last case, but figured ill hit the vendor and answers before asking you, so funny that you show up here too Not the answer i was hoping for but at least an answer.. Thanks mate, upvoted and confirmed as the answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.