allow_push on .hg/hgrc doesn't seem to work
Question
I'm setting up a mercurial server with LDAP auth where I want to allow access per repo so I'm creating a hgrc under .hg for each repo.
[web]
allow_push = user1
My problem is that If I use these hgrc files I cannot push with any user (abort: authorization failed). If I just use hgweb.config I can do it with no problem
Any help?
Thanks
Solution
When you put those lines in your hgweb.config
file can you push with any user or only the ones you list? My guess would be that your LDAP is providing user names formatted differently than you expect (perhaps as email addresses, etc.) and so they're not matching.
Check your apache error logs for anything interesting, and consider changing the log format to log the $REMOTE_USER
environment user to see what's being matched. Also, make sure your push_ssl
value is set to false if you're not using SSL connections (though you should).
OTHER TIPS
When your HTTP server is Nginx, Modify log_format
to find out which user redirect from Nginx to HG
vi /etc/nginx/nginx.conf
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
And see the Nginx log file
cat /var/log/nginx/nginx.log