src/init/conf/hg-ssh-wrapper
author Paul Crowley <paul@lshift.net>
Fri, 20 Feb 2009 11:37:58 +0000
changeset 47 ebcc230f21e4
parent 39 f5055ce263c7
child 50 77d97aa18f29
permissions -rwxr-xr-x
Fix test for user existence
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
41ecb5a3172c separate out executables and data
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     1
#!/bin/sh
41ecb5a3172c separate out executables and data
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     2
36
b3237aabd0fe Change the name to mercurial-server
Paul Crowley <paul@lshift.net>
parents: 34
diff changeset
     3
# This file should live in /etc/mercurial-server.  It expects
10
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
     4
# to be specified as the target of the "command" section in the prefix
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
     5
# of a key in the authorized_keys file, and be passed a name associated
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
     6
# with an ssh key as its only argument.  It does some setting up before
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
     7
# calling hg-ssh, which does the real work of deciding whether to allow
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
     8
# the users action based on the type of the action, the key name, and
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
     9
# the contents of the specified rules file.
4
dcd195f3e52c move config out of Python files; don't make hg-ssh-wrapper a dotfile;
Paul Crowley <paul@lshift.net>
parents: 0
diff changeset
    10
10
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
    11
# If your repository is laid out differently you may need to modify
524b4a45ef0a wrap overlong lines
Paul Crowley <paul@lshift.net>
parents: 8
diff changeset
    12
# this file.
4
dcd195f3e52c move config out of Python files; don't make hg-ssh-wrapper a dotfile;
Paul Crowley <paul@lshift.net>
parents: 0
diff changeset
    13
0
41ecb5a3172c separate out executables and data
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    14
set -e
8
1efc50c61a26 improve hg-ssh-wrapper, suggest HGRCPATH trick
Paul Crowley <paul@lshift.net>
parents: 4
diff changeset
    15
1efc50c61a26 improve hg-ssh-wrapper, suggest HGRCPATH trick
Paul Crowley <paul@lshift.net>
parents: 4
diff changeset
    16
# Use a different hgrc for remote pulls - this way you can set
18
538d6b198f4a Big change to support file conditions; format of hg-ssh-access.conf
Paul Crowley <paul@lshift.net>
parents: 10
diff changeset
    17
# up access.py for everything at once without affecting local operations
538d6b198f4a Big change to support file conditions; format of hg-ssh-access.conf
Paul Crowley <paul@lshift.net>
parents: 10
diff changeset
    18
36
b3237aabd0fe Change the name to mercurial-server
Paul Crowley <paul@lshift.net>
parents: 34
diff changeset
    19
HGRCPATH=/etc/mercurial-server/remote-hgrc
18
538d6b198f4a Big change to support file conditions; format of hg-ssh-access.conf
Paul Crowley <paul@lshift.net>
parents: 10
diff changeset
    20
export HGRCPATH
8
1efc50c61a26 improve hg-ssh-wrapper, suggest HGRCPATH trick
Paul Crowley <paul@lshift.net>
parents: 4
diff changeset
    21
4
dcd195f3e52c move config out of Python files; don't make hg-ssh-wrapper a dotfile;
Paul Crowley <paul@lshift.net>
parents: 0
diff changeset
    22
# Set up this environment variable - useful for hg hooks to check.
18
538d6b198f4a Big change to support file conditions; format of hg-ssh-access.conf
Paul Crowley <paul@lshift.net>
parents: 10
diff changeset
    23
REMOTE_USER=$1
538d6b198f4a Big change to support file conditions; format of hg-ssh-access.conf
Paul Crowley <paul@lshift.net>
parents: 10
diff changeset
    24
export REMOTE_USER
8
1efc50c61a26 improve hg-ssh-wrapper, suggest HGRCPATH trick
Paul Crowley <paul@lshift.net>
parents: 4
diff changeset
    25
1efc50c61a26 improve hg-ssh-wrapper, suggest HGRCPATH trick
Paul Crowley <paul@lshift.net>
parents: 4
diff changeset
    26
cd repos
39
f5055ce263c7 New system. No breaking in, just putting files in /etc/mercurial-server
Paul Crowley <paul@lshift.net>
parents: 36
diff changeset
    27
HG_ACCESS_RULES_PATH=/etc/mercurial-server/access.conf:$(pwd)/hgadmin/access.conf
f5055ce263c7 New system. No breaking in, just putting files in /etc/mercurial-server
Paul Crowley <paul@lshift.net>
parents: 36
diff changeset
    28
export HG_ACCESS_RULES_PATH
36
b3237aabd0fe Change the name to mercurial-server
Paul Crowley <paul@lshift.net>
parents: 34
diff changeset
    29
exec /usr/local/lib/mercurial-server/hg-ssh
31
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents: 18
diff changeset
    30