aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-05-17 10:10:49 +0100
committerSimon McVittie <smcv@debian.org>2016-05-17 10:10:49 +0100
commitd1ed45f4c187952c67c85485032a17b141657cde (patch)
treeb4a67213509c76b7d67e06f5830bfb9f55ee3fdb /doc
parent181419688f01cb72bf8ba2338e450bed7a425ea8 (diff)
downloadikiwiki-d1ed45f4c187952c67c85485032a17b141657cde.tar
ikiwiki-d1ed45f4c187952c67c85485032a17b141657cde.tar.gz
Revert vandalism
Diffstat (limited to 'doc')
-rw-r--r--doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn13
-rw-r--r--doc/bugs/password_reset_failure.mdwn22
-rw-r--r--doc/plugins/contrib/irker.mdwn128
-rw-r--r--doc/tips/monitor_page_changes_through_IRC.mdwn2
4 files changed, 164 insertions, 1 deletions
diff --git a/doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn b/doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn
index a66941389..f4f2f2685 100644
--- a/doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn
+++ b/doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn
@@ -26,6 +26,10 @@ The `moderatedcomments` plugins is **not** enabled
The `anonok` plugin is **not** enabled
+> What are your complete `add_plugins` and `disable_plugins` options?
+> Which version of ikiwiki are you running? Are you using any third-party
+> plugins or patches? --[[smcv]]
+
---
## Steps
@@ -57,3 +61,12 @@ For [this particular installation](https://dev.iikb.xyz), that's not the case.
## Question
Is there a session file or something to logout this phantom user?
+
+> See [[tips/inside_dot_ikiwiki]]. `.ikiwiki/userdb` is a Perl Storable file;
+> there are instructions for inspecting it on that page. `.ikiwiki/sessions.db`
+> is most likely a Berkeley DB file.
+>
+> I would be interested to see the contents of these two files and the complete
+> `.setup` file. I would also be interested to see a tarball of the entire
+> wiki source directory, if it isn't excessively large. If you'd be willing to
+> share them, please contact <mailto:smcv@debian.org>. --[[smcv]]
diff --git a/doc/bugs/password_reset_failure.mdwn b/doc/bugs/password_reset_failure.mdwn
new file mode 100644
index 000000000..1e40981b4
--- /dev/null
+++ b/doc/bugs/password_reset_failure.mdwn
@@ -0,0 +1,22 @@
+I can't seem to do a password reset on this wiki. I am writing this
+through the anonymous git push interface (phew for that!).
+
+I have tried three times now to reset my password through the user
+interface - my account name is [[anarcat]], and when i do the password
+reset, I get a token. I go visit the website, set a passphrase, click
+`Save Preferences` and I end up on a login form. I enter my
+passphrase, click `Login` and I get the error:
+
+ 1 error(s) were encountered with your submission. Please correct the fields highlighted below.
+
+ Name
+ [anarcat]
+
+ Password
+ [*************] Invalid entry
+
+`Password` is highlighted.
+
+Even if I leave the password there (my cleartext password is in the
+login form by default after the password reset, which is strange), it
+still gives me that error. -- [[anarcat]]
diff --git a/doc/plugins/contrib/irker.mdwn b/doc/plugins/contrib/irker.mdwn
new file mode 100644
index 000000000..bbc24e57d
--- /dev/null
+++ b/doc/plugins/contrib/irker.mdwn
@@ -0,0 +1,128 @@
+[[!template id=plugin name=irker author="[[anarcat]]"]]
+[[!tag type/special-purpose]]
+
+This plugin will configure your wiki to send IRC notifications using the [irker](http://www.catb.org/esr/irker/) notification bot.
+
+It is fairly simple and requires no configuration but installation of the irker package. For template configuration, patches from [Debian bug #824512](https://bugs.debian.org/824512) are necessary.
+
+[[!format perl """
+package IkiWiki::Plugin::irker;
+
+use warnings;
+use strict;
+use IkiWiki 3.00;
+
+sub import {
+ hook(type => "getsetup", id => "irker", call => \&getsetup);
+ hook(type => "checkconfig", id => "branchable", call => \&checkconfig,
+ first => 1);
+ hook(type => "genwrapper", id => "irker", call => \&genwrapper,
+ last => 1);
+}
+
+sub getsetup() {
+ return
+ plugin => {
+ safe => 0,
+ rebuild => undef,
+ section => "core",
+ },
+ irker_channels => {
+ type => "string",
+ example => ['ircs://irc.example.com/example'],
+ description => "IRC channels to send notifications to",
+ safe => 1,
+ rebuild => 0,
+ },
+ irker_template => {
+ type => "string",
+ example => "'%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s",
+ description => "Template to use for messages. Only supported with patch from https://bugs.debian.org/824512",
+ safe => 1,
+ rebuild => 0,
+ },
+ irker_hook => {
+ type => "string",
+ example => "irkerhook-git",
+ description => 'Hook to setup for notifications, will look in $PATH if File::Which is available, otherwise use absolute path.',
+ safe => 1,
+ rebuild => 0,
+ },
+}
+
+sub checkconfig {
+ use URI; # ikiwiki Depends on it
+ foreach my $channel (@{$config{'irker_channels'}}) {
+ my $uri = URI->new( $channel );
+ # inspired by http://stackoverflow.com/a/2599378/1174784
+ # and http://stackoverflow.com/a/4953329/1174784
+ if (!$uri->scheme || $uri->path =~ m/^([#&]?[^\x07\x2C\s]{,200})/) {
+ error("$channel is not a valid IRC channel URI");
+ }
+ }
+ # check if hook exists
+ if (-x $config{irker_hook}) {
+ # shortcut: already configured
+ return;
+ }
+ eval q{use File::Which};
+ # check with which, i available
+ if (!$@) {
+ my $hook;
+ if (!defined $config{'irker_hook'}) {
+ $config{'irker_hook'} = 'irkerhook-git';
+ }
+ $hook = which($config{'irker_hook'});
+ if (defined $hook) {
+ $config{'irker_hook'} = $hook;
+ }
+ else {
+ error("irker hook '$config{irker_hook}' not found in PATH");
+ }
+ }
+ if (!-x $config{irker_hook}) {
+ error("irker hook '$config{irker_hook}' not executable");
+ }
+}
+
+# Parses git_wrapper to find out where the git repository is.
+# cargo-culted from branchable.pm
+sub find_git_repository {
+ if ($config{rcs} eq 'git' &&
+ $config{git_wrapper}=~m!^(.*)/hooks/post-update$!) {
+ return $1;
+ }
+ else {
+ return undef;
+ }
+}
+
+# setup the hook symlink and git configuration
+sub genwrapper() {
+ my $repo=find_git_repository();
+ if (defined $repo && defined $config{'irker_channels'}) {
+ if (!-l $repo . '/hooks/post-receive') {
+ if (-e $repo . '/hooks/post-receive') {
+ error('post-receive hook exists and is not a symlink, failed to setup hook');
+ }
+ symlink($config{'irker_hook'}, $repo . '/hooks/post-receive') || error('failed to symlink: $!');
+ }
+ my $channels = join(",", @{$config{'irker_channels'}});
+ exec { 'git' } ('config', '-C', $repo, 'config', 'irker.channels', $channels);
+ exec { 'git' } ('config', '-C', $repo, 'config', 'irker.channels', $config{'wikiname'});
+ if ($config{'irker_template'}) {
+ exec { 'git' } ('config', '-C', $repo, 'config', 'irker.channels', $config{'irker_template'});
+ }
+ }
+ else {
+ exec { 'git' } ('config', '-C', $repo, 'config', '--remove-section', 'irker');
+ if (-l $repo . '/hooks/post-receive' &&
+ readlink($repo . '/hooks/post-receive') =~ m/irkerhook/) {
+ unlink($repo . '/hooks/post-receive');
+ }
+ }
+ return "";
+}
+
+1
+"""]]
diff --git a/doc/tips/monitor_page_changes_through_IRC.mdwn b/doc/tips/monitor_page_changes_through_IRC.mdwn
index b958b8906..d1b611326 100644
--- a/doc/tips/monitor_page_changes_through_IRC.mdwn
+++ b/doc/tips/monitor_page_changes_through_IRC.mdwn
@@ -17,6 +17,6 @@ there are basically two alternatives now:
* [KGB](https://kgb.alioth.debian.org/) - a Perl script that has been running at Debian since 2009
* [irker](http://www.catb.org/esr/irker/) - a Python script whipped up by ESR in the fall of CIA.vc (~2011), ignoring the existing KGB bot
-KGB is harder to setup ([tutorial](https://www.donarmstrong.com/posts/switching_to_kgb/)), as it , but more reliable than irker, in my experience. --[[anarcat]]
+KGB is harder to setup ([tutorial](https://www.donarmstrong.com/posts/switching_to_kgb/)), as it , but more reliable than irker, in my experience. I built the [[plugins/contrib/irker]] plugin to automatically configure notifications with irker. --[[anarcat]]
See also [[todo/ikibot]] for another bot idea.