diff --git a/.dockerignore b/.dockerignore index 4207a951..7ca01557 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,5 @@ logs *.log dist/ -**/node_modules/ \ No newline at end of file +**/node_modules/ +**/tmp/ diff --git a/backend/services/git.go b/backend/services/git.go index f1d42f23..1bb8b3b9 100644 --- a/backend/services/git.go +++ b/backend/services/git.go @@ -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 { diff --git a/docker_init.sh b/docker_init.sh index 6f139c92..b65188b4 100755 --- a/docker_init.sh +++ b/docker_init.sh @@ -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 \ No newline at end of file