]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Add an openid plugin to support logging in using OpenID.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 20 Nov 2006 02:46:58 +0000 (02:46 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 20 Nov 2006 02:46:58 +0000 (02:46 +0000)
* Web commits by OpenID users will record the full OpenID url for the user,
  but in recentchanges, these urls will be converted to a simplified display
  form+link.
* Modified svn, git, tla backends to recognise such web commits.

IkiWiki.pm
IkiWiki/CGI.pm
IkiWiki/Rcs/git.pm
IkiWiki/Rcs/svn.pm
IkiWiki/Rcs/tla.pm
debian/NEWS
debian/changelog

index efacb20ed309e65859ea2ac26cac51443dc31ce1..3803bb917e2bc671bbe6344e408594d52ca56110 100644 (file)
@@ -30,6 +30,7 @@ sub defaultconfig () { #{{{
        wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$|\.atom$|.arch-ids/|{arch}/)},
        wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/,
        wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/,
        wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$|\.atom$|.arch-ids/|{arch}/)},
        wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/,
        wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/,
+       web_commit_regexp => qr/^web commit (by (.*?(?=: )|[^:]+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/,
        verbose => 0,
        syslog => 0,
        wikiname => "wiki",
        verbose => 0,
        syslog => 0,
        wikiname => "wiki",
index def0549c5d10367cb2dc7dd90f0f091e7028e0e8..fe1c5153e6cb2cf01a1acbaba796fc45395fa674 100644 (file)
@@ -85,7 +85,16 @@ sub cgi_recentchanges ($) { #{{{
        my $changelog=[rcs_recentchanges(100)];
        foreach my $change (@$changelog) {
                $change->{when} = concise(ago($change->{when}));
        my $changelog=[rcs_recentchanges(100)];
        foreach my $change (@$changelog) {
                $change->{when} = concise(ago($change->{when}));
-               $change->{user} = htmllink("", "", escapeHTML($change->{user}), 1);
+
+               if ($change->{user} =~ m!^https?://! &&
+                   eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) {
+                       # Munge user-urls, as used by eg, OpenID.
+                       my $oid=Net::OpenID::VerifiedIdentity->new(identity => $change->{user});
+                       $change->{user} = "<a href=\"".$change->{user}."\">".escapeHTML($oid->display)."</a>";
+               }
+               else {
+                       $change->{user} = htmllink("", "", escapeHTML($change->{user}), 1);
+               }
 
                my $is_excess = exists $change->{pages}[10]; # limit pages to first 10
                delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess;
 
                my $is_excess = exists $change->{pages}[10]; # limit pages to first 10
                delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess;
index c8b5adc45d6b584064d93a06102b1ad0887ab01c..868bec40da2d6d9623420c4d17bb12807fa6c108 100644 (file)
@@ -12,7 +12,6 @@ my $origin_branch    = 'origin';            # Git ref for main repository
 my $master_branch    = 'master';            # working branch
 my $sha1_pattern     = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
 my $dummy_commit_msg = 'dummy commit';      # message to skip in recent changes
 my $master_branch    = 'master';            # working branch
 my $sha1_pattern     = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
 my $dummy_commit_msg = 'dummy commit';      # message to skip in recent changes
-my $web_commit_msg   = qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
 
 sub _safe_git (&@) { #{{{
        # Start a child process safely without resorting /bin/sh.
 
 sub _safe_git (&@) { #{{{
        # Start a child process safely without resorting /bin/sh.
@@ -375,7 +374,7 @@ sub rcs_recentchanges ($) { #{{{
                push @message, { line => $title };
 
                if (defined $message[0] &&
                push @message, { line => $title };
 
                if (defined $message[0] &&
-                   $message[0]->{line} =~ m/$web_commit_msg/) {
+                   $message[0]->{line} =~ m/$config{web_commit_regexp}/) {
                        $user=defined $2 ? "$2" : "$3";
                        $message[0]->{line}=$4;
                } else {
                        $user=defined $2 ? "$2" : "$3";
                        $message[0]->{line}=$4;
                } else {
@@ -424,7 +423,7 @@ sub rcs_notify () { #{{{
        my @changed_pages = map { $_->{'file'} } @{ $ci->{'details'} };
 
        my ($user, $message);
        my @changed_pages = map { $_->{'file'} } @{ $ci->{'details'} };
 
        my ($user, $message);
-       if (@{ $ci->{'comment'} }[0] =~ m/$web_commit_msg/) {
+       if (@{ $ci->{'comment'} }[0] =~ m/$config{web_commit_regexp}/) {
                $user    = defined $2 ? "$2" : "$3";
                $message = $4;
        } else {
                $user    = defined $2 ? "$2" : "$3";
                $message = $4;
        } else {
index 2d3ad046caf95c171bbc0d1d2b56b0eeee738b42..71189c82eb1766998bb90f1f3f4cdc0e0d22f2de 100644 (file)
@@ -7,8 +7,6 @@ use POSIX qw(setlocale LC_CTYPE);
 
 package IkiWiki;
                
 
 package IkiWiki;
                
-my $svn_webcommit=qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
-
 # svn needs LC_CTYPE set to a UTF-8 locale, so try to find one. Any will do.
 sub find_lc_ctype() {
        my $current = setlocale(LC_CTYPE());
 # svn needs LC_CTYPE set to a UTF-8 locale, so try to find one. Any will do.
 sub find_lc_ctype() {
        my $current = setlocale(LC_CTYPE());
@@ -162,7 +160,7 @@ sub rcs_recentchanges ($) { #{{{
 
                my $committype="web";
                if (defined $message[0] &&
 
                my $committype="web";
                if (defined $message[0] &&
-                   $message[0]->{line}=~/$svn_webcommit/) {
+                   $message[0]->{line}=~/$config{web_commit_regexp}/) {
                        $user=defined $2 ? "$2" : "$3";
                        $message[0]->{line}=$4;
                }
                        $user=defined $2 ? "$2" : "$3";
                        $message[0]->{line}=$4;
                }
@@ -204,7 +202,7 @@ sub rcs_notify () { #{{{
        my $user=`svnlook author $config{svnrepo} -r $rev`;
        chomp $user;
        my $message=`svnlook log $config{svnrepo} -r $rev`;
        my $user=`svnlook author $config{svnrepo} -r $rev`;
        chomp $user;
        my $message=`svnlook log $config{svnrepo} -r $rev`;
-       if ($message=~/$svn_webcommit/) {
+       if ($message=~/$config{web_commit_regexp}/) {
                $user=defined $2 ? "$2" : "$3";
                $message=$4;
        }
                $user=defined $2 ? "$2" : "$3";
                $message=$4;
        }
index c71c9e6ee77907ea02afcc66e7e512323d50ce74..00ee7e7a0aade3de454ccd210d2269c1baf91a37 100644 (file)
@@ -7,8 +7,6 @@ use POSIX qw(setlocale LC_CTYPE);
 
 package IkiWiki;
 
 
 package IkiWiki;
 
-my $tla_webcommit=qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
-
 sub quiet_system (@) {
        # See Debian bug #385939.
        open (SAVEOUT, ">&STDOUT");
 sub quiet_system (@) {
        # See Debian bug #385939.
        open (SAVEOUT, ">&STDOUT");
@@ -117,7 +115,7 @@ sub rcs_recentchanges ($) {
                my $when = time - str2time($sdate, 'UTC');
 
                my $committype = "web";
                my $when = time - str2time($sdate, 'UTC');
 
                my $committype = "web";
-               if (defined $summ && $summ =~ /$tla_webcommit/) {
+               if (defined $summ && $summ =~ /$config{web_commit_regexp}/) {
                        $user = defined $2 ? "$2" : "$3";
                        $summ = $4;
                }
                        $user = defined $2 ? "$2" : "$3";
                        $summ = $4;
                }
@@ -176,7 +174,7 @@ sub rcs_notify () { #{{{
        my @changed_pages = grep { !/(^.*\/)?\.arch-ids\/.*\.id$/ }
                split(/ /, "$newfiles $modfiles $remfiles .arch-ids/fake.id");
 
        my @changed_pages = grep { !/(^.*\/)?\.arch-ids\/.*\.id$/ }
                split(/ /, "$newfiles $modfiles $remfiles .arch-ids/fake.id");
 
-       if ($message =~ /$tla_webcommit/) {
+       if ($message =~ /$config{web_commit_regexp}/) {
                $user=defined $2 ? "$2" : "$3";
                $message=$4;
        }
                $user=defined $2 ? "$2" : "$3";
                $message=$4;
        }
index 781a32f590dad2cb6a8a8b2c242ff355fcd07640..dd19e26b4ee3f9c87f02994f6252e025b5bbfa94 100644 (file)
@@ -1,3 +1,15 @@
+ikiwiki (1.34) unstable; urgency=low
+
+  The httpauth setting in config files has been removed. To enable
+  httpauth support on your wiki, you should now enable the httpauth plugin,
+  instead.
+
+  This release includes OpenID support that is enabled through the openid
+  plugin. I recommend turning this on to make it easier for users to sign
+  in to your wiki.
+
+ -- Joey Hess <joeyh@debian.org>  Sun, 19 Nov 2006 20:53:05 -0500
+
 ikiwiki (1.32) unstable; urgency=low
 
   There is a change to the plugin interface in this version. Any plugins that
 ikiwiki (1.32) unstable; urgency=low
 
   There is a change to the plugin interface in this version. Any plugins that
index f261f92c95b636e114e484d048ab77da658ad9bb..26778719d19b24c77c7b550553157d716755f9d7 100644 (file)
@@ -1,8 +1,11 @@
 ikiwiki (1.34) UNRELEASED; urgency=low
 
 ikiwiki (1.34) UNRELEASED; urgency=low
 
-  * Make auth methods pluggable.
-  * Move httpauth support to a plugin.
   * Add an openid plugin to support logging in using OpenID.
   * Add an openid plugin to support logging in using OpenID.
+  * Web commits by OpenID users will record the full OpenID url for the user,
+    but in recentchanges, these urls will be converted to a simplified display
+    form+link.
+  * Modified svn, git, tla backends to recognise such web commits.
+  * Move httpauth support to a plugin.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 19 Nov 2006 16:40:26 -0500
 
 
  -- Joey Hess <joeyh@debian.org>  Sun, 19 Nov 2006 16:40:26 -0500