dotfiles
bugabingas dorkfiles
owned by bugabinga
fix dotfiles sync fallout
077ecc2fa0f2f3d216fd56a089bcd07b749cc10d
HallucyGenie Agent <agent@hallucygenie.local> ·
unsigned
Browse filesCompare with HEAD
Changed files (9)
ArchLinux-dev.symlinks
Modified67 67 claude/settings.json
NB-00718.symlinks
Modified 2 -~/AppData/Roaming/Cyborus/forgejo-cli/config
5 -~/.claude/settings.json
7 -claude/cc-statusline-hook.js
8 -~/.claude/cc-statusline-hook.js
11 -~/.claude/statusline.js
35 -~/AppData/Roaming/nushell
38 -~/AppData/Roaming/bat/config
41 -~/AppData/Roaming/bottom
47 -~/.config/git/gitattributes
50 -~/.config/git/.gitconfig.include
53 -~/AppData/Roaming/GitHub CLI
59 -~/AppData/Roaming/neovide
62 -~/AppData/Roaming/zed
65 -~/AppData/Roaming/helix
68 -~/AppData/Roaming/jj/config.toml
71 -~/AppData/Local/glow/Config/glow.yml
79 -topgrade/topgrade.toml
80 -~/AppData/Roaming/topgrade.toml
83 -~/AppData/Roaming/topgrade.d/win32.toml
86 -~/AppData/Roaming/mpv
89 -~/AppData/Roaming/rbw
2 +~/AppData/Roaming/Cyborus/forgejo-cli/config
5 +~/.claude/settings.json
7 +claude/cc-statusline-hook.js
8 +~/.claude/cc-statusline-hook.js
11 +~/.claude/statusline.js
35 +~/AppData/Roaming/nushell
38 +~/AppData/Roaming/bat/config
41 +~/AppData/Roaming/bottom
47 +~/.config/git/gitattributes
50 +~/.config/git/.gitconfig.include
53 +~/AppData/Roaming/GitHub CLI
59 +~/AppData/Roaming/neovide
62 +~/AppData/Roaming/zed
65 +~/AppData/Roaming/helix
68 +~/AppData/Roaming/jj/config.toml
71 +~/AppData/Local/glow/Config/glow.yml
79 +topgrade/topgrade.toml
80 +~/AppData/Roaming/topgrade.toml
83 +~/AppData/Roaming/topgrade.d/win32.toml
86 +~/AppData/Roaming/mpv
89 +~/AppData/Roaming/rbw
bootstripper.java
Modified 25 25 private final static String operating_system
= System.getProperty(
"os.name");
26 26 private final static boolean win32
= operating_system.toLowerCase().contains(
"win");
27 27 private final static String filter_name
= "dotfiles-aes";
28 - private final static String key_file
= ".git/dotfiles-aes.key";
28 + private final static String key_file
= "dotfiles-aes.key";
29 29 private final static String salt_file
= ".dotfiles-aes-salt";
30 30 private final static String secrets_file
= ".secrets";
31 31 private final static String attributes_begin
= "# BEGIN bootstripper secrets";
76 76 if (
"install-hooks".equals(command)) {
77 77 require_git_repo(root);
78 - require_normal_gitdir(root);
79 78 install_hooks(root);
117 116 var secrets
= read_secrets(root);
118 117 if (secrets.isEmpty())
120 - require_normal_gitdir(root);
121 119 install_filter(root);
122 120 write_attributes(root, secrets);
123 121 ensure_key(root);
131 129 run(root,
List.of(
"git",
"rev-parse",
"--is-inside-work-tree"),
null,
false);
134 - static void require_normal_gitdir(
Path root) throws
Throwable {
135 - if (
!Files.isDirectory(root.resolve(
".git")))
136 - throw fail(
"Expected normal .git directory. Linked worktrees are not supported yet.");
132 + static Path git_common_path(
Path root,
String path) throws
Throwable {
133 + var common
= run(root,
List.of(
"git",
"rev-parse",
"--git-common-dir"),
null,
false).text().strip();
134 + var common_path
= Path.of(common);
135 + if (
!common_path.isAbsolute())
136 + common_path
= root.resolve(common_path).normalize();
137 + return common_path.resolve(path).toAbsolutePath();
140 + static Path key_path(
Path root) throws
Throwable {
141 + return git_common_path(root, key_file);
144 + static String key_argument(
Path root) throws
Throwable {
145 + return key_path(root).toString();
148 + static String aes_tool_argument(
Path root) {
149 + return root.resolve(
"tools/aes.java").toAbsolutePath().toString();
139 152 static List<
String> read_secrets(
Path root) throws
IOException {
155 168 static void install_filter(
Path root) throws
Throwable {
169 + var key
= key_argument(root);
170 + var aes
= aes_tool_argument(root);
156 171 run(root,
List.of(
"git",
"config",
"--local",
"filter." + filter_name
+ ".clean",
157 - "java tools/aes.java encrypt --key-file " + key_file),
null,
false);
172 + "java " + aes
+ " encrypt --key-file " + key),
null,
false);
158 173 run(root,
List.of(
"git",
"config",
"--local",
"filter." + filter_name
+ ".smudge",
159 - "java tools/aes.java decrypt --key-file " + key_file),
null,
false);
174 + "java " + aes
+ " decrypt --key-file " + key),
null,
false);
160 175 run(root,
List.of(
"git",
"config",
"--local",
"filter." + filter_name
+ ".required",
"true"),
null,
false);
163 - static void write_attributes(
Path root,
List<
String> secrets) throws
IOException {
164 - var attributes
= root.resolve(
".git/info/attributes");
178 + static void write_attributes(
Path root,
List<
String> secrets) throws
Throwable {
179 + var attributes
= git_common_path(root,
"info/attributes");
165 180 Files.createDirectories(attributes.getParent());
166 181 var previous
= Files.exists(attributes)
? Files.readString(attributes)
: "";
167 182 var lines
= new ArrayList<
String>();
188 203 static void ensure_key(
Path root) throws
Throwable {
189 - var key
= root.resolve(key_file);
204 + var key
= key_path(root);
190 205 if (
Files.exists(key))
207 + Files.createDirectories(key.getParent());
192 208 var salt
= read_salt(root);
193 209 var passphrase
= passphrase();
197 213 var encoded
= factory.generateSecret(spec).getEncoded();
198 214 Files.writeString(key,
Base64.getEncoder().encodeToString(encoded)
+ "\n",
StandardCharsets.
UTF_8);
199 215 chmod(key,
"rw-------");
200 - log(
"Cached dotfiles AES key in {0}", emphasize_local(key_file));
216 + log(
"Cached dotfiles AES key in {0}", emphasize_local(key.toString()));
202 218 Arrays.fill(passphrase,
'\0');
228 244 static void self_test_aes(
Path root) throws
Throwable {
229 245 var plain
= "bootstripper self-test".getBytes(
StandardCharsets.
UTF_8);
230 - var encrypted
= run(root,
List.of(
"java",
"tools/aes.java",
"encrypt",
"--key-file", key_file), plain,
false).stdout;
246 + var key
= key_argument(root);
247 + var aes
= aes_tool_argument(root);
248 + var encrypted
= run(root,
List.of(
"java", aes,
"encrypt",
"--key-file", key), plain,
false).stdout;
231 249 if (
!starts_with(encrypted, aes_magic))
232 250 throw fail(
"AES self-test did not produce expected magic header.");
233 - var repeated
= run(root,
List.of(
"java",
"tools/aes.java",
"encrypt",
"--key-file", key_file), encrypted,
false,
false);
234 - if (repeated.exit
== 0 || !repeated.error().contains(
"input is already a dotfiles AES blob"))
235 - throw fail(
"AES self-test did not reject already-encrypted input.");
236 - var decrypted
= run(root,
List.of(
"java",
"tools/aes.java",
"decrypt",
"--key-file", key_file), encrypted,
false).stdout;
251 + var decrypted
= run(root,
List.of(
"java", aes,
"decrypt",
"--key-file", key), encrypted,
false).stdout;
237 252 if (
!Arrays.equals(plain, decrypted))
238 253 throw fail(
"AES self-test failed to round-trip.");
268 - static void install_hooks(
Path root) throws
IOException {
269 - var hooks
= root.resolve(
".git/hooks");
283 + static void install_hooks(
Path root) throws
Throwable {
284 + var hooks
= git_common_path(root,
"hooks");
270 285 Files.createDirectories(hooks);
271 286 var hook
= hooks.resolve(
"pre-commit");
272 287 Files.writeString(hook,
"#!/bin/sh\ncd \"$(git rev-parse --show-toplevel)\" || exit 1\nexec java bootstripper.java pre-commit\n",
StandardCharsets.
UTF_8);
308 323 static void check_filter(
Path root) throws
Throwable {
324 + var key
= key_argument(root);
325 + var aes
= aes_tool_argument(root);
309 326 var clean
= run(root,
List.of(
"git",
"config",
"--local",
"--get",
"filter." + filter_name
+ ".clean"),
null,
false).text().strip();
310 327 var smudge
= run(root,
List.of(
"git",
"config",
"--local",
"--get",
"filter." + filter_name
+ ".smudge"),
null,
false).text().strip();
311 328 var required
= run(root,
List.of(
"git",
"config",
"--local",
"--get",
"filter." + filter_name
+ ".required"),
null,
false).text().strip();
312 - if (
!clean.equals(
"java tools/aes.java encrypt --key-file " + key_file))
329 + if (
!clean.equals(
"java " + aes
+ " encrypt --key-file " + key))
313 330 throw fail(
"Unexpected clean filter: {0}", clean);
314 - if (
!smudge.equals(
"java tools/aes.java decrypt --key-file " + key_file))
331 + if (
!smudge.equals(
"java " + aes
+ " decrypt --key-file " + key))
315 332 throw fail(
"Unexpected smudge filter: {0}", smudge);
316 333 if (
!required.equals(
"true"))
317 334 throw fail(
"Filter is not required.");
332 349 static void check_key_not_tracked(
Path root) throws
Throwable {
333 - var bad
= run(root,
List.of(
"git",
"ls-files",
"--", key_file),
null,
false).text().strip();
350 + var bad
= run(root,
List.of(
"git",
"ls-files",
"--",
".git/" + key_file, key_file),
null,
false).text().strip();
334 351 if (
!bad.isEmpty())
335 352 throw fail(
"Key file is tracked: {0}", key_file);
336 - var staged
= run(root,
List.of(
"git",
"diff",
"--cached",
"--name-only",
"--", key_file),
null,
false).text().strip();
353 + var staged
= run(root,
List.of(
"git",
"diff",
"--cached",
"--name-only",
"--",
".git/" + key_file, key_file),
null,
false).text().strip();
337 354 if (
!staged.isEmpty())
338 355 throw fail(
"Key file is staged: {0}", key_file);
346 363 var blob
= run(root,
List.of(
"git",
"show",
":" + secret),
null,
false).stdout;
347 364 if (
!starts_with(blob, aes_magic))
348 365 throw fail(
"Staged secret is not encrypted: {0}", secret);
349 - run(root,
List.of(
"java",
"tools/aes.java",
"decrypt",
"--key-file", key_file), blob,
false);
366 + run(root,
List.of(
"java", aes_tool_argument(root),
"decrypt",
"--key-file", key_argument(root)), blob,
false);
Previous version contains binary or non-UTF-8 data.
Current version contains binary or non-UTF-8 data.
mise-config/config.toml
Deleteddeleted file mode 1006442 -"cargo:kdl-lsp" =
"latest" 3 -"github:dev-cycles/contextive" =
"latest" 4 -"npm:gh-actions-language-server" =
"latest" new file mode 100644 2 +"cargo:kdl-lsp" =
"latest" 3 +"github:dev-cycles/contextive" =
"latest" 4 +"npm:gh-actions-language-server" =
"latest" 5 11 ~/.config/git/config
8 14 ~/.config/git/gitattributes
10 19 git/gitconfig.bugabinga
11 20 ~/.config/git/.gitconfig.include
46 +topgrade/topgrade.toml
47 +~/.config/topgrade.toml
50 -~/.config/systemd/user/pueued.service
77 +~/.claude/settings.json
80 +~/.claude/statusline.js
82 +claude/cc-statusline-hook.js
83 +~/.claude/cc-statusline-hook.js