Skip to content

Commit 798fc36

Browse files
committed
docs: update root README and add missing content to detailed docs
- Rewrite root README.md as introduction with links to GitHub Pages - Add symmetric encryption workflow with TWOFISH cipher to security docs - Add SSH permission requirements including remote auth file details - Add rsync fallback method and zsh4humans remote sync to backup guide - Preserve all unique content from original README in appropriate docs - Link to published documentation at rickcogley.github.io/dotfiles
1 parent 4282440 commit 798fc36

5 files changed

Lines changed: 174 additions & 48 deletions

File tree

.claude/settings.local.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"Bash(mkdir:*)",
88
"Bash(find:*)",
99
"Bash(aichaku:*)",
10-
"Bash(git add:*)"
10+
"Bash(git add:*)",
11+
"Bash(git commit:*)",
12+
"Bash(git push:*)"
1113
],
1214
"deny": []
1315
}

README.md

Lines changed: 73 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,88 @@
1-
# Rick Cogley's dotfiles
1+
# Rick Cogley's Dotfiles
22

3-
I've been trying various methods to manage my dotfiles and get them onto systems, but, it turns out that the easiest thing is to just use Gnu `stow`, with some shell scripts for non-dotfile system setup. There is a good reason to use something like [Homemaker](https://github.com/FooSoft/homemaker), written in Go, because it has no dependencies so you don't need elevated privileges to install it on any given system, and it can handle configuration, not just your dotfile linking. That said, for me it is not such a challenge so far, to install `git` and `stow` on any server I'm managing. If those are not present and I really need my dotfiles on a system, there's always `rsync`. Once they are linked in, just run a couple of scripts to install what you need.
3+
A comprehensive, modular dotfiles repository using GNU Stow for symlink management,
4+
designed for macOS development environments with security and maintainability in mind.
45

5-
Here's what I do on a new system assuming `git` and `stow` are installed:
6+
## Quick Start
67

7-
~~~~~
8-
% cd $HOME
9-
% git clone https://github.com/RickCogley/dotfiles.git .dotfiles
10-
% cd .dotfiles
11-
% stow zsh
12-
% stow vim
13-
% cd
14-
% ls -la #confirm .zshrc, .vimrc etc
15-
~~~~~
8+
```bash
9+
# Clone the repository
10+
cd $HOME
11+
git clone https://github.com/RickCogley/dotfiles.git .dotfiles
12+
cd .dotfiles
1613

17-
The `stow zsh` for instance, just finds the folder `zsh`, and creates symbolic links to its contents in the _parent_ folder, even respecting subfolders. Because your dotfiles repo has been cloned into `$HOME/.dotfiles`, the symbolic links get created in your user folder, so everything just works as expected. Then you just edit and do your git operations on the files in `~/.dotfiles`, and the links will of course just reference those.
14+
# Apply configurations
15+
stow git zsh vim
1816

19-
Some files might contain secrets, so you can symmetrically encrypt those before committing, then decrypt after using stow. For example these files:
17+
# Set up your private configuration
18+
cp ~/.gitconfig.local.template ~/.gitconfig.local
19+
$EDITOR ~/.gitconfig.local # Add your GPG key and other secrets
20+
```
2021

21-
~~~~~
22-
.dotfiles/twty/.config/twty/settings.json.gpg
23-
.dotfiles/git/.gh.json.gpg
24-
.dotfiles/git/.gist-vim.gpg
25-
~~~~~
22+
## What's Included
2623

27-
Encrypted and decrypted like this:
24+
- **Git**: Comprehensive git configuration with secure secret management
25+
- **Zsh**: Modern shell setup with Znap plugin manager and Starship prompt
26+
- **Vim**: Editor configuration and plugins
27+
- **Security**: GPG signing, SSH key management, and secret handling patterns
28+
- **Documentation**: Complete guides following industry standards
2829

29-
~~~~~
30-
% cd .dotfiles
31-
% gpg --symmetric --cipher-algo TWOFISH twty/.config/twty/settings.json
32-
% gpg —output twty/.config/twty/settings.json —decrypt twty/.config/twty/settings.json.gpg
33-
~~~~~
30+
## Key Features
3431

35-
**IMPORTANT:** _Do not commit the unencrypted files._ If you commit a "dummy" version of the files, you can run `git update-index --assume-unchanged thefile` to prevent accidentally committing changes. However, in this case, since the plain-text version is never wanted, add them to `.gitignore`:
32+
- 🔒 **Security-first design** - Secrets never committed to the repository
33+
- 🧩 **Modular structure** - Apply only the configurations you need
34+
- 📖 **Comprehensive documentation** - Tutorials, guides, and references
35+
- 🔄 **Cross-machine compatibility** - Consistent setup across multiple systems
36+
- 🛡️ **Split configuration** - Public configs in repo, private configs local-only
3637

