Dokuwiki

From Crashcourse Wiki

Jump to: navigation, search

Contents

[edit] Links

[edit] Hierarchy (tarball/installed)

etc/
  dokuwiki/
    ... many *.conf and *.php files ...
usr/
  bin/
    dokuwiki-addsite
    dokuwiki-delsite
  share/
    doc/
      dokuwiki/
    dokuwiki/
      bin/
        dwpage.php
        indexer.php
        render.php
        striplangs.php
        wantedpages.php
      inc/
      lib/
      doku.php
      feed.php
      index.php
      install.php
    lintian/
    man/
var/lib/dokuwiki/
  acl/
    acl.auth.php
    users.auth.php
  data/
    attic/
    cache/
    deleted.files
    _dummy
    index/
    locks/
    media/
    meta/
    pages/
    security.png
    security.xcf
    tmp/
  inc/ -> /usr/share/dokuwiki/inc/
  lib/
    plugins/
    tpl/

[edit] Getting started

After Ubuntu install, change perms on plugins directory:

$ sudo chown www-data:www-data /var/lib/dokuwiki/lib/plugins

Next, install "upgrade" plugin (works). After that, still have to make some config files accessible to webserver:

$ cd /etc/dokuwiki
$ sudo chown www-data:www-data *.conf *.php

[edit] Ubuntu package scripts

[edit] preinst

#!/bin/sh
# preinst for dokuwiki.

set -e

# Restructure the data tree to the new format introduced in the
# 2005-07-01 release
if [ -e "/var/lib/dokuwiki/attic" ] ; then
        mv /var/lib/dokuwiki/data /var/lib/dokuwiki/data.tmp
        mkdir /var/lib/dokuwiki/data
        mv /var/lib/dokuwiki/data.tmp /var/lib/dokuwiki/data/pages
        mv /var/lib/dokuwiki/attic /var/lib/dokuwiki/data/
        mv /var/lib/dokuwiki/media /var/lib/dokuwiki/data/
fi

if [ $1 = "upgrade" ] ; then
    # Backup the .htaccess file managed by ucf that used to be part
    # of the package file and would be deleted as a side effect.
    # Remove useless ucf associations: these files are part of the
    # package and would get deleted or overwritten before ucf
    # can do anything.
    #
    # See bug #506100.
    if [ -f /usr/share/dokuwiki/.htaccess -a ! -f /usr/share/dokuwiki/.htaccess.dist ]
    then
        cp /usr/share/dokuwiki/.htaccess /usr/share/dokuwiki/.htaccess.upgrade
        ucf --purge /usr/share/dokuwiki/.htaccess
        ucf --purge /var/lib/dokuwiki/data/.htaccess
        ucf --purge /usr/share/dokuwiki/bin/.htaccess
        ucf --purge /usr/share/dokuwiki/inc/.htaccess
        ucf --purge /usr/share/dokuwiki/inc/lang/.htaccess
    fi
fi

[edit] postinst

#!/bin/sh
# Postinst script for Dokuwiki.

set -e

