Skip to content

Commit

Permalink
Update ssh signing config
Browse files Browse the repository at this point in the history
This breaks down the two configurations into personal and work/spatial.

Based on config from https://markentier.tech/posts/2021/02/github-with-multiple-profiles-gpg-ssh-keys/
  • Loading branch information
justin committed Dec 17, 2024
1 parent ad1cc98 commit 56394bf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
12 changes: 10 additions & 2 deletions files/private_dot_config/git/config.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
[user]
name = {{ .name }}
email = {{ .email }}
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC947DfJQryRkXvmotipCdU4S1vh3tqk9S+Mxei6imqL7Ebx7iA7kqdERset6ez3eOcLwu3UFftLSy1gg+ZeUJmRRyLPsPUhRBy/OCzMnhUv8K5slJmKEBSiJ1DR4VoEKitIQKJYrm5SZkfocQVhQovHgoXiN0Y8xGGzbSmCRNGW9z8t/R4GRToYAzFWOGvdz1GSfm9ZjjEb3yaA7Y3Kuk1xN1EabWKnvHz39VZfzHVcJ2eCuuoifmiHc++YgKdHYguUcicCEdhcgZHe1Wj/1CFrFj88frww9gej0n8GFm7Gi+GqnVbGlPdJ8ma50Hp7rYT/WUmtf8MAkGSu+0s5UJHO3e6O8/0z146+1dvau7e+Y07xtGloO2xwsmuj7O/5JAoqjfpxjysa3i2nWLr446/IlA2ikMJbnH2vqL8NRyAMB5yMgqIGSAoYcZAk0q0mkO/DxytkiEct/Tg2zJLgWGE8bGJJP2YVKXP9NPIN/2Q6yDQOLYTlkpkFH8GKBkxkP376aoN81vgmJIlKx23bDWwv8i8waDPUkyxwf32QiQNJNPrre6wqlWfqbF3ilvlH5QABieaVt+R6D7QajezLCC1ZrQOKYAyFO2YRMU2fgGeh125jVaX8QLFpRaorE4qXsMKbIbhqHIcMK3TK1dzcz6GqeeQ9crYPwT5u4zjmUzYpQ==
useConfigOnly = true

[include]
path = ~/.gitconfig.personal

[includeIf "gitdir:~/src/justin/"]
path = ~/.gitconfig.personal

[includeIf "gitdir:~/src/spatiallabs/"]
path = ~/.gitconfig.contentful

[github]
user = {{ .username }}
Expand Down
3 changes: 3 additions & 0 deletions files/private_dot_config/git/gitconfig.personal.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[user]
email = {{- onepasswordRead "op://Personal/Personal SSH Key/email" .onepasswordAccount -}}
signingKey = {{- onepasswordRead "op://Personal/Personal SSH Key/public key" .onepasswordAccount -}}
6 changes: 6 additions & 0 deletions files/private_dot_config/git/gitconfig.spatial.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[user]
email = {{- onepasswordRead "op://Spatial/Spatial SSH Signing/email" .onepasswordAccount -}}
signingKey = {{- onepasswordRead "op://Spatial/Spatial SSH Signing/public key" .onepasswordAccount -}}

[url "[email protected]"]
insteadOf = [email protected]
32 changes: 23 additions & 9 deletions files/private_dot_ssh/config.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{{- if eq .chezmoi.os "darwin" }}
Include ~/.orbstack/ssh/config
{{ end }}
### -- PERSONAL/MAIN ACCOUNT --

Host *
IdentityFile {{ .chezmoi.homeDir }}/.ssh/id_rsa
AddKeysToAgent yes
ServerAliveInterval 120
ServerAliveCountMax 30
ForwardAgent yes
Host github.com
Hostname github.com
User {{ .github_username }}
IdentityFile ~/.ssh/id_rsa

### -- WORK PERSONA/ACCOUNT --

Host github.com-work
Hostname github.com
User {{ .github_username }}
IdentityFile ~/.ssh/spatial_signing

Host homelab
User justin
Expand All @@ -28,3 +31,14 @@ Host studio
Host udm
User root
HostName unifi

Host *
AddKeysToAgent yes
ServerAliveInterval 120
ServerAliveCountMax 30
ForwardAgent yes

{{- if eq .chezmoi.os "darwin" }}
Include ~/.orbstack/ssh/config
{{ end }}

0 comments on commit 56394bf

Please sign in to comment.