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