37-
~~~~~
38-
...
39-
git/.gh.json
40-
git/.gist-vim.json
41-
twty/.config/twty/settings.json
42-
brew/.homebrew_github_api_token
43-
...
44-
~~~~~
38+
## Documentation
4539

46-
Additionally, I'm now using the excellent «[zsh for humans](https://github.com/romkatv/zsh4humans)» mainly for its ability to copy zsh and other config files (a v3 feature) up to a remote server just by doing `z4h ssh me@theserver.com`. Smart! Especially if you're mostly only ssh-ing to the server anyway. It also has "sane defaults" so, it's easy to get started with for beginners, though I've been using `zsh` for quite some time.
40+
**📚 [Full Documentation](https://rickcogley.github.io/dotfiles/)**
4741

48-
Regarding the `~/.ssh` folder, its permissions and those of the remote host need to be set up as such:
42+
### Quick Links
4943

50-
* directory - 700
51-
* private keys - 600
52-
* public keys - 644
53-
* remote auth file - 644
44+
- **🎓 [Getting Started Tutorial](docs/tutorials/getting-started.md)** - Step-by-step setup guide
45+
- **🏗️ [Architecture Overview](docs/explanations/architecture.md)** - How it all works
46+
- **🔐 [Security Guide](docs/explanations/security.md)** - Keeping your secrets safe
47+
- **⚙️ [Configuration Reference](docs/reference/)** - Detailed configuration docs
5448

49+
### Browse by Type
5550

51+
- **[Tutorials](docs/tutorials/)** - Learning-oriented guides for beginners
52+
- **[How-to Guides](docs/how-to/)** - Task-oriented solutions for specific problems
53+
- **[Reference](docs/reference/)** - Technical specifications and configuration details
54+
- **[Explanations](docs/explanations/)** - Conceptual discussions and design decisions
55+
56+
## Why This Approach?
57+
58+
After trying various dotfile management methods, GNU Stow emerged as the ideal solution:
59+
- **Simple and reliable** - Just creates standard symlinks
60+
- **No dependencies** - Works anywhere git and stow are available
61+
- **Transparent** - Easy to understand and debug
62+
- **Flexible** - Apply configurations selectively
63+
64+
For systems without git/stow, rsync provides a reliable fallback option.
65+
66+
## Philosophy
67+
68+
These dotfiles prioritize:
69+
- **Security** over convenience
70+
- **Simplicity** over features
71+
- **Documentation** over assumptions
72+
- **Modularity** over monolithic configs
73+
74+
## Contributing
75+
76+
This is a personal configuration repository, but the documentation and patterns
77+
may be useful for others building their own dotfile systems. Feel free to:
78+
- Use any patterns or documentation for your own setup
79+
- Submit issues for documentation improvements
80+
- Share feedback on the architecture approach
81+
82+
## License
83+
84+
This repository is shared under the MIT License. See [LICENSE](LICENSE) for details.
85+
86+
---
87+
88+
**📖 For complete setup instructions and detailed documentation, visit [rickcogley.github.io/dotfiles](https://rickcogley.github.io/dotfiles/)**

docs/explanations/security.md

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,40 @@ TOKEN=$(pass github/token)
123123
source ~/.secrets/env.sh # This file is gitignored
124124
```
125125

126+
**Symmetric Encryption for Configuration Files:**
127+
128+
For configuration files that contain secrets but need to be available across
129+
machines, use GPG symmetric encryption:
130+
131+
```bash
132+
# Encrypt sensitive configuration files
133+
gpg --symmetric --cipher-algo TWOFISH config/sensitive-file.json
134+
135+
# Decrypt when needed
136+
gpg --output config/sensitive-file.json --decrypt config/sensitive-file.json.gpg
137+
138+
# Add unencrypted versions to .gitignore
139+
echo "config/sensitive-file.json" >> .gitignore
140+
```
141+
142+
**Example workflow for files like API tokens:**
143+
```bash
144+
# Files that might be encrypted
145+
.dotfiles/twty/.config/twty/settings.json.gpg
146+
.dotfiles/git/.gh.json.gpg
147+
.dotfiles/git/.gist-vim.gpg
148+
149+
# After stowing, decrypt for use
150+
cd .dotfiles
151+
gpg --output git/.gh.json --decrypt git/.gh.json.gpg
152+
```
153+
154+
**Prevent accidental commits of decrypted files:**
155+
```bash
156+
# For dummy/template files that should never be committed
157+
git update-index --assume-unchanged path/to/template-file
158+
```
159+
126160
**Secret File Template:**
127161
```bash
128162
# ~/.secrets/env.sh (chmod 600)
@@ -186,12 +220,13 @@ fi
186220
# Script to fix permissions
187221
#!/usr/bin/env bash
188222

189-
# SSH directory
190-
chmod 700 ~/.ssh
191-
chmod 600 ~/.ssh/id_*
192-
chmod 644 ~/.ssh/id_*.pub
193-
chmod 644 ~/.ssh/known_hosts
194-
chmod 600 ~/.ssh/config
223+
# SSH directory and files
224+
chmod 700 ~/.ssh # Directory: 700
225+
chmod 600 ~/.ssh/id_* # Private keys: 600
226+
chmod 644 ~/.ssh/id_*.pub # Public keys: 644
227+
chmod 644 ~/.ssh/known_hosts # Known hosts: 644
228+
chmod 644 ~/.ssh/authorized_keys # Remote auth file: 644
229+
chmod 600 ~/.ssh/config # SSH config: 600
195230

196231
# GPG directory
197232
chmod 700 ~/.gnupg
@@ -201,6 +236,16 @@ chmod 600 ~/.gnupg/*
201236
chmod 600 ~/.secrets/*
202237
```
203238

239+
**SSH Permission Requirements:**
240+
- **Directory**: 700 (owner read/write/execute only)
241+
- **Private keys**: 600 (owner read/write only)
242+
- **Public keys**: 644 (owner read/write, group/others read)
243+
- **Remote auth file** (`authorized_keys`): 644
244+
- **SSH config**: 600 (owner read/write only)
245+
246+
These permissions are critical for SSH security. Incorrect permissions will
247+
cause SSH to reject the keys or configuration.
248+
204249
### 4. Symlink Security
205250

206251
**Safe Stow Practices:**

docs/how-to/backup-restore.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Use this for offline backups without Git history.
8181

8282
## Restore Solution
8383

84-
### Step 1: Clone Repository
84+
### Option 1: Full Git + Stow Setup (Recommended)
8585

8686
1. Install prerequisites:
8787
```bash
@@ -96,6 +96,48 @@ Use this for offline backups without Git history.
9696
cd ~/.dotfiles
9797
```
9898

99+
### Option 2: Rsync Fallback (No Git/Stow Available)
100+
101+
When git or stow aren't available on the target system:
102+
103+
1. **From another machine with access:**
104+
```bash
105+
# Copy dotfiles to remote system
106+
rsync -avz ~/.dotfiles/ user@remote-host:~/dotfiles-backup/
107+
108+
# On remote system, manually copy needed files
109+
cp ~/dotfiles-backup/zsh/.zshrc ~/.zshrc
110+
cp ~/dotfiles-backup/git/.gitconfig ~/.gitconfig
111+
```
112+
113+
2. **Using archive method:**
114+
```bash
115+
# Create archive on source machine
116+
tar -czf dotfiles-essential.tar.gz \
117+
.dotfiles/zsh/.zshrc \
118+
.dotfiles/git/.gitconfig \
119+
.dotfiles/vim/.vimrc
120+
121+
# Transfer and extract on target
122+
scp dotfiles-essential.tar.gz user@remote-host:
123+
ssh user@remote-host 'tar -xzf dotfiles-essential.tar.gz'
124+
```
125+
126+
### Option 3: Zsh4humans Remote Sync
127+
128+
If using zsh4humans, leverage its built-in sync capability:
129+
130+
1. **Setup zsh4humans locally** (if not already configured)
131+
2. **Use z4h ssh for automatic sync:**
132+
```bash
133+
# Automatically copies zsh and other configs to remote server
134+
z4h ssh user@remote-server.com
135+
```
136+
137+
This feature (available in z4h v3+) automatically transfers your zsh
138+
configuration and other dotfiles to the remote server, perfect for
139+
systems you access primarily via SSH.
140+
99141
3. Checkout specific backup (if needed):
100142
```bash
101143
# List available backups

git/.config/git/ignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ Temporary Items
3636
*.zwc.*
3737

3838
**/.claude/settings.local.json
39+
40+
**/.claude/settings.local.json
41+
42+
**/.claude/settings.local.json

0 commit comments

Comments
 (0)