X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/85f0e8bf6a2d45e96aa123ed8d39f6ca0b837d6d..651cdd4b2a85f4e5f9d298a7eea7d0e6d94442b1:/doc/tips/distributed_wikis.mdwn diff --git a/doc/tips/distributed_wikis.mdwn b/doc/tips/distributed_wikis.mdwn index 2fd82700c..229f27148 100644 --- a/doc/tips/distributed_wikis.mdwn +++ b/doc/tips/distributed_wikis.mdwn @@ -1,3 +1,5 @@ +[[!meta date="2008-05-06 19:22:09 -0400"]] + [[rcs/git]] and other distributed version control systems are all about making it easy to create and maintain copies and branches of a project. And this can be used for all sorts of interesting stuff. Since ikiwiki can use @@ -7,12 +9,13 @@ git, let's explore some possibilities for distributed wikis. ## Overview -There are three possible level of decentralisation: +There are several possible level of decentralisation: 0. [[default setup|rcs/git]], no decentralisation 1. [[a simple HTML mirror|tips/Git_repository_and_web_server_on_different_hosts/]] - 2. separate `srcdir`, still requires a central bare repo - uses [[plugins/pinger]] - 3. completely distinct ikiwiki installs, synchronised with [[plugins/contrib/gitpush]] + 2. [[separate ikiwiki and git servers|tips/Hosting_Ikiwiki_and_master_git_repository_on_different_machines]] + 3. separate `srcdir`, still requires a central bare repo - uses [[plugins/pinger]] + 4. completely distinct ikiwiki installs Here's a graphic overview of those: @@ -34,6 +37,13 @@ This is the configuration described in hosts the HTML files, the ikiwiki [[cgi]] but everything else is on the git server. +### Separate webserver and git repository, the git srcdir being hosted on the webserver + +[[!img Hosting_Ikiwiki_and_master_git_repository_on_different_machines/separate-web-git-servers.svg size=400x]] + +This is the configuration described in +[[tips/Hosting_Ikiwiki_and_master_git_repository_on_different_machines]]. One server hosts the web server (and the [[Ikiwiki cgi|cgi]]) and the git source dir; a second server hosts the git bare repository. This can be used when you have very limited access to the git server. + ### Decentralised pinger setup [[!img ping-setup.svg size=400x]] @@ -50,23 +60,7 @@ Step by step setup instructions for this are detailed below. [[!img decentralized_wikis.svg size=400x]] In this configuration, each wiki is fully independent and pushes its -changes to other wikis using the [[plugins/contrib/gitpush]] plugin. - -### branching a wiki - -It follows that setting up a branch of a wiki is just like the fully decentralised mirror above, except -we don't want it to push changes back to the origin. The easy way to -accomplish this is to clone the origin git repository using a readonly -protocol (ie, "git://"). Then you can't push to it. - -If a page on your branch is modified and other modifications are made to -the same page in the origin, a conflict might occur when that change is -pulled in. How well will this be dealt with and how to resolve it? I think -that the conflict markers will just appear on the page as it's rendered in -the wiki, and if you could even resolve the conflict using the web -interface. Not 100% sure as I've not gotten into this situation yet. - ---[[Joey]] +changes to other wikis using git. ## Step by step setup instructions @@ -74,6 +68,8 @@ The first two ways of setting up ikiwiki are better described in [[setup]] or [[ Say you have a friend that has already configured a shiny ikiwiki site, and you want to help by creating a mirror. You still need to figure out how to install ikiwiki and everything, hopefully this section will help you with that. +Note that parts of the following documentation duplicate instructions from [[setup]], [[setup/byhand]], [[rcs/git]] and [[tips/laptop_wiki_with_git]]. + ### Installing ikiwiki You need to install the ikiwiki package for the mirror to work. You can use ikiwiki to publish the actual HTML pages elsewhere if you don't plan on letting people edit the wiki, but generally you want the package to be installed on the webserver for editing to work. @@ -190,15 +186,6 @@ and you want a mirror, and not a branch, you should disable web edits on your mirror. (You could also point the cgiurl for your mirror at the origin wiki if you do not want to incur that overhead or do not want to, or can't, run a CGI.) -### Announcing the mirror - -Once your mirror works, you can also add it to the list of mirrors. You can ask the mirror where you take it from (and why not, all mirrors) to add it to their setup file. As an example, here's the configuration for the first mirror: - - mirrorlist: - example: https://wiki.example.com/ - -The [[plugins/mirrorlist]] plugin of course needs to be enabled for this to work. - ### Fully decentralized configuration In the above configuration, the master git repository is still on the main site. If that site goes down, there will be delays when editing the wiki mirror. It could also simply fail because it will not be able to push the changes to the master git repo. An alternative is to setup a local bare repository that is synced with the master. @@ -220,17 +207,43 @@ The following entries will be different from the above setup file: git_wrapper: /home/user/source.git/hooks/post-commit git_test_receive_wrapper: /home/user/source.git/hooks/pre-receive -To do this, the mirror needs to push back to the master, using the [[plugins/contrib/gitpush]] plugin: +To make the mirror push back to the master, use, for example: + + git_wrapper_background_command: git push git://wiki.example.com/ + +This will help ensure that commits done on the mirror will propagate back to the master. + +## Other ideas + +See also: + + * [[setup]] + * [[setup/byhand]] + * [[rcs/git]] + * [[tips/laptop_wiki_with_git]] + * [ikiwiki creation notes](http://piny.be/jrayhawk/notes/ikiwiki_creation/) + +### Announcing the mirror + +Once your mirror works, you can also add it to the list of mirrors. You can ask the mirror where you take it from (and why not, all mirrors) to add it to their setup file. As an example, here's the configuration for the first mirror: + + mirrorlist: + example: https://wiki.example.com/ - git_push_to: - - git://wiki.example.com/ +The [[plugins/mirrorlist]] plugin of course needs to be enabled for this to work. -This will ensure that commits done on the mirror will propagate back to the master. +### branching a wiki -### Other guides +It follows that setting up a branch of a wiki is just like the fully decentralised mirror above, except +we don't want it to push changes back to the origin. The easy way to +accomplish this is to clone the origin git repository using a readonly +protocol (ie, "git://"). Then you can't push to it. -Another guide is the [[tips/laptop_wiki_with_git]] guide. To get a -better understanding of how ikiwiki works, see [[rcs/git]]. +If a page on your branch is modified and other modifications are made to +the same page in the origin, a conflict might occur when that change is +pulled in. How well will this be dealt with and how to resolve it? I think +that the conflict markers will just appear on the page as it's rendered in +the wiki, and if you could even resolve the conflict using the web +interface. Not 100% sure as I've not gotten into this situation yet. -[This](http://piny.be/jrayhawk/notes/ikiwiki_creation/) may also be of -use if the above doesn't work. +--[[Joey]]