Just noticed that Githubâs generated tarballs doesnât include submodules⊠If you tried to install Auto Git using Kirby CLI and it didnât contain the Git library it depends on, itâs fixed now.
I chose to use composer to manage the dependency and committed the vendor folder. Afff!
I am having a few problems setting it up on the production server though (works fine locally.)
I expect to do with user access to the repository? Itâs a private github repository, but I can git via the cmd line, because the server has ssh key. The panel users donât have their own repository access that matches their name/email, but I donât think that should matter?
current error message when loading panel:
Panel Error:
Error without a useful message :(
It happened here:
File: /var/www/XXX/site/plugins/autogit/vendor/sebastian/git/src/Git.php
Line: 136
First of all you should connect to your server via SSH and check:
if ssh github.com outputs a message with your username. If it doesnât, generate an SSH key on the server and add it to your repository as deploy key with push access.
if you can then push and pull inside your repository on the server.
If that works, the next issue could be that the git binary is not in the $PATH of the PHP execution environment (meaning: when PHP tries to execute git in the line from the error message, it canât find the git binary). You should check this with your hosting provider.
Are you sure the server has a valid SSH key? Maybe via cmd line only your user has a key. Oftentimes the webserver runs with its own user (apache normally uses the user www-data). Having apache run with âyour userâ actually requires some extra configurations (like setting up suEXEC) that many (less serious) shared hosting providers donât do.
Thanks @lukasbestle and @rasteiner for your suggestions. That has definitely moved me along. Iâm going to detail a few steps here for anyone future-googling:
Yes, apache was using the www-data user. You can duplicate your âactualâ user key for use as that user too: http://stackoverflow.com/a/7307059/2989133
I also needed to connect via the command line first to acknowledge the message and add github to known hosts:
$sudo -u www-data ssh -vT git@github.com
I checked php had access to git path by comparing $which git to output of phpinfo(). And to prove it, made a php page of <?php echo exec("git status"); which should now output a message like âno changes added to commitâ.
Although sadly enabling Autogit plugin still errors at the same place. I might try running apache as me instead, see if hat helps.
My conclusion is, it is better to run apache as [the user that I use to ssh into the server] rather than www-data.
Given that it is likely that you will be using this user for the initial git init anyway, and possibly other actions, it simplifies permissions, keys, etc. And, autogit seems much happier this way!
I would love a version where I donât have to have a remote repository but could simply commit to the repository within the content folder. This way I could easily just pull changes to my local repository I made with the panel without committing them on my remote via ssh before pulling. I donât want an extra remote repository. Or do I miss something here?
Sorry, from your two messages I couldnât understand exactly what you are trying to accomplish. Could you provide more info on how your setup looks like and what do you want to do?