wget http://dev.lshift.net/paul/mercurial-server/mercurial-server_1.3.tar.gz tar -xf mercurial-server_1.3.tar.gz cd mercurial-server-1.3
python setup.py build python setup.py install
cp scripts*/* /var/lib/mercurial-server/
nano /etc/ssh/sshd_config
RSAAuthentication yes PubkeyAuthentication yes
AuthorizedKeysFile /etc/ssh/keys/%u.pub
mkdir /etc/ssh/keys
touch /var/lib/mercurial-server/.ssh/authorized_keys chmod 644 /var/lib/mercurial-server/.ssh/authorized_keys ln /var/lib/mercurial-server/.ssh/authorized_keys /etc/ssh/keys/hg.pub
touch /usr/bin/hg-update-users chmod 744 /usr/bin/hg-update-users nano /usr/bin/hg-update-users
chown hg -R /etc/mercurial-server/keys/ chmod 444 -R /etc/mercurial-server/keys/ sudo -u hg /var/lib/mercurial-server/refresh-auth
ssh-keygen scp ~/.ssh/id_rsa.pub root@<b>_</b>:/etc/mercurial-server/keys/root/ ssh root@_ 'hg-update-users'
$ ssh hg@_ PTY allocation request failed on channel 0 <u>mercurial-server: direct logins on the hg account prohibited</u> Connection to _ closed.
ssh hg@_ 'hg -R hgadmin serve --stdio'
$ssh hg@_ 'hg -R hgadmin serve --stdio' Traceback (most recent call last): File "/var/lib/mercurial-server/hg-ssh", line 86, in <module> dispatch.dispatch(['-R', repo, 'serve', '--stdio']) File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 31, in dispatch if req.ferr: AttributeError: 'list' object has no attribute 'ferr'
--- hg-ssh_old 2012-12-27 00:49:04.764989364 +0300 +++ hg-ssh 2012-12-27 00:50:16.173113572 +0300 @@ -83,7 +83,7 @@ repo = getrepo("read", cmd[6:-14]) if not os.path.isdir(repo + "/.hg"): fail("no such repository %s" % repo) - dispatch.dispatch(['-R', repo, 'serve', '--stdio']) + dispatch.dispatch(dispatch.request(['-R', repo, 'serve', '--stdio'])) elif cmd.startswith('hg init '): repo = getrepo("init", cmd[8:]) if os.path.exists(repo): @@ -91,7 +91,7 @@ d = os.path.dirname(repo) if d != "" and not os.path.isdir(d): os.makedirs(d) - dispatch.dispatch(['init', repo]) + dispatch.dispatch(dispatch.request(['init', repo])) else: fail("illegal command %r" % cmd)
Source: https://habr.com/ru/post/164095/
All Articles