Skip to content

Instantly share code, notes, and snippets.

@bekicot
Last active May 22, 2019 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bekicot/3907bfff48b4b7779cf8b3bb57fa61eb to your computer and use it in GitHub Desktop.
Save bekicot/3907bfff48b4b7779cf8b3bb57fa61eb to your computer and use it in GitHub Desktop.

Reading Private Key from ENV variables and storing it in yaml using erb template

  1. Convert new line char into double new line char e.g from \n to \n\n
  2. On YAML file, suround it using double quotes
key: "<%= ENV['PRIVATE_KEY'] %>"

Mina install

  • Create deploy user with sudo
/usr/sbin/adduser deploy sudo
  • Allow using sudo without password
    • Open visudo
      sudo visudo
      
    • append
      deploy ALL=(ALL) NOPASSWD: ALL
      
  • Setup ssh forwarding https://dchua.com/2013/08/29/properly-using-ssh-agent-forwarding-in-capistrano/
    • Check ssh-add -L
    • run ssh-add if not exists
    • Allow agent forwarding

      On Server

      # /etc/ssh/sshd_config
      AllowAgentForwarding yes
      

      On Client

      # /etc/ssh_config file
      

      On Server

      Host *
        SendEnv LANG LC_*
        ForwardAgent no yes
      
  • Install rbenv and ruby's dependencies

    Add rbenv path and init BEFORE the interactive shell checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment