ProjectWiki.new() creates a new wiki git repository, so any tries
to bare clone a bundle fail. With this patch we remove the newly
created wiki.git before restoring from the backup bundle.
If a project is being restored, but there is no bundle file, the project was
empty when it was backed up. In this case, just use git init --base to create a
new bare repository.
We need to skip empty repositories when creating a backup. Before this
change, we were asking gollum-lib if the wiki contains any _pages_. Now
we ask gitlab_git if the repository contains _files_. This should
resolve gollum_lib Grit timeouts in the backup script.
The backup restore code for repositories was assuming that gitlab-shell
is installed in /home/git/gitlab-shell. This commit changes that to use
the configuration setting from gitlab.yml that specifies the path where
gitlab-shell is installed.
- Database name may contain characters which are not shell friendly
- Database password could contain the same
- While we at it there is no harm in escaping generated paths too
- Refactored 2-line system(command)
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
These fixes will allow a restore of gitlab when the backups and
repositories directories are in non-standard locations (ie sub-dirs
of gitlabhq). Also allows the restore to be run from script
overriding the need of a user to confirm the rebuild of the
authorized_keys file.