This document explains the two helper scripts included in this skeleton vault in 000-Meta/001-Settings:
-
create_vault.sh
Bootstraps a brand-new Obsidian vault (main + personal + workspace) from predefined skeleton repositories, initializes Git, and pushes to GitHub. -
secure_vault.sh
Enables transparent AES-256-CBC encryption of all.mdfiles via Git’s clean/smudge filters (using PBKDF2 with 100 000 iterations). Your notes stay plaintext locally, but only encrypted blobs ever land on GitHub.
- Curl
- Git
- OpenSSL (≥ 1.1)
- A shared passphrase that you’ll enter once per clone to unlock encryption.
To create a secure Obsidian vault with personal and workspace submodules, you can simply execute:
curl -fsSL https://raw.githubusercontent.com/Kakudou/Obsidian_Skeleton-Main_Vault/main/000-Meta/001-Settings/create_vault.sh | sh -s -- <vault_name> <github_user>- Clone three skeleton repos (main, personal, workspace)
- Initialize each as a fresh Git repo
- Commit & push to GitHub under your account
- Add the personal & workspace vaults as submodules into the main vault
sh create_vault.sh <vault_name> <github_user><vault_name>— name of your new vault (e.g.MyNotes)<github_user>— your GitHub username
The script will prompt you before pushing each repository to GitHub. After it completes, you’ll have:
MyNotes/ ← main vault
└── 100-Personal/ ← personal-vault submodule
└── 600-Workspace/ ← workspace-vault submodule
-
Prompt once for your vault passphrase
-
Configure Git filter drivers (
clean&smudge) to:- Encrypt any changed/new
*.mdwith AES-256-CBC + PBKDF2 (100 000 iterations, no salt) ongit add/push - Decrypt them back on
git checkout/pull
- Encrypt any changed/new
-
Commit the needed
.gitattributesentry so submodules and the main vault all use the same filter
# Inside your vault or submodule folder:
sh /path/to/secure_vault.shOr, to target another path:
sh /path/to/secure_vault.sh /abs/path/to/repo-
You’ll be prompted:
Enter vault passphrase: -
The script writes the filter into
.git/configand ensures:-
.gitattributescontains:*.md filter=vault -
Your commit history and GitHub only see AES-encrypted blobs.
-
-
Future
git statuswill only show files you actually edit.
-
Skeleton cloning
create_vault.shpulls from your predefined GitHub skeletons, resets history, and pushes under your account. -
Git submodules Personal & workspace vaults become subdirectories tracked as submodules for separation of concerns.
-
Transparent encryption
secure_vault.shsets up:[filter "vault"] clean = openssl enc -aes-256-cbc -md sha256 -pbkdf2 -iter 100000 -nosalt -pass pass:<your-passphrase> smudge = openssl enc -d -aes-256-cbc -md sha256 -pbkdf2 -iter 100000 -nosalt -pass pass:<your-passphrase> required = true
-nosaltensures deterministic ciphertext so Git only re-encrypts changed files.- PBKDF2 + 100 000 iterations avoids deprecated KDF warnings while keeping your passphrase private.
Feel free to:
- Adapt filter settings (cipher, iterations)
- Extend
create_vault.shfor additional submodules or hooks - Share improvements back to the Obsidian community!