#663926 ikiwiki: please allow empty hostname in (cgi)url config

#663926#5
Date:
2012-03-14 00:59:23 UTC
From:
To:
Dear Joey,

Thank you for making fantastic and unique wiki like no other.

It would be nice if cgi wrapper would use relative URLs instead of ones with
hardcoded domain name and support hostname-less configuration.

When I enter 'url' or 'cgiurl' in configuration without 'http://' prefix as

 url    => '~/iki',
 cgiurl => '~/iki/ikiwiki.cgi'

and run 'ikiwiki --setup' I get

"Use of uninitialized value in string ne at /usr/share/perl5/IkiWiki.pm line
570."

which is not a problem by itself. But I'm trying to use a peculiar
configuration when rsync plugin send blog content to extranet site where
reverse proxy tunnel channelling requests to ~/iki/ikiwiki.cgi back to
intranet.

And that's where problems are manifesting: if page generated by ikiwiki.cgi
(like login page) is accessed from extranet it looks distorted due to all
resources like .CSS files are linked using absolute URLs with domain name as
configured in (cgi)url or using domain name of intranet server is it
identifies itself if no domain explicitly mentioned in (cgi)url configuration.

Basically because of hardcoded domain names in links ikwiki can't work well
from behind reverse proxy because intranet domain (configured or fallback one)
may not be available from outside.

Moreover in such configuration it is preferable not to disclose intranet
domain names.

Hardcoding domain names in links seems unnecessary because relative linking is
more than enough for addressing internal pages.

Thank you.

All the best,
Dmitry.

#663926#10
Date:
2014-10-16 22:14:18 UTC
From:
To:
Control: forwarded 663926 http://ikiwiki.info/todo/design_for_cross-linking_between_content_and_CGI/

Sorry, this is not possible. Some features in ikiwiki really do need to
know the wiki's canonical externally-facing URL. For best results use
the external version, not the intranet version.

If you configure the url and cgiurl to have the same hostname, then recent
versions of ikiwiki will use relative links between the CGI and the
static content as much as possible, so accesses via the intranet
should stay in the intranet. I've been working on improving this
recently.

If you enable the html5 option, there will be more relative links,
because HTML5 allows <base href> to be relative, whereas HTML4 and
XHTML1 did not. I'm hoping to make that the default post-jessie.

If the CGI is behind a reverse proxy, you may need to configure the url/cgiurl
to be the externally-facing version (not the intranet version), and enable
the new reverse_proxy option, which is not in a release yet, but will be
in the release that I'm preparing now. That stops the CGI from trying to be
clever and determining its own location from CGI environment variables.

    S