|
@@ -666,54 +666,6 @@ function restore_mailing_list {
|
666
|
666
|
fi
|
667
|
667
|
}
|
668
|
668
|
|
669
|
|
-function restore_gogs {
|
670
|
|
- export GVM_ROOT=$GVM_HOME
|
671
|
|
- if [ -d $GVM_ROOT/bin ]; then
|
672
|
|
- cd $GVM_ROOT/bin
|
673
|
|
- [[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
|
674
|
|
- gvm use go${GO_VERSION} --default
|
675
|
|
- systemctl set-environment GOPATH=$GOPATH
|
676
|
|
- fi
|
677
|
|
-
|
678
|
|
- if [[ $RESTORE_APP != 'all' ]]; then
|
679
|
|
- if [[ $RESTORE_APP != 'gogs' ]]; then
|
680
|
|
- return
|
681
|
|
- fi
|
682
|
|
- fi
|
683
|
|
- if grep -q "Gogs domain" $COMPLETION_FILE; then
|
684
|
|
- GIT_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Gogs domain" | awk -F ':' '{print $2}')
|
685
|
|
- restore_database_from_friend gogs $GIT_DOMAIN_NAME
|
686
|
|
- if [ -d $SERVER_DIRECTORY/backup/gogs ]; then
|
687
|
|
- if [ ! -d $GOPATH/src/github.com/gogits/gogs/custom ]; then
|
688
|
|
- mkdir -p $GOPATH/src/github.com/gogits/gogs/custom
|
689
|
|
- fi
|
690
|
|
- cp -r /root/tempgogs/$GOPATH/src/github.com/gogits/gogs/custom/* $GOPATH/src/github.com/gogits/gogs/custom/
|
691
|
|
- if [ ! "$?" = "0" ]; then
|
692
|
|
- exit 5885
|
693
|
|
- fi
|
694
|
|
- echo $"Restoring Gogs repos"
|
695
|
|
- restore_directory_from_friend /root/tempgogsrepos gogsrepos
|
696
|
|
- cp -r /root/tempgogsrepos/home/git/gogs-repositories/* /home/git/gogs-repositories/
|
697
|
|
- if [ ! "$?" = "0" ]; then
|
698
|
|
- exit 7649
|
699
|
|
- fi
|
700
|
|
- echo $"Restoring Gogs authorized_keys"
|
701
|
|
- restore_directory_from_friend /root/tempgogsssh gogsssh
|
702
|
|
- if [ ! -d /home/git/.ssh ]; then
|
703
|
|
- mkdir /home/git/.ssh
|
704
|
|
- fi
|
705
|
|
- cp -r /root/tempgogsssh/home/git/.ssh/* /home/git/.ssh/
|
706
|
|
- if [ ! "$?" = "0" ]; then
|
707
|
|
- exit 74239
|
708
|
|
- fi
|
709
|
|
- rm -rf /root/tempgogs
|
710
|
|
- rm -rf /root/tempgogsrepos
|
711
|
|
- rm -rf /root/tempgogsssh
|
712
|
|
- chown -R git:git /home/git
|
713
|
|
- fi
|
714
|
|
- fi
|
715
|
|
-}
|
716
|
|
-
|
717
|
669
|
function restore_wiki {
|
718
|
670
|
if [[ $RESTORE_APP != 'all' ]]; then
|
719
|
671
|
if [[ $RESTORE_APP != 'wiki' ]]; then
|
|
@@ -934,7 +886,6 @@ restore_mailing_list
|
934
|
886
|
restore_email
|
935
|
887
|
#restore_apps remote
|
936
|
888
|
|
937
|
|
-restore_gogs
|
938
|
889
|
restore_wiki
|
939
|
890
|
restore_blog
|
940
|
891
|
restore_cjdns
|