aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/W3MMode_still_uses_http:__47____47__localhost__63__.mdwn
blob: c21329bae61cc52f228d6d9fd58e502b175db988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
My setup matches w3mmode [[w3mmode/ikiwiki.setup]] exactly.
My doc/index.mdwn just has a line or two of plain text.
When I try to edit that page in w3m, it works fine until I push [Save Page].
Then I just get a page that only contains "403".

ikiwiki version is 3.20110715ubuntu1.
w3m is 0.5.3.

-- [[terry|tjgolubi]]

I made it work, though probably not completely, by renaming
~/.ikiwiki/wrappers/ikiwiki.cgi to ikiwiki2.cgi and replacing it with:

    #!/bin/bash
    /home/tjgolubi/.ikiwiki/wrappers/ikiwiki2.cgi $* | sed -e 's,http://localhost,file://,g'

I'm afraid that this hack may have bad side-effects, but I hope it points you to the cause/solution.
Of course, the next time I rerun ikiwiki --setup, it will overwrite my wrapper-wrapper.

-- [[terry|tjgolubi]]

I made a logfile of all the args, env, and stdin/stdout to/from my wrapper.  If you're interested, I'll email it to you.  I wasn't able to attach it here.

-- [[terry|tjgolubi]]

I confirm that the supplied w3mmode setup appears not to work. When I try to edit a page and save it, w3m tries to access an URL beginning http://localhost/ . The HTML source of the edit page contains a BASE URL beginning with http://localhost. It should not. Maybe this is a result of changes a while back, where use of absolute URLs was enforced in various places in Ikiwiki.

-- Martin

The problem is that IkiWiki::CGI::cgitemplate() and IkiWiki::CGI::redirect() use Perl's CGI::url() to determine the absolute URL of the CGI script when it is being executed. url() generates an URL beginning http://localhost. As w3m's serverless CGI mode is rather unusual, presumably there's no provision for the URL of a CGI script beginning file:///, even if there's a way to specify that.

A quick workaround might be to force the use of $config{url} instead of $cgi->url as a base for URLs when w3mmode is set.

-- Martin

> [[Fixed|done]] --[[smcv]]