Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
cd3aac7c
Commit
cd3aac7c
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Move remote gogs restore to app script
parent
ffb76f5d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-gogs
+42
-1
42 additions, 1 deletion
src/freedombone-app-gogs
src/freedombone-restore-remote
+0
-49
0 additions, 49 deletions
src/freedombone-restore-remote
with
42 additions
and
50 deletions
src/freedombone-app-gogs
+
42
−
1
View file @
cd3aac7c
...
...
@@ -184,7 +184,48 @@ function backup_remote_gogs {
}
function
restore_remote_gogs
{
echo
-n
''
export
GVM_ROOT
=
$GVM_HOME
if
[
-d
$GVM_ROOT
/bin
]
;
then
cd
$GVM_ROOT
/bin
[[
-s
"
$GVM_ROOT
/scripts/gvm"
]]
&&
source
"
$GVM_ROOT
/scripts/gvm"
gvm use go
${
GO_VERSION
}
--default
systemctl set-environment
GOPATH
=
$GOPATH
fi
if
grep
-q
"Gogs domain"
$COMPLETION_FILE
;
then
GIT_DOMAIN_NAME
=
$(
cat
$COMPLETION_FILE
|
grep
"Gogs domain"
|
awk
-F
':'
'{print $2}'
)
function_check restore_database_from_friend
restore_database_from_friend gogs
$GIT_DOMAIN_NAME
if
[
-d
$SERVER_DIRECTORY
/backup/gogs
]
;
then
if
[
!
-d
$GOPATH
/src/github.com/gogits/gogs/custom
]
;
then
mkdir
-p
$GOPATH
/src/github.com/gogits/gogs/custom
fi
cp
-r
/root/tempgogs/
$GOPATH
/src/github.com/gogits/gogs/custom/
*
$GOPATH
/src/github.com/gogits/gogs/custom/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
5885
fi
echo
$"Restoring Gogs repos"
restore_directory_from_friend /root/tempgogsrepos gogsrepos
cp
-r
/root/tempgogsrepos/home/git/gogs-repositories/
*
/home/git/gogs-repositories/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
7649
fi
echo
$"Restoring Gogs authorized_keys"
restore_directory_from_friend /root/tempgogsssh gogsssh
if
[
!
-d
/home/git/.ssh
]
;
then
mkdir
/home/git/.ssh
fi
cp
-r
/root/tempgogsssh/home/git/.ssh/
*
/home/git/.ssh/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
74239
fi
rm
-rf
/root/tempgogs
rm
-rf
/root/tempgogsrepos
rm
-rf
/root/tempgogsssh
chown
-R
git:git /home/git
echo
$"Restore of Gogs complete"
fi
fi
}
function
remove_gogs
{
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-restore-remote
+
0
−
49
View file @
cd3aac7c
...
...
@@ -666,54 +666,6 @@ function restore_mailing_list {
fi
}
function
restore_gogs
{
export
GVM_ROOT
=
$GVM_HOME
if
[
-d
$GVM_ROOT
/bin
]
;
then
cd
$GVM_ROOT
/bin
[[
-s
"
$GVM_ROOT
/scripts/gvm"
]]
&&
source
"
$GVM_ROOT
/scripts/gvm"
gvm use go
${
GO_VERSION
}
--default
systemctl set-environment
GOPATH
=
$GOPATH
fi
if
[[
$RESTORE_APP
!=
'all'
]]
;
then
if
[[
$RESTORE_APP
!=
'gogs'
]]
;
then
return
fi
fi
if
grep
-q
"Gogs domain"
$COMPLETION_FILE
;
then
GIT_DOMAIN_NAME
=
$(
cat
$COMPLETION_FILE
|
grep
"Gogs domain"
|
awk
-F
':'
'{print $2}'
)
restore_database_from_friend gogs
$GIT_DOMAIN_NAME
if
[
-d
$SERVER_DIRECTORY
/backup/gogs
]
;
then
if
[
!
-d
$GOPATH
/src/github.com/gogits/gogs/custom
]
;
then
mkdir
-p
$GOPATH
/src/github.com/gogits/gogs/custom
fi
cp
-r
/root/tempgogs/
$GOPATH
/src/github.com/gogits/gogs/custom/
*
$GOPATH
/src/github.com/gogits/gogs/custom/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
5885
fi
echo
$"Restoring Gogs repos"
restore_directory_from_friend /root/tempgogsrepos gogsrepos
cp
-r
/root/tempgogsrepos/home/git/gogs-repositories/
*
/home/git/gogs-repositories/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
7649
fi
echo
$"Restoring Gogs authorized_keys"
restore_directory_from_friend /root/tempgogsssh gogsssh
if
[
!
-d
/home/git/.ssh
]
;
then
mkdir
/home/git/.ssh
fi
cp
-r
/root/tempgogsssh/home/git/.ssh/
*
/home/git/.ssh/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
74239
fi
rm
-rf
/root/tempgogs
rm
-rf
/root/tempgogsrepos
rm
-rf
/root/tempgogsssh
chown
-R
git:git /home/git
fi
fi
}
function
restore_wiki
{
if
[[
$RESTORE_APP
!=
'all'
]]
;
then
if
[[
$RESTORE_APP
!=
'wiki'
]]
;
then
...
...
@@ -934,7 +886,6 @@ restore_mailing_list
restore_email
#restore_apps remote
restore_gogs
restore_wiki
restore_blog
restore_cjdns
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment