create-user: Add symlink for gitweb hosting
[clinton/scripts.git] / create-user
index 7301181..ccd65e7 100755 (executable)
@@ -9,6 +9,21 @@
 #  - while holding tokens for a user who is:
 #     - a member of system:administrator
 #     - listed in 'bos listusers deleuze'
+#  - and who has been set up with Domtool admin privileges by:
+#     - running 'domtool-adduser $USER' while holding AFS admin tokens as
+#       someone who is already a Domtool admin
+#     - running 'domtool-admin grant $USER priv all' as someone who is already a
+#       Domtool admin
+#       (To bootstrap yourself into admindom:
+#         1. Run '/etc/init.d/domtool-server stop' on deleuze.
+#         2. Run '/etc/init.d/domtool-slave stop' on all Domtool slave machines
+#            (e.g., mire).
+#         3. Edit ~domtool/acl, following the example of adamc_admin to grant
+#             yourself 'priv all'.
+#         4. Run '/etc/init.d/domtool-server start' on deleuze.
+#         5. Run '/etc/init.d/domtool-slave start' on all Domtool slave
+#            machines.
+#         6. Run 'domtool-adduser' as above.)
 
 USER=$1
 
@@ -181,6 +196,10 @@ test -e $HOMEPATH/.domtool || \
     test -L $HOMEPATH/.domtool || \
         ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
 
+# Gitweb hosting
+test -L /var/cache/git/$USER || \
+    ln -s $HOMEPATH/.hcoop-git /var/cache/git/$USER
+
 # MAIL VOLUME
 vos examine mail.$USER 2>/dev/null || \
   vos create deleuze.hcoop.net /vicepa mail.$USER -maxquota 400000
@@ -202,23 +221,28 @@ if test -f $HOMEPATH/Maildir/shared-maildirs; then
             's!^(SpamAssassin  )/home/spamd!\1/var/local/lib/spamd!1' \
             $file
     fi
-    NOTIFY=no
-    for dir in $HOMEPATH/Maildir/shared-folders/SpamAssassin/*; do
-        if ! test -d $dir; then
-            NOTIFY=yes
-        else
-            dest=/var/local/lib/spamd/Maildir/.$(basename $dir)
-            if test "$(readlink $dir/shared)" != "$dest"; then
-                ln -sf $dest $dir/shared
-            fi
-        fi
-    done
-    if test $NOTIFY = yes; then
-        # This is probably going overboard, but oh well
-        echo "$USER needs assistance on their shared spam dir" | \
-            mail -s "[create-user] $USER needs assistance" \
-              -e -a "From: admins@deleuze.hcoop.net" mwolson_admin
-    fi
+
+# This does not yet seem to be needed, and it triggers an AFS issue,
+# so I've commented it out --mwolson.
+#
+#     NOTIFY=no
+#     for dir in $HOMEPATH/Maildir/shared-folders/SpamAssassin/*; do
+#         if ! test -d $dir; then
+#             NOTIFY=yes
+#         else
+#             dest=/var/local/lib/spamd/Maildir/.$(basename $dir)
+#             if test "$(readlink $dir/shared)" != "$dest"; then
+#                 ln -sf $dest $dir/shared
+#             fi
+#         fi
+#     done
+#     if test $NOTIFY = yes; then
+#         # This is probably going overboard, but oh well
+#         echo "$USER needs assistance on their shared spam dir" | \
+#             pagsh -c mail -s "[create-user] $USER needs assistance" \
+#               -e -a "From: admins@deleuze.hcoop.net" mwolson_admin
+#     fi
+
 else
     maildirmake --add SpamAssassin=/var/local/lib/spamd/Maildir \
         $HOMEPATH/Maildir
@@ -278,3 +302,9 @@ mire_and_deleuze fs checkvolumes
 mire_and_deleuze sudo mkdir -p /var/lock/apache2/dav/$USER
 mire_and_deleuze sudo chown $USER:www-data /var/lock/apache2/dav/$USER
 mire_and_deleuze sudo chmod ug=rwx,o= /var/lock/apache2/dav/$USER
+
+#
+# Domtool integration
+#
+
+domtool-adduser $USER