repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

git: track the SSH signature trust store and harden defaults

0dc71963dc215c8ecfd0ad0505d97ecc96da382d

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

~/.gitconfig only carried SSH signing settings, yet every host needed it
because the allowed-signers path lived nowhere else. Track the trust store
instead: it holds public keys and email principals only, so it needs no
encryption, and versioning trust decisions makes them reviewable and
identical on every host.

Also:

- fix core.attributesfile, which was relative and therefore resolved against
  the current directory instead of the tracked global attributes file;
- reject malformed objects on transfer, fetch, and receive;
- renormalize line endings during merges, matching autocrlf=false;
- name the enclosing declaration in Zig and ZON hunk headers, using a
  group-free alternation because capture groups truncate the header;
- colour moved blocks with zebra, tolerating re-indentation;
- fetch, checkout, and submodule work in parallel;
- refuse implicitly discovered bare repositories.

Changed files (8)

ArchLinux-dev.symlinks

Modified
7 7 git/gitattributes
8 8 ~/.config/git/gitattributes
10 +git/allowed_signers
11 +~/.config/git/allowed_signers
10 13 git/gitconfig.isp
11 14 ~/.config/git/.gitconfig.include

NB-00718.symlinks

Modified
43 43 git/gitattributes
44 44 ~/.config/git/gitattributes
46 +git/allowed_signers
47 +~/.config/git/allowed_signers
46 49 git/gitconfig.isp
47 50 ~/.config/git/.gitconfig.include

desktop.symlinks

Modified
40 40 git/gitattributes
41 41 ~/.config/git/gitattributes
43 +git/allowed_signers
44 +~/.config/git/allowed_signers
43 46 git/gitconfig.bugabinga
44 47 ~/.config/git/.gitconfig.include

git/allowed_signers

Added
new file mode 100644
1 +# Trust store for SSH commit signatures. Public keys only; no secret material.
2 +# Principal is matched against the committer email.
3 +oliver@bugabinga.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICyZgTxIo9LIsvZLl/iKxlh6vf2WSiz6tyHEQI9lYnC6 oli@velma
4 +o.krylow@isp-insoft.de ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIvGTFdXbhJF4VCi1l5Rm3/ypY0rN16XEJOcIzyLq8AA code.isp-insoft.de

git/gitattributes

Modified
45 45 *.sv merge=mergiraf
46 46 *.svh merge=mergiraf
48 +*.zig diff=zig
49 +*.zon diff=zig

git/gitconfig

Modified
19 19 pf = push --force-with-lease
21 21 [core]
22 - attributesfile = .gitattributes
22 + attributesfile = ~/.config/git/gitattributes
23 23 autocrlf = false
24 24 safecrlf = false
25 25 compression = 9
101 101 # Binary is named 'zeditor' on some distros, 'zed' elsewhere.
102 102 cmd = "\"$(command -v zeditor || command -v zed)\" --wait --diff \"$LOCAL\" \"$REMOTE\""
104 +[diff "zig"]
105 + # Hunk headers name the enclosing declaration in Zig and ZON sources.
106 + # Capture groups would truncate the header, so the alternation is group-free.
107 + xfuncname = "^pub .*$|^fn .*$|^const .*$|^var .*$|^test .*$|^export .*$|^inline .*$|^comptime .*$"
104 109 [difftool "difftastic"]
105 110 cmd = "difft \"$LOCAL\" \"$REMOTE\""
108 113 # Difftastic as default `git difftool` target.
109 114 tool = difftastic
110 115 algorithm = histogram
111 - colorMoved = plain
116 + colorMoved = zebra
117 + colorMovedWS = allow-indentation-change
112 118 context = 3
113 119 interHunkContext = 10
114 120 mnemonicPrefix = true
118 124 [merge]
119 125 tool = nvimdiff2
126 + renormalize = true
120 127 autostash = true
121 128 conflictstyle = zdiff3
136 143 format = ssh
145 +[gpg "ssh"]
146 + allowedSignersFile = ~/.config/git/allowed_signers
139 149 sort = version:refname
140 150 gpgSign = true
152 +[transfer]
153 + fsckObjects = true
155 +[receive]
156 + fsckObjects = true
142 158 [fetch]
159 + fsckObjects = true
160 + parallel = 0
143 161 prune = true
144 162 pruneTags = true
145 163 all = true
176 194 [submodule]
177 195 recurse = false
196 + fetchJobs = 0
179 198 [pager]
180 199 # Use a pager if the difftool output is larger than one screenful,
181 200 # consistent with the behaviour of `git diff`.
182 201 difftool = true
203 +[checkout]
204 + workers = 0
206 +[column]
207 + ui = auto
209 +[safe]
210 + bareRepository = explicit
184 212 [worktree]
185 213 guessRemote = true

termux.symlinks

Modified
10 10 git/gitattributes
11 11 ~/.config/git/gitattributes
13 +git/allowed_signers
14 +~/.config/git/allowed_signers
13 16 git/ignore
14 17 ~/.config/git/ignore
43 46 topgrade/topgrade.toml
44 47 ~/.config/topgrade.toml
49 +topgrade/termux.toml
50 +~/.config/topgrade.d/termux.toml
46 52 mise
47 53 ~/.config/mise

x230.symlinks

Modified
16 16 claude/RTK.md
17 17 ~/.claude/RTK.md
19 -rbw/config.json
20 -~/.config/rbw/config.json
22 19 paru/paru.conf
23 20 ~/.config/paru/paru.conf
43 40 git/gitattributes
44 41 ~/.config/git/gitattributes
43 +git/allowed_signers
44 +~/.config/git/allowed_signers
46 46 git/gitconfig.bugabinga
47 47 ~/.config/git/.gitconfig.include