diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-07-19 12:36:01 +0200 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-07-19 12:36:01 +0200 |
commit | ec965fc92cd41f597c6e8e88584b9a688407c8c6 (patch) | |
tree | 410173c14f66ae62a6436ea00b73bb470c9d1dda /doc/forum | |
parent | 86edd73d169600875a10a635ef8df4a644545b0d (diff) | |
parent | fa2c3a3dba2a4589b63cf445ec9e33ec19be627e (diff) |
Merge branch 'master' into po
Conflicts:
debian/changelog
Diffstat (limited to 'doc/forum')
-rw-r--r-- | doc/forum/Accessing_meta_values_in_pages__63__.mdwn | 8 | ||||
-rw-r--r-- | doc/forum/Can_OpenID_users_be_adminusers__63__.mdwn | 69 | ||||
-rw-r--r-- | doc/forum/is_it_possible_to_NOT_add_openid2_meta_tags.mdwn | 67 | ||||
-rw-r--r-- | doc/forum/speeding_up_ikiwiki.mdwn | 91 |
4 files changed, 235 insertions, 0 deletions
diff --git a/doc/forum/Accessing_meta_values_in_pages__63__.mdwn b/doc/forum/Accessing_meta_values_in_pages__63__.mdwn new file mode 100644 index 000000000..78594f912 --- /dev/null +++ b/doc/forum/Accessing_meta_values_in_pages__63__.mdwn @@ -0,0 +1,8 @@ +If I set a meta value on a page (lets say \[[!meta author="Adam Shand"]] is there some way to retrieve the value of author and put it somewhere visible on the page? Eg. can I write: + +author: $author + +I know I can update the raw templates but it'd be nice to be able to do this in the pages them selves. + +Cheers, +Adam. diff --git a/doc/forum/Can_OpenID_users_be_adminusers__63__.mdwn b/doc/forum/Can_OpenID_users_be_adminusers__63__.mdwn new file mode 100644 index 000000000..7599e71e5 --- /dev/null +++ b/doc/forum/Can_OpenID_users_be_adminusers__63__.mdwn @@ -0,0 +1,69 @@ +I've just finished an upgrade to 3.141 and am trying to give myself admin rights to play with the new webadmin features. My login is via OpenID but from reading on the wiki I believe that OpenID users should be able to be granted admin rights. However I'm obviously doing something wrong as when I click on the "Preferences" link at the top of the page I don't see any admin features. + +My login is: http://adam.shand.net/ + +In .ikiwiki/userdb I see: + +> adam@shand.net +> email <br> +> password <br> +> locked_pages <br> +> banned <br> +> 1229722296 <br> +> regdate <br> +> http://adam.shand.net/ <br> + +And in my config file I have: + +> adminuser => [qw{http://adam.shand.net/}], + +Any pointers to what I'm doing wrong would be much appreciated. + +Thanks, +Adam. + +> This is certianly supposed to work. For example, the admin +> user on my ikiwikis is `http://joey.kitenet.net/` +> +> The only caveat I know of to make it work is that the +> adminuser openid url has to exactly match the openid url that +> ikiwiki sees when you log in. Including any trailing slash, +> and the `http://`. --[[Joey]] + +>> Hrm, it's not working. I'm sure I've made a silly mistake somewhere but +>> I've looked and looked and just can't find it. Any suggestions on where +>> to look for debugging information would be much appreciated. -- [[Adam]] + +>>> Well, you could use this patch to add debugging info about admin +>>> username comparisons: + +<pre> +diff --git a/IkiWiki/UserInfo.pm b/IkiWiki/UserInfo.pm +index 0bf100a..77b467a 100644 +--- a/IkiWiki/UserInfo.pm ++++ b/IkiWiki/UserInfo.pm +@@ -71,6 +71,8 @@ sub userinfo_setall ($$) { + sub is_admin ($) { + my $user_name=shift; + ++ print STDERR "is_admin test @{$config{adminuser}} vs $user_name: ".(grep { $_ eq $user_name } @{$config{adminuser}})."\n"; ++ + return grep { $_ eq $user_name } @{$config{adminuser}}; + } + +</pre> + +>>>> After applying that change to what is probably +>>>> `/usr/share/perl5/IkiWiki/UserInfo.pm` on your system, +>>>> when you go to the preferences page it should log in your web server's +>>>> error.log, something like this: + + [Wed Jul 08 12:54:35 2009] [error] [client 127.0.1.1] is_admin test http://joey.kitenet.net/ vs http://joey.kitenet.net/: 1 + +>>>> So you can see if the two usernames/openids match. If the end is "0", +>>>> they don't match. If nothing is logged, you have not enabled the websetup plugin. +>>>> If the end if "1" you should see the "Wiki Setup" button, if not the +>>>> problem is not in determining if you're an admin, but elsewhere.. +>>>> --[[Joey]] + +I was being incredibly stupid and missed that websetup is a **plugin** and thus needed to be enabled. Many thanks for your patient assistance, by helping me eliminate the unlikely it eventually led me to the obvious. Cheers. -- [[Adam]] diff --git a/doc/forum/is_it_possible_to_NOT_add_openid2_meta_tags.mdwn b/doc/forum/is_it_possible_to_NOT_add_openid2_meta_tags.mdwn new file mode 100644 index 000000000..e952263a3 --- /dev/null +++ b/doc/forum/is_it_possible_to_NOT_add_openid2_meta_tags.mdwn @@ -0,0 +1,67 @@ +### "meta openid" problems + +I have add the followning to _index.mdwn_ on my site. + + \[[!meta openid="http://certifi.ca/lunix" + server="http://certifi.ca/_serve"]] + +This resulted in the following being added to my site + + <link href="http://certifi.ca/_serve" rel="openid.server" /> + <link href="http://certifi.ca/_serve" rel="openid2.provider" /> + <link href="http://certifi.ca/lunix" rel="openid.delegate" /> + <link href="http://certifi.ca/lunix" rel="openid2.local_id" /> --> + +Perhaps I have done something wrong but this fails to work when I try to log in to several sites using my sites url as my login. +If I edit index.html and remove the two openid2 lines all works fine. +**Is there a way to only add openid version 1 tags to my index.html ? +Or a way to make it work the way it is ?** --[Mick](http://www.lunix.com.au) + +> Before I think about adding a way to not add the openid 2 tags, +> I'd like to know what the problem is. Is there something +> wrong with the tags? Does your openid provider not support +> openid 2, and the site you are logging into sees the openid 2 tags +> and uses it, not falling back to openid 1? +> +> Since certifi.ca is a public openid provider (run by a +> guy I know even!), I should be +> able to reproduce your problem if you can tell me what +> site(s) you are trying to log into. --[[Joey]] + +---------- + +I was using _phpMyID_ and its not _openid2_ compliant so I switched to certifi.ca to counteract that but I really +want to go back to running my own provider. +I can't login to identi.ca.unless I comment out the openid2 lines.(this may be there problem, I get sent to certifi.ca's site and redirected back to identi.ca) +I will test all the different openid enabled sites I log into today and see what happens. +It seems that since I have moved my site to its final location and made it live over night I am able to login to most places now. +I do not have a proper understanding of the inner workings of openid so not exactly sure what part is failing but I think the problem +lays with the consumers not falling back to the openid1 tags when they are openid1 only consumers. --[Mick](http://www.lunix.com.au) + +> So, just to clarify, certifi.ca works ok (I verified this, logging into identi.ca using it). +> You had the problem running your own openid provider which did not support 2.0, in which case, +> consumers seem justified in not falling back (guess; I don't know the 2.0 spec). +> The only way this seems fixable is to add an option to meta to allow disabling openid 2. Which +> should be easy enough to do. --[[Joey]] + +I can't log into identi.ca with openid2 tags. strange. I will look at that again today. +Having the option to disable openid2 tags would be perfect. +Thanks Joey. --[Mick](http://www.lunix.com.au) + +>> Actually, it seems that identi.ca / certifi.ca do +>> not interoperate when using openid2. It actually +>> fails half the time, and succeeds half the time; +>> seems to be picking openid1 and openid2 randomly and failing +>> on the latter. I have emailed Evan Prodromou about this weird behavior. +>> Not clear to me if identi.ca or certifi.ca is at fault, +>> but luckily he runs both.. +>> --[[Joey]] + +Ahh so it's not just me. +It's handy having contacts in the _right_ places. --[Mick](http://www.lunix.com.au) + +>> ikiwiki's next release will allow adding 'delegate=1' to the +>> meta directive to only delegate to openid1. --[[Joey]] + +## awesome. +--[Mick](http://www.lunix.com.au) diff --git a/doc/forum/speeding_up_ikiwiki.mdwn b/doc/forum/speeding_up_ikiwiki.mdwn new file mode 100644 index 000000000..0b2164238 --- /dev/null +++ b/doc/forum/speeding_up_ikiwiki.mdwn @@ -0,0 +1,91 @@ +My website takes a fairly long time to render. It takes a long time to do +things like add pages, too. I'd like to try and understand what takes the +time and what I might be able to do to speed things up. + +I have 1,234 objects on my site (yikes!). 717 are items under "/log" which +I think might be the main culprit because there are some complex pagespecs +operating in that area (e.g. log/YYYY/MM/DD, YYYY/MM and YYYY for YYYY >= +2003, YYYY <= 2008 which include every page under log/ which was modified +in the corresponding YYYY or YYYY/MM or YYYY/MM/DD). There is very little +linking between the world outside of /log and that within it. + +I was interested in generating a graphical representation of ikiwiki's idea of +page inter-dependencies. I started by looking at the '%links' hash using the +following plugin: + + #!/usr/bin/perl + package IkiWiki::Plugin::deps; + + use warnings; + use strict; + use IkiWiki 3.00; + + + sub import { + hook(type => "format", id => "deps", call => \&fooble); + } + + my $hasrun = 0; + + sub fooble ($$) { + if(0 == $hasrun) { + $hasrun = 1; + open MYFILE, ">/home/jon/deps.dot"; + foreach my $key (keys %links) { + my $arrref = $links{$key}; + foreach my $page (@$arrref) { + print MYFILE "$key -> $page;\n"; + } + } + close MYFILE; + } + } + + 1 + +The resulting file was enormous: 2,734! This turns out to be because of the following code in scan() in Render.pm: + + if ($config{discussion}) {$ + # Discussion links are a special case since they're + # not in the text of the page, but on its template. + $links{$page}=[ $page."/".gettext("discussion") ]; + +Worst case (no existing discussion pages) this will double the number of link +relationships. Filtering out all of those, the output drops to 1,657. This +number is still too large to really visualize: the graphviz PNG and PDF output +engines segfault for me, the PS one works but I can't get any PS software to +render it without exploding. + +Now, the relations in the links hash are not the same thing as IkiWiki's notion of dependencies. Can anyone point me at that data structure / where I might be able to add some debugging foo to generate a graph of it? + +Once I've figured out that I might be able to optimize some pagespecs. I +understand pagespecs are essentially translated into sequential perl code. I +might gain some speed if I structure my complex pagespecs so that the tests +which have the best time complexity vs. "pages ruled out" ratio are performed +first. + +I might also be able to find some dependencies which shouldn't be there and +remove the dependency. + +In general any advice people could offer on profiling ikiwiki would be great. +I did wonder about invoking the magic profiling arguments to perl via the CGI +wrapper. + + +-- [[Jon]] + +> Dependencies go in the `%IkiWiki::depends` hash, which is not exported. It +> can also be dumped out as part of the wiki state - see [[tips/inside_dot_ikiwiki]]. +> +> It's a map from page name to increasingly complex pagespec, although +> the `optimize-depends` branch in my git repository changes that to a +> map from a page name to a *list* of pagespecs which are automatically +> or'd together for use (this at least means duplicates can be weeded out). +> +> See [[todo/should_optimise_pagespecs]] for more on that. +> +> I've been hoping to speed up IkiWiki too - making a lot of photo albums +> with my [[plugins/contrib/album]] plugin makes it pretty slow. +> +> One thing that I found was a big improvement was to use `quick=yes` on all +> my `archive=yes` [[ikiwiki/directive/inline]]s. --[[smcv]] |