Forum OpenACS Development: HostNodeMap root the same as the url

On an installation I have a case of HostNodeMap where the address points to a subsite:

my.hostnode.address -> /app

The main application in this subsite is also mounted under a site node named "app", so that its path would be "/app/app" on the main subsite and just "/app" on the host node.

Now, due to the code we can see here, it seems this use-case is not supported on OpenACS: request-processor-procs.tcl (lines 577–604)

The original contribution was in commit f79adf7

Whenever we try to request a URL under the host node, that is the same or has the root in the prefix, this will be stripped and transformed into "/" and we will be redirected. On my installation, this results in a redirection loop, as /app is also configured as the IndexRedirectURL on the subsite.

At first look, this seems to me the kind of code we should consider cleaning up... To speculate over prefixes in the request processor is tricky enough, and if one uses the wrong URL to access something under a host node map should simply get a 404 in my opinion.

Has any of you some more context or remarks?

Collapse
Posted by Antonio Pisano on

To be clearer, the part I would get rid of is request-processor-procs.tcl (lines 580–593)

All the best

Collapse
Posted by Antonio Pisano on
It is of course not so simple: this hack is instrumental to translate URLs such as "/admin" transparently into the admin page without prepending the host node root all the time...

To change this would require touching a few other places I fear.

Collapse
Posted by Gustaf Neumann on
This area is tricky, and it is not unlikely to get a solution that works for your application, but which kills others. It would be certainly useful to have a test set exercising host-node-map interactions.

You might get some input from "get_register_subsite" [1], where one has to distinguish between a host-node-map entry pointing to a subsite vs. a host-node-map entry pointing to an application (maybe useful in your case?). This is not only related to URLs for admin, but as well for register redirects etc. Technically, it is also possible to have nested subsites.

To evade the complications for simple applications, xowiki has a feature to strip a prefix to omit unwanted in-between nodes - but certainly, this is only for xo* applications.

[1] https://openacs.org/api-doc/proc-view?proc=security::get_register_subsite&source_p=1