Issue 1 and 2 are to document a bug in the Admin UI. A solution to this UI feature is the preferred solutuion.
Issue 3 and 4 are current workaround suggestions that I need further assistance solving.
These are the docs that cover this:
#Issue nr 1:
Step 1: Generate key from the Admin UI: Application Management > Deployment via Git.
Step 2: Downoad key. (public key)
Step 2: Add key to Github repo as a deploy key: “Key is invalid” error.
After checking with the id_rsa.pub file generated in the application users .ssh/id_rsa.pub the file that is downloaded is missing the ‘+’ character - possibly a reg-exp error.
The file in the application users .ssh/id_rsa.pub is a valid key and is the same key as the one that is mangled by the admin UI.
#Issue nr 2:
After adding the valid key generated in the last issue as a deploy key to the github repo - the admin UI fails with an error: “An unexpected error has occcured”
After testing this on the command line by doing a git clone from the application user (via ssh) it fails with:
Failed to add the host to the list of known hosts (/home/121777.cloudwaysapps.com/ynwfpsshpe/.ssh/known_hosts).
Permission denied (publickey).
#Issue nr 3:
If the system implied by the admin UI does not work then there is still an issue with the docs for git from the command line.
I generated id_rsa.1 and id_rsa.1.pub in /home/master/.ssh/ but multiple key files in /home/master/.ssh are not recognized by ssh server.
So how do I register multiple ssh key files ?
I need 1 key for each application (as deploy key)
#Issue nr 4:
After discussing this with support i was instructed to solve this with the API.
This is interesting and I will be looking to develop addons.
However my issue cannot be unique. So I will ask the community for anyone that has already solved this issue. Has anyone developed an addon to generate multiple ssh keys for git deployment already?