====== DokuWiki Server ====== This guide is for installation instructions of a DokuWiki private site, or a DokuWiki help server for a Joomla 3.9 website installation and help pages served by DokuWiki. This is specific for my personal needs, but might help you in setting up a highly customized dokuwiki server instance. ===== Installation ===== - Go to [[https://download.dokuwiki.org/|Download DokuWiki]] and configure your download to include: * Version: stable * Languages: en, de, fr, ko, th * Popular Plugins: CAPTCHA, Upgrade, Wrap, Translation. * For a general purpose server, add Popular Plugins: Video Share, Gallery. - Unzip the download to your web server directory, then run /path/to/wiki/install.php - Install bethico template for DokuWiki - Install the [[https://www.dokuwiki.org/plugin:icons|Icons Plugin]] for FontAwesome icons - Install the [[https://www.dokuwiki.org/plugin:condition|condition Plugin]] - Install the [[https://www.dokuwiki.org/plugin:include|Include Plugin]] - Install the [[https://www.dokuwiki.org/plugin:date|date Plugin]] - Install the [[https://www.dokuwiki.org/plugin:toctweak|TocTweak Plugin]] ==== General Purpose Server ==== - Install [[https://www.dokuwiki.org/plugin:sqlite|sqlite Plugin]] (required for Calendar Plugin) - Install [[https://www.dokuwiki.org/plugin:davcal|davcal Plugin]] (Calendar Plugin with CalDAV sharing support) - Install [[https://www.dokuwiki.org/plugin:comment|Comment Plugin]] - Install [[https://www.dokuwiki.org/plugin:discussion|Discussion Plugin]] - Install [[https://www.dokuwiki.org/plugin:google_maps|Google Maps Plugin]] - Install [[https://www.dokuwiki.org/plugin:whoisonline|whoisonline Plugin]] - FIXME hover css and icon links to websites FIXME - [[https://www.dokuwiki.org/plugin:google_maps|Google Maps Plugin]] -> **grep -r " tags, disable html - [[https://www.dokuwiki.org/plugin:color|color Plugin]] -> **grep -r "**Note: you need to verify below modifications after every DokuWiki upgrade.** === Concept === * The dispatcher calls files ''doku.php'' and ''help.php'' in the template directory instead of ''main.php'' (function ''bethico_dispatch'') * Language detection and fallback added to ''doku.php'' in the root directory which then dispatches ''doku.php'' in the template directory * Language detection and fallback added to ''help.php'' (copy of ''doku.php'') in the root directory which then dispatches ''help.php'' in the template directory === Core hacks === - Install my {{ :dokuwiki:tpl_bethico.zip |Bethico Template}} into ''/lib/tpl/''. Current version is v55.1 / 2024-06-09 suitable for DokuWiki "Kaos". - Add the following lines in ''doku.php'' in DokuWiki's root after line ''$ID = getID();'' at the beginning...require_once(template('dispatcher.php')); $langcode = bethico_language(); bethico_init_toc(); - ...and replace at the end line ''act_dispatch();'' withinit_lang($langcode); bethico_dispatch(basename(__FILE__)); - Add a line to file ''/lib/scripts/page.js'' in function ''makeToggle'' to allow the template to set the table of contents to //open// or //closed//$handle[0].setState = function(state){ var hidden; --> if(!state && JSINFO.toc) state = JSINFO.toc.initial_state; if(!state) state = 1; === Fix toc handling in core === - Modify ''/inc/template.php'' in function ''tpl_toc'' add before line ''Event::createAndTrigger('TPL_TOC_RENDER', $toc, null, false);'':if (@include_once(template('dispatcher.php'))) bethico_update_toc($toc, $TOC);This is a non-destructive change which fixes an issue in the table of contents if plugin:condition is installed. === Fix toc handling in plugin:toctweak === - Make elements of items array unique at the end of function ''_toc'' in file ''lib/plugins/toctweak/helper.php''$items = array_unique($items, SORT_REGULAR); === Install === - Copies of the modified files for "Kaos" are in folder ''/lib/tpl/bethico/core/v551/'', copy them withcp -R /lib/tpl/bethico/core/v551/* /then check file permissions - After a DokuWiki upgrade check and change if necessary - Check ''/inc/actions.php'' and change ''/lib/tpl/bethico/dispatcher.php'' - Check ''/inc/template.php'' and change - Check ''/doku.php'' and change then copy to ''/help.php'' - Optional: replace favicon and logo in '/lib/tpl/bethico/images/'. - Add the following line in ''/lib/scripts/page.js'' (v55.1-line 170) right before ''if(!state) state = 1;''if(!state && JSINFO.toc) state = JSINFO.toc.initial_state; ===== Move Wiki to new web server ===== - Log in to your old server via SSH. - Clear out everything inside your ''data/cache/*'' folder to save space and avoid corrupt cache issues on the new host. - Pack the entire DokuWiki installation directory into a .tgz archive:tar -czvf dokuwiki-backup.tgz -C /path/to/dokuwiki . - Transfer the archive to your new server, then extract the archive into your new web server document root directory:tar -xzvf dokuwiki-backup.tgz -C /path/to/new/webroot - Make sure your new server runs a compatible or identical version of PHP as your old server. Check and update your ''.htaccess'' file if you use URL rewriting or custom paths on the new domain. - Set the correct owner and permissions so your web server user (like www-data or nginx) can write to the wiki.Ensure the data/ and conf/ directories (and their contents) are fully writable by the web server:bashsudo chown -R www-data:www-data /path/to/new/webroot sudo chmod -R 775 /path/to/new/webroot/data /path/to/new/webroot/conf Use code with caution. [1] (https://forum.dokuwiki.org/d/8687-move-to-another-server), [2] (https://forum.dokuwiki.org/d/6797-moving-my-dokuwiki-to-an-external-website)5. Test Your InstallationPoint your browser to your new domain or temporary URL to verify that pages, media files, and plugins load correctly.If old or incompatible plugins break the interface, reinstall or update them via the DokuWiki plugin manager. [1] (https://forum.dokuwiki.org/d/20489-migrating-old-wiki-to-new-wiki-and-server), [2] (https://yyhh.org/blog/2018/10/migrate-dokuwiki-to-another-server/), [3] (https://www.dokuwiki.org/faq:backup) ===== Joomla Access ===== * Set the Help URL in the component configuration of com_bethico to'https://your.wiki.server/help.php?id={langcode}:{keyref}' * Add a help button to view 'view' to open the help pageJToolbarHelper::help('view', true); * With English as the active language it will invokehttps://your.wiki.server/help.php?id=en:view ==== Help system ==== Joomla's default help url:url example: https://help.joomla.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode} Substitute tags: ^ Tag ^ Name ^ Example ^ | {app} | Application name | 'Administrator' | | {component} | Component name | 'com_content' | | {keyref} | Help screen key reference | JToolbarHelper::help('{keyref}', true) | | {language} | Full language code | 'en-GB' | | {langcode} | Short language code | 'en' | | {langregion} | Region code | 'GB' | | {major} | Joomla major version number || | {minor} | Joomla minor version number || | {maintenance} | Joomla maintenance version number || ===== Backup with zip ===== * use the following command to backup an entire wiki with zip$ sudo zip -r my_wiki my_wiki -x my_wiki/data/cache/**\* my_wiki my_wiki -x my_wiki/data/log/error/**\* my_wiki my_wiki -x my_wiki/data/log/deprecated/**\* ===== Upgrade to Version 2020-07-29 "Hogfather" ===== ==== Plugin whoisonline ==== - Replace function handle($match, $state, $pos, &$handler) definition with function handle($match, $state, $pos, Doku_Handler $handler) in file lib/plugins/whoisonline/syntax.php - Replace function render($mode, &$renderer, $data) definition with function render($mode, Doku_Renderer $renderer, $data) in file lib/plugins/whoisonline/syntax.php - Set $conf['defer_js']=0; in file conf/dokuwiki.php ===== Todo: change menu system ===== * New menu system see /inc/Menu * [[https://www.dokuwiki.org/devel:menus|Menus]] * [[https://www.patreon.com/posts/menus-14160215|Menus! blog]] * [[https://materialdesignicons.com/|Material Design Icons]] ===== Links ===== * [[https://www.dokuwiki.org/namespaces|Namespaces (and how to rename them]] * [[help2server|DokuWiki Help Server with 2 templates]] * [[https://www.dokuwiki.org/tips:safely_include_php_code|Safely include PHP code]] * [[https://www.splitbrain.org/personal|Andreas Gohr]] * [[https://www.plothost.com/kb/update-dokuwiki-command-line/|How to update DokuWiki from the command line]] ===== PHP 8.1 issues ===== ==== Plugin condition ==== * Replace curly brackets string indices with square brackets in line 84 and 149 of ''plugins/condition/syntax.php'' if you run your webserver with PHP 8. ==== Plugin html5video ==== * Put brackets enclosing the expressions on line 190 and 191 of ''plugins/html5video/syntax/video.php'' if you run your webserver with PHP 8. ===== davcal ===== ==== Check when a date entry was made ==== - Copy ''/data/meta/davcal.sqlite3'' to D:\ - Open ''sqlite3.exe'' command line tool from D:\PortableCustom\sqlite3, then enter the following commands to see entries made after 2023-01-01:.open /davcal.sqlite3 SELECT calendardata FROM calendarobjects WHERE datetime(lastoccurence, 'unixepoch') > '2023-01-01 00:00:00'; .quit