Skip to content

Commit 6d3c52e

Browse files
author
sheeek
committed
feat: Add SSH key configuration and OS-aware Tailscale installation
Features: - Add clawdbot_ssh_keys variable for SSH access configuration - Split Tailscale installation into OS-specific tasks - Tailscale support for macOS (Homebrew Cask) - Tailscale support for Linux (apt repository) - Automatic SSH directory creation with proper permissions - SSH key status messages and warnings Documentation: - Add comprehensive configuration guide (docs/configuration.md) - Document all available variables with examples - Add security best practices for SSH keys and Tailscale - Add environment-specific configuration examples - Update README with configuration section and links Files: - roles/clawdbot/defaults/main.yml - Add clawdbot_ssh_keys variable - roles/clawdbot/tasks/user.yml - Add SSH key configuration - roles/clawdbot/tasks/tailscale.yml - Refactor to orchestrator - roles/clawdbot/tasks/tailscale-linux.yml - Linux-specific Tailscale - roles/clawdbot/tasks/tailscale-macos.yml - macOS-specific Tailscale - docs/configuration.md - Complete configuration guide - README.md - Add configuration section and documentation links Linting: - yamllint: PASSED - ansible-lint: PASSED (production profile)
1 parent a94c4c2 commit 6d3c52e

8 files changed

Lines changed: 754 additions & 60 deletions

File tree

README.md

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ Verify: `nmap -p- YOUR_SERVER_IP` should show only port 22 open.
122122

123123
## Documentation
124124

125-
- [Security Architecture](docs/security.md)
126-
- [Technical Details](docs/architecture.md)
127-
- [Troubleshooting](docs/troubleshooting.md)
128-
- [Agent Guidelines](AGENTS.md)
125+
- [Configuration Guide](docs/configuration.md) - All configuration options
126+
- [Development Mode](docs/development-mode.md) - Build from source
127+
- [Security Architecture](docs/security.md) - Security details
128+
- [Technical Details](docs/architecture.md) - Architecture overview
129+
- [Troubleshooting](docs/troubleshooting.md) - Common issues
130+
- [Agent Guidelines](AGENTS.md) - AI agent instructions
129131

130132
## Requirements
131133

@@ -197,6 +199,82 @@ This will:
197199
- Symlink binary to `~/.local/bin/clawdbot`
198200
- Add development aliases to `.bashrc`
199201

202+
## Configuration Options
203+
204+
All configuration variables can be found in [`roles/clawdbot/defaults/main.yml`](roles/clawdbot/defaults/main.yml).
205+
206+
You can override them in three ways:
207+
208+
### 1. Via Command Line
209+
210+
```bash
211+
ansible-playbook playbook.yml --ask-become-pass \
212+
-e clawdbot_install_mode=development \
213+
-e "clawdbot_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
214+
```
215+
216+
### 2. Via Variables File
217+
218+
```bash
219+
# Create vars.yml
220+
cat > vars.yml << EOF
221+
clawdbot_install_mode: development
222+
clawdbot_ssh_keys:
223+
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGxxxxxxxx user@host"
224+
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB... user@host"
225+
clawdbot_repo_url: "https://github.com/YOUR_USERNAME/clawdbot.git"
226+
clawdbot_repo_branch: "feature-branch"
227+
tailscale_authkey: "tskey-auth-xxxxxxxxxxxxx"
228+
EOF
229+
230+
# Use it
231+
ansible-playbook playbook.yml --ask-become-pass -e @vars.yml
232+
```
233+
234+
### 3. Edit Defaults Directly
235+
236+
Edit `roles/clawdbot/defaults/main.yml` before running the playbook.
237+
238+
### Available Variables
239+
240+
| Variable | Default | Description |
241+
|----------|---------|-------------|
242+
| `clawdbot_user` | `clawdbot` | System user name |
243+
| `clawdbot_home` | `/home/clawdbot` | User home directory |
244+
| `clawdbot_install_mode` | `release` | `release` or `development` |
245+
| `clawdbot_ssh_keys` | `[]` | List of SSH public keys |
246+
| `clawdbot_repo_url` | `https://github.com/clawdbot/clawdbot.git` | Git repository (dev mode) |
247+
| `clawdbot_repo_branch` | `main` | Git branch (dev mode) |
248+
| `tailscale_authkey` | `""` | Tailscale auth key for auto-connect |
249+
| `nodejs_version` | `22.x` | Node.js version to install |
250+
251+
See [`roles/clawdbot/defaults/main.yml`](roles/clawdbot/defaults/main.yml) for the complete list.
252+
253+
### Common Configuration Examples
254+
255+
#### SSH Keys for Remote Access
256+
257+
```bash
258+
ansible-playbook playbook.yml --ask-become-pass \
259+
-e "clawdbot_ssh_keys=['ssh-ed25519 AAAAC3... user@host']"
260+
```
261+
262+
#### Development Mode with Custom Repository
263+
264+
```bash
265+
ansible-playbook playbook.yml --ask-become-pass \
266+
-e clawdbot_install_mode=development \
267+
-e clawdbot_repo_url=https://github.com/YOUR_USERNAME/clawdbot.git \
268+
-e clawdbot_repo_branch=feature-branch
269+
```
270+
271+
#### Tailscale Auto-Connect
272+
273+
```bash
274+
ansible-playbook playbook.yml --ask-become-pass \
275+
-e tailscale_authkey=tskey-auth-xxxxxxxxxxxxx
276+
```
277+
200278
## License
201279

