thathoff / kirby-git-content

Commit and Push changes made via the Panel
MIT License
136 stars 20 forks source link

Working fine locally but not committing when on public server #89

Closed ericpedia closed 2 years ago

ericpedia commented 2 years ago

I have the plugin working brilliantly on my local machine. However, when I make a change on the live site, no commit occurs.

My config:

    'thathoff' => [
        'git-content' => [
            'commit' => true,
            'push'=> true,
        ],
    ],

My steps

  1. Edit a page in the panel and click Save.
  2. Run git status and/or git log via ssh from content folder. Expected: Change has been committed, working directory is clean. Actual: Changes are visible but have not been staged or uncommitted.

What I know about the server setup

Other notes

Kirby Status

Debugging: on PHP: 7.4.25 Server: Apache

Any thoughts?

ericpedia commented 2 years ago

I have also confirmed that PHP has access to git. I created test.php inside the content folder and tested shell_exec('git add -A');. It successfully ran the git command and staged all unstaged files.

thathoff commented 2 years ago

The plugin acts as the webserver’s user. So this user needs to be able to make git commit, git push and pull actions.

Have you tried to enable the displayErrors option? In this case you might get some information about errors happening when committing.

ericpedia commented 2 years ago

Yeah, my config has displayErrors and debug both set to true, but no errors appear in the Kirby interface, browser console, or server error log, as far as I can tell.

I also confirmed that the webserver user on my Kirby site can successfully use git, by adding various operations like exec('git add -A') to my Kirby templates, which worked (confirmed by checking content repo status directly via SSH afterwards). Do you have any ideas of how to troubleshoot it?

thathoff commented 2 years ago

displayErrors is an option for this plugin. I’m not talking about the php.ini option.

You said your config looks like this:

'thathoff' => [
    'git-content' => [
        'commit' => true,
        'push'=> true,
    ],
],

try to change it to

'thathoff' => [
    'git-content' => [
        'commit' => true,
        'push'=> true,
        'displayErrors' => true,
    ],
],
thathoff commented 2 years ago

Closing this issue because it has not been updated for a longer time. Considering it as resolved. Otherwise feel free to re-open.