src/init/conf/hg-ssh-wrapper
changeset 36 b3237aabd0fe
parent 34 4b5ca59fe3b7
child 39 f5055ce263c7
equal deleted inserted replaced
35:0ed592d0f799 36:b3237aabd0fe
     1 #!/bin/sh
     1 #!/bin/sh
     2 
     2 
     3 # This file should live in /etc/hg-admin-tools.  It expects
     3 # This file should live in /etc/mercurial-server.  It expects
     4 # to be specified as the target of the "command" section in the prefix
     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
     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
     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
     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
     8 # the users action based on the type of the action, the key name, and
    14 set -e
    14 set -e
    15 
    15 
    16 # Use a different hgrc for remote pulls - this way you can set
    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
    17 # up access.py for everything at once without affecting local operations
    18 
    18 
    19 HGRCPATH=/etc/hg-admin-tools/remote-hgrc
    19 HGRCPATH=/etc/mercurial-server/remote-hgrc
    20 export HGRCPATH
    20 export HGRCPATH
    21 
    21 
    22 # Set up this environment variable - useful for hg hooks to check.
    22 # Set up this environment variable - useful for hg hooks to check.
    23 REMOTE_USER=$1
    23 REMOTE_USER=$1
    24 export REMOTE_USER
    24 export REMOTE_USER
    25 
    25 
    26 cd repos
    26 cd repos
    27 HG_ACCESS_RULES_FILE=$(pwd)/hgadmin/hg-ssh-access.conf
    27 HG_ACCESS_RULES_FILE=$(pwd)/hgadmin/hg-ssh-access.conf
    28 export HG_ACCESS_RULES_FILE
    28 export HG_ACCESS_RULES_FILE
    29 exec /usr/local/lib/hg-admin-tools/hg-ssh
    29 exec /usr/local/lib/mercurial-server/hg-ssh
    30 
    30