202280
MIT - see [LICENSE](LICENSE)

RELEASE_NOTES_v2.0.0.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Release v2.0.0 - Multi-OS Support & Critical Fixes
2+
3+
## 🎉 Major Release
4+
5+
This release adds **multi-OS support** (macOS + Linux), **development mode**, and fixes **all critical issues** reported by users.
6+
7+
### ✨ New Features
8+
9+
#### Multi-OS Support
10+
-**macOS support** alongside Debian/Ubuntu
11+
-**Homebrew** automatically installed on both platforms
12+
- ✅ OS-specific tasks for clean separation
13+
- ✅ Automatic OS detection with proper fallback
14+
15+
#### Installation Modes
16+
-**Release Mode** (default): `pnpm install -g clawdbot@latest`
17+
-**Development Mode**: Clone repo, build from source, symlink binary
18+
- ✅ Switch with `-e clawdbot_install_mode=development`
19+
- ✅ Development aliases: `clawdbot-rebuild`, `clawdbot-dev`, `clawdbot-pull`
20+
21+
### 🐛 Critical Bug Fixes
22+
23+
All issues from user feedback resolved:
24+
25+
1.**DBus Session Bus Errors**
26+
- Auto-configured `loginctl enable-linger`
27+
- Dynamic `XDG_RUNTIME_DIR=/run/user/$(id -u)`
28+
- Proper `DBUS_SESSION_BUS_ADDRESS` setup
29+
- No more manual `eval $(dbus-launch --sh-syntax)` needed!
30+
31+
2.**User Switch Command**
32+
- Fixed from `sudo -i -u clawdbot` to `sudo su - clawdbot`
33+
- Ensures proper login shell with environment
34+
35+
3.**Homebrew Integration**
36+
- Installed for both Linux and macOS
37+
- Added to PATH in both `.bashrc` and `.zshrc`
38+
- `brew shellenv` properly configured
39+
40+
4.**PNPM Configuration**
41+
- `PNPM_HOME` properly set in shell configs
42+
- PATH includes pnpm directories
43+
- Correct permissions on `~/.local/share/pnpm`
44+
45+
5.**User-ID Dynamic**
46+
- No longer hardcoded to 1000
47+
- Dynamically determined with `id -u`
48+
49+
### 🔧 Improvements
50+
51+
-**Better onboarding**: Recommends `clawdbot onboard --install-daemon`
52+
-**No auto-config**: Config files created by clawdbot itself
53+
-**Enhanced security**: systemd service hardening
54+
-**Linting**: yamllint & ansible-lint production profile passed
55+
56+
### 📦 Installation
57+
58+
#### Quick Start (Release Mode)
59+
```bash
60+
curl -fsSL https://raw.githubusercontent.com/clawdbot/clawdbot-ansible/main/install.sh | bash
61+
```
62+
63+
#### Development Mode
64+
```bash
65+
git clone https://github.com/clawdbot/clawdbot-ansible.git
66+
cd clawdbot-ansible
67+
./run-playbook.sh -e clawdbot_install_mode=development
68+
```
69+
70+
### 📚 Documentation
71+
72+
- [README.md](README.md) - Getting started
73+
- [CHANGELOG.md](CHANGELOG.md) - Full changelog
74+
- [UPGRADE_NOTES.md](UPGRADE_NOTES.md) - Technical details
75+
- [docs/development-mode.md](docs/development-mode.md) - Development guide
76+
77+
### ⚠️ Breaking Changes
78+
79+
1. **User switch command changed**: Use `sudo su - clawdbot` instead of `sudo -i -u clawdbot`
80+
2. **No auto-configuration**: Config files no longer auto-generated, use `clawdbot onboard`
81+
3. **No auto-service**: systemd service not auto-installed, use `--install-daemon` flag
82+
83+
### 🔄 Migration
84+
85+
For existing installations:
86+
```bash
87+
# Add environment variables
88+
echo 'export XDG_RUNTIME_DIR=/run/user/$(id -u)' >> ~/.bashrc
89+
echo 'export PNPM_HOME="$HOME/.local/share/pnpm"' >> ~/.bashrc
90+
91+
# Enable lingering
92+
sudo loginctl enable-linger clawdbot
93+
94+
# Add Homebrew (Linux)
95+
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
96+
97+
# Reload
98+
source ~/.bashrc
99+
100+
# Reinstall clawdbot
101+
pnpm install -g clawdbot@latest
102+
```
103+
104+
### 📊 Testing
105+
106+
- ✅ yamllint: **PASSED**
107+
- ✅ ansible-lint: **PASSED** (production profile)
108+
- ✅ Tested on Debian 11/12
109+
- ✅ Tested on Ubuntu 20.04/22.04
110+
- ⚠️ macOS framework ready (needs real hardware testing)
111+
112+
### 🙏 Thanks
113+
114+
Special thanks to early adopters who provided feedback on the DBus and user switching issues!
115+
116+
---
117+
118+
**Full Changelog**: https://github.com/clawdbot/clawdbot-ansible/blob/main/CHANGELOG.md

0 commit comments

Comments
 (0)