Don't hardwire location of authorized_keys file
authorPaul Crowley <paul@lshift.net>
Fri, 13 Nov 2009 12:32:43 +0000
changeset 213 72e7ba8b41a6
parent 212 ab5e0e4f5a0c
child 214 7374d0147875
Don't hardwire location of authorized_keys file
src/init/dot-mercurial-server
src/mercurialserver/config.py
src/mercurialserver/refreshauth.py
--- a/src/init/dot-mercurial-server	Fri Nov 13 12:30:06 2009 +0000
+++ b/src/init/dot-mercurial-server	Fri Nov 13 12:32:43 2009 +0000
@@ -3,6 +3,7 @@
 
 [paths]
 repos = ~/repos
+authorizedkeys = ~/.ssh/authorized_keys
 keys = /etc/mercurial-server/keys:~/repos/hgadmin/keys
 access = /etc/mercurial-server/access.conf:~/repos/hgadmin/access.conf
 
--- a/src/mercurialserver/config.py	Fri Nov 13 12:30:06 2009 +0000
+++ b/src/mercurialserver/config.py	Fri Nov 13 12:32:43 2009 +0000
@@ -28,6 +28,7 @@
         for p in _getConf()["paths"][name].split(":")]
 
 def getReposPath(): return _getPath("repos")
+def getAuthorizedKeysPath(): return _getPath("authorized_keys")
 
 def getKeysPaths(): return _getPaths("keys")
 def getAccessPaths(): return _getPaths("access")
--- a/src/mercurialserver/refreshauth.py	Fri Nov 13 12:30:06 2009 +0000
+++ b/src/mercurialserver/refreshauth.py	Fri Nov 13 12:32:43 2009 +0000
@@ -15,7 +15,7 @@
 goodkey = re.compile("[/A-Za-z0-9._-]+$")
 
 def refreshAuth():
-    akeyfile = os.path.expanduser("~/.ssh/authorized_keys")
+    akeyfile = config.getAuthorizedKeysPath()
     wrappercommand = config.getExePath() + "/hg-ssh"
     prefix='no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command='