| | 3 | |
| | 4 | == Background == |
| | 5 | Pidgin's Mercurial repositories are served by the [http://www.lshift.net/mercurial-server.html mercurial-server] package. This relies entirely upon SSH key-based authentication, providing access control and a layer of accountability. |
| | 6 | |
| | 7 | == Anonymous Pull (Non-Developers) == |
| | 8 | All Pidgin Mercurial repositories will be available via HTTP. As we are not yet using Mercurial, this is not yet available. |
| | 9 | |
| | 10 | == Developers == |
| | 11 | |
| | 12 | === Configure SSH For Access (Developers/CPW's/SoC Students Only) === |
| | 13 | If you wish, you can simplify Mercurial ssh: URL's by adding the following to `~/.ssh/config`: |
| | 14 | {{{ |
| | 15 | Host hg.pidgin.im |
| | 16 | Protocol 2 |
| | 17 | User hg |
| | 18 | }}} |
| | 19 | |
| | 20 | === SSH-based Push/Pull === |
| | 21 | You can get your initial checkouts from Mercurial by: |
| | 22 | * With SSH config above: `hg clone ssh://hg.pidgin.im/path/to/repo` |
| | 23 | * Without SSH config above: `hg clone ssh://hg@hg.pidgin.im/path/to/repo` |
| | 24 | |
| | 25 | Once initial clones are done, pulls are a simple matter of running `hg pull` within your working copy. You may optionally add `-u` to have your checkout automatically updated if possible. |
| | 26 | |
| | 27 | Pushes are a simple matter of `hg push` within your working copy. If you need to push a new repository, you must clone: |
| | 28 | * With SSH config above: `hg clone . ssh://hg.pidgin.im/path/to/repo` in working copy |
| | 29 | * Without SSH config above: `hg clone . ssh://hg@hg.pidgin.im/path/to/repo` in working copy |
| | 30 | |
| | 31 | == Administration == |
| | 32 | |
| | 33 | === Access Control === |
| | 34 | Access control on Pidgin's Mercurial server is strict. The repositories will be structured like so (developers/CPW's listed here are for the purpose of example): |
| | 35 | |
| | 36 | {{{ |
| | 37 | hg.pidgin.im # Mercurial server |
| | 38 | + pidgin # "Official" Pidgin and libpurple repositories |
| | 39 | | + main # replaces im.pidgin.pidgin in Monotone |
| | 40 | | + 2_x_y # replaces im.pidgin.pidgin.2.x.y in Monotone |
| | 41 | + dev # Developers' repositories |
| | 42 | | + darkrain # for all repositories darkrain wishes to create |
| | 43 | | | + irc # replaces im.pidgin.cpw.darkrain42.irc in Monotone |
| | 44 | | | + xmpp_roster # replaces im.pidgin.cpw.darkrain42.xppp.roster in Monotone |
| | 45 | | + rekkanoryo # for all repositories rekkanoryo wishes to create |
| | 46 | | + examples # replaces im.pidgin.cpw.rekkanoryo.examples in Monotone |
| | 47 | + cpw # Crazy Patch Writers' repositories |
| | 48 | | + eionrobb # for all repositories eionrobb wishes to create |
| | 49 | | + newfeature # new repository |
| | 50 | + www # For websites |
| | 51 | | + pidgin # for pidgin.im |
| | 52 | | + imfreedom # for imfreedom.org |
| | 53 | + soc # For Google Summer of Code projects (lines below should be obvious) |
| | 54 | + 2007 |
| | 55 | | + student1 |
| | 56 | | + project1 |
| | 57 | + ... |
| | 58 | + 2012 |
| | 59 | + studentx |
| | 60 | + projectx |
| | 61 | }}} |
| | 62 | |
| | 63 | Access control will be as follows: |
| | 64 | * Developers have write access to `pidgin/*` |
| | 65 | * Developers can create and modify repositories in `dev/$NICKNAME/` |
| | 66 | * Crazy Patch Writers can create and modify repositories in `cpw/$NICKNAME/*` |
| | 67 | * Summer of Code students can create and modify repositories in `soc/$YEAR/$NICKNAME/*` |
| | 68 | * All of the above have read access to any repository on the server. |
| | 69 | * Those people with "root" access can do anything to any repository. This access is strictly controlled. |
| | 70 | |
| | 71 | |
| | 72 | === Adding New Users === |
| | 73 | The process to allow new users SSH access to the Mercurial repositories is pretty simple, but requires someone with "root" access to mercurial-server. Currently those people are rekkanoryo and lschiere. |
| | 74 | |
| | 75 | 1. Check out the `hgadmin` repo: `hg clone ssh://hg@hg.pidgin.im/hgadmin pidgin-hgadmin` |
| | 76 | 1. `cd pidgin-hgadmin/keys`. Inhere is a series of directories. The format is self-explaining. Developers go in `devs/$NICKNAME`, CPW's in `cpws/$NICKNAME`, SoC students in `soc/$NICKNAME`. |
| | 77 | 1. Create the appropriate directory. |
| | 78 | 1. Within this directory create a file named for the SSH key being added, for example `user@somehost`. |
| | 79 | 1. Put the SSH public key in this file. |
| | 80 | 1. `hg add $FILE` |
| | 81 | 1. Go back to the root of `pidgin-hgadmin`. |
| | 82 | 1. Edit `access.conf`. Copy an existing line for the same class of user (developer, CPW, SoC student) and modify it as appropriate for the new person's nickname and, if applicable, SoC year. |
| | 83 | 1. `hg commit` |
| | 84 | 1. `hg push` (mercurial-server updates automatically on push) |