summaryrefslogtreecommitdiff
path: root/doc/recentchanges/change_8935a131d02ac13b6024dff9cbf7a5f837fcdc04._change
blob: 12ef0e9ab07df6b7bea92f0c422ef492177f288c (plain)
  1. [[!meta author="""http://smcv.pseudorandom.co.uk/"""]]
  2. [[!meta authorurl="""http://smcv.pseudorandom.co.uk/"""]]
  3. [[!meta title="""change to todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both on ikiwiki"""]]
  4. [[!meta permalink="http://ikiwiki.info/recentchanges/#change-8935a131d02ac13b6024dff9cbf7a5f837fcdc04"]]
  5. <div id="change-8935a131d02ac13b6024dff9cbf7a5f837fcdc04" class="metadata">
  6. <span class="desc"><br />Changed pages:</span>
  7. <span class="pagelinks">
  8. <a href="http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn;h=8b0501041379278330dbdb52c3232dc26fef5d2c;hp=f8ec4c420469f47168ced54b93dbe75fa39dfdab;hb=8935a131d02ac13b6024dff9cbf7a5f837fcdc04;hpb=1968317cacc2f555af17286acf26a60ce616cc40" title="diff" rel="nofollow">[[diff|wikiicons/diff.png]]</a><a href="http://ikiwiki.info/ikiwiki.cgi?page=todo%2Fwant_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both&amp;do=goto" rel="nofollow">todo/want to avoid ikiwiki using http or https in urls to allow serving both</a>
  9. </span>
  10. <span class="desc"><br />Changed by:</span>
  11. <span class="committer">
  12. <a href="http://smcv.pseudorandom.co.uk/" rel="nofollow">smcv</a>
  13. </span>
  14. <span class="desc"><br />Commit type:</span>
  15. <span class="committype">web</span>
  16. <span class="desc"><br />Date:</span>
  17. <span class="changedate"><span class="relativedate" title="Tue, 23 Nov 2010 00:37:28 +0000">00:37:28 11/23/10</span></span>
  18. <span class="desc"><br /></span>
  19. </div>
  20. <span class="revert">
  21. <a href="http://ikiwiki.info/ikiwiki.cgi?rev=8935a131d02ac13b6024dff9cbf7a5f837fcdc04&amp;do=revert" title="revert" rel="nofollow">[[revert|wikiicons/revert.png]]</a>
  22. </span>
  23. <div class="changelog">
  24. updated branch, not tested properly yet<br />
  25. </div>
  26. <div class="diff">
  27. <pre>
  28. diff --git a/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn b/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
  29. index f8ec4c4..8b05010 100644
  30. --- a/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
  31. +++ b/doc/todo/want_to_avoid_ikiwiki_using_http_or_https_in_urls_to_allow_serving_both.mdwn
  32. @@ -147,7 +147,7 @@ you don&#39;t like my approach:
  33. ----
  34. -&#91;&#91;!template id=gitbranch branch=smcv/ready/localurl author=&quot;&#91;&#91;smcv&#93;&#93;&quot;&#93;&#93;
  35. +&#91;&#91;!template id=gitbranch branch=smcv/localurl author=&quot;&#91;&#91;smcv&#93;&#93;&quot;&#93;&#93;
  36. &#91;&#91;!tag patch&#93;&#93;
  37. OK, here&#39;s an alternative approach, closer in spirit to what was initially
  38. @@ -165,14 +165,17 @@ whether `url` and `cgiurl` are on the same server with the the same URL
  39. scheme. In theory you could use things like `//static.example.com/wiki/`
  40. and `//dynamic.example.com/ikiwiki.cgi` to preserve choice of http/https
  41. while switching server, but I don&#39;t know how consistently browsers
  42. -suppot that.
  43. +support that.
  44. &quot;local&quot; here is short for &quot;locally valid&quot;, because these URLs are neither
  45. fully relative nor fully absolute, and there doesn&#39;t seem to be a good name
  46. for them...
  47. -I&#39;ve tested this on a demo website with the CGI enabled, and it seems to
  48. +I tested an earlier version on a demo website with the CGI enabled, and it seemed to
  49. work nicely (there might be bugs in some plugins, I didn&#39;t try all of them).
  50. +I haven&#39;t yet re-tested with my updated branch, which is why it&#39;s not `ready/`
  51. +yet.
  52. +
  53. The `$config{url}` and `$config{cgiurl}` are both HTTP, but if I enable
  54. `httpauth`, set `cgiauthurl` to a HTTPS version of the same site and log
  55. in via that, links all end up in the HTTPS version.
  56. @@ -217,11 +220,19 @@ New API added by this branch:
  57. &gt;&gt;
  58. &gt;&gt;&gt; That makes a great deal of sense, bravo for actually removing
  59. &gt;&gt;&gt; parameters in the common case while maintaining backwards
  60. - &gt;&gt;&gt; compatability!
  61. + &gt;&gt;&gt; compatability! --&#91;&#91;Joey&#93;&#93;
  62. + &gt;&gt;&gt;
  63. + &gt;&gt;&gt;&gt; Done in my `localurl` branch; not tested in a whole-wiki way
  64. + &gt;&gt;&gt;&gt; yet, but I did add a regression test. I&#39;ve used
  65. + &gt;&gt;&gt;&gt; `urlto(x, undef)` rather than `urlto(x)` so far, but I could
  66. + &gt;&gt;&gt;&gt; go back through the codebase using the short form if you&#39;d
  67. + &gt;&gt;&gt;&gt; prefer. --&#91;&#91;smcv&#93;&#93;
  68. &gt;&gt;&gt;
  69. &gt;&gt;&gt; It does highlight that it would be better to have a
  70. &gt;&gt;&gt; `absolute_urlto($link)` (or maybe `absolute(urlto($link))` )
  71. &gt;&gt;&gt; rather than the 3 parameter form. --&#91;&#91;Joey&#93;&#93;
  72. + &gt;&gt;&gt;
  73. + &gt;&gt;&gt; Possibly. I haven&#39;t added this.
  74. * `IkiWiki::baseurl` has a new second argument which works like the
  75. third argument of `urlto`
  76. @@ -232,19 +243,34 @@ New API added by this branch:
  77. &gt;&gt; (But I assume changes to `urlto` will follow through here anyway.)
  78. &gt;&gt; --&#91;&#91;Joey&#93;&#93;
  79. + &gt;&gt;&gt; I had to use it a bit more, as a replacement for `$config{url}`
  80. + &gt;&gt;&gt; when doing things like referencing stylesheets or redirecting to
  81. + &gt;&gt;&gt; the top of the wiki.
  82. + &gt;&gt;&gt;
  83. + &gt;&gt;&gt; I ended up redoing this without the extra parameter. Previously,
  84. + &gt;&gt;&gt; `baseurl(undef)` was the absolute URL; now, `baseurl(undef)` is
  85. + &gt;&gt;&gt; the local path. I know you objected to me using `baseurl()` in
  86. + &gt;&gt;&gt; an earlier branch, because `baseurl().$x` looks confusingly
  87. + &gt;&gt;&gt; similar to `baseurl($x)` but has totally different semantics;
  88. + &gt;&gt;&gt; I&#39;ve generally written it `baseurl(undef)` now, to be more
  89. + &gt;&gt;&gt; explicit. --&#91;&#91;smcv&#93;&#93;
  90. +
  91. * `IkiWiki::cgiurl` uses `$local_cgiurl` if passed `local_cgiurl =&gt; 1`
  92. - &gt; Possibly changed to making this always be local unless `cgiurl =&gt; $x`
  93. - &gt; is given: see below --&#91;&#91;smcv&#93;&#93;
  94. + &gt; Now changed to always use the `$local_cgiurl`. --&#91;&#91;smcv&#93;&#93;
  95. * `IkiWiki::cgiurl` omits the trailing `?` if given no named parameters
  96. except `cgiurl` and/or `local_cgiurl`
  97. &gt; I assume you have no objection to this --&#91;&#91;smcv&#93;&#93;
  98. &gt;
  99. - &gt;&gt; Nod, although I don&#39;t know of a use case. --&#91;&#91;Joey&#93;&#93;
  100. + &gt;&gt; Nod, although I don&#39;t know of a use case. --&#91;&#91;Joey&#93;&#93;
  101. +
  102. + &gt;&gt;&gt; The use-case is that I can replace `$config{cgiurl}` with
  103. + &gt;&gt;&gt; `IkiWiki::cgiurl()` for things like the action attribute of
  104. + &gt;&gt;&gt; forms. --&#91;&#91;smcv&#93;&#93;
  105. -Bugs:
  106. +Fixed bugs:
  107. * I don&#39;t think anything except `openid` calls `cgiurl` without also
  108. passing in `local_cgiurl =&gt; 1`, so perhaps that should be the default;
  109. @@ -265,6 +291,10 @@ Bugs:
  110. &gt;&gt;&gt; if `absolute()` were implemented as suggested above, it could also
  111. &gt;&gt;&gt; be used with cgiurl if necessary.) --&#91;&#91;Joey&#93;&#93;
  112. + &gt;&gt;&gt;&gt; Done (minus `absolute()`). --&#91;&#91;smcv&#93;&#93;
  113. +
  114. +Potential future things:
  115. +
  116. * It occurs to me that `IkiWiki::cgiurl` could probably benefit from being
  117. exported? Perhaps also `IkiWiki::baseurl`?
  118. @@ -285,4 +315,7 @@ Bugs:
  119. &gt; AFACIS, `baseurl` is only called in 3 places so I don&#39;t think that&#39;s
  120. &gt; needed. --&#91;&#91;Joey&#93;&#93;
  121. - &gt;&gt; OK, wontfix. --&#91;&#91;smcv&#93;&#93;
  122. + &gt;&gt; OK, wontfix. For what it&#39;s worth, my branch has 6 uses in IkiWiki
  123. + &gt;&gt; core code (IkiWiki, CGI, Render and the pseudo-core part of editpage)
  124. + &gt;&gt; and 5 in plugins, since I used it for things like redirection back
  125. + &gt;&gt; to the top of the wiki --&#91;&#91;smcv&#93;&#93;
  126. </pre>
  127. </div>
  128. <!-- 8935a131d02ac13b6024dff9cbf7a5f837fcdc04 -->