Installer to set things up automatically
authorPaul Crowley <paul@ciphergoth.org>
Wed, 23 Apr 2008 09:23:32 +0100
changeset 27 ec31ba248edd
parent 26 2c4f499ea12f
child 28 583ed103e021
Installer to set things up automatically
hginit
install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hginit	Wed Apr 23 09:23:32 2008 +0100
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+initdir=$(pwd)
+
+cd
+mkdir -p admin repos/hgadmin/keys/admin .ssh
+cp -r "$initdir" admin/hg-admin-tools
+cp admin/hg-admin-tools/hg-ssh-wrapper admin/hg-admin-tools/remote-hgrc ~
+mv admin/hg-admin-tools/first-adminkey repos/hgadmin/keys/admin/first
+cd repos/hgadmin
+hg init .
+echo "init user=admin/*" > hg-ssh-access.conf
+hg add
+hg commit -m "initial commit"
+cp ../../admin/hg-admin-tools/hgadmin-hgrc .hg/hgrc
+../../admin/hg-admin-tools/refresh-auth ./hg-ssh-wrapper
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/install	Wed Apr 23 09:23:32 2008 +0100
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+ssh-add -L > first-adminkey
+
+if [ \! -s first-adminkey ] ; then
+    echo "No key defined in ssh agent; exiting"
+    exit -1
+fi
+
+sudo adduser --system --shell /bin/sh --group --disabled-password \
+   --gecos "Mercurial repositories" hg
+sudo -u hg -H ./hginit