Merge branch 'master' of ssh://git.ikiwiki.info

master
Joey Hess 2013-12-03 12:45:18 -04:00
commit 854152c299
12 changed files with 385 additions and 60 deletions

View File

@ -0,0 +1,71 @@
For some reason, on a wiki hosted locally using [ikiwiki-hosting](http://ikiwiki-hosting.branchable.com), web edits do not get committed and pushed to the central repository anymore.
For example, I just did an edit on the web interface, which went on without error, but then the modified files are not committed:
[[!format txt """
o-cats@marcos:~/source$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: 2014/summer.mdwn
#
no changes added to commit (use "git add" and/or "git commit -a")
"""]]
The files and the .cgi are owned by the right user:
[[!format txt """
o-cats@marcos:~/source$ ls -al 2014/summer.mdwn
-rw-r--r-- 1 o-cats o-cats 2812 Nov 28 23:35 2014/summer.mdwn
o-cats@marcos:~/source$ ls -al /var/www/o-cats/ikiwiki.cgi
-rwxr-xr-x 1 o-cats o-cats 15596 Oct 4 12:16 /var/www/o-cats/ikiwiki.cgi
"""]]
The virtual host is configured to run as the right user:
[[!format txt """
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName foo.example.com
SuexecUserGroup o-cats o-cats
UserDir disabled
DocumentRoot /home/o-cats/public_html
<Directory />
DirectoryIndex index.html index
AllowOverride None
</Directory>
<Directory /home/o-cats/public_html>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory /var/www>
Options ExecCGI
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /ikiwiki.cgi /var/www/o-cats/ikiwiki.cgi
ErrorLog /var/log/ikiwiki-hosting/o-cats/error.log
LogLevel warn
CustomLog /var/log/ikiwiki-hosting/o-cats/access.log combined
ErrorDocument 404 "/ikiwiki.cgi"
</VirtualHost>
"""]]
What's going on all of a sudden? This is Debian wheezy. --[[anarcat]]
> Oh... it seems like this is related yet again to the disruptive git upgrade:
>
> [Thu Nov 28 23:35:01 2013] [error] [client 2001:1928:1:9::1] Aborting commit due to empty commit message., referer: http://foo.example.com
>
> So this is [[fixed|done]] as of 3.20130711. Shouldn't we backport to wheezy now? :) --[[anarcat]]

View File

@ -0,0 +1,67 @@
[[!template id=gitbranch branch=anarcat/dev/proxy-utf8-fail author="[[anarcat]]"]]
ikiwiki 3.20130904.1~bpo70+1
rebuilding the whole wiki:
[[!format txt """
anarcat@marcos:ikiwiki*$ sudo ikisite changesetup wiki.anarc.at --rebuild
Subroutine import redefined at /usr/share/perl5/IkiWiki/Plugin/translinks.pm line 19.
Subroutine getsetup redefined at /usr/share/perl5/IkiWiki/Plugin/translinks.pm line 29.
Subroutine pagetemplate redefined at /usr/share/perl5/IkiWiki/Plugin/translinks.pm line 38.
Subroutine otherlanguagesloop redefined at /usr/share/perl5/IkiWiki/Plugin/translinks.pm line 51.
Use of uninitialized value $body in split at /usr/share/perl5/Text/MultiMarkdown.pm line 1131.
uncaught exception: 'ascii' codec can't encode character u'\xe9' in position 289: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/ikiwiki/plugins/proxy.py", line 309, in run
self._in_fd, self._out_fd)
File "/usr/lib/ikiwiki/plugins/proxy.py", line 192, in handle_rpc
ret = self._dispatcher.dispatch(method, params)
File "/usr/lib/ikiwiki/plugins/proxy.py", line 84, in dispatch
return self._dispatch(method, params)
File "/usr/lib/python2.7/SimpleXMLRPCServer.py", line 420, in _dispatch
return func(*params)
File "/usr/lib/ikiwiki/plugins/proxy.py", line 253, in hook_proxy
"{0} hook `{1}' returned: [{2}]".format(type, name, ret))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 289: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/ikiwiki/plugins/rst", line 86, in <module>
proxy.run()
File "/usr/lib/ikiwiki/plugins/proxy.py", line 317, in run
self.error('uncaught exception: {0}\n{1}'.format(e, tb))
File "/usr/lib/ikiwiki/plugins/proxy.py", line 298, in error
self.rpc('error', msg)
File "/usr/lib/ikiwiki/plugins/proxy.py", line 233, in rpc
*args, **kwargs)
File "/usr/lib/ikiwiki/plugins/proxy.py", line 173, in send_rpc
raise GoingDown()
proxy.py.GoingDown
error: ikiwiki failed
"""]]
\xe9 is "é" in latin1, it may be the last letter of my name. no clue how it got there. suspecting this is related to the fix in [[bugs/proxy.py_utf8_troubles]], since this was not happening before the upgrade from squeeze. --[[anarcat]]
> Ooops... turns out the plugin *was* enabled, through the `rst` plugin. After disabling it, the crash is gone, but one page isn't rendered anymore:
>
> removing art/histoireinternet/index.html, no longer built by art/histoireinternet.rst
>
> Here is that source file: http://anarc.at/art/histoireinternet.rst - and it seems encoded properly:
>
> $ curl -s http://anarc.at/art/histoireinternet.rst | iconv -f utf8 -t latin1 | iconv -f latin1 -t utf8 > /dev/null
> $
>
> So I am not sure what is going on here... --[[anarcat]]
>> Python is decoding what it receives from IkiWiki using the default `ascii`
>> codec. To match IkiWiki's "all source text is UTF-8" assumption, the
>> Python proxy should explicitly decode incoming text from bytes
>> (`str`) to `unicode` using the `utf8` codec instead.
>>
>> Python's conservative default is "`ascii`, regardless of locale" -
>> this minimizes the chance of silently incorrect decoding, but
>> unfortunately also maximizes the chance of crashing. --[[smcv]]
> > > Right, I know that. The trick is to find the rabbit hole. :P
> > >
> > > And I found it. With my dev/proxy-utf8-fail, this doesn't fail anymore. Yay, a [[patch]] ready for commit! --[[anarcat]]

View File

@ -1,3 +1,5 @@
[[!template id=gitbranch branch=anarcat/dev/openid_email author="[[anarcat]]"]]
This bug affects [[plugins/notifyemail]] but is probably caused more by [[plugins/openid]]. When using OpenID to login to a site, no email notification is sent to the user (pagespec set to `*`) when a modification is done on the wiki. I believe this is because the OpenID plugin assumes the email comes from the OpenID provider - which is not necessarily going to succeed if, for privacy reason, the OpenID provider refuses to transmit the email to ikiwiki.
In the OpenID plugin, the email is actually fetched when authenticating and is stored in the session, like so:
@ -56,9 +58,7 @@ sub formbuilder_setup (@) {
I believe this could be worked around simply by re-enabling that field and allowing the user to specify an email there by hand, making a note that the OpenID provider's email is used by default.
[[!template id=gitbranch branch=anarcat/openid_email author="[[anarcat]]"]]
The dumbest [[!taglink patch]] that actually fixes the problem for me is in the branch mentionned here.
The dumbest [[!taglink patch]] that actually fixes the problem for me is in the branch mentionned above.
It would probably be better to add a comment on the field as indicated above, but it's a good proof of concept.

View File

@ -0,0 +1,48 @@
Put something like this in the setup file:
~~~
conversion:
- from: odt
to: pdf
command: [unoconv, -f, pdf, -o, $OUTPUTDIR, $INPUTFILE]
- from: ditaa
to: png
command: [ditaa, $INPUTFILE, $OUTPUTFILE, -s, 0.7]
~~~
However `Dumper($config{conversion})` shows:
~~~
$VAR1 = [
'HASH(0x164e1a0)',
'HASH(0x164e3c8)'
];
~~~
I think it is getting mangled in `sub merge` in `IkiWiki/Setup.pm` and its calls to `possibly_foolish_untaint`
Workaround: force the array values to be strings, and then re-parse them using YAML::XS::Load:
~~~
conversion:
- |
from: [odt, odp]
to: pdf
command: [unoconv, -f, pdf, -o, $OUTPUTDIR, $INPUTFILE]
- |
from: ditaa
to: png
command: [ditaa, $INPUTFILE, $OUTPUTFILE, -s, 0.7]
...
sub checkconfig {
if (!defined $config{conversion} || ref $config{conversion} ne "ARRAY") {
error(sprintf(gettext("Must specify '%s' and it must be a list"), "conversion"));
}
for (my $i=0; $i < @{$config{conversion}}; $i++) {
$config{conversion}->[$i] = YAML::XS::Load($config{conversion}->[$i]) if
ref $config{conversion}->[$i] ne 'HASH';
}
}
~~~

View File

@ -1,4 +1,4 @@
[[!template id=gitbranch branch=anarcat/syslog_utf8 author="[[anarcat]]"]]
[[!template id=gitbranch branch=anarcat/dev/syslog_utf8 author="[[anarcat]]"]]
[[this feature|todo/syslog_should_show_wiki_name]] made it so syslog doesn't work anymore if the site being logged has non-ASCII characters it in.

View File

@ -11,3 +11,4 @@ error: Bad exit status from /var/tmp/rpm-tmp.Sgq2QK (%build)
when trying to build
> Ok, added. [[done]] --[[Joey]]
>> Appears to be missing in 'Makefile.PL' also. -- [[ttw]]

View File

@ -0,0 +1,33 @@
[[!template id=plugin name=cowsay author="[[BrianCandler]]"]]
[[!tag type/fun]]
This plugin provides the cowsay [[ikiwiki/directive]].
This directive allows creation of ASCII-art cows.
For example,
~~~
\[[!cowsay state="stoned" text="""
moo tube!
"""]]
~~~
renders as
~~~
___________
< moo tube! >
-----------
\ ^__^
\ (**)\_______
(__)\ )\/\
U ||----w |
|| ||
~~~
You must have the [cowsay](https://en.wikipedia.org/wiki/Cowsay) package
installed.
# Download
You can get the source code from [github](https://github.com/candlerb/ikiwiki-cowsay)

View File

@ -3,62 +3,11 @@ I've tried to retrieve the wmd-editor source tarball lately, but the site seems
From what I've read on the Internet, wmd-editor is not (yet?) free software by itself, and its author has gone MIA.
But it looks like somebody recently took the step to rewrite a wmd-clone under a saner license, see [[pagedown|http://code.google.com/p/pagedown/source/browse/]].
Given all the above, what about upgrading this plugin to use pagedown instead of wmd? It seem a clear win to me...
Given all the above, what about upgrading this plugin to use pagedown instead of wmd? It seem a clear win to me... --(unsigned)
> AFAICS, pagedown is a modified version of WMD. Let's
> look at its license file: --[[Joey]]
> I have moved that conversation to the pagedown plugin todo [[todo/pagedown_plugin/discussion]] page, which now actually has an implementation now, and is free! --[[anarcat]]
<pre>
A javascript port of Markdown, as used on Stack Overflow
and the rest of Stack Exchange network.
Largely based on showdown.js by John Fraser (Attacklab).
Original Markdown Copyright (c) 2004-2005 John Gruber
<http://daringfireball.net/projects/markdown/>
Original Showdown code copyright (c) 2007 John Fraser
Modifications and bugfixes (c) 2009 Dana Robinson
Modifications and bugfixes (c) 2009-2011 Stack Exchange Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy [...]
</pre>
> Ok, so it says it's based on showdown. John Fraser wrote showdown and also
> WMD, which IIRC was built on top of showdown. (Showdown converts the
> markdown to html, and WMD adds the editor UI.)
>
> I can nowhere find a actual statement of the copyright of showdown or
> WMD. <http://code.google.com/p/wmd/> has a "MIT License" notice on it,
> but this is clearly just the license chosen when signing up at google
> code for the repo that would be used for a rewrite of the code, and the only thing
> said about the previous 1.0 release of WMD is "use it freely", which is not
> specific enough to be a grant of license, and is moreover not a free
> software license, as it does not cover distribution or modification.
>
> Which was all covered in the thread here,
> when StackOverflow decided to start working on pagedown.
> <http://blog.stackoverflow.com/2008/12/reverse-engineering-the-wmd-editor/>
> This thread does not give any indication that they ever managed to get
> a license grant for WMD/showdown. It frankly, does not inspire confidence
> that the people working on this care about the license.
>
> It would probably be pretty easy to adapt the ikiwiki wmd plugin
> to use pagedown. But without a clear and credible license, why?
>
> (Note that I have a wmd-new branch in my ikiwiki git repo that
> uses <https://github.com/derobins/wmd>, which was an earlier
> version of pagedown (probably, not entirely clear).)
>
> An alternate alternative is markitup: <http://markitup.jaysalvat.com/>
> It has a clear history and a credible license (MIT or GPL dual license).
> It's also easily extensible to other formats so could handle rst etc.
> It does not, however, have a markdown to html converter -- for
> previewing it has to talk to the server with AJAX.
> --[[Joey]]
Other conversations:
>> I've got pagedown working on my personal site (simon.kisikew.org) but I'm not sure how
>> I can inject the relevant &lt;div&gt;'s in the right place. They need to go **above**

View File

@ -0,0 +1,3 @@
Using one of the strategies described here: http://stackoverflow.com/questions/6333814/ ... we could support copying/pasting images from the clipboard (in supported browsers).
[[!tag wishlist]]

View File

@ -0,0 +1,7 @@
So this is a little nutty [[wishlist]].
There's this cool software called [Bugs Everywhere](http://bugseverywhere.org/) (be) which allows you to track your bug reports as plain text files in git.
There's also an "html" command for be that allows you to produce an HTML rendering of the repository.
ikiwiki could detect and use that instead of the (fairly limited) [[tips/integrated_issue_tracking_with_ikiwiki]].. --[[anarcat]]

View File

@ -1,5 +1,5 @@
[[!template id=gitbranch branch=anarcat/osm_kml_formatting author="[[anarcat]]"]]
[[!template id=gitbranch branch=anarcat/osm_openlayers_misc author="[[anarcat]]"]]
[[!template id=gitbranch branch=anarcat/attic/osm_emacs_indent author="[[anarcat]]"]]
I have accumulated a small series of patches to the OSM plugin along with the [[other|todo/osm_arbitrary_layers]] [[fixes|bugs/osm_KML_maps_do_not_display_properly_on_google_maps]] I have submitted here. They have lived in a tangled mess on my master branch so far, but not anymore!
@ -20,7 +20,7 @@ I have two main branches that need merging (on top of [[todo/osm_arbitrary_layer
> doubly for files served over the network. Cherry-picked the layer sorting
> change. --[[Joey]]
> > Alright, I am fine with that, thanks. -- [[anarcat]]
> > Alright, I am fine with that, thanks. I moved my branch to the attic. -- [[anarcat]]
Those two branches are also merged directly on my master branch... along with [[todo/osm_arbitrary_layers]].

View File

@ -0,0 +1,146 @@
(This conversation was moved from [[plugins/wmd/discussion]]. --[[anarcat]])
I've tried to retrieve the wmd-editor source tarball lately, but the site seems offline.
From what I've read on the Internet, wmd-editor is not (yet?) free software by itself, and its author has gone MIA.
But it looks like somebody recently took the step to rewrite a wmd-clone under a saner license, see [[pagedown|http://code.google.com/p/pagedown/source/browse/]].
Given all the above, what about upgrading this plugin to use pagedown instead of wmd? It seem a clear win to me...
> AFAICS, pagedown is a modified version of WMD. Let's
> look at its license file: --[[Joey]]
>
> A javascript port of Markdown, as used on Stack Overflow
> and the rest of Stack Exchange network.
>
> Largely based on showdown.js by John Fraser (Attacklab).
>
> Original Markdown Copyright (c) 2004-2005 John Gruber
> <http://daringfireball.net/projects/markdown/>
>
>
> Original Showdown code copyright (c) 2007 John Fraser
>
> Modifications and bugfixes (c) 2009 Dana Robinson
> Modifications and bugfixes (c) 2009-2011 Stack Exchange Inc.
>
> Permission is hereby granted, free of charge, to any person obtaining a
> copy [...]
>
> Ok, so it says it's based on showdown. John Fraser wrote showdown and also
> WMD, which IIRC was built on top of showdown. (Showdown converts the
> markdown to html, and WMD adds the editor UI.)
>
> I can nowhere find a actual statement of the copyright of showdown or
> WMD. <http://code.google.com/p/wmd/> has a "MIT License" notice on it,
> but this is clearly just the license chosen when signing up at google
> code for the repo that would be used for a rewrite of the code, and the only thing
> said about the previous 1.0 release of WMD is "use it freely", which is not
> specific enough to be a grant of license, and is moreover not a free
> software license, as it does not cover distribution or modification.
>
> Which was all covered in the thread here,
> when StackOverflow decided to start working on pagedown.
> <http://blog.stackoverflow.com/2008/12/reverse-engineering-the-wmd-editor/>
> This thread does not give any indication that they ever managed to get
> a license grant for WMD/showdown. It frankly, does not inspire confidence
> that the people working on this care about the license.
>
> It would probably be pretty easy to adapt the ikiwiki wmd plugin
> to use pagedown. But without a clear and credible license, why?
>
> (Note that I have a wmd-new branch in my ikiwiki git repo that
> uses <https://github.com/derobins/wmd>, which was an earlier
> version of pagedown (probably, not entirely clear).)
>
> An alternate alternative is markitup: <http://markitup.jaysalvat.com/>
> It has a clear history and a credible license (MIT or GPL dual license).
> It's also easily extensible to other formats so could handle rst etc.
> It does not, however, have a markdown to html converter -- for
> previewing it has to talk to the server with AJAX.
> --[[Joey]]
>> Showdown has a pretty explicit [license.txt file](https://github.com/coreyti/showdown/blob/master/license.txt)
>> and it basically looks like a BSD license. That license.txt file was imported into
>> github directly from the upstream showdown source, so it seems credible. That zip file
>> is still available [on archive.org](http://wayback.archive.org/web/20100612163302/http://attacklab.net/showdown/showdown-v0.9.zip),
>> and does mention a BSD copyright.
>>
>> So Showdown itself is clean: it's free. Nowhere does it say it derives from WMD, or
>> if it does, it doesn't matter *because* it was made by the same author **and then**
>> released under that free license. But even then, it does *not* mention being a
>> derivative of WMD.
>>
>> I agree the license behind WMD is murky. One the one hand, the [google code page](https://code.google.com/p/wmd/)
>> mentions the code will be relicensed under MIT but "for now" we can "use it freely":
>>
>> > *I'm refactoring the code, and will be releasing WMD under the MIT license soon. For
>> now you can download the most recent release (wmd-1.0.1.zip) and use it freely.*
>>
>> That zip file is again offline, but it's also [on archive.org](http://web.archive.org/web/20101226145228/http://wmd-editor.com/downloads/wmd-1.0.1.zip).
>> Things get a little more murky there: the file doesn't actually mention any copyright
>> statement, and the code is actually obfuscated, something that is mentionned on the aforementionned
>> Stack Exchange thread. The [terms and conditions of WMD](http://web.archive.org/web/20100323043113/http://wmd-editor.com/terms)
>> are pretty hostile however:
>>
>>> *All rights reserved. You may not duplicate, copy, or reuse any portion of the HTML/CSS, JavaScript, or visual design elements or concepts without express written permission from AttackLab.*
>>
>> But one could argue they apply only to WMD, and *not* showdown, which has been
>> explicitely published under a different license. And maybe that was the whole
>> point here: the stack exchange people were trying to negociate having the
>> clear and free version of WMD for their own use, maybe showdown is actually
>> what came out of this and what allows Stack exchange to do their thing...
>>
>> And besides: the point here is that we *can't actually use WMD safely*, but
>> we **can use pagedown safely!**.
>>
>> I tried the plugin: it works, and it works well. It's also fairly trivial to
>> install the upstream showdown library, which is not shipped with the plugin
>> (which alleviates all possible copyright problems). You can take test the
>> plugin at <http://testwiki.anarc.at/>
>>
>> There are only three issues I could find during testing:
>>
>> 1. two previews are showed (the showdown one and the regular ikiwiki one),
>> which can be confusing, but is still necessary because the showdown one
>> doesn't parse ikiwiki directives.
>> 2. the wiki needs to be rebuilt when the plugin is first activated for the
>> stylesheets to regenerate. new wikis are not affected, and this can be
>> deployed massively on farms without user intervention.
>> 3. on large pages, the edit screen isn't in the first screen, so it's not
>> obvious we're editing the page, which is also a little confusing - we
>> would need an anchor in there... Update: a simple patch fixes that...
>> but in a rather crude way:
>>
>> [[!format diff """
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -87,7 +87,7 @@ sub genpage ($$) {
my $actions=0;
if (length $config{cgiurl}) {
if (IkiWiki->can("cgi_editpage")) {
- $template->param(editurl => cgiurl(do => "edit", page => $page));
+ $template->param(editurl => cgiurl(do => "edit", page => $page) . '#editcontent');
$actions++;
}
}
"""]]
>> ideally, we would show the edit box next to the page preview... And there's a way to do that too! But it requires some more CSS hackery, like [this](http://css-tricks.com/scrollfollow-sidebar/), for example:
>>
>> #wmd-preview {
>> position: relative;
>> margin: 15px auto;
>> float: left;
>> width: 50%;
>> }
>> form {
>> position: fixed;
>> margin-left: 50%;
>> }
>>
>> But this is getting a little crazy and I need to sleep now.
>>
>> [[!template id=gitbranch branch=anarcat/pagedown author="[[anarcat]]"]]
>>
>> Anyways, let's work on merging that pretty branch already shall we? :) --[[anarcat]]