Subdirectory install

Hello!

I am sorry, if this topic has been already covered, but I have not found instructions for building Indico for further subdirectory install neither in the docs, nor here. Could anyone point me in the right direction please? Thanks a lot in advance.

I’ve build Indico wheel directly from the 3.2.9 tag and specified subdirectory as a base URL, but resulting asset URLs are still without subdirectory at the start (e.g. https://DOMAIN/dist/css/… instead of https://DOMAIN/SUBDIR/dist/css/…). Do I need to specify some additional flags to build-wheel.py or maybe link a special configuration file?

P.S.: I know that subdirectory install is heavily discouraged, but it’s been decided to use subdirectory.

Subpath setups were discouraged since v2.0 (released early 2018) and unsupported since v2.2 (released mid 2019). We are on v3.2.x now…

So “it has been decided” is an argument you should easily be able to counter with the simple fact that Indico does not support such a deployment. I know for sure that some things will break when Indico is not running using the URL root path and in fact the extra complexity of supporting such cases in a way that can be changed “at runtime” would add more complexity than such a niche feature is worth.

From a technical point of view there is also no good argument for using a subpath instead of a subdomain.

FWIW, if you build your own Indico package from git, you can use e.g. ./bin/maintenance/build-assets.py indico --url-root /indico to build the Indico assets so they work on /indico instead of /. You can then build the wheel while passing the --no-assets switch so it doesn’t rebuild your assets without that option. Note that we do not test this (I’m quite sure that nobody has tested that switch since around 2019, even I had almost forgotten about it) and in fact if anyone discovers that this is broken, we’re likely to remove this. Unless you plan customizing the Indico core yourself, we do not recommend this. It’s extra work for you during every upgrade.


PS: Here’s the message that would have been shown back then:

You are currently running Indico in a subdirectory. While using a URL subdirectory has been discouraged since the release of 2.0, there will be further changes in the next release (2.2) which will require you to build your own Indico packages. To avoid this, we strongly recommend you to move your Indico instance to a subdomain!

and from the upgrade notes from 2.x to 2.2:

Keep in mind that running Indico from a subdirectory such as https://example.com/indico is no longer supported by the packages we provide on PyPI. Please use a subdomain instead.

Thank you very much for a fast and detailed reply! I’ll try to build assets as a separate wheel and report back.

We’re trying to update our lab Indico instance (which was installed as a subdirectory) from v. 2.0 to the latest version without breaking links and attachments in events. From a quick glance at the DB dump there is quite a number of those. So it is either a subdirectory install or manual check and correction of existing events. If it’s possible to install latest Indico as a subdirectory, we’d prefer that.

It would be very easy to setup a redirect to avoid breaking links on the webserver level. In fact we always added such redirects when making otherwise breaking changes to URLs in Indico ourselves (e.g. between indico v1 and v2) exactly because breaking links is bad.

In pretty much any webserver (nginx and Apache for sure) you can easily setup a redirect for <yourdomain>/indico/ to indico.<yourdomain>/ (and configure it to preserve the rest of the path and query string params).