mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
fixed ssh-keygen issue
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
logs
|
||||
*.log
|
||||
dist/
|
||||
**/node_modules/
|
||||
**/node_modules/
|
||||
**/tmp/
|
||||
|
||||
@@ -312,12 +312,9 @@ func GetGitSshPublicKey() string {
|
||||
if !utils.Exists(path.Join(os.Getenv("HOME"), ".ssh")) ||
|
||||
!utils.Exists(path.Join(os.Getenv("HOME"), ".ssh", "id_rsa")) ||
|
||||
!utils.Exists(path.Join(os.Getenv("HOME"), ".ssh", "id_rsa.pub")) {
|
||||
cmd := exec.Command(fmt.Sprintf("ssh-keygen -q -t rsa -N \"\" -f %s/.ssh/id_rsa", os.Getenv("HOME")))
|
||||
if err := cmd.Start(); err != nil {
|
||||
log.Errorf(err.Error())
|
||||
debug.PrintStack()
|
||||
return ""
|
||||
}
|
||||
log.Errorf("no ssh public key")
|
||||
debug.PrintStack()
|
||||
return ""
|
||||
}
|
||||
content, err := ioutil.ReadFile(path.Join(os.Getenv("HOME"), ".ssh", "id_rsa.pub"))
|
||||
if err != nil {
|
||||
|
||||
@@ -29,5 +29,8 @@ then
|
||||
/bin/sh /app/backend/scripts/install-nodejs.sh
|
||||
fi
|
||||
|
||||
# generate ssh
|
||||
ssh-keygen -q -t rsa -N "" -f ${HOME}/.ssh/id_rsa
|
||||
|
||||
# start backend
|
||||
crawlab
|
||||
Reference in New Issue
Block a user