Comments (3)
the permission that you would give to the user that uses git from the command line should be given to the server user. What problem do you have?
from gitelephant.
Thank you for your response (and the program as a whole). I will just sketch the developement and my findings for future interests:
It started with The path provided (/var/ftp/restOfPath) is not a valid git repository path
. This could be resolved by adding rwx permissons to the path for www-data (the server-user).
Next up was Not a git repository (or any of the parent directories): .git
which could be resolved by adding rwx permissions to the .git directory.
unable to access '.git/config': Permission denied
was resolved, once again, by setting permissions to rwx.
Uncaught PHP Exception RuntimeException: "Exit code: 1 while executing: "/usr/bin/git pull '--rebase'" with reason: anyFile: Permission denied
was the next upcoming which had to be resolved by adding x permission to all files in the repository.
So, in essence, to answer my own question, the whole repository including .git needs rwx-permissions. I am not exactly sure why every file needs the e_x_ecute permission, but it is like it is.
Currently, I am struggling with Uncaught PHP Exception RuntimeException: "Exit code: 1 while executing: "/usr/bin/git pull '--rebase'" with reason: Could not create directory '/var/www/.ssh'. Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
. I suspect some changes to the id_rsa file are necessary and will update this post as soon as I found out.
from gitelephant.
Okay, the last follow-up as I finally managed to get everything working as intended:
To fix the ssh error, one has to create new ssh keys for the apache user like so: sudo -u apache ssh-keygen -t rsa
. These will probably be saved to the home directory of the apache user, respectively e.g. /var/www/.ssh/
. To enable the ssh-key, the public part has to be loaded at the remote-side, e.g. GitHub, as you do. Afterwards, the whole ssh-directory had to be added to the global ssh_config file (which has to be readable by the apache user) under Host with key IdentityFile. An alternative variant would be to use deploy keys.
To trust the connection, a connection has to be done once, e.g. using sudo -u apache git pull
so you can type yes when asked if you want to trust the remote.
This is all to get ssh & git working with another user than the default.
In the end, I also got some ACL which prevented some commands, but that's probably not relevant for anyone else.
from gitelephant.
Related Issues (20)
- getBranches() fails when the repository is in a detached state HOT 1
- PHP 7.2 breaks project because of "Object" type-hint HOT 2
- dev-develop branch breaks composer HOT 2
- Symfony 4 HOT 2
- Make LC_ALL call optional on Windows HOT 2
- live example website is down ? HOT 3
- Problems with Stash and Pop HOT 6
- Error calling all the functions HOT 1
- git pull origin HOT 4
- GitElephant for Enterprise HOT 5
- Update composer.json to allow sf5 versions of dependencies HOT 1
- Process::fromShellCommandline($cmd, $cwd); fails HOT 4
- v4.1.1: Call to undefined function GitElephant\Command\is_countable() HOT 3
- Replace Repo::getTree() with a contrib Tree implementation HOT 1
- PHP 8
- git add . HOT 1
- PHP 8.1 compatibility fix for deprecated return
- More PHP 8.1 deprecations HOT 1
- phpcollection/phpcollection seems to be unmaintained HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitelephant.