src/init/conf/hg-ssh-wrapper
changeset 34 4b5ca59fe3b7
parent 31 d54720d47ca2
child 36 b3237aabd0fe
equal deleted inserted replaced
33:18e93dbdaf12 34:4b5ca59fe3b7
       
     1 #!/bin/sh
       
     2 
       
     3 # This file should live in /etc/hg-admin-tools.  It expects
       
     4 # to be specified as the target of the "command" section in the prefix
       
     5 # of a key in the authorized_keys file, and be passed a name associated
       
     6 # with an ssh key as its only argument.  It does some setting up before
       
     7 # calling hg-ssh, which does the real work of deciding whether to allow
       
     8 # the users action based on the type of the action, the key name, and
       
     9 # the contents of the specified rules file.
       
    10 
       
    11 # If your repository is laid out differently you may need to modify
       
    12 # this file.
       
    13 
       
    14 set -e
       
    15 
       
    16 # Use a different hgrc for remote pulls - this way you can set
       
    17 # up access.py for everything at once without affecting local operations
       
    18 
       
    19 HGRCPATH=/etc/hg-admin-tools/remote-hgrc
       
    20 export HGRCPATH
       
    21 
       
    22 # Set up this environment variable - useful for hg hooks to check.
       
    23 REMOTE_USER=$1
       
    24 export REMOTE_USER
       
    25 
       
    26 cd repos
       
    27 HG_ACCESS_RULES_FILE=$(pwd)/hgadmin/hg-ssh-access.conf
       
    28 export HG_ACCESS_RULES_FILE
       
    29 exec /usr/local/lib/hg-admin-tools/hg-ssh
       
    30