X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=website%2Fmirrors.mdwn;h=5fcc34743197fa2f3e1341870dd73a2b907193e1;hb=8c9c2f20a9897605724cdf8ca89c21391bd621ed;hp=342abfaa352023a3826ca1c055f39070ba2e18a7;hpb=7c8b46d6ddce871b4c4520fc6910f4553af008ec;p=monkeysphere.git diff --git a/website/mirrors.mdwn b/website/mirrors.mdwn index 342abfa..5fcc347 100644 --- a/website/mirrors.mdwn +++ b/website/mirrors.mdwn @@ -1,71 +1,47 @@ -[[meta title="Mirroring the web site"]] +[[meta title="Mirroring the Monkeysphere web site"]] -In keeping with the philosophy of distributed development, our web site is +# Mirroring the Monkeysphere web site # + +In keeping with the distributed philosophy of distributed development, our web site is stored in our git repositories and converted into html by [ikiwiki](http://ikiwiki.info/). We're mirrored on several servers. Rather than using ikiwiki's [pinger/pingee approach to distribution](http://ikiwiki.info/tips/distributed_wikis/), we've -opted for a method that uses ssh. - -The steps for creating a new mirror are: - - * Add etch-backports to your /etc/apt/sources.list: - deb http://www.backports.org/debian etch-backports main contrib non-free - * Add the following lines to your /etc/apt/preferences file: - Package: ikiwiki - Pin: release a=etch-backports - Pin-Priority: 999 - - # needed by ikiwiki - Package: libcgi-formbuilder-perl - Pin: release a=etch-backports - Pin-Priority: 999 - - Package: git-core - Pin: release a=etch-backports - Pin-Priority: 999 - * Install git-core and ikiwiki - - aptitude update; aptitutde install git-core ikiwiki - - * Create a new user. Change the new users shell to git-shell: - - adduser -s /usr/bin/git-shell - - * Add webmaster@george's public key to this user's ~/.ssh/authorized_keys file +opted for a simpler rsync of the ikiwiki-produced html files. - * Add web site configuration that the user has write access to. If you are using Apache, include the following rewrite: +## Initial steps to take on the mirror server ## - RewriteEngine On - RewriteCond %{HTTP_HOST} !^(YOURHOSTNAME|web)\.monkeysphere\.info$ [NC] - RewriteCond %{HTTP_HOST} !^$ - RewriteRule ^/(.*) http://web.monkeysphere.info/$1 [L,R] +Create a new user. - * Upload and edit ikiwiki.setup.sample from the docs directory - * As the new user, create two new git repos +Add web site configuration that the user has write access to. If you are +using Apache, include the following rewrite: - mkdir monkeysphere.git; cd monkeysphere.git; git init --bare; cd ../ - git clone monkeysphere.git # this will create a second git repo called monkeysphere + RewriteEngine On + RewriteCond %{HTTP_HOST} !^(YOURHOSTNAME|web)\.monkeysphere\.info$ [NC] + RewriteCond %{HTTP_HOST} !^$ + RewriteRule ^/(.*) http://web.monkeysphere.info/$1 [L,R] - * Change the mode of monkeysphere.git/hooks/post-receive to 755 +Add `webmaster@george`'s public key to this user's +`~/.ssh/authorized_keys` file, restricting that user to rsync (modify +path to web directory as needed): - chmod 755 monkesphere.git/hooks/post-receive + command="/usr/bin/rsync --server -vlogDtprz --delete . web/",no-pty,no-agent-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0SCD6tAh7g1yyuelIm5zyh5OFX89NNbpNzyp+BxXNxMc/C1BS9SN5KlNDT30WdDbw3X0St0dBBC69TZWYbSUn4+/6BNmYpLH2orhedBv4w2jBLmtVEfnMWa3a11CnIagMEkEz7rBIWpl76WOqzoueQbAAa/7GziVmv+2qdjcDFxHluO+VL/+gEw8BqZc587oiDYkIw3oBnOLaxUWDtaMFKiL8sgdBmPxzc8PgHxL5ezVDJExw5krR4FK7hG7KpBOlSwKQPFy2pPhHSb1ZuFJmp2kr2wfJ0RO7By5s/GbrkJbnGoiJ5W0fUC9YoI82U3svC5saowvoSo19yToJW4QUw== webmaster@george - * Edit the file so that it executes the post-receive hook ikiwiki generates (as you specified in the ikiwiki.setup file) +## Admin steps to take to enable the configuration ## -The steps to be taken on the mirror site should now be complete. The following steps should be taken by a Monkeysphere admin user: +Add a new dns record for SERVERNAME.monkeysphere.info. - * Add a new dns record for SERVERNAME.monkeysphere.info. - * Test the ssh connection by logging in as webmaster@george.riseup.net - * Add the new server as a remote on webmaster@george.riseup.net:monkeysphere.git +If the mirror server is not participating in the monkeysphere, add the +server to webmaster's known host file. - cd ~/monkeysphere.git - git add remote SERVERNAME USER@SERVERNAME.monkeysphere.info:/path/to/repo +Add the new server to `webmaster@george:~/mirrors` in the format: - * Test: + username@server:directory - git push SERVERNAME +Test by manually running the git post-receive hook as +`webmaster@george`: + ~/monkeysphere.git/hooks/post-receive - +Add a new `A` record into the `web.monkeysphere.info` round robin.