General Information
For reference:
This is an administrator guide for how to set up and maintain shared Mercurial repositories on Turing. You can put your shared repositories anywhere in /home/hg and they'll appear in the web interface. There are more instructions below under "Creating a Repository".- Repositories go in: /home/hg
- The web interface is: https://turing.cs.gmu.edu/hg
- You can also clone repos using: hg clone https://turing.cs.gmu.edu/hg/[path]
Authentication is required to access all repositories. You use the same username and password as your SSH account to Turing. There is also an anonymous login available:
- Username: anonymous
- Password: password
Creating a Repository
1. Create the Mercurial repository (in this example, we create a repo called papers/testpaper):
hg init /home/hg/papers/testpaper
Alternative: You can also clone your local repository to the server (don't forget the double-slash in the URL)
# (on your local machine) hg clone testpaper ssh://user@masc.cs.gmu.edu//home/hg/papers/testpaper
2. Customize access to the repository. Do this by creating a configuration file as [repo path]/.hg/hgrc like this example:
/home/hg/papers/testpaper/.hg/hgrc:
[web] description = Test Paper contact = Jyh-Ming Lien (jmlien@cs.gmu.edu) style = masc allow_archive = bz2 gz zip # comment the following to allow the anonymous user push access deny_push = anonymous@MASC.GMU.EDU # comment the following line to allow the anonymous user read access deny_read = anonymous@MASC.GMU.EDU # the deny lines above take precedence over allow lines. # these allow lines allow read and push access for everyone else allow_read = * allow_push = *
The description and contact fields will be what is displayed in the repository web interface. The style and allow_archive fields set up some basic options for displaying the repository and whether you are allowed to download tarballs from it.
The deny_push, deny_read, allow_push, and allow_read directives are how you specify access control. "deny" directives always take priority over "allow" directives, and for MASC usernames, these are specified as either a list of "username@MASC.GMU.EDU" entries or the special entry *, which represents everyone. The anonymous user is "anonymous@MASC.GMU.EDU".
For example, to allow only jmlien and jharri1 access to a repository, you could use the following lines:
allow_read = jmlien@MASC.GMU.EDU, jharri1@MASC.GMU.EDU allow_push = jmlien@MASC.GMU.EDU, jharri1@MASC.GMU.EDU
More details on hgrc options are available at the Mercurial manual.
3. Set directory permissions to ensure hgadmin group access the new repo:
chgrp -R hgadmin /home/hg/papers/testpaper chmod -R 775 /home/hg/papers/testpaper
The repository should be now available through:
https://turing.cs.gmu.edu/hg/papers/testpaper
4. (optional) You shouldn't have to, but if there are problems, restart apache server to ensure all settings are reloaded. You will need root if you have to do this.
sudo /etc/init.d/apache2 restart
List of Resource Pages in MASC