Does not detect https repository
Our repository requires https instead of http. The automatic url only has http. Is there a way to edit this?
Comments (6)
-
-
For me it also generates http links, but for a coworker using the same repo, it generates https links…
We both have the repo URL as
ssh://...
in the.git/config
… -
staff Linky detects Bitbucket Server by trying different schema and port combinations. Since Bitbucket can sit behind the firewall, it might be on HTTP and not HTTPS.
Linky does try HTTPS first. However, such check might fail, whereas HTTP come out fine. After successful resolution Linky saves the schema, host and port from the git remote URL so that next time, should you have another repository hosted at the same Bitbucket, resolve its remote URL immediately without re-detecting Bitbucket.
I can think of few possible reasons for HTTPS check to fail:
- the certificate used for HTTPS is signed by non-trusted CA – note that it has to be trusted by JRE which IntelliJ runs on, it doesn’t respect system settings
- some different proxy configuration, should you use it (Linky uses IntelliJ’s global proxy config)
- network blip during detection - as I said, once hosting is resolved, Linky stores and uses that information
That being said, even though there’s no UI to edit this data in the IntelliJ, you can find the right file and manually adjust the mapping – here’s how to do that:
- Close your IDE If you do the rest of the steps but keep the IDE open, it will most likely restore the previous file state cause it reads them during startup and then dumps to the disk from time to time (e.g. when you switch to another app window).
- Locate your IDE configuration directory – check out this page.
- Under that directory find
options/bitbucket-linky.xml
file and open it using a text editor. - Find the
<component name="BitbucketServerRegistry">
element and look for<instance>
tags inside it – these are what Linky was able to detect. ThebaseUri
attribute of these elements is the resolved Bitbucket URL – change the schema in it tohttps://
, and save the file. - Open your IDE and try to create a link with Linky.
I hope this helps. Let me know if you have any questions.
Cheers,
Daniil -
Ah ok, I see the problem now:
My Bitbucket instance is only reachable via VPN. So when the plugin first tried to resolve it, I was probably not connected to the VPN hence it could not reach it and assumed it has to use http…
Thanks for taking the time to explain.
-
staff Hmm, that shouldn’t be the case if your Bitbucket instance is completely inaccessible without VPN.
Detection makes an active call to an API endpoint – specifically,
rest/api/1.0/application-properties
– and checks the response to match the expected shape. This call also helps to surface whether that instance is a mirror instance – in that case Linky looks for the upstream server by calling/rest/mirroring/1.0/upstreamServers
endpoint.Now I’m thinking this might be another reason of the issue you faced: if the mirror for some reason is configured to point to HTTP URL of the upstream server, Linky won’t check whether it is also available via HTTPS. Are you using a Bitbucket mirror instance?
If none of the schema and port combination worked, Linky assumes this repository is not hosted on Bitbucket but rather on some other app, and doesn’t show up its actions (e.g. try to open a repository hosted on GitHub – Linky actions won’t show up). In this case detection runs again when you open that repository next time.
-
A mirror instance? Hm, not that I know of…
But whatever the issue was, I solved it by manually adjusting the
bitbucket-linky.xml
like you said… - Log in to comment
Same issue to me. I don’t think any source code repo will use http. So the default protocol should be https.