diff options
| author | Franck Cuny <franck@fcuny.net> | 2022-06-18 14:45:58 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2022-06-18 14:50:46 -0700 |
| commit | b30dd0c0f9f3c55517434fdc7d37b34ef0c94664 (patch) | |
| tree | 4a4cd5399cdea2e6918d6a574e70ede351d81752 /tools/ssh-key-to-forge/README.org | |
| parent | feat(tools/music-organizer): add a CLI to organize my music (diff) | |
| download | infra-b30dd0c0f9f3c55517434fdc7d37b34ef0c94664.tar.gz | |
feat(tools/ssh-key-to-forge): import a SSH key to a forge
This can be useful if I need to import a SSH key to one of the
forge (only GitHub is supported for now).
Change-Id: Ieb5143a670cd75f1fbe51c0f3ae763dd1d667bef
Reviewed-on: https://cl.fcuny.net/c/world/+/449
Tested-by: CI
Reviewed-by: Franck Cuny <franck@fcuny.net>
Diffstat (limited to 'tools/ssh-key-to-forge/README.org')
| -rw-r--r-- | tools/ssh-key-to-forge/README.org | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/ssh-key-to-forge/README.org b/tools/ssh-key-to-forge/README.org new file mode 100644 index 0000000..cb7eba6 --- /dev/null +++ b/tools/ssh-key-to-forge/README.org @@ -0,0 +1,28 @@ +#+TITLE: ssh-key-to-forge + +Upload a publich SSH key to GitHub and Gitea. + +** Configuration + +All the information are expected to be stored in the global =gitconfig=. + +The following keys are required: + +- =github.user=: name of the user on GitHub +- =github.tokensshtoforge=: the API token to use (you might want to restrict the token to only access the SSH keys, with read/write permissions) + +#+begin_src sh +; git config --global github.user +fcuny +; git config --global github.tokensshtoforge +<API TOKEN> +#+end_src + +** Run + +Once you've build the command, you can run =ssh-key-to-forge= without any arguments if the public key is stored under =$HOME/.ssh/id_rsa.pub=. If you need to upload a different key, you can use the =-ssh-key= flag with the path to the key. + +The program will ensure it's a proper public key that you're trying to upload. If there's no errors, nothing is printed on =STDERR= or =STDOUT=. If the key is already present, it will not do anything. + +*** Errors +Errors are printed on =STDERR=. The only error that is considered fatal is if the ssh key is not a valid public key. |
