This is an old revision of the document!
Table of Contents
gitbacked Plugin
Compatible with DokuWiki
Release 2012-10-13 "Adora Belle",Release 2013-05-10 "Weatherwax",Release 2013-12-08 "Binky",Release 2014-09-29d "Hrun"
Sync/store pages and media in a git repository. So you can show/edit your human-readable wiki dir (e.g. documentation) with DokuWiki and store it together with your source code in the same git repo.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to git
Installation
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Note that this plugin only works if you have a git executable available at /usr/bin/git
so it requires modifications to the Git wrapper script when you run a chrooted server or don't use linux.
Suggested Directories / Structure
To avoid conflicts with the git repo and the DokuWiki files/directories we suggest to use a different directory structure.
For example, add the following setting values to your local.php
in the global conf directory of your DokuWiki Installation.
$conf['datadir'] = './data/gitrepo/wiki/pages';
$conf['mediadir'] = './data/gitrepo/wiki/media';
Attention: Don't forget to move the original pages and media folders (./data/pages
and ./data/media
) to the new location (./data/gitrepo/wiki/
), otherwise DokuWiki won't find any pages and media files.
If you use this structure, you have to set the repoPath (in the Admin-Area of DokuWiki in the section gitbacked) to the correct location ./data/gitrepo
. This means, that all wiki related files are located in the directory wiki
in your git repository.
The plugin creates a new repo if no git repo can be found in the specified repoPath. If you want to use an existing git repository, clone the repository to e.g. /tmp/yourrepo
. Subsequently, copy all data (don't forget the .git
folder) from /tmp/yourrepo
to ./data/gitrepo
.
Congrats! You are finished and every page edit is committed to the git repo.
If you want to push all changes to the remote origin, see the pushAfterCommit setting in the next section.
Configuration and Settings
pushAfterCommit
If activated, every commit (page edit) is pushed to the remote repo. Activate this flag iff you already cloned from a remote location and the git environment ist configured correctly (attention: the git env has to be configured for the webserver/php user)
periodicPull
If activated, after a defined period (defined in ) the system executes a pull request and updates the local git repository. Thus, external commits on page files are merged from remote to the local repo.
periodicMinutes
Defines the period (in minutes) for the periodic pull request executions.
commitMsg
,commitMsgDel
,commitMediaMsg
,commitMediaMsgDel
The String which is used for the different commit messages (page edits, media edits, page deletion, media deletion). The variables %page%
,%media%
, %summary%
and %user%
can be used and are replaced with the corresponding values during the commit process.
repoPath
The path to your git repository (root) – set to the savedir by default (./data
).
repoWorkDir
Path of the git working tree, must contain “pages” and “media” directories (e.g. the savedir).
ignorePaths
Paths or files (comma separated) that will be ignored and not added by git (currently simple wildcard string matching of paths is performed)
addParams
Specify additional parameters for the git binary. For example, if you can't set default git config values for the webserver's system user you can add some basic information by specifying additional parameters. e.g. -c http.sslVerify=false -c user.email=someone@somewhere.com -c user.name=MyName
deactivates the SSL certificate check and specify the user's email and name which are used for the commits. The value in addParams
is placed directly after the git binary when executing some git command. The variables %mail%
and %user%
can be used and are replaced with the corresponding values before being passed on to git.
Known Bugs and Issues
Please, use Github https://github.com/woolfg/dokuwiki-plugin-gitbacked/issues