Mercurial Trust Issues

I am trying to set up a hook to notify me of new commits by mail.

Due to the problem described in the inappropriate Mercurial hook , I cannot get it to work by simply adding the following to my .hg/hgrc , since the script will not run:

 [hooks] changegroup = /path/to/script 

As a workaround, I added a hook to hgweb.config , where it works as expected. Now when I click HTTP, the actual user running the script is apache (as defined when running id from inside the hook), which means I get errors like

Non-trusting .hg / hgrc file from untrusted user u, group g

I added

 [trusted] users = u 

but the same errors remain. What am I doing wrong? I understand this is completely wrong? Appreciate any help!

+4
source share
1 answer

You must add both the hook and the trust blocks not in hgweb.config , but in the .hgrc file in the apache user's home directory. Usually they don’t think about system users having home directories, but they all do, and you can find them in /etc/password . This often happens as /var/www , so if you are creating the /var/www/.hgrc file, make sure it belongs to the Apache user and add a hook and trust that will be useful to you.

+2
source

Source: https://habr.com/ru/post/1344488/


All Articles