Note that there are some explanatory texts on larger screens.

plurals
  1. POGit post receive hook with sudo -u not working for some users
    primarykey
    data
    text
    <p>We have a website we're developing with WP-Engine. To simplify the processes I've set up the git repository for the site to automatically push code changes up to the WP-Engine staging area, using a Post Receive hook that looks like this:</p> <pre><code>#!/bin/bash -x PUSH_AS_USER="admin" sudo -u $PUSH_AS_USER git push wp-engine-staging master </code></pre> <p>I've also made it so that any user in the admin group, can sudo -u admin git, without typing the password (for reference, add the following to /etc/sudoers</p> <pre><code>%admin ALL=(admin) NOPASSWD: /usr/bin/git` </code></pre> <p>When I push to the repository, it fires the post commit hook no problem, however for some reason it only works for me. Two other users get the following warning:</p> <pre><code>[username@server repository]$ sudo -u admin git push wp-engine-staging master fatal: unable to access '/home/username/.config/git/config': Permission denied </code></pre> <p>The weird thing is, I don't have this file for my user and mine works ok. Additionally, if I create the file for those users, I can't seem to give admin permission to view it, even if I add admin to the users own group, and give read permission to the group in every directory to the file. (ie, /home/username/.config/git/ and the config file itself).</p> <p>As another example of this weird issue:</p> <pre><code>[daniel@server repository]$ sudo su username [username@server repository]$ sudo -u admin git config --global --list fatal: unable to access '/home/username/.config/git/config': Permission denied [username@server repository]$ exit [daniel@server repository]$ sudo -u admin git config --global --list user.email=daniel@example.com user.name=Daniel [daniel@server repository]$ cat /home/daniel/.config/git/config cat: /home/daniel/.config/git/config: No such file or directory </code></pre> <p>It's rather messing with our workflow. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload