Notification Mails: Links Point to "localhost" (And Setting xwiki.home Breaks the Annotation Feature)

Xwiki 11.10.3 LTS on Debian 10 Buster running in Tomcat9 and behind an Apache reverse proxy which terminates SSL connections and proxies via AJP.

I just noticed that all links my notification mails point to “localhost”, which obviously does not make sense. :wink: Not sure if this always has been the case, or only after the upgrade from Xwiki 10.11.x to 11.10.3.

Google found this ML discussion:

https://devs.xwiki.narkive.com/ZjohUMDG/xwiki-devs-localhost-in-notification-email

and tried to set xwiki.home as suggested there. Not sure if this would help for the notification mails (unfortunately didn’t get one this night), but it actually broke the annotation feature! If this config setting is (as far as I can tell correctly) defined, activated annotation loading shows a red error bar on every page load, that the host could not be accessed.

This seems to be caused by invalid URLs being generated for the annotation request:

https://xwiki/rest/wikis/xwiki/spaces/Ohrner%20IT/spaces/Team/pages/WebHome/annotations?media=json

If I unset xwiki.home and restart Tomcat, annotation loading immedately works again… That’s probably some bug? Shall I report it?

I also heard I should check my “Wiki Descriptor”. I was a bit confused about the information concerning it I found online.

  1. The Debian install instructions I basically used for setting Xwiki up don’t talk about the Wiki Descriptor at all.
  2. The config files also do not tell much about a “Wiki Descriptor”
  3. There’s some (optinal?) Wiki Manager Application which apparently can be used to edit this descriptor. Do I have to install it or can it be viewed / edited without? I mean, if it’s imported to be (re)configured, there should be some standard way to adjust it?

I’ll also continue reading in parallel, but as this is getting time consuming I’m progressing slowly unfortunately. (Too much other “real” work to be done in parallel…)

I’ll report back if I found additional information and am happy about any relevant pointers or hints to authorative documentation.

I just stumbled accross

So the Wiki Descriptor can be edited without installing any optional Extension. However, do you - as the admin - have to know the URL how to get to this page, or is it somehow accessible / linked from the settings screens?

And second question - why do I have to configure the hostname and everything here if it also can be set (at least globally for the whole installation) in the config file? I only have a single wiki running on my instance.

This information looks somewhat redundant to me, and I wonder which of those I could leave empty - in case of future changes, it’s really easy to overlook one of the different places. (There’s xwiki.cfg, xwiki.properties, this “Wiki Descriptor”, the Apache reverse proxy config, …, and all refer to / repeat definitions of the same host name or URL fragments…)

In any case, the settings in the Xwiki descriptor seem to be wrong and I should probably adjust them, but they always have been wrong then… (The Page was last changed in Juni 2019 by superadmin, according to its header.)

This still does not solve the observation, that annotations work if I don’t eplicitly configure anything and break if I set the URL in xwiki.cfg…

You have the “Wiki Index” on the right “hamburger” menu.

You don’t, xwiki.cfg have priority over the descriptor. But the point here is that xwiki.cfg is a last resort, not the first thing you should configure usually. The main wiki descriptor is generated with the host you use the first time you access it, but that assume your properly configured your proxy as an actually proxy and don’t hide the source host.

Ah, got it! Thanks.

Ok, I understand.

I now configured “SSL” and “Alias” (called like this, contains the host name) (hopefully) properly and am curious how the next notification mails will look like.

Interestingly, the annotation feature now still works, in contrast to the configuration using xwiki.cfg.

I’m also now passing the original host name through the reverse proxy BTW.

Where is this setting stored? I grep’d the file system after setting it and it does not show up. I’m guessing in the database?

Would be nice if it was in a cfg file that could be manipulated as part of restoring one environment to another.

I think the config setting is stored in the database.

You have the xwiki.home property in the xwiki.cfg file, which however didn’t fully work for me, as stated above.