# Create an apache configuration file for dokuwiki
write_apache_conf()
{
    apacheconf=`tempfile`
    
    # Get config options
    db_get dokuwiki/system/documentroot
    docroot=$RET;

    cat >> $apacheconf <<-EOF
	AliasMatch ^$docroot/sites/[^/]+$      /usr/share/dokuwiki/
	AliasMatch ^$docroot/sites/[^/]+/(.*)$ /usr/share/dokuwiki/\$1
	Alias      $docroot                    /usr/share/dokuwiki/
	EOF

    # Print directory options for /usr/share/dokuwiki
    cat >> $apacheconf <<-EOF

	<Directory /usr/share/dokuwiki/>
		Options +FollowSymLinks
		AllowOverride All
		order allow,deny
	EOF

    db_get dokuwiki/system/accessible
    if [ "$RET" = "global" ]; then  # Globally accessible
        echo "	Allow from all" >> $apacheconf
    elif [ "$RET" = "localhost only" ]; then  # Access only from localhost
	echo "	Allow from localhost 127.0.0.1 ::1" >> $apacheconf
    else  # Access from localnet
	db_get dokuwiki/system/localnet
	echo "	Allow from localhost 127.0.0.1 ::1" >> $apacheconf
	echo "	Allow from $RET" >> $apacheconf
    fi
    
    cat >> $apacheconf <<-EOF

	        <IfModule mod_rewrite.c>

	                # Uncomment to implement server-side URL rewriting
	                # (cf. <http://www.dokuwiki.org/config:userewrite>).
                        # Do *not* mix that with multisite!
	                #RewriteEngine on
	                #RewriteBase /dokuwiki
	                #RewriteRule ^lib                      - [L]
	                #RewriteRule ^doku.php                 - [L]
	                #RewriteRule ^feed.php                 - [L]
	                #RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=\$1  [QSA,L]
	                #RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=\$1 [QSA,L]
	                #RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_\$1&id=\$2 [QSA,L]
	                #RewriteRule ^$                        doku.php  [L]
	                #RewriteRule (.*)                      doku.php?id=\$1  [QSA,L]
	        </IfModule>
	</Directory>

	<Directory /usr/share/dokuwiki/bin>
	        Deny from all
	</Directory>

	<Directory /var/lib/dokuwiki/data>
	        Deny from all
	</Directory>
	EOF
    
    ucf --debconf-ok $apacheconf /etc/dokuwiki/apache.conf
    ucfr dokuwiki /etc/dokuwiki/apache.conf

    # Remove temporary file
    rm $apacheconf;

    if [ -e /etc/dokuwiki/apache.conf ]; then
        chmod 0644 /etc/dokuwiki/apache.conf
    fi
}

# Create a lighttpd configuration file for dokuwiki
write_lighttpd_conf()
{
    lighttpdconf=$(tempfile)

    # Get document root
    db_get dokuwiki/system/documentroot
    docroot=$RET;

    # Configure lighttpd to server dokuwiki on the docroot
    echo "alias.url += (\"$docroot\" => \"/usr/share/dokuwiki\")" >> $lighttpdconf
    cat >> $lighttpdconf << EOF

\$HTTP["url"] =~ "^$docroot" {
  server.follow-symlink = "enable"
}

\$HTTP["url"] =~ "/(\.|_)ht" {
  url.access-deny = ( "" )
}
\$HTTP["url"] =~ "^$docroot/(bin|data|inc|conf)" {
  url.access-deny = ( "" )
}
EOF

    # TODO: access restriction

    # Write the configuration file to its final location
    ucf --debconf-ok $lighttpdconf /etc/dokuwiki/lighttpd.conf
    ucfr dokuwiki /etc/dokuwiki/lighttpd.conf

    # Remove temporary file
    rm $lighttpdconf;

    if [ -e /etc/dokuwiki/lighttpd.conf ]; then
        chmod 0644 /etc/dokuwiki/lighttpd.conf
    fi
}

# Create a local dokuwiki configuration file
write_dokuwiki_conf()
{
    dokuwikiconf=$(tempfile)

    now=$(date --rfc-2822)
    cat >> $dokuwikiconf << EOF
<?php
/**
 * Dokuwiki's Main Configuration File - Local Settings
 * Auto-generated by Debian postinst script
 * Date: $now
 */

EOF

    db_get dokuwiki/wiki/title
    title="$(printf "%s" "$RET" | sed -e 's/\\/\\\\/g;'"s/'/\\\\'/g")"
    echo "\$conf['title'] = '$title';" >> $dokuwikiconf

    db_get dokuwiki/wiki/license
    echo "\$conf['license'] = '$RET';" >> $dokuwikiconf

    echo "#\$conf['lang'] = 'en';" >> $dokuwikiconf

    db_get dokuwiki/wiki/acl
    if [ "$RET" = "true" ]; then
        echo "\$conf['useacl'] = 1;" >> $dokuwikiconf
        echo "\$conf['superuser'] = '@admin';" >> $dokuwikiconf
    fi

    ucf --debconf-ok $dokuwikiconf /etc/dokuwiki/local.php
    ucfr dokuwiki /etc/dokuwiki/local.php

    # Remove temporary file
    rm $dokuwikiconf

    if [ -e /etc/dokuwiki/local.php ]; then
        chmod 0644 /etc/dokuwiki/local.php
    fi

    # Set permissions according to the user's wishes
    db_get dokuwiki/system/writeconf
    if [ "$RET" = "true" ]; then
        if [ -e /etc/dokuwiki/local.php ]; then
            chown root:www-data /etc/dokuwiki/local.php
            chmod 0664 /etc/dokuwiki/local.php
            if ! dpkg-statoverride --list /etc/dokuwiki >/dev/null 2>&1; then
                dpkg-statoverride --update --add root www-data 0775 /etc/dokuwiki
            fi
        fi
    fi
    db_get dokuwiki/system/writeplugins
    if [ "$RET" = "true" ]; then
        if ! dpkg-statoverride --list /var/lib/dokuwiki/lib/plugins >/dev/null 2>&1; then
            dpkg-statoverride --update --add root www-data 0775 /var/lib/dokuwiki/lib/plugins
        fi
    fi
}

