action/test1
changeset 272 f7c64f03cd60
parent 271 c1ceab337505
child 273 7bae88583a53
equal deleted inserted replaced
271:c1ceab337505 272:f7c64f03cd60
     1 #!/bin/sh
       
     2 
       
     3 set -e
       
     4 
       
     5 cd
       
     6 
       
     7 cat > .ssh/config <<__END__
       
     8 Host chroothg
       
     9 Hostname localhost
       
    10 User hg
       
    11 Port 2222
       
    12 __END__
       
    13 
       
    14 echo "Cloning hgadmin..."
       
    15 hg clone ssh://chroothg/hgadmin
       
    16 echo "Updating hgadmin..."
       
    17 cd hgadmin
       
    18 
       
    19 cat > access.conf <<__END__
       
    20 read user=restricted/** file=denied/**
       
    21 write user=restricted/**
       
    22 __END__
       
    23 mkdir -p keys/restricted
       
    24 cp /home/test2/.ssh/id_rsa.pub keys/restricted/test2
       
    25 
       
    26 hg add keys/restricted/test2 access.conf
       
    27 hg commit -u test1 -m "Added user test2"
       
    28 echo "Push"
       
    29 hg push
       
    30 cd ..
       
    31 mkdir realrepo
       
    32 cd realrepo
       
    33 hg init .
       
    34 mkdir denied
       
    35 echo "This is a file" > content
       
    36 echo "This is a file not everyone can write to" > denied/cantwrite
       
    37 hg add content denied/cantwrite
       
    38 hg commit -u test1 -m "Add files to the repo"
       
    39 echo "Pushing changes"
       
    40 hg clone . ssh://chroothg/real/project
       
    41 echo "Done for user test1"