Set applinks.allow.all.hosts Java property to enable local application links

We found out that starting from Confluence 8.4 we could not define application links to Jira in the local environment (when the hostname pointed to a localhost address). The following error message was shown:

URL must not point to localhost or restricted IPs.

After long debugging, we found out that this could be fixed by adding a Java property
-Dapplinks.allow.all.hosts=true to CATALINA_OPTS in bin/setenv.sh.

It seems that this property was adding starting from Applinks 9.1 which is used in the latest Confluence versions but not yet in Jira.

This property is mentioned in Recognized System Properties | Confluence Data Center and Server 8.4 | Atlassian Documentation but didn’t see it mentioned in any release notes.

So if you are testing applicaiton links locally this might help you.

9 Likes

Brilliant help, thank you. (What an annoying restriction!)

For fellow plugin developers, here’s how you feed that JVM arg into “atlas-run”:

atlas-run --jvmargs -Dapplinks.allow.all.hosts=true

It won’t even let me use an applink of 192.168.1.* or a DNS host that uses an IP like that! (A totally valid setup for a small-business network!)

We have been seing the same behaviour with the exact same message now also with Crowd Version: 5.2.3. The fix works also there:

✓ demonstration.agilehive.net  crowd  file:/opt/crowd/apache-tomcat/bin/setenv.sh  fixed
│ 
│ content
│ @@ -18,7 +18,6 @@
│  export JAVA_HOME=/opt/openjdk11
│  export JRE_HOME=/opt/openjdk11
│  
│ +CATALINA_OPTS="-Dapplinks.allow.all.hosts=True $CATALINA_OPTS"
│ +export CATALINA_OPTS