# Set up an initial access control system
setup_acl()
{
    # Do not touch ACLs of existing installationq
    if [ ! -e /var/lib/dokuwiki/acl/acl.auth.php ]; then
        aclauth=`tempfile`

        now=$(date --rfc-2822)
        cat >> $aclauth << EOF
# acl.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# Access Control Lists
#
# Auto-generated by Debian postinst script
# Date: $now

EOF

        db_get dokuwiki/wiki/policy
        if [ "$RET" = "closed" ]; then
                echo "*               @ALL          0" >> $aclauth
                echo "*               @user         8" >> $aclauth
        elif [ "$RET" = "public" ]; then
                echo "*               @ALL          1" >> $aclauth
                echo "*               @user         8" >> $aclauth
        else
                echo "*               @ALL          8" >> $aclauth
        fi

    	ucf --debconf-ok $aclauth /var/lib/dokuwiki/acl/acl.auth.php
        ucfr dokuwiki /var/lib/dokuwiki/acl/acl.auth.php

        # Remove temporary file
        rm $aclauth;
    
        if [ -e /var/lib/dokuwiki/acl/acl.auth.php ]; then
            chown www-data:root /var/lib/dokuwiki/acl/acl.auth.php
        fi
    fi
}

# Set up an initial administrator account
setup_superuser()
{
    # Do not touch user lists of existing installations
    if [ ! -e /var/lib/dokuwiki/acl/users.auth.php ]; then
        usersauth=`tempfile`

        db_get dokuwiki/wiki/superuser
        superuser="$RET"
        db_get dokuwiki/wiki/fullname
        fullname="$RET"
        db_get dokuwiki/wiki/email
        email="$RET"
        db_get dokuwiki/wiki/password
        password=$(echo -n "$RET" | md5sum -b | cut -d' ' -f1)
        db_set dokuwiki/wiki/password ""
        db_set dokuwiki/wiki/confirm ""
        echo "$superuser:$password:$fullname:$email:admin,user" >> $usersauth

    	ucf --debconf-ok $usersauth /var/lib/dokuwiki/acl/users.auth.php
        ucfr dokuwiki /var/lib/dokuwiki/acl/users.auth.php

        # Remove temporary file
        rm $usersauth;

        if [ -e /var/lib/dokuwiki/acl/users.auth.php ]; then
            chown www-data:root /var/lib/dokuwiki/acl/users.auth.php
        fi
    fi
}

# Create a .htaccess sample file for dokuwiki
write_htaccess()
{
    # Restore the backup of the .htaccess that used to be part of the
    # package and would have been lost. See preinst.
    if [ -f /usr/share/dokuwiki/.htaccess.upgrade ]
    then
        mv /usr/share/dokuwiki/.htaccess.upgrade /etc/dokuwiki/htaccess
    fi

    # A previous versions of this script, 0.0.20091225c-4, used to restore the
    # backup *after* ucf. As this erased the following official modification
    # after ucf, let us make it back before ucf.
    if [ -e /etc/dokuwiki/local.php -a -f /etc/dokuwiki/htaccess ]; then
        sed -i -e '/^php_value auto_prepend_file "\/usr\/share\/dokuwiki\/prepend.php"$/,+1d' /etc/dokuwiki/htaccess
    fi

    ucfr dokuwiki /etc/dokuwiki/htaccess
    ucf --debconf-ok /usr/share/dokuwiki/.htaccess.dist /etc/dokuwiki/htaccess
}

