Mercurial-server

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
m (Update the user accounts)
 
(2 intermediate revisions by one user not shown)
Line 2: Line 2:
  
 
===Useful Links===
 
===Useful Links===
https://web.archive.org/web/20131127081747/http://dev.lshift.net/paul/mercurial-server/docbook.html
+
https://web.archive.org/web/20131127081747/http://dev.lshift.net/paul/mercurial-server/docbook.html<br>
 +
[https://web.archive.org/web/20131127081747/http://dev.lshift.net/paul/mercurial-server/docbook.html#id1332825 access.conf information]
  
 
===As root===
 
===As root===
Line 38: Line 39:
 
===Update the user accounts===
 
===Update the user accounts===
 
You should really access the hgadmin repo via SSH, but if you modify it directly, then run the following to refresh the user details
 
You should really access the hgadmin repo via SSH, but if you modify it directly, then run the following to refresh the user details
<source>
+
<source lang="bash">
 
sudo -u hg /usr/share/mercurial-server/refresh-auth
 
sudo -u hg /usr/share/mercurial-server/refresh-auth
 
</source>
 
</source>
 +
 +
===access.conf===
 +
* <code>init</code>: allow reads, writes, and the creation of new repositories
 +
* <code>write</code>: allow reads and writes
 +
* <code>read</code>: allow only read operations
 +
* <code>deny</code>: deny all requests

Latest revision as of 14:43, 21 July 2014

Note: This procedure was carried out on a Debian server

Contents

[edit] Useful Links

https://web.archive.org/web/20131127081747/http://dev.lshift.net/paul/mercurial-server/docbook.html
access.conf information

[edit] As root

apt-get install mercurial-server
cp ~${USER}/.ssh/id_rsa.pub /etc/mercurial-server/root/${USER}
sed -re '/^write user=users\/\*\*/d' -i /etc/mercurial-server/access.conf
sudo -u hg /usr/share/mercurial-server/refresh-auth

[edit] As ${USER}

hg clone ssh://${USER}@localhost/hgadmin
cd hgadmin
mkdir -p keys/root keys/users
cat <<EOF > access.conf
# template:
#   this will prevent external/3rd party developers from merging or writing to the release branch
#   releases must be made by internal developers
#
#write repo=therepo user=internal/**
#read repo=therepo user=external/** branch=release
#write repo=therepo user=external/**
 
 
 
# this should be LAST
read user=internal/**
EOF
hg add
hg ci -m "initial commit"
hg push

[edit] Update the user accounts

You should really access the hgadmin repo via SSH, but if you modify it directly, then run the following to refresh the user details

sudo -u hg /usr/share/mercurial-server/refresh-auth

[edit] access.conf

  • init: allow reads, writes, and the creation of new repositories
  • write: allow reads and writes
  • read: allow only read operations
  • deny: deny all requests
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox