@sebastienrousseau/dotfiles 0.2.481 → 0.2.499

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/docs/ARCHITECTURE.md +29 -196
  2. package/docs/COMPLIANCE.md +10 -10
  3. package/docs/COPYRIGHT +3 -4
  4. package/docs/OPERATIONS.md +38 -65
  5. package/docs/PLAN.md +3 -3
  6. package/docs/PR_DESCRIPTION.md +85 -84
  7. package/docs/ROADMAP.md +11 -11
  8. package/docs/ROADMAP_legacy.md +556 -0
  9. package/docs/SECURITY_CHECKLIST.md +1 -1
  10. package/docs/TASK.md +4 -4
  11. package/docs/WALKTHROUGH.md +33 -152
  12. package/package.json +17 -5
  13. package/scripts/backup.sh +142 -0
  14. package/scripts/banner.sh +20 -0
  15. package/scripts/benchmark.sh +20 -0
  16. package/scripts/build.sh +41 -0
  17. package/scripts/clean.sh +31 -0
  18. package/scripts/compile.sh +54 -0
  19. package/scripts/copy.sh +108 -0
  20. package/scripts/{tools/detect-collisions.py → detect-collisions.py} +1 -1
  21. package/scripts/doctor.sh +79 -0
  22. package/scripts/dotfiles.sh +63 -0
  23. package/scripts/download.sh +35 -0
  24. package/scripts/help.sh +57 -0
  25. package/scripts/lock-configs.sh +57 -0
  26. package/scripts/package.sh +46 -0
  27. package/scripts/ssh.sh +55 -0
  28. package/scripts/teleport.sh +23 -0
  29. package/scripts/{tests/test-aliases.sh → test-aliases.sh} +3 -3
  30. package/scripts/test_smoke.sh +88 -0
  31. package/scripts/unpack.sh +28 -0
  32. package/scripts/{diagnostics/verify_state.sh → verify_state.sh} +21 -21
  33. package/templates/projects/go/README.md +0 -4
  34. package/templates/projects/node/README.md +0 -4
  35. package/templates/projects/python/README.md +0 -4
  36. package/templates/projects/python/pyproject.toml +0 -15
  37. package/CHANGELOG.md +0 -285
  38. package/LICENSE +0 -1283
  39. package/README.md +0 -315
  40. package/docs/ALIASES.md +0 -128
  41. package/docs/FEATURES.md +0 -166
  42. package/docs/FONTS.md +0 -147
  43. package/docs/INSTALL.md +0 -119
  44. package/docs/KEYS.md +0 -40
  45. package/docs/KEY_ROTATION.md +0 -219
  46. package/docs/LEGACY_ROADMAP.md +0 -142
  47. package/docs/NEOVIM_IDE_GUIDE.md +0 -52
  48. package/docs/README.md +0 -269
  49. package/docs/REPO_AUDIT.md +0 -23
  50. package/docs/SCREENSHOTS.md +0 -116
  51. package/docs/SECRETS.md +0 -76
  52. package/docs/SECURITY.md +0 -30
  53. package/docs/TESTING.md +0 -190
  54. package/docs/TOOLS.md +0 -146
  55. package/docs/TROUBLESHOOTING.md +0 -112
  56. package/docs/UTILS.md +0 -105
  57. package/docs/WSL2_NIX_TROUBLESHOOTING.md +0 -723
  58. package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -101
  59. package/docs/adr/ADR-002-shell-performance.md +0 -121
  60. package/docs/adr/ADR-003-security-first.md +0 -140
  61. package/docs/adr/ADR-004-cli-architecture.md +0 -157
  62. package/docs/adr/ADR-005-chezmoi-choice.md +0 -89
  63. package/docs/adr/ADR-006-shell-selection.md +0 -115
  64. package/docs/adr/README.md +0 -33
  65. package/docs/themes/README.md +0 -20
  66. package/dot_config/aider/aider.conf.yml +0 -32
  67. package/dot_config/alacritty/alacritty.toml.tmpl +0 -483
  68. package/dot_config/ansible/ansible.cfg.tmpl +0 -11
  69. package/dot_config/atuin/config.toml +0 -23
  70. package/dot_config/bat/config +0 -8
  71. package/dot_config/brave-flags.conf.tmpl +0 -7
  72. package/dot_config/btop/btop.conf +0 -16
  73. package/dot_config/btop/themes/tokyonight.theme +0 -34
  74. package/dot_config/bun/bunfig.toml.tmpl +0 -33
  75. package/dot_config/claude/mcp_servers.json +0 -49
  76. package/dot_config/clippy.toml +0 -55
  77. package/dot_config/containers/containers.conf +0 -14
  78. package/dot_config/curl/dot_curlrc +0 -18
  79. package/dot_config/dlv/config.yml +0 -39
  80. package/dot_config/docker/config.json.tmpl +0 -15
  81. package/dot_config/dotfiles/boot/README.md +0 -11
  82. package/dot_config/dotfiles/grub/README.md +0 -11
  83. package/dot_config/dotfiles/lock/README.md +0 -11
  84. package/dot_config/dotfiles/versions.env.tmpl +0 -19
  85. package/dot_config/duf/duf.conf +0 -6
  86. package/dot_config/duti/defaults.duti +0 -5
  87. package/dot_config/emoji/emoji.txt +0 -34
  88. package/dot_config/fastfetch/config.jsonc +0 -28
  89. package/dot_config/firefox/user.js +0 -8
  90. package/dot_config/flatpak/flatpak.list +0 -4
  91. package/dot_config/fontconfig/fonts.conf.tmpl +0 -44
  92. package/dot_config/gem/gemrc +0 -9
  93. package/dot_config/gh/config.yml +0 -12
  94. package/dot_config/ghostty/config.tmpl +0 -661
  95. package/dot_config/git/attributes +0 -12
  96. package/dot_config/git/config.tmpl +0 -77
  97. package/dot_config/git/ignore +0 -27
  98. package/dot_config/gnupg/gpg-agent.conf.tmpl +0 -11
  99. package/dot_config/go/aliases.sh +0 -61
  100. package/dot_config/go/env.sh +0 -24
  101. package/dot_config/go/golangci.yml +0 -118
  102. package/dot_config/go/gopls.json +0 -30
  103. package/dot_config/goose/config.yaml +0 -29
  104. package/dot_config/gtk-3.0/gtk.css.tmpl +0 -305
  105. package/dot_config/gtk-3.0/settings.ini.tmpl +0 -66
  106. package/dot_config/gtk-4.0/gtk.css.tmpl +0 -309
  107. package/dot_config/gtk-4.0/settings.ini.tmpl +0 -21
  108. package/dot_config/htop/htoprc +0 -20
  109. package/dot_config/ice/README.md +0 -13
  110. package/dot_config/inputrc +0 -2
  111. package/dot_config/ipython/profile_default/ipython_config.py.tmpl +0 -5
  112. package/dot_config/just/justfile +0 -104
  113. package/dot_config/k9s/config.yaml.tmpl +0 -65
  114. package/dot_config/k9s/skins/catppuccin-mocha.yaml +0 -116
  115. package/dot_config/karabiner/karabiner.json +0 -14
  116. package/dot_config/kitty/kitty.conf.tmpl +0 -517
  117. package/dot_config/lazydocker/config.yml +0 -186
  118. package/dot_config/lazygit/config.yml +0 -23
  119. package/dot_config/lsd/config.yaml +0 -19
  120. package/dot_config/mas/masapps.txt +0 -5
  121. package/dot_config/minikube/config.json +0 -13
  122. package/dot_config/mise/config.toml +0 -41
  123. package/dot_config/mongosh/mongoshrc.js +0 -67
  124. package/dot_config/mycli/myclirc +0 -67
  125. package/dot_config/nano/nanorc +0 -28
  126. package/dot_config/ncdu/config +0 -12
  127. package/dot_config/nvim/init.lua +0 -4
  128. package/dot_config/nvim/lazy-lock.json +0 -27
  129. package/dot_config/nvim/lua/config/autocmds.lua +0 -63
  130. package/dot_config/nvim/lua/config/keymaps.lua +0 -87
  131. package/dot_config/nvim/lua/config/lazy.lua +0 -34
  132. package/dot_config/nvim/lua/config/options.lua +0 -48
  133. package/dot_config/nvim/lua/plugins/coding.lua +0 -234
  134. package/dot_config/nvim/lua/plugins/dap.lua +0 -201
  135. package/dot_config/nvim/lua/plugins/editor.lua +0 -59
  136. package/dot_config/nvim/lua/plugins/git.lua +0 -9
  137. package/dot_config/nvim/lua/plugins/lsp.lua +0 -221
  138. package/dot_config/nvim/lua/plugins/markdown.lua +0 -17
  139. package/dot_config/nvim/lua/plugins/rust.lua +0 -33
  140. package/dot_config/nvim/lua/plugins/sessions.lua +0 -32
  141. package/dot_config/nvim/lua/plugins/ui.lua +0 -537
  142. package/dot_config/nvim/snippets/all.lua +0 -9
  143. package/dot_config/nvim/snippets/python.lua +0 -16
  144. package/dot_config/pip/pip.conf.tmpl +0 -32
  145. package/dot_config/pypoetry/config.toml.tmpl +0 -6
  146. package/dot_config/pyrightconfig.json.tmpl +0 -5
  147. package/dot_config/raycast/README.md +0 -13
  148. package/dot_config/redis/redisclirc +0 -41
  149. package/dot_config/shell/00-container-detect.sh +0 -53
  150. package/dot_config/shell/00-core-paths.sh.tmpl +0 -95
  151. package/dot_config/shell/05-core-safety.sh.tmpl +0 -13
  152. package/dot_config/shell/40-ls-colors.sh.tmpl +0 -31
  153. package/dot_config/shell/50-logic-functions.sh.tmpl +0 -10
  154. package/dot_config/shell/90-theme-switch.sh +0 -70
  155. package/dot_config/shell/90-ux-aliases.sh.tmpl +0 -35
  156. package/dot_config/shell/91-ux-aliases-lazy.sh.tmpl +0 -23
  157. package/dot_config/shell/Brewfile +0 -207
  158. package/dot_config/shell/Brewfile.cask +0 -92
  159. package/dot_config/shell/Brewfile.cli +0 -119
  160. package/dot_config/shell/README.md +0 -267
  161. package/dot_config/shell/custom/context_suggest.zsh +0 -68
  162. package/dot_config/shell/custom/error_analysis.zsh +0 -45
  163. package/dot_config/sops/dot_sops.yaml +0 -23
  164. package/dot_config/starship.toml.tmpl +0 -124
  165. package/dot_config/task/Taskfile.yml +0 -86
  166. package/dot_config/tflint/tflint.hcl.tmpl +0 -9
  167. package/dot_config/tmux/tmux.conf.tmpl +0 -181
  168. package/dot_config/topgrade/topgrade.toml.tmpl +0 -42
  169. package/dot_config/vscode/extensions.txt +0 -11
  170. package/dot_config/vscode/settings.json.tmpl +0 -123
  171. package/dot_config/waybar/style.css +0 -8
  172. package/dot_config/wezterm/wezterm.lua.tmpl +0 -236
  173. package/dot_config/wget/wgetrc +0 -12
  174. package/dot_config/yarn/yarnrc.yml.tmpl +0 -36
  175. package/dot_config/yazi/yazi.toml +0 -40
  176. package/dot_config/zellij/config.kdl +0 -79
  177. package/dot_config/zsh/dot_zprofile +0 -13
  178. package/dot_config/zsh/dot_zshenv +0 -6
  179. package/dot_config/zsh/dot_zshrc.tmpl +0 -199
  180. package/dot_config/zsh/rc.d/05-ssh-agent.zsh +0 -5
  181. package/dot_config/zsh/rc.d/10-env.zsh.tmpl +0 -28
  182. package/dot_config/zsh/rc.d/20-zinit.zsh.tmpl +0 -22
  183. package/dot_config/zsh/rc.d/30-options.zsh.tmpl +0 -123
  184. package/dot_config/zsh/rc.d/40-bell.zsh.tmpl +0 -20
  185. package/dot_config/zsh/rc.d/50-login-fortune.zsh.tmpl +0 -9
  186. package/dot_local/bin/executable_ai_core +0 -130
  187. package/dot_local/bin/executable_b64 +0 -59
  188. package/dot_local/bin/executable_dot +0 -178
  189. package/dot_local/bin/executable_dot_completion +0 -55
  190. package/dot_local/bin/executable_epoch +0 -62
  191. package/dot_local/bin/executable_extract +0 -108
  192. package/dot_local/bin/executable_git-ai-commit +0 -160
  193. package/dot_local/bin/executable_git-ai-diff +0 -154
  194. package/dot_local/bin/executable_hash +0 -123
  195. package/dot_local/bin/executable_hex +0 -79
  196. package/dot_local/bin/executable_ip +0 -37
  197. package/dot_local/bin/executable_jsonv +0 -54
  198. package/dot_local/bin/executable_jwt +0 -78
  199. package/dot_local/bin/executable_kill-port +0 -59
  200. package/dot_local/bin/executable_lorem +0 -103
  201. package/dot_local/bin/executable_regex +0 -96
  202. package/dot_local/bin/executable_tmux-sessionizer +0 -187
  203. package/dot_local/bin/executable_tour +0 -137
  204. package/dot_local/bin/executable_update +0 -108
  205. package/dot_local/bin/executable_uuid +0 -57
  206. package/dot_local/bin/executable_yamlv +0 -39
  207. package/dot_local/bin/executable_zig-install +0 -89
  208. package/dot_local/bin/voice_ops +0 -7
  209. package/dot_local/share/bash-completion/completions/dot +0 -54
  210. package/dot_local/share/zsh/completions/.keep +0 -0
  211. package/install.sh +0 -255
  212. package/scripts/ci/validate-ci-config.sh +0 -222
  213. package/scripts/demo/record.sh +0 -41
  214. package/scripts/diagnostics/benchmark.sh +0 -201
  215. package/scripts/diagnostics/doctor.sh +0 -115
  216. package/scripts/diagnostics/drift-dashboard.sh +0 -26
  217. package/scripts/diagnostics/health.sh +0 -356
  218. package/scripts/diagnostics/history-analysis.sh +0 -77
  219. package/scripts/diagnostics/security-score.sh +0 -392
  220. package/scripts/dot/commands/appearance.sh +0 -63
  221. package/scripts/dot/commands/core.sh +0 -130
  222. package/scripts/dot/commands/diagnostics.sh +0 -100
  223. package/scripts/dot/commands/meta.sh +0 -117
  224. package/scripts/dot/commands/restore.sh +0 -209
  225. package/scripts/dot/commands/secrets.sh +0 -81
  226. package/scripts/dot/commands/security.sh +0 -73
  227. package/scripts/dot/commands/tools.sh +0 -228
  228. package/scripts/dot/lib/utils.sh +0 -72
  229. package/scripts/fonts/install-nerd-fonts.sh +0 -59
  230. package/scripts/fonts/patch-fonts.sh +0 -34
  231. package/scripts/ops/chezmoi-apply.sh +0 -42
  232. package/scripts/ops/chezmoi-diff.sh +0 -14
  233. package/scripts/ops/chezmoi-remove.sh +0 -43
  234. package/scripts/ops/chezmoi-update.sh +0 -16
  235. package/scripts/ops/heal.sh +0 -466
  236. package/scripts/ops/health-check.sh +0 -380
  237. package/scripts/ops/rollback.sh +0 -531
  238. package/scripts/ops/teleport.sh +0 -32
  239. package/scripts/secrets/age-init.sh +0 -69
  240. package/scripts/secrets/create-secrets-file.sh +0 -44
  241. package/scripts/secrets/encrypt-ssh-key.sh +0 -42
  242. package/scripts/security/backup.sh +0 -17
  243. package/scripts/security/dns-doh.sh +0 -29
  244. package/scripts/security/encryption-check.sh +0 -39
  245. package/scripts/security/enforce-policies.sh +0 -339
  246. package/scripts/security/firewall.sh +0 -34
  247. package/scripts/security/lock-configs.sh +0 -57
  248. package/scripts/security/lock-screen.sh +0 -33
  249. package/scripts/security/manage-secrets.sh +0 -415
  250. package/scripts/security/telemetry-kill.sh +0 -28
  251. package/scripts/security/usb-safety.sh +0 -29
  252. package/scripts/tests/README.md +0 -241
  253. package/scripts/tests/benchmark.sh +0 -91
  254. package/scripts/tests/framework/assertions.sh +0 -283
  255. package/scripts/tests/framework/mocks.sh +0 -201
  256. package/scripts/tests/framework/test_runner.sh +0 -189
  257. package/scripts/tests/integration/test_install.sh +0 -237
  258. package/scripts/tests/performance/benchmark_runner.sh +0 -156
  259. package/scripts/tests/performance/regression_check.sh +0 -73
  260. package/scripts/tests/performance/stress_test.sh +0 -65
  261. package/scripts/tests/test-docker.sh +0 -48
  262. package/scripts/tests/unit/test_ai_aliases.sh +0 -158
  263. package/scripts/tests/unit/test_ai_cli_checks.sh +0 -47
  264. package/scripts/tests/unit/test_backup.sh +0 -227
  265. package/scripts/tests/unit/test_case_functions.sh +0 -238
  266. package/scripts/tests/unit/test_cd_aliases.sh +0 -367
  267. package/scripts/tests/unit/test_dot_cli.sh +0 -217
  268. package/scripts/tests/unit/test_encode64.sh +0 -67
  269. package/scripts/tests/unit/test_environment.sh +0 -78
  270. package/scripts/tests/unit/test_extract.sh +0 -163
  271. package/scripts/tests/unit/test_framework_edge_cases.sh +0 -113
  272. package/scripts/tests/unit/test_genpass.sh +0 -298
  273. package/scripts/tests/unit/test_install_edge_cases.sh +0 -167
  274. package/scripts/tests/unit/test_installers.sh +0 -172
  275. package/scripts/tests/unit/test_keygen.sh +0 -68
  276. package/scripts/tests/unit/test_logging.sh +0 -96
  277. package/scripts/tests/unit/test_os_detection_comprehensive.sh +0 -388
  278. package/scripts/tests/unit/test_package_managers_comprehensive.sh +0 -321
  279. package/scripts/tests/unit/test_prependpath.sh +0 -66
  280. package/scripts/tests/unit/test_prependpath_refactored.sh +0 -89
  281. package/scripts/tests/unit/test_rd.sh +0 -230
  282. package/scripts/tests/unit/test_security_fixes.sh +0 -130
  283. package/scripts/tests/unit/test_security_scripts.sh +0 -87
  284. package/scripts/tests/unit/test_template_validation.sh +0 -238
  285. package/scripts/tests/unit/test_utility_functions.sh +0 -144
  286. package/scripts/tests/unit/test_wave1_alias_split.sh +0 -132
  287. package/scripts/tests/unit/test_wave1_ci_pinning.sh +0 -61
  288. package/scripts/tests/unit/test_wave1_gitleaks_config.sh +0 -52
  289. package/scripts/tests/unit/test_wave1_heal_fixes.sh +0 -97
  290. package/scripts/tests/unit/test_wave1_install_gpg.sh +0 -35
  291. package/scripts/tests/unit/test_wave1_zshenv_path.sh +0 -89
  292. package/scripts/tests/unit/test_wave1_zshrc_lazy_hook.sh +0 -115
  293. package/scripts/tests/unit/test_wave2_dot_new_guard.sh +0 -75
  294. package/scripts/tests/unit/test_zipf.sh +0 -76
  295. package/scripts/theme/apply-gnome-theme.sh +0 -297
  296. package/scripts/theme/install-boot-logo.sh +0 -61
  297. package/scripts/theme/install-catppuccin-themes.sh +0 -346
  298. package/scripts/theme/install-cursors.sh +0 -24
  299. package/scripts/theme/install-file-icons.sh +0 -25
  300. package/scripts/theme/install-grub-theme.sh +0 -51
  301. package/scripts/theme/install-lock-icon.sh +0 -29
  302. package/scripts/theme/switch.sh +0 -250
  303. package/scripts/theme/wallpaper-rotate.sh +0 -82
  304. package/scripts/theme/wallpaper-sync.sh +0 -42
  305. package/scripts/tools/cmatrix.sh +0 -20
  306. package/scripts/tools/emoji-picker.sh +0 -45
  307. package/scripts/tools/figlet-banner.sh +0 -17
  308. package/scripts/tools/log-rotate.sh +0 -29
  309. package/scripts/tools/lolcat-wrap.sh +0 -18
  310. package/scripts/tools/pipes.sh +0 -47
  311. package/scripts/tuning/linux.sh +0 -175
  312. package/scripts/tuning/macos.sh +0 -46
  313. package/templates/projects/molecule/README.md +0 -7
  314. package/templates/projects/molecule/converge.yml +0 -7
  315. package/templates/projects/molecule/molecule.yml +0 -16
  316. package/templates/projects/packer/README.md +0 -15
  317. package/templates/projects/packer/main.pkr.hcl +0 -15
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- KEY_PATH="${1:-$HOME/.ssh/id_ed25519}"
5
- OUT_FILE="${2:-$HOME/.config/chezmoi/encrypted_id_ed25519.age}"
6
- KEYRING_DIR="$HOME/.config/chezmoi"
7
- AGE_KEY="$KEYRING_DIR/key.txt"
8
-
9
- if [ ! -f "$KEY_PATH" ]; then
10
- echo "SSH key not found: $KEY_PATH"
11
- exit 1
12
- fi
13
-
14
- if [ ! -f "$AGE_KEY" ]; then
15
- echo "Age identity not found: $AGE_KEY"
16
- echo "Run: dot secrets-init"
17
- exit 1
18
- fi
19
-
20
- if ! command -v age >/dev/null; then
21
- echo "age not found. Install it first."
22
- exit 1
23
- fi
24
-
25
- recipient="$(age-keygen -y "$AGE_KEY")"
26
- mkdir -p "$(dirname "$OUT_FILE")"
27
-
28
- if [ -f "$OUT_FILE" ]; then
29
- echo "Encrypted file already exists: $OUT_FILE"
30
- exit 0
31
- fi
32
-
33
- age -R <(printf "%s" "$recipient") -o "$OUT_FILE" "$KEY_PATH"
34
- chmod 600 "$OUT_FILE"
35
-
36
- cat <<MSG
37
- Encrypted SSH key written to:
38
- $OUT_FILE
39
-
40
- This file is local only. If you want to track it in dotfiles, run:
41
- chezmoi add --encrypt $OUT_FILE
42
- MSG
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
-
4
- BACKUP_DIR="${DOTFILES_BACKUP_DIR:-$HOME/.backups}"
5
- SRC_DIR="${DOTFILES_BACKUP_SRC:-$HOME}"
6
- STAMP=$(date +%Y%m%d-%H%M%S)
7
- OUT="$BACKUP_DIR/dotfiles-backup-$STAMP.tgz"
8
-
9
- mkdir -p "$BACKUP_DIR"
10
-
11
- if ! tar --exclude="$HOME/.cache" --exclude="$HOME/.local/share/Trash" -czf "$OUT" "$SRC_DIR"; then
12
- echo "[ERROR] Backup failed!" >&2
13
- rm -f "$OUT"
14
- exit 1
15
- fi
16
-
17
- echo "Backup written to: $OUT"
@@ -1,29 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
-
4
- if [ "${DOTFILES_DOH:-}" != "1" ]; then
5
- echo "DoH script is disabled by default."
6
- echo "Re-run with DOTFILES_DOH=1 to apply."
7
- exit 1
8
- fi
9
-
10
- case "$(uname -s)" in
11
- Linux)
12
- if command -v resolvectl >/dev/null; then
13
- echo "Enabling DNS-over-HTTPS with systemd-resolved (Cloudflare)..."
14
- sudo resolvectl dns-over-https on
15
- sudo resolvectl dns 1.1.1.1 1.0.0.1
16
- else
17
- echo "systemd-resolved not detected."
18
- exit 1
19
- fi
20
- ;;
21
- Darwin)
22
- echo "Configure DoH in your browser (system-wide DoH requires profiles)."
23
- exit 0
24
- ;;
25
- *)
26
- echo "Unsupported OS for DoH config."
27
- exit 1
28
- ;;
29
- esac
@@ -1,39 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
-
4
- case "$(uname -s)" in
5
- Darwin)
6
- if command -v fdesetup >/dev/null; then
7
- status=$(fdesetup status || true)
8
- echo "$status"
9
- echo "$status" | grep -qi "FileVault is On" && exit 0
10
- echo "Warning: FileVault appears to be off."
11
- exit 1
12
- else
13
- echo "fdesetup not found."
14
- exit 1
15
- fi
16
- ;;
17
- Linux)
18
- if command -v lsblk >/dev/null; then
19
- lsblk_output=$(lsblk -f)
20
- if command -v rg >/dev/null; then
21
- if echo "$lsblk_output" | rg -i "crypto|luks" >/dev/null; then
22
- echo "Encrypted block device detected (LUKS)."
23
- exit 0
24
- fi
25
- else
26
- if echo "$lsblk_output" | grep -Ei "crypto|luks" >/dev/null; then
27
- echo "Encrypted block device detected (LUKS)."
28
- exit 0
29
- fi
30
- fi
31
- echo "Warning: No LUKS/crypto volume detected."
32
- exit 1
33
- fi
34
- ;;
35
- *)
36
- echo "Unsupported OS for encryption check."
37
- exit 1
38
- ;;
39
- esac
@@ -1,339 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Security Policy Enforcement Script
3
- # This script enforces security policies across the dotfiles repository
4
-
5
- set -euo pipefail
6
-
7
- # Script configuration
8
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
- readonly SCRIPT_DIR
10
- REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
11
- readonly REPO_ROOT
12
- readonly POLICIES_DIR="${REPO_ROOT}/.github/security-policies"
13
- readonly LOG_FILE="${REPO_ROOT}/.security-audit.log"
14
-
15
- # Color codes for output (respect NO_COLOR: https://no-color.org)
16
- if [[ -z "${NO_COLOR:-}" ]] && [[ -t 1 ]]; then
17
- readonly RED='\033[0;31m'
18
- readonly GREEN='\033[0;32m'
19
- readonly YELLOW='\033[1;33m'
20
- readonly NC='\033[0m'
21
- else
22
- readonly RED='' GREEN='' YELLOW='' NC=''
23
- fi
24
-
25
- # Logging function
26
- log() {
27
- local level="$1"
28
- shift
29
- local message="$*"
30
- local timestamp
31
- timestamp=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
32
-
33
- echo "[${timestamp}] [${level}] ${message}" | tee -a "${LOG_FILE}"
34
- }
35
-
36
- # Error handling
37
- error_exit() {
38
- log "ERROR" "$1"
39
- exit 1
40
- }
41
-
42
- # Check if required tools are installed
43
- check_dependencies() {
44
- log "INFO" "Checking dependencies..."
45
-
46
- local missing_tools=()
47
-
48
- # Required tools
49
- local tools=("opa" "gitleaks" "shellcheck" "grep" "find")
50
-
51
- for tool in "${tools[@]}"; do
52
- if ! command -v "$tool" &>/dev/null; then
53
- missing_tools+=("$tool")
54
- fi
55
- done
56
-
57
- if [[ ${#missing_tools[@]} -gt 0 ]]; then
58
- error_exit "Missing required tools: ${missing_tools[*]}"
59
- fi
60
-
61
- log "INFO" "All dependencies satisfied"
62
- }
63
-
64
- # Scan for hardcoded secrets
65
- scan_secrets() {
66
- log "INFO" "Scanning for hardcoded secrets..."
67
-
68
- local violations=0
69
-
70
- # Run gitleaks
71
- if gitleaks detect --source="${REPO_ROOT}" --config="${REPO_ROOT}/config/gitleaks.toml" --no-git >/dev/null 2>&1; then
72
- log "INFO" "✅ No secrets detected by gitleaks"
73
- else
74
- log "WARN" "❌ Potential secrets detected by gitleaks"
75
- violations=$((violations + 1))
76
- fi
77
-
78
- # Manual pattern checks
79
- local secret_patterns=(
80
- 'password\s*=\s*["\047][^"\047]*["\047]'
81
- 'token\s*=\s*["\047][^"\047]*["\047]'
82
- 'secret\s*=\s*["\047][^"\047]*["\047]'
83
- 'key\s*=\s*["\047][^"\047]*["\047]'
84
- 'AKIA[0-9A-Z]{16}' # AWS Access Key
85
- '[0-9a-f]{32,}' # Potential hash/token
86
- )
87
-
88
- for pattern in "${secret_patterns[@]}"; do
89
- if grep -r -E -i "${pattern}" "${REPO_ROOT}" \
90
- --exclude-dir=".git" \
91
- --exclude="*.log" \
92
- --exclude="enforce-policies.sh" \
93
- --exclude="environment-template.env" >/dev/null 2>&1; then
94
- log "WARN" "❌ Potential hardcoded credential pattern found: ${pattern}"
95
- violations=$((violations + 1))
96
- fi
97
- done
98
-
99
- if [[ $violations -eq 0 ]]; then
100
- log "INFO" "✅ No hardcoded secrets detected"
101
- fi
102
-
103
- return $violations
104
- }
105
-
106
- # Check file permissions
107
- check_file_permissions() {
108
- log "INFO" "Checking file permissions..."
109
-
110
- local violations=0
111
-
112
- # Check for overly permissive files
113
- while IFS= read -r -d '' file; do
114
- if [[ -f "$file" ]]; then
115
- local perms
116
- perms=$(stat -c %a "$file" 2>/dev/null || stat -f %A "$file")
117
- if [[ $perms -gt 755 ]]; then
118
- log "WARN" "❌ Overly permissive file: ${file} (${perms})"
119
- violations=$((violations + 1))
120
- fi
121
- fi
122
- done < <(find "${REPO_ROOT}" -type f -not -path "*/.git/*" -print0)
123
-
124
- # Check for executable text files
125
- local text_extensions=("md" "txt" "json" "yaml" "yml" "toml")
126
-
127
- for ext in "${text_extensions[@]}"; do
128
- while IFS= read -r -d '' file; do
129
- if [[ -x "$file" ]]; then
130
- log "WARN" "❌ Executable text file: ${file}"
131
- violations=$((violations + 1))
132
- fi
133
- done < <(find "${REPO_ROOT}" -name "*.${ext}" -executable -not -path "*/.git/*" -print0)
134
- done
135
-
136
- if [[ $violations -eq 0 ]]; then
137
- log "INFO" "✅ File permissions are appropriate"
138
- fi
139
-
140
- return $violations
141
- }
142
-
143
- # Validate shell scripts
144
- validate_shell_scripts() {
145
- log "INFO" "Validating shell scripts..."
146
-
147
- local violations=0
148
-
149
- while IFS= read -r -d '' script; do
150
- if ! shellcheck "$script" >/dev/null 2>&1; then
151
- log "WARN" "❌ ShellCheck violations in: ${script}"
152
- violations=$((violations + 1))
153
- fi
154
- done < <(find "${REPO_ROOT}" -name "*.sh" -not -path "*/.git/*" -print0)
155
-
156
- if [[ $violations -eq 0 ]]; then
157
- log "INFO" "✅ All shell scripts pass validation"
158
- fi
159
-
160
- return $violations
161
- }
162
-
163
- # Check environment variable usage
164
- check_environment_variables() {
165
- log "INFO" "Checking environment variable usage..."
166
-
167
- local violations=0
168
-
169
- # Look for unprotected variable assignments
170
- while IFS= read -r -d '' file; do
171
- # Skip binary files and specific files
172
- if file "$file" | grep -q "text" && [[ ! "$file" =~ \.(log|env)$ ]]; then
173
- # Check for variables that should use default patterns
174
- if grep -E '^[A-Z_]+=.+$' "$file" >/dev/null 2>&1; then
175
- # Check if they use proper defaulting
176
- if ! grep -E '\$\{[A-Z_]+:-[^}]*\}' "$file" >/dev/null 2>&1; then
177
- local suspicious_vars
178
- suspicious_vars=$(grep -E '^[A-Z_]+=.+$' "$file" | head -3)
179
- if [[ -n "$suspicious_vars" ]]; then
180
- log "WARN" "❌ Potential hardcoded variables in ${file}: ${suspicious_vars}"
181
- violations=$((violations + 1))
182
- fi
183
- fi
184
- fi
185
- fi
186
- done < <(find "${REPO_ROOT}" -type f -not -path "*/.git/*" -not -path "*/.github/security-policies/*" -print0)
187
-
188
- if [[ $violations -eq 0 ]]; then
189
- log "INFO" "✅ Environment variable usage is appropriate"
190
- fi
191
-
192
- return $violations
193
- }
194
-
195
- # Validate OPA policies
196
- validate_policies() {
197
- log "INFO" "Validating OPA policies..."
198
-
199
- if [[ ! -f "${POLICIES_DIR}/security.rego" ]]; then
200
- log "WARN" "❌ Security policy file not found"
201
- return 1
202
- fi
203
-
204
- if opa test "${POLICIES_DIR}" >/dev/null 2>&1; then
205
- log "INFO" "✅ OPA policies are valid"
206
- return 0
207
- else
208
- log "WARN" "❌ OPA policy validation failed"
209
- return 1
210
- fi
211
- }
212
-
213
- # Check for sensitive files
214
- check_sensitive_files() {
215
- log "INFO" "Checking for sensitive files..."
216
-
217
- local violations=0
218
- local sensitive_patterns=(
219
- "*.key"
220
- "*.pem"
221
- "*.p12"
222
- "*.pfx"
223
- "*.jks"
224
- "*.keystore"
225
- ".env"
226
- ".env.*"
227
- "credentials.json"
228
- "service-account.json"
229
- "id_rsa"
230
- "id_dsa"
231
- "id_ecdsa"
232
- "id_ed25519"
233
- )
234
-
235
- for pattern in "${sensitive_patterns[@]}"; do
236
- while IFS= read -r -d '' file; do
237
- # Skip allowed files
238
- if [[ ! "$file" =~ (environment-template\.env|\.pub$) ]]; then
239
- log "WARN" "❌ Sensitive file detected: ${file}"
240
- violations=$((violations + 1))
241
- fi
242
- done < <(find "${REPO_ROOT}" -name "${pattern}" -not -path "*/.git/*" -print0)
243
- done
244
-
245
- if [[ $violations -eq 0 ]]; then
246
- log "INFO" "✅ No sensitive files detected"
247
- fi
248
-
249
- return $violations
250
- }
251
-
252
- # Generate security report
253
- generate_report() {
254
- local total_violations="$1"
255
- local report_file="${REPO_ROOT}/security-report.md"
256
-
257
- log "INFO" "Generating security report..."
258
-
259
- cat >"${report_file}" <<EOF
260
- # Security Policy Enforcement Report
261
-
262
- **Generated:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')
263
- **Repository:** $(basename "${REPO_ROOT}")
264
- **Total Violations:** ${total_violations}
265
-
266
- ## Security Checks Performed
267
-
268
- - ✅ Secrets scanning (gitleaks + manual patterns)
269
- - ✅ File permissions validation
270
- - ✅ Shell script analysis (shellcheck)
271
- - ✅ Environment variable usage check
272
- - ✅ OPA policy validation
273
- - ✅ Sensitive files detection
274
-
275
- ## Security Score
276
-
277
- $(if [[ $total_violations -eq 0 ]]; then echo "🟢 **PASSED** - No security violations detected"; else echo "🔴 **FAILED** - ${total_violations} violations detected"; fi)
278
-
279
- ## Recommendations
280
-
281
- 1. Review any flagged violations in the audit log
282
- 2. Update hardcoded values to use environment variables
283
- 3. Ensure proper file permissions (644 for files, 755 for executables)
284
- 4. Use the provided environment template for configuration
285
- 5. Run this script regularly as part of your development workflow
286
-
287
- ## Next Steps
288
-
289
- - Fix any identified violations
290
- - Run \`scripts/security/enforce-policies.sh\` again to verify fixes
291
- - Consider setting up automated policy enforcement in CI/CD
292
-
293
- ---
294
- *This report was generated by the automated security policy enforcement system.*
295
- EOF
296
-
297
- log "INFO" "Security report generated: ${report_file}"
298
- }
299
-
300
- # Main execution
301
- main() {
302
- log "INFO" "Starting security policy enforcement..."
303
-
304
- # Initialize log file
305
- echo "# Security Audit Log - $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >"${LOG_FILE}"
306
-
307
- check_dependencies
308
-
309
- local total_violations=0
310
-
311
- # Run all checks
312
- scan_secrets || total_violations=$((total_violations + $?))
313
- check_file_permissions || total_violations=$((total_violations + $?))
314
- validate_shell_scripts || total_violations=$((total_violations + $?))
315
- check_environment_variables || total_violations=$((total_violations + $?))
316
- validate_policies || total_violations=$((total_violations + 1))
317
- check_sensitive_files || total_violations=$((total_violations + $?))
318
-
319
- # Generate report
320
- generate_report "$total_violations"
321
-
322
- # Final result
323
- if [[ $total_violations -eq 0 ]]; then
324
- echo -e "${GREEN}✅ All security checks passed!${NC}"
325
- log "INFO" "Security policy enforcement completed successfully"
326
- exit 0
327
- else
328
- echo -e "${RED}❌ Security policy enforcement failed with ${total_violations} violations${NC}"
329
- echo -e "${YELLOW}📋 Check ${LOG_FILE} for details${NC}"
330
- echo -e "${YELLOW}📋 Review security-report.md for summary${NC}"
331
- log "ERROR" "Security policy enforcement failed with ${total_violations} violations"
332
- exit 1
333
- fi
334
- }
335
-
336
- # Script entry point
337
- if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
338
- main "$@"
339
- fi
@@ -1,34 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
-
4
- if [ "${DOTFILES_FIREWALL:-}" != "1" ]; then
5
- echo "Firewall script is disabled by default."
6
- echo "Re-run with DOTFILES_FIREWALL=1 to apply."
7
- exit 1
8
- fi
9
-
10
- case "$(uname -s)" in
11
- Darwin)
12
- echo "Enabling macOS firewall..."
13
- sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
14
- sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned on
15
- sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp on
16
- sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on
17
- ;;
18
- Linux)
19
- if command -v ufw >/dev/null; then
20
- echo "Enabling UFW..."
21
- sudo ufw default deny incoming
22
- sudo ufw default allow outgoing
23
- sudo ufw allow OpenSSH
24
- sudo ufw --force enable
25
- else
26
- echo "ufw not installed. Install ufw and re-run."
27
- exit 1
28
- fi
29
- ;;
30
- *)
31
- echo "Unsupported OS for firewall setup."
32
- exit 1
33
- ;;
34
- esac
@@ -1,57 +0,0 @@
1
- #!/usr/bin/env bash
2
- # MIT License
3
- # Copyright (c) 2026 Sebastien Rousseau
4
- # See LICENSE file for details.
5
-
6
- # Script: lock-configs.sh
7
- # Description: Toggles immutability flags on critical configuration files.
8
- # Usage: lock-configs [lock|unlock]
9
-
10
- set -e
11
-
12
- ACTION="${1:-lock}"
13
- CRITICAL_FILES=(
14
- "$HOME/.zshrc"
15
- "$HOME/.bashrc"
16
- "$HOME/.profile"
17
- )
18
-
19
- # Determine OS command for immutability
20
- if [[ "$OSTYPE" == "darwin"* ]]; then
21
- LOCK_CMD="chflags uchg"
22
- UNLOCK_CMD="chflags nouchg"
23
- CHECK_CMD="ls -lO"
24
- else
25
- # Linux (requires root usually, but we'll try)
26
- if command -v chattr >/dev/null; then
27
- LOCK_CMD="sudo chattr +i"
28
- UNLOCK_CMD="sudo chattr -i"
29
- CHECK_CMD="lsattr"
30
- else
31
- echo " 'chattr' not found. Cannot set immutability on Linux without it."
32
- exit 1
33
- fi
34
- fi
35
-
36
- if [[ "$ACTION" == "lock" ]]; then
37
- echo " Locking critical configuration files..."
38
- CMD="$LOCK_CMD"
39
- elif [[ "$ACTION" == "unlock" ]]; then
40
- echo " Unlocking critical configuration files..."
41
- CMD="$UNLOCK_CMD"
42
- else
43
- echo "Usage: $0 [lock|unlock]"
44
- exit 1
45
- fi
46
-
47
- for file in "${CRITICAL_FILES[@]}"; do
48
- if [[ -f "$file" ]]; then
49
- echo "Processing: $file"
50
- $CMD "$file" || echo "️ Failed to modify flags for $file (permission denied?)"
51
- fi
52
- done
53
-
54
- echo "Done. Environment state:"
55
- for file in "${CRITICAL_FILES[@]}"; do
56
- [[ -f "$file" ]] && $CHECK_CMD "$file"
57
- done
@@ -1,33 +0,0 @@
1
- #!/bin/sh
2
- set -e
3
-
4
- if [ "${DOTFILES_LOCK:-}" != "1" ]; then
5
- echo "Lock screen script is disabled by default."
6
- echo "Re-run with DOTFILES_LOCK=1 to apply."
7
- exit 1
8
- fi
9
-
10
- case "$(uname -s)" in
11
- Linux)
12
- if command -v gsettings >/dev/null; then
13
- echo "Enabling screen lock and idle timeout..."
14
- gsettings set org.gnome.desktop.screensaver lock-enabled true || true
15
- gsettings set org.gnome.desktop.session idle-delay 300 || true
16
- gsettings set org.gnome.desktop.screensaver lock-delay 0 || true
17
- else
18
- echo "gsettings not found."
19
- exit 1
20
- fi
21
- ;;
22
- Darwin)
23
- echo "Enabling lock on sleep and screensaver (macOS)..."
24
- defaults write com.apple.screensaver askForPassword -int 1 || true
25
- defaults write com.apple.screensaver askForPasswordDelay -int 0 || true
26
- # 5-minute idle timeout
27
- defaults -currentHost write com.apple.screensaver idleTime -int 300 || true
28
- ;;
29
- *)
30
- echo "Unsupported OS for lock screen hardening."
31
- exit 1
32
- ;;
33
- esac