# Configure Apache web servers (possibly version 1.3 or 2.x?)
configure_apache()
{
    webserver=$1
    dir="/etc/$webserver/conf.d"
    file="$dir/dokuwiki.conf"
    # Skip servers with no configuration
    if [ -d "$dir" ] && [ ! -e "$file" ]; then
        # Link the apache configuration file to the server's
        # conf.d directory
        echo "Installing into... [$dir]" >/dev/stderr
        ln -fs /etc/dokuwiki/apache.conf "$file"
    fi
}

# Configure lighttpd web server
configure_lighttpd()
{
    webserver=$1
    dir="/etc/$webserver/conf-available"
    file="$dir/50-dokuwiki.conf"
    if [ -d "$dir" ] && [ ! -e "$file" ]; then
        if [ ! -x /usr/sbin/lighty-enable-mod ] ; then
            echo "Lighttpd not installed, skipping"
        else
            echo "Installing into... [$dir]" >/dev/stderr
            ln -sf /etc/dokuwiki/lighttpd.conf "$file"
            lighty-enable-mod dokuwiki
        fi
    fi
}

# Configure requested web server
configure_webservers()
{
    db_get dokuwiki/system/configure-webserver
    webservers="$RET"
    db_get dokuwiki/system/restart-webserver
    restart="$RET"
    write_apache_conf
    write_lighttpd_conf
    for webserver in $webservers; do
        webserver=${webserver%,}
        case "$webserver" in
            apache2)
                configure_apache $webserver ;;
            lighttpd)
                configure_lighttpd $webserver ;;
        esac
        if [ "$restart" = "true" ]; then
            if which invoke-rc.d >/dev/null 2>&1; then
                invoke-rc.d $webserver force-reload 3>/dev/null || true
            else
                /etc/init.d/$webserver force-reload 3>/dev/null || true
            fi
        fi
    done
}

if [ $1 = "configure" ]; then
    . /usr/share/debconf/confmodule

    write_htaccess
    write_dokuwiki_conf
    db_get dokuwiki/wiki/acl
    if [ "$RET" = "true" ]; then
        setup_acl
        db_get dokuwiki/wiki/superuser
        if [ ! -z "$RET" ]; then
            setup_superuser
        fi
    fi
    configure_webservers

    db_stop

    # A double transition...
    # Templates and plugins used to be under /usr/share/dokuwiki/lib.
    # They were moved to /var/lib/dokuwiki to allow additions within the FHS.
    # But some plugins need to find DokuWiki's root directory at ../../../,
    # so they are now installed under /var/lib/dokuwiki/lib to reproduce the
    # original hierarchy at /var/lib/dokuwiki.

    # Possible cases for /usr/share/dokuwiki/lib/tpl:
    # * inexistant, regular file, special file: *abnormal* cases, not handled;
    # * symlink: no transition needed;
    # * directory: transition to the new location needed.
    if [ ! -L /usr/share/dokuwiki/lib/tpl ]; then
        echo -n "Moving template directory from /usr/share/dokuwiki to /var/lib/dokuwiki/lib... " >/dev/stderr
        mv /usr/share/dokuwiki/lib/tpl/* /var/lib/dokuwiki/lib/tpl/ 2> /dev/null || true
        if ! rmdir /usr/share/dokuwiki/lib/tpl; then
            # Files left on /usr/share/dokuwiki/lib/tpl.
            # Typical case: the user added files deeply in
            # /usr/share/dokuwiki/lib/tpl/default. Requires user
            # intervention.
            echo >/dev/stderr
            echo "Some files were left on /usr/share/dokuwiki/lib/tpl:" >/dev/stderr
            echo "they are backed up on /usr/share/dokuwiki/lib/tpl.old," >/dev/stderr
            echo "please check them and consider removing them." >/dev/stderr
            mv /usr/share/dokuwiki/lib/tpl /usr/share/dokuwiki/lib/tpl.old
        fi
        ln -s /var/lib/dokuwiki/lib/tpl /usr/share/dokuwiki/lib/
        echo "[done]" >/dev/stderr
    fi
    # Possible clases for /var/lib/dokuwiki/tpl:
    # * inexistant: no transition needed;
    # * regular file, special file, symlink:  *abnormal* cases, not handled;
    # * directory: transition to the new location needed.
    if [ -d /var/lib/dokuwiki/tpl ]; then
        echo -n "Moving template directory from /var/lib/dokuwiki to /var/lib/dokuwiki/lib... " >/dev/stderr
        # A previous version of this script, 0.0.20090214b-3.1, used to
        # brutally move templates from /usr/share/dokuwiki/lib to
        # /var/lib/dokuwiki, resulting in files not belonging to the package.
        # On upgrade, they are left, but can be removed safely as they are now
        # simply provided by the package.
        rm -f /var/lib/dokuwiki/tpl/default/images/bullet.gif \
              /var/lib/dokuwiki/tpl/default/images/button-cc.gif \
              /var/lib/dokuwiki/tpl/default/images/button-css.png \
              /var/lib/dokuwiki/tpl/default/images/button-debian.png \
              /var/lib/dokuwiki/tpl/default/images/button-debian.png.uue \
              /var/lib/dokuwiki/tpl/default/images/button-donate.gif \
              /var/lib/dokuwiki/tpl/default/images/button-dw.png \
              /var/lib/dokuwiki/tpl/default/images/button-php.gif \
              /var/lib/dokuwiki/tpl/default/images/button-rss.png \
              /var/lib/dokuwiki/tpl/default/images/buttonshadow.png \
              /var/lib/dokuwiki/tpl/default/images/button-xhtml.png \
              /var/lib/dokuwiki/tpl/default/images/closed.gif \
              /var/lib/dokuwiki/tpl/default/images/favicon.ico \
              /var/lib/dokuwiki/tpl/default/images/inputshadow.png \
              /var/lib/dokuwiki/tpl/default/images/link_icon.gif \
              /var/lib/dokuwiki/tpl/default/images/mail_icon.gif \
              /var/lib/dokuwiki/tpl/default/images/open.gif \
              /var/lib/dokuwiki/tpl/default/images/tocdot2.gif \
              /var/lib/dokuwiki/tpl/default/images/UWEB.png \
              /var/lib/dokuwiki/tpl/default/images/UWEBshadow.png \
              /var/lib/dokuwiki/tpl/default/images/windows.gif
        rmdir /var/lib/dokuwiki/tpl/default/images/ 2> /dev/null || true
        rm -f /var/lib/dokuwiki/tpl/default/design.css \
              /var/lib/dokuwiki/tpl/default/detail.php \
              /var/lib/dokuwiki/tpl/default/footer.html \
              /var/lib/dokuwiki/tpl/default/layout.css \
              /var/lib/dokuwiki/tpl/default/main.php \
              /var/lib/dokuwiki/tpl/default/media.css \
              /var/lib/dokuwiki/tpl/default/mediamanager.php \
              /var/lib/dokuwiki/tpl/default/print.css \
              /var/lib/dokuwiki/tpl/default/rtl.css \
              /var/lib/dokuwiki/tpl/default/style.ini
        rmdir /var/lib/dokuwiki/tpl/default/ 2> /dev/null || true
        rm -f /var/lib/dokuwiki/tpl/index.php
        mv /var/lib/dokuwiki/tpl/* /var/lib/dokuwiki/lib/tpl/ 2> /dev/null || true
        if ! rmdir /var/lib/dokuwiki/tpl; then
            # Files left on /var/lib/dokuwiki/tpl.
            # Typical case: the user added files deeply in
            # /var/lib/dokuwiki/tpl/default. Requires user
            # intervention.
            echo >/dev/stderr
            echo "Some files were left on /var/lib/dokuwiki/tpl:" >/dev/stderr
            echo "they are backed up on /var/lib/dokuwiki/tpl.old," >/dev/stderr
            echo "please check them and consider removing them." >/dev/stderr
            mv /var/lib/dokuwiki/tpl /var/lib/dokuwiki/tpl.old
        fi
        echo "[done]" >/dev/stderr
    fi


    # Possible cases for /usr/share/dokuwiki/lib/plugins:
    # * inexistant, regular file, special file: *abnormal* cases, not handled;
    # * symlink: no transition needed;
    # * directory: transition to the new location needed.
    if [ ! -L /usr/share/dokuwiki/lib/plugins ]; then
        echo -n "Moving plugins directory from /usr/share/dokuwiki to /var/lib/dokuwiki/lib... " >/dev/stderr
        mv /usr/share/dokuwiki/lib/plugins/* /var/lib/dokuwiki/lib/plugins/ 2> /dev/null || true
        if ! rmdir /usr/share/dokuwiki/lib/plugins; then
            # Files left on /usr/share/dokuwiki/lib/plugins.
            # Typical case: the user added files deeply in
            # /usr/share/dokuwiki/lib/plugins/something_provided_by_the_package.
            # Requires user intervention.
            echo >/dev/stderr
            echo "Some files were left on /usr/share/dokuwiki/lib/plugins:" >/dev/stderr
            echo "they are backed up on /usr/share/dokuwiki/lib/plugins.old," >/dev/stderr
            echo "please check them and consider removing them." >/dev/stderr
            mv /usr/share/dokuwiki/lib/plugins /usr/share/dokuwiki/lib/plugins.old
        fi
        ln -s /var/lib/dokuwiki/lib/plugins /usr/share/dokuwiki/lib/
        echo "[done]" >/dev/stderr
    fi
    # Possible cases for /var/lib/dokuwiki/plugins:
    # * inexistant: no transition needed;
    # * regular file, special file, symlink:  *abnormal* cases, not handled;
    # * directory: transition to the new location needed.
    if [ -d /var/lib/dokuwiki/plugins ]; then
        echo -n "Moving plugins directory from /var/lib/dokuwiki to /var/lib/dokuwiki/lib... " >/dev/stderr
        mv /var/lib/dokuwiki/plugins/* /var/lib/dokuwiki/lib/plugins/ 2> /dev/null || true
        if ! rmdir /var/lib/dokuwiki/plugins; then
            # Files left on /var/lib/dokuwiki/plugins.
            # Typical case: the user added files deeply in
            # /var/lib/dokuwiki/plugins/something_provided_by_the_package.
            # Requires user intervention.
            echo >/dev/stderr
            echo "Some files were left on /var/lib/dokuwiki/plugins:" >/dev/stderr
            echo "they are backed up on /var/lib/dokuwiki/plugins.old," >/dev/stderr
            echo "please check them and consider removing them." >/dev/stderr
            mv /var/lib/dokuwiki/plugins /var/lib/dokuwiki/plugins.old
        fi
        echo "[done]" >/dev/stderr
    fi

fi

[edit] postrm

#!/bin/sh
# Postrm script for DokuWiki by Matti Pöllä <mpo@iki.fi>
# Based on postrm for PHPWiki written by Matthew Palmer.

set -e

# Above debhelper's additions that clean the debconf database!
if [ "$1" = "purge" ] && [ -e /usr/share/debconf/confmodule ]; then
    . /usr/share/debconf/confmodule
    db_get dokuwiki/system/purgepages || true
    if [ "$RET" = "true" ]; then
        rm -rf /var/lib/dokuwiki/data/attic/*
        rm -rf /var/lib/dokuwiki/data/media/*
        rm -rf /var/lib/dokuwiki/data/meta/*
	rm -rf /var/lib/dokuwiki/data/pages/*
        if [ -e /var/lib/dokuwiki/farm ]
        then
            rm -rf /var/lib/dokuwiki/farm
        fi
    fi
fi

if [ "$1" = "remove" ]; then
    rm -rf /var/lib/dokuwiki/data/cache
    rm -rf /var/lib/dokuwiki/data/index
    if [ -e /var/lib/dokuwiki/farm ] && [ "$(stat -c '%h' "/var/lib/dokuwiki/farm")" -gt 2 ]
    then
        for site in /var/lib/dokuwiki/farm/* ; do
            rm -rf -- "$site/data/cache"
            rm -rf -- "$site/data/index"
        done
    fi
fi

if [ "$1" = "purge" ]; then
    # Remove apache configuration
    for srv in apache apache2 apache-ssl apache-perl; do
	    rm -f /etc/$srv/conf.d/dokuwiki.conf
    done

    # Remove lighttpd configuration
    if [ -x /usr/sbin/lighty-disable-mod ]; then
        lighty-disable-mod dokuwiki
    fi
    rm -f /etc/lighttpd/conf-available/50-dokuwiki.conf

    if [ -x /usr/bin/ucf ]; then
	ucf --purge /etc/dokuwiki/apache.conf
	ucf --purge /etc/dokuwiki/lighttpd.conf
	ucf --purge /var/lib/dokuwiki/acl/acl.auth.php
	ucf --purge /var/lib/dokuwiki/acl/users.auth.php
        ucf --purge /etc/dokuwiki/htaccess
        ucf --purge /etc/dokuwiki/local.php
    fi

    if [ -x /usr/bin/ucfr ]; then
        ucfr --purge dokuwiki /etc/dokuwiki/apache.conf
        ucfr --purge dokuwiki /etc/dokuwiki/lighttpd.conf
	ucfr --purge dokuwiki /var/lib/dokuwiki/acl/acl.auth.php
	ucfr --purge dokuwiki /var/lib/dokuwiki/acl/users.auth.php
	ucfr --purge dokuwiki /etc/dokuwiki/htaccess
        ucfr --purge dokuwiki /etc/dokuwiki/local.php
    fi

    for ext in '' '~' '%' .bak .ucf-new .ucf-old .ucf-dist;  do
        rm -f /etc/dokuwiki/apache.conf$ext
        rm -f /etc/dokuwiki/lighttpd.conf$ext
        rm -f /var/lib/dokuwiki/acl/acl.auth.php$ext
        rm -f /var/lib/dokuwiki/acl/users.auth.php$ext
        rm -f /etc/dokuwiki/htaccess$ext
        rm -f /etc/dokuwiki/local.php$ext
    done

    if dpkg-statoverride --list /var/lib/dokuwiki/plugins >/dev/null 2>&1; then
        dpkg-statoverride --remove /var/lib/dokuwiki/plugins
    fi

    if dpkg-statoverride --list /etc/dokuwiki >/dev/null 2>&1; then
        dpkg-statoverride --remove /etc/dokuwiki
    fi

    # Remove sites configuration
    if [ -e /etc/dokuwiki/farm ]
    then
        rm -rf /etc/dokuwiki/farm
    fi
fi

# Remove some configuration files backups, cf. preinst upgrade.
if [ "$1" = "abort-upgrade" ] ; then
    rm /usr/share/dokuwiki/.htaccess.upgrade
fi

# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section

[edit] conffiles

/etc/dokuwiki/mime.conf
/etc/dokuwiki/acronyms.conf
/etc/dokuwiki/dokuwiki.php
/etc/dokuwiki/acl.auth.php.dist
/etc/dokuwiki/license.php
/etc/dokuwiki/local.php.dist
/etc/dokuwiki/userstyle.css
/etc/dokuwiki/scheme.conf
/etc/dokuwiki/entities.conf
/etc/dokuwiki/mediameta.php
/etc/dokuwiki/smileys.conf
/etc/dokuwiki/mysql.conf.php.example
/etc/dokuwiki/interwiki.conf
/etc/dokuwiki/.htaccess
/etc/dokuwiki/userprint.css
/etc/dokuwiki/wordblock.conf
/etc/dokuwiki/users.auth.php.dist
Personal tools