post-receive hook permission denied “unable to create file” error

前端 未结 1 1971
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 03:39

Just got gitolite installed on my webserver and am trying to get a post-receive hook that can point the git dir in apache\'s direction

相关标签:
1条回答
  • 2021-01-15 04:20

    This is how I got it working:

    Changed post-receive to:

    sudo sh /usr/local/sbin/prgetsimpleappscom
    

    Changed sudoers with visudo

    git ALL = (root) NOPASSWD: /usr/local/sbin/prgetsimpleappscom
    git ALL = (root) NOPASSWD: /bin/sh
    git ALL = (root) NOPASSWD: /bin/sh /usr/local/sbin/prgetsimpleappscom
    

    Confirm visudo worked

    git@vannevar:~$ sudo -l
    Matching Defaults entries for git on this host:
        env_reset, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
    
    User git may run the following commands on this host:
        (root) NOPASSWD: /usr/local/sbin/prgetsimpleappscom
        (root) NOPASSWD: /bin/sh
        (root) NOPASSWD: /bin/sh /usr/local/sbin/prgetsimpleappscom
    

    run:

    sudo sh /usr/local/sbin/prgetsimpleappscom
    post-receive getsimpleapps.com triggered
    

    and:

    $ git push origin master
    remote: post-receive getsimpleapps.com triggered
    
    0 讨论(0)
提交回复
热议问题