You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
950 B

  1. ## These instruction are sent to ``dupd`` on target image (doodba)
  2. set -ex
  3. mkdir -p /root/.ssh
  4. curl https://docker.0k.io/get/vm_git_access_id_rsa > /root/.ssh/id_rsa || {
  5. echo "Fatal: Could not retrieve http://docker.0k.io/get/vm_git_access_id_rsa ..." >&2
  6. exit 1
  7. }
  8. ## Not so usefull as it is public !
  9. chmod 0600 /root/.ssh/id_rsa
  10. ssh-keyscan -p 10022 git.0k.io > /root/.ssh/known_hosts
  11. chmod 600 /root/.ssh/known_hosts
  12. cat <<EOF > /root/.ssh/config
  13. Host git.0k.io
  14. ## We'll leverage persistent connection to speed things up
  15. ControlMaster auto
  16. ControlPath ~/.ssh/control/%r@%h:%p
  17. ControlPersist 1m
  18. ServerAliveInterval 20
  19. HostKeyAlgorithms +ssh-dss
  20. User vm-user
  21. Port 10022
  22. EOF
  23. mkdir -p /root/.ssh/control
  24. cat <<EOF > /opt/odoo/common/build.d/050-open-ssh
  25. #!/bin/bash
  26. echo "Checking and opening connection to git.0k.io:" >&2
  27. ssh -v git.0k.io -- true
  28. EOF
  29. chmod +x /opt/odoo/common/build.d/050-open-ssh