Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > d8544620e4ac7bee48ddb48c85d55709 > files > 572

ikiwiki-3.20190228-1.mga7.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>inside .ikiwiki</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../style.css" type="text/css" />

<link rel="stylesheet" href="../local.css" type="text/css" />










</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../index.html">ikiwiki</a>/ 

<a href="../tips.html">tips</a>/ 

</span>
<span class="title">
inside .ikiwiki

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p>The <code>.ikiwiki</code> directory contains ikiwiki's internal state. Normally,
you don't need to look in it, but here's some tips for how to do so if
you need/want to.</p>

<h2>the index</h2>

<p><code>.ikiwiki/indexdb</code> contains a cache of information about pages.
This information can always be recalculated by rebuilding the wiki.
(So the file is safe to delete and need not be backed up.)
It used to be a (semi) human-readable text file, but is not anymore.</p>

<p>To dump the contents of the file, enter a perl command like this.</p>

<pre><code>joey@kodama:~/src/joeywiki/.ikiwiki&gt; perl -le 'use Storable; my &#036;index=Storable::retrieve("indexdb"); use Data::Dumper; print Dumper &#036;index' | head
&#036;VAR1 = {
      'index' =&gt; {
                 'ctime' =&gt; 1199739528,
                 'dest' =&gt; [
                             'index.html'
                           ],
                 'mtime' =&gt; 1199739528,
                 'src' =&gt; 'index.mdwn',
                 'links' =&gt; [
                              'index/discussion',
</code></pre>

<h2>the user database</h2>

<p><code>.ikiwiki/userdb</code> is the user database, which records preferences of all
web users.</p>

<p>To list all users in the database, enter a perl command like this.
Note that the output can include both registered users, and known
openids.</p>

<pre><code>joey@kodama:~/src/joeywiki/.ikiwiki&gt; perl -le 'use Storable; my &#036;userinfo=Storable::retrieve("userdb"); print &#036;_ foreach keys %&#036;userinfo'         
http://joey.kitenet.net/
foo
</code></pre>

<p>To list each user's email address:</p>

<pre><code>joey@kodama:~/src/joeywiki/.ikiwiki&gt; perl -le 'use Storable; my &#036;userinfo=Storable::retrieve("userdb"); print &#036;userinfo-&gt;{&#036;_}-&gt;{email} foreach keys %&#036;userinfo'

joey@kitenet.net
</code></pre>

<p>To dump the entire database contents:</p>

<pre><code>joey@kodama:~/src/joeywiki/.ikiwiki&gt; perl -le 'use Storable; my &#036;userinfo=Storable::retrieve("userdb"); use Data::Dumper; print Dumper &#036;userinfo'
&#036;VAR1 = {
          'http://joey.kitenet.net/' =&gt; {
                                          'email' =&gt; 'joey@kitenet.net',
[...]
</code></pre>

<p>Editing values is simply a matter of changing values and calling <code>Storable::nstore()</code>.
So to change a user's email address:</p>

<pre><code>joey@kodama:~/src/joeywiki/.ikiwiki&gt; perl -le 'use Storable; my &#036;userinfo=Storable::retrieve("userdb"); &#036;userinfo-&gt;{"foo"}-&gt;{email}=q{foo@bar}; Storable::lock_nstore(&#036;userinfo, "userdb")'
</code></pre>

<p>To remove that user:</p>

<pre><code>joey@kodama:~/src/joeywiki/.ikiwiki&gt; perl -le 'use Storable; my &#036;userinfo=Storable::retrieve("userdb"); delete &#036;userinfo-&gt;{"foo"}; Storable::lock_nstore(&#036;userinfo, "userdb")'
</code></pre>

<p>I've not written actual utilities to do this yet because I've only needed
to do it rarely, and the data I've wanted has been different each time.
--<span class="createlink">Joey</span></p>

<h2>the session database</h2>

<p><code>.ikiwiki/sessions.db</code> is the session database. See the <a href="http://search.cpan.org/search?mode=dist&amp;query=CGI%3A%3ASession">CGI::Session</a>
documentation for more details.</p>

<h2>lockfiles</h2>

<p>In case you're curious, here's what the various lock files do.</p>

<ul>
<li><code>.ikiwiki/lockfile</code> is the master ikiwiki lock file. Ikiwiki takes this 
lock before reading/writing state.</li>
<li><code>.ikiwiki/commitlock</code> is locked as a semophore, to disable the commit hook
from doing anything.</li>
<li><code>.ikiwiki/cgilock</code> is locked by the cgi wrapper, to ensure that only 
one ikiwiki process is run at a time to handle cgi requests.</li>
</ul>

<h2>plugin state files</h2>

<p>Some plugins create other files to store their state. </p>

<ul>
<li><code>.ikiwiki/aggregate</code> is a plain text database used by the aggregate plugin
to record feeds and known posts.</li>
<li><code>.ikiwiki/xapian/</code> is created by the search plugin, and contains xapian-omega
configuration and the xapian database.</li>
</ul>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">











<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Fri Mar 21 17:52:50 2008</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>