Deployment Key Symlink
If you are using GIT, deploying with RunCloud is easy. However, if you manually editing your files inside the server, RunCloud will refuse to update because of GIT conflict. After you have fixed the conflict, you may want to run git pull command. But suddenly you will receive git authentication error says that you didn’t have a deployment key or not authenticate to GitHub, Bitbucket or GitLab.
We are using GIT helper script to deploy your web app using GIT. Which is why manual git pull from terminal didn’t work. Sometimes this leads to a bunch of questions from our customers and leaves them confused.
The deployment key is located inside /opt/RunCloud/.ssh/<username>_rsa. This is outside of GIT SSH key checking path. Thus, git command to the remote repository will not work. To prevent this problem from happening, you can symlink the key to the original path.
ln -s /opt/RunCloud/.ssh/<username>_rsa ~/.ssh/id_rsa
By symlink the private key to the original path, you will be able to manually pull or push again. In the 2.0.4 update, this will be done by default when you create or regenerate the deployment key from RunCloud Panel. If the ~/.ssh/id_rsa already exists, it won’t overwrite your id_rsa key.
Shallow GIT Clone
When we started RunCloud, we always run GIT command like below to clone a repository inside your server from GitHub:
git clone email@example.com:<username>/<repository>.git
However, this will leads to a bunch of GIT histories getting copied on your server. Since the timeout to clone a repository inside RunCloud is capped at 120 seconds, usually, the GIT clone won’t be able to finish it under two minutes in a large GIT repository.
A shallow GIT clone is a GIT clone with fewer commit histories. Thus, cloning a repository will become faster. The new command that we use to clone using the agent is:
git clone --depth 1 --no-single-branch firstname.lastname@example.org:<username>/<repository>.git -b master
With this clone command, cloning a repository will be faster than before.
GIT Clone bug
This is not a bug inside GIT, but a bug inside RunCloud agent. When we try to clone a repository, we will empty the target directory before cloning. However, it doesn’t clear everything. Dot files (hidden files) won’t be cleared by our directory cleaning command. This will leads to an error when cloning GIT repository inside your server. This bug was reported by @ShaquilleRay. Thank you.
Remove user’s home folder after user deletion
This is not a bug but rather a small fix. When you try to delete a user from RunCloud Panel, the user will be deleted along with all their files. However, the /home/<username> folder is not deleted. So, this small fix will delete the home folder too.