Ртутный вопрос авторизации на Йосемити

546
Mike979

У меня есть местный репозиторий HG для моей клиентской работы. Я ранее настраивал сервер HG в более ранних версиях OS X без каких-либо проблем, но в Yosemite я застрял. Я использовал пакет Mercurial от MacPorts, настроил apache с самозаверяющим SSL-сертификатом, и я в большинстве своем готов к работе ... hgweb отлично работает, и я могу использовать другие команды.

Однако я не могу нажать:

$ hg push --debug --traceback -v pushing to https://localhost/hg/website.com using https://localhost/hg/website.com sending capabilities command using auth.default.* for authentication localhost certificate matched fingerprint ************ using auth.default.* for authentication http auth: user mike, password ************ using auth.default.* for authentication localhost certificate matched fingerprint ************ query 1; heads sending batch command using auth.default.* for authentication searching for changes all remote heads known locally sending branchmap command using auth.default.* for authentication sending branchmap command using auth.default.* for authentication preparing listkeys for "bookmarks" sending listkeys command using auth.default.* for authentication 1 changesets found list of changesets: c05e7b9045cf27f7508dcaaace632ba8a9940c4e bundling: 1/1 changesets (100.00%) bundling: 1/1 manifests (100.00%) bundling: file1.txt 1/2 files (50.00%) bundling: file2.txt 2/2 files (100.00%) sending unbundle command sending 12141 bytes using auth.default.* for authentication sending: 11/22 kb (50.00%) sending: 11/22 kb (50.00%) Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 138, in _runcatch return _dispatch(req) 

...

 File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 172, in _call fp = self._callstream(cmd, **args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 122, in _callstream raise util.Abort(_('authorization failed')) Abort: authorization failed abort: authorization failed 

Имя пользователя и пароль верны ... они работают на интерфейсе hgweb и даже работали в выводе выше на предыдущих этапах (строка 8). Я также несколько раз проверял разрешения репозитория ... У пользователя _www есть полный доступ:

$ ls -al /var/repos/website.com total 0 drwxrwxr-x 3 _www staff 102 Oct 19 23:34 . drwxrwxr-x 11 _www staff 374 Oct 27 02:09 .. drwxrwxr-x 10 _www staff 340 Oct 19 23:34 .hg 

Версия HG: 3.1.2, версия OSX: 10.10, версия Apache: 2.4.9

Любая помощь или предложения будут высоко оценены - спасибо заранее!

0

1 ответ на вопрос

1
Mike979

I found the answer. Not sure why this fixes it, but all I had to do was create an hgrc file in the .hg directory of the repository in question (not the local cloned dir), and add:

[web] allow_push = * 

In case anyone finds this answer while trying to debug a different part of the setup, here is a tutorial for the whole setup of Mercurial on Yosemite.

http://www.curvingspace.com/2014/11/05/mercurial-on-yosemite/