@bostonuniversity/buwp-local 0.6.3 → 0.7.0
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.
- package/bin/buwp-local.js +9 -0
- package/docs/CHANGELOG.md +14 -0
- package/docs/COMMANDS.md +40 -0
- package/docs/MIGRATION_FROM_VM.md +1 -1
- package/docs/ROADMAP.md +19 -1
- package/lib/commands/destroy.js +1 -1
- package/lib/commands/init.js +37 -35
- package/lib/commands/update.js +113 -0
- package/package.json +2 -2
- package/.buwp-local.json +0 -22
- package/MULTI_PROJECT_GUIDE.md +0 -929
- package/PROJECT_OVERVIEW.md +0 -307
- package/QUICK_REFERENCE.md +0 -234
- package/ROADMAP.md +0 -363
- package/USAGE.md +0 -324
- package/docker-compose.yml +0 -106
- package/docs/MULTI_PROJECT.md +0 -516
- package/feedback-from-0-6-1.md +0 -16
package/ROADMAP.md
DELETED
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
# buwp-local Development Roadmap
|
|
2
|
-
|
|
3
|
-
This is a historical document, see the current roadmap in the `docs/ROADMAP.md` file.
|
|
4
|
-
|
|
5
|
-
## ✅ Phase 1: Core Infrastructure (Complete)
|
|
6
|
-
|
|
7
|
-
**Status:** Shipped ✅
|
|
8
|
-
**Date:** November 2025
|
|
9
|
-
|
|
10
|
-
### Features Delivered
|
|
11
|
-
- [x] CLI framework with Commander.js
|
|
12
|
-
- [x] Configuration management system
|
|
13
|
-
- [x] Docker Compose generation with js-yaml
|
|
14
|
-
- [x] Core commands: start, stop, destroy, logs, config
|
|
15
|
-
- [x] Environment variable support (.env.local)
|
|
16
|
-
- [x] Volume mapping for local development
|
|
17
|
-
- [x] Service toggles (Redis, S3, Shibboleth)
|
|
18
|
-
- [x] Configuration validation
|
|
19
|
-
- [x] Comprehensive documentation
|
|
20
|
-
|
|
21
|
-
### Outcome
|
|
22
|
-
**20+ developers** can set up local WordPress environments with a single command.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## ✅ Phase 1.5: Multi-Project Support (Complete)
|
|
27
|
-
|
|
28
|
-
**Status:** Shipped ✅
|
|
29
|
-
**Date:** November 2025
|
|
30
|
-
**Trigger:** Real-world testing feedback
|
|
31
|
-
|
|
32
|
-
### Features Delivered
|
|
33
|
-
- [x] **Unique project names** - Based on directory name
|
|
34
|
-
- [x] **Isolated volumes** - Each project gets own database and WordPress
|
|
35
|
-
- [x] **Smart config initialization**
|
|
36
|
-
- [x] `--plugin` flag for plugin development
|
|
37
|
-
- [x] `--mu-plugin` flag for mu-plugin development
|
|
38
|
-
- [x] `--theme` flag for theme development
|
|
39
|
-
- [x] **Auto-generated mappings** - Correct paths without manual typing
|
|
40
|
-
- [x] **Multi-project documentation** - Complete usage guide
|
|
41
|
-
|
|
42
|
-
### Outcome
|
|
43
|
-
Developers can **run multiple projects simultaneously** with complete isolation.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## 🚀 Phase 2: Developer Experience (Planned)
|
|
48
|
-
|
|
49
|
-
**Status:** In Planning
|
|
50
|
-
**Timeline:** 2-4 weeks
|
|
51
|
-
**Priority:** High
|
|
52
|
-
|
|
53
|
-
### Proposed Features
|
|
54
|
-
|
|
55
|
-
#### 2.1 WP-CLI Proxy ⭐
|
|
56
|
-
```bash
|
|
57
|
-
buwp-local wp plugin list
|
|
58
|
-
buwp-local wp db export backup.sql
|
|
59
|
-
buwp-local wp user create testuser test@example.com
|
|
60
|
-
```
|
|
61
|
-
**Impact:** Direct WordPress CLI access without Docker exec
|
|
62
|
-
**Effort:** Low (2-3 days)
|
|
63
|
-
|
|
64
|
-
#### 2.2 Project Listing
|
|
65
|
-
```bash
|
|
66
|
-
buwp-local list
|
|
67
|
-
# Output:
|
|
68
|
-
# ACTIVE PROJECTS:
|
|
69
|
-
# ├─ bu-custom-analytics (http://bu-custom-analytics.local)
|
|
70
|
-
# ├─ bu-slideshow (http://bu-slideshow.local:8081)
|
|
71
|
-
# └─ responsive-framework (http://responsive-framework.local:8082)
|
|
72
|
-
```
|
|
73
|
-
**Impact:** Quick overview of running projects
|
|
74
|
-
**Effort:** Low (1-2 days)
|
|
75
|
-
|
|
76
|
-
#### 2.3 Health Checks & Status
|
|
77
|
-
```bash
|
|
78
|
-
buwp-local status
|
|
79
|
-
# Output:
|
|
80
|
-
# Project: bu-custom-analytics
|
|
81
|
-
# Status: Running
|
|
82
|
-
# WordPress: Ready (v6.4)
|
|
83
|
-
# Database: Connected
|
|
84
|
-
# Services: wordpress, db, redis, s3proxy
|
|
85
|
-
# URLs: http://bu-custom-analytics.local
|
|
86
|
-
```
|
|
87
|
-
**Impact:** Better visibility into project state
|
|
88
|
-
**Effort:** Medium (3-4 days)
|
|
89
|
-
|
|
90
|
-
#### 2.4 Auto-Port Assignment
|
|
91
|
-
```bash
|
|
92
|
-
buwp-local config --init --plugin --auto-ports
|
|
93
|
-
# Automatically finds available ports
|
|
94
|
-
# Suggests non-conflicting port configuration
|
|
95
|
-
```
|
|
96
|
-
**Impact:** Eliminates port conflict errors
|
|
97
|
-
**Effort:** Medium (3-4 days)
|
|
98
|
-
|
|
99
|
-
#### 2.5 Enhanced Credential Management
|
|
100
|
-
- macOS Keychain integration (using `security` command)
|
|
101
|
-
- Windows Credential Manager support
|
|
102
|
-
- Cross-platform credential storage
|
|
103
|
-
- Secure credential prompts
|
|
104
|
-
|
|
105
|
-
**Impact:** Better security, easier credential management
|
|
106
|
-
**Effort:** High (5-7 days)
|
|
107
|
-
|
|
108
|
-
### Team Testing Needed
|
|
109
|
-
Before Phase 2 implementation, gather feedback on:
|
|
110
|
-
- Which features are most valuable?
|
|
111
|
-
- Pain points in current workflow?
|
|
112
|
-
- Additional features needed?
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## 🔮 Phase 3: Advanced Features (Future)
|
|
117
|
-
|
|
118
|
-
**Status:** Conceptual
|
|
119
|
-
**Timeline:** TBD
|
|
120
|
-
**Priority:** Medium
|
|
121
|
-
|
|
122
|
-
### Potential Features
|
|
123
|
-
|
|
124
|
-
#### 3.1 Automatic /etc/hosts Management
|
|
125
|
-
```bash
|
|
126
|
-
buwp-local start
|
|
127
|
-
# Automatically adds hostname to /etc/hosts (requires sudo)
|
|
128
|
-
# Removes on destroy
|
|
129
|
-
```
|
|
130
|
-
**Consideration:** Requires elevated permissions
|
|
131
|
-
|
|
132
|
-
#### 3.2 SSL Certificate Generation
|
|
133
|
-
```bash
|
|
134
|
-
buwp-local config --ssl
|
|
135
|
-
# Generates local SSL certificates with mkcert
|
|
136
|
-
# Enables HTTPS without browser warnings
|
|
137
|
-
```
|
|
138
|
-
**Consideration:** Requires mkcert installation
|
|
139
|
-
|
|
140
|
-
#### 3.3 Database Backup & Restore
|
|
141
|
-
```bash
|
|
142
|
-
buwp-local backup
|
|
143
|
-
buwp-local restore backup-2025-11-10.sql
|
|
144
|
-
buwp-local backup --auto # Daily automatic backups
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
#### 3.4 Preset Configurations
|
|
148
|
-
```bash
|
|
149
|
-
buwp-local config --init --preset bu-standard
|
|
150
|
-
# Loads common BU settings
|
|
151
|
-
# Pre-configured services
|
|
152
|
-
# Standard environment variables
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
#### 3.5 Project Templates
|
|
156
|
-
```bash
|
|
157
|
-
buwp-local create my-new-plugin --template bu-plugin
|
|
158
|
-
# Scaffolds new plugin with BU conventions
|
|
159
|
-
# Includes composer.json, phpunit.xml, etc.
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
#### 3.6 Performance Monitoring
|
|
163
|
-
```bash
|
|
164
|
-
buwp-local monitor
|
|
165
|
-
# Real-time performance metrics
|
|
166
|
-
# Query times, memory usage, cache hits
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
#### 3.7 Team Sync
|
|
170
|
-
```bash
|
|
171
|
-
buwp-local sync --remote bu-shared-config
|
|
172
|
-
# Sync configuration with team repository
|
|
173
|
-
# Share common settings across team
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
#### 3.8 Plugin/Theme Dependency Management
|
|
177
|
-
```bash
|
|
178
|
-
buwp-local deps install
|
|
179
|
-
# Installs required plugins/themes
|
|
180
|
-
# Based on .buwp-deps.json configuration
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## 🎯 Success Metrics
|
|
186
|
-
|
|
187
|
-
### Current (Phase 1-1.5)
|
|
188
|
-
- ✅ Setup time: < 2 minutes (from clone to running)
|
|
189
|
-
- ✅ Team adoption: 3-5 early adopters testing
|
|
190
|
-
- ✅ Multi-project support: Yes
|
|
191
|
-
- ✅ Documentation: Complete
|
|
192
|
-
|
|
193
|
-
### Phase 2 Targets
|
|
194
|
-
- Setup time: < 1 minute
|
|
195
|
-
- Team adoption: 15+ active users
|
|
196
|
-
- Support tickets: < 2 per week
|
|
197
|
-
- Developer satisfaction: > 85% positive
|
|
198
|
-
|
|
199
|
-
### Phase 3 Targets
|
|
200
|
-
- Setup time: < 30 seconds
|
|
201
|
-
- Team adoption: 20+ active users
|
|
202
|
-
- Zero-config experience
|
|
203
|
-
- Self-service onboarding
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## 📊 Feature Priority Matrix
|
|
208
|
-
|
|
209
|
-
### High Priority (Do Next)
|
|
210
|
-
1. **WP-CLI Proxy** - Frequently requested, high value
|
|
211
|
-
2. **Project Listing** - Visibility into running projects
|
|
212
|
-
3. **Health Checks** - Troubleshooting aid
|
|
213
|
-
|
|
214
|
-
### Medium Priority (Nice to Have)
|
|
215
|
-
4. **Auto-Port Assignment** - Reduces friction
|
|
216
|
-
5. **Credential Management** - Better security
|
|
217
|
-
6. **Database Backup** - Data safety
|
|
218
|
-
|
|
219
|
-
### Low Priority (Future)
|
|
220
|
-
7. **SSL Certificates** - Better local HTTPS
|
|
221
|
-
8. **/etc/hosts Management** - Convenience feature
|
|
222
|
-
9. **Presets & Templates** - Standardization
|
|
223
|
-
10. **Team Sync** - Large team coordination
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## 🤝 Community Feedback Needed
|
|
228
|
-
|
|
229
|
-
### Questions for Team
|
|
230
|
-
1. **What's your biggest pain point** with current version?
|
|
231
|
-
2. **Which Phase 2 feature** would help you most?
|
|
232
|
-
3. **What's missing** from current feature set?
|
|
233
|
-
4. **How often** do you work on multiple projects?
|
|
234
|
-
5. **What takes the most time** in your setup process?
|
|
235
|
-
|
|
236
|
-
### How to Provide Feedback
|
|
237
|
-
- GitHub Issues
|
|
238
|
-
- Team Slack/Chat
|
|
239
|
-
- Email to maintainers
|
|
240
|
-
- Quick survey (to be created)
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## 🛠️ Technical Debt & Maintenance
|
|
245
|
-
|
|
246
|
-
### Current
|
|
247
|
-
- [ ] Add unit tests for core functions
|
|
248
|
-
- [ ] Add integration tests for Docker operations
|
|
249
|
-
- [ ] Set up CI/CD pipeline
|
|
250
|
-
- [ ] Automated version bumping
|
|
251
|
-
- [ ] Changelog automation
|
|
252
|
-
|
|
253
|
-
### Future
|
|
254
|
-
- [ ] Error handling improvements
|
|
255
|
-
- [ ] Logging system
|
|
256
|
-
- [ ] Telemetry (opt-in)
|
|
257
|
-
- [ ] Update checking
|
|
258
|
-
- [ ] Deprecation warnings
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## 📈 Adoption Strategy
|
|
263
|
-
|
|
264
|
-
### Phase 1 (Current)
|
|
265
|
-
- ✅ Working with 3-5 early adopters
|
|
266
|
-
- ✅ Gathering feedback
|
|
267
|
-
- ✅ Documenting common issues
|
|
268
|
-
- ✅ Iterating on UX
|
|
269
|
-
|
|
270
|
-
### Phase 2 (Next 2-4 Weeks)
|
|
271
|
-
- Expand to 10-15 users
|
|
272
|
-
- Create video tutorials
|
|
273
|
-
- Office hours / Q&A sessions
|
|
274
|
-
- Document best practices from real usage
|
|
275
|
-
|
|
276
|
-
### Phase 3 (1-2 Months)
|
|
277
|
-
- Full team rollout (20+ developers)
|
|
278
|
-
- Self-service documentation
|
|
279
|
-
- Automated onboarding
|
|
280
|
-
- Community support channel
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 🎓 Learning & Iteration
|
|
285
|
-
|
|
286
|
-
### What We Learned So Far
|
|
287
|
-
1. **Multi-project support was critical** - Came from real usage
|
|
288
|
-
2. **Smart init flags save time** - No manual path configuration
|
|
289
|
-
3. **Good defaults matter** - Auto-generated project names work well
|
|
290
|
-
4. **Documentation is key** - Comprehensive guides prevent questions
|
|
291
|
-
|
|
292
|
-
### What We'll Track
|
|
293
|
-
- Most used commands
|
|
294
|
-
- Common error messages
|
|
295
|
-
- Configuration patterns
|
|
296
|
-
- Support questions
|
|
297
|
-
|
|
298
|
-
### How We'll Improve
|
|
299
|
-
- Quarterly feature reviews
|
|
300
|
-
- User surveys
|
|
301
|
-
- Usage analytics (opt-in)
|
|
302
|
-
- Regular team check-ins
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
## 🚢 Release Strategy
|
|
307
|
-
|
|
308
|
-
### Semantic Versioning
|
|
309
|
-
- `v0.x.x` - Beta/testing phase (current)
|
|
310
|
-
- `v1.0.0` - Full production release (after team adoption)
|
|
311
|
-
- `v1.x.x` - Feature additions
|
|
312
|
-
- `v2.0.0` - Major changes (if needed)
|
|
313
|
-
|
|
314
|
-
### Current Version
|
|
315
|
-
**v0.2.0** - Multi-project support
|
|
316
|
-
|
|
317
|
-
### Planned Versions
|
|
318
|
-
- `v0.3.0` - Phase 2 features (WP-CLI, listing, health)
|
|
319
|
-
- `v0.4.0` - Phase 2 cont. (ports, credentials)
|
|
320
|
-
- `v1.0.0` - Production ready (full team rollout)
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
## 📞 Support & Resources
|
|
325
|
-
|
|
326
|
-
### Documentation
|
|
327
|
-
- **Quick Start:** `README.md`
|
|
328
|
-
- **Full Usage:** `USAGE.md`
|
|
329
|
-
- **Multi-Project:** `MULTI_PROJECT_GUIDE.md`
|
|
330
|
-
- **Quick Reference:** `QUICK_REFERENCE.md`
|
|
331
|
-
- **Implementation Details:** `IMPLEMENTATION_SUMMARY.md`
|
|
332
|
-
- **This Roadmap:** `ROADMAP.md`
|
|
333
|
-
|
|
334
|
-
### Getting Help
|
|
335
|
-
- Check documentation first
|
|
336
|
-
- Search existing issues
|
|
337
|
-
- Ask in team chat
|
|
338
|
-
- Create GitHub issue
|
|
339
|
-
- Contact maintainers
|
|
340
|
-
|
|
341
|
-
### Contributing
|
|
342
|
-
- Report bugs
|
|
343
|
-
- Suggest features
|
|
344
|
-
- Submit PRs
|
|
345
|
-
- Improve documentation
|
|
346
|
-
- Share usage patterns
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
## 🎉 Conclusion
|
|
351
|
-
|
|
352
|
-
We've built a **solid foundation** for BU WordPress local development. The tool now supports:
|
|
353
|
-
- ✅ Easy single-project setup
|
|
354
|
-
- ✅ Multi-project workflows
|
|
355
|
-
- ✅ Team collaboration
|
|
356
|
-
- ✅ Enterprise scalability
|
|
357
|
-
|
|
358
|
-
**Next steps:**
|
|
359
|
-
1. Continue gathering feedback from early adopters
|
|
360
|
-
2. Prioritize Phase 2 features based on team needs
|
|
361
|
-
3. Expand adoption gradually
|
|
362
|
-
4. Iterate and improve based on real usage
|
|
363
|
-
|
package/USAGE.md
DELETED
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
# buwp-local Development Guide
|
|
2
|
-
|
|
3
|
-
## Quick Start
|
|
4
|
-
|
|
5
|
-
### 1. Install in your project
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install --save-dev @bostonuniversity/buwp-local
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### 2. Initialize configuration
|
|
12
|
-
|
|
13
|
-
**Interactive mode (recommended):**
|
|
14
|
-
```bash
|
|
15
|
-
npx buwp-local init
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
The interactive setup will guide you through:
|
|
19
|
-
- Project name and type (plugin, theme, mu-plugin)
|
|
20
|
-
- Hostname configuration
|
|
21
|
-
- Port selection
|
|
22
|
-
- Service options (Redis, S3, Shibboleth)
|
|
23
|
-
- Debug settings
|
|
24
|
-
|
|
25
|
-
**Non-interactive mode:**
|
|
26
|
-
```bash
|
|
27
|
-
npx buwp-local config --init --plugin # For plugins
|
|
28
|
-
npx buwp-local config --init --mu-plugin # For mu-plugins
|
|
29
|
-
npx buwp-local config --init --theme # For themes
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
This creates `.buwp-local.json` in your project directory.
|
|
33
|
-
|
|
34
|
-
### 3. Edit configuration
|
|
35
|
-
|
|
36
|
-
Edit `.buwp-local.json` to map your local repository into the container:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"image": "ghcr.io/bu-ist/bu-wp-docker-mod_shib:arm64-latest",
|
|
41
|
-
"hostname": "myproject.local",
|
|
42
|
-
"multisite": true,
|
|
43
|
-
"mappings": [
|
|
44
|
-
{
|
|
45
|
-
"local": "./",
|
|
46
|
-
"container": "/var/www/html/wp-content/plugins/my-plugin"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 4. Create `.env.local` for secrets
|
|
53
|
-
|
|
54
|
-
Create `.env.local` (never commit this file!) or copy from the example:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
cp .env.local.example .env.local
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Then edit `.env.local` with your actual credentials:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# Database
|
|
64
|
-
WORDPRESS_DB_PASSWORD=password
|
|
65
|
-
DB_ROOT_PASSWORD=rootpassword
|
|
66
|
-
|
|
67
|
-
# Shibboleth (if needed)
|
|
68
|
-
SP_ENTITY_ID=https://your-sp-entity-id
|
|
69
|
-
IDP_ENTITY_ID=https://shib-test.bu.edu/idp/shibboleth
|
|
70
|
-
SHIB_IDP_LOGOUT=https://shib-test.bu.edu/idp/logout.jsp
|
|
71
|
-
SHIB_SP_KEY=your-key-here
|
|
72
|
-
SHIB_SP_CERT=your-cert-here
|
|
73
|
-
|
|
74
|
-
# AWS S3 (if needed)
|
|
75
|
-
S3_UPLOADS_BUCKET=your-bucket
|
|
76
|
-
S3_UPLOADS_REGION=us-east-1
|
|
77
|
-
S3_UPLOADS_ACCESS_KEY_ID=your-access-key
|
|
78
|
-
S3_UPLOADS_SECRET_ACCESS_KEY=your-secret-key
|
|
79
|
-
S3_ACCESS_RULES_TABLE=your-access-rules-table
|
|
80
|
-
|
|
81
|
-
# OLAP
|
|
82
|
-
OLAP=your-olap-name
|
|
83
|
-
OLAP_ACCT_NBR=your-account-number
|
|
84
|
-
OLAP_REGION=us-east-1
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
**Important:** Credentials are read directly from `.env.local` by Docker Compose. They are never written to the generated `docker-compose.yml` file, making it safe to review or share the generated compose file without exposing secrets.
|
|
88
|
-
|
|
89
|
-
### 5. Add hostname to /etc/hosts
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
sudo bash -c 'echo "127.0.0.1 username.local" >> /etc/hosts'
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### 6. Start the environment
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
npx buwp-local start
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 7. Access your site
|
|
102
|
-
|
|
103
|
-
Open http://username.local or https://username.local in your browser.
|
|
104
|
-
|
|
105
|
-
## Commands
|
|
106
|
-
|
|
107
|
-
### Initialize configuration
|
|
108
|
-
```bash
|
|
109
|
-
npx buwp-local init
|
|
110
|
-
|
|
111
|
-
Options:
|
|
112
|
-
--no-interactive Use non-interactive mode with defaults
|
|
113
|
-
--plugin Non-interactive: initialize as plugin
|
|
114
|
-
--mu-plugin Non-interactive: initialize as mu-plugin
|
|
115
|
-
--theme Non-interactive: initialize as theme
|
|
116
|
-
-f, --force Overwrite existing configuration
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
The `init` command provides an interactive setup experience with:
|
|
120
|
-
- **Smart defaults** - Detects project type from files
|
|
121
|
-
- **Real-time validation** - Validates inputs as you type
|
|
122
|
-
- **Guided workflow** - Clear prompts for all configuration options
|
|
123
|
-
|
|
124
|
-
### Start environment
|
|
125
|
-
```bash
|
|
126
|
-
npx buwp-local start [options]
|
|
127
|
-
|
|
128
|
-
Options:
|
|
129
|
-
--xdebug Enable Xdebug
|
|
130
|
-
--no-s3 Disable S3 proxy service
|
|
131
|
-
--no-redis Disable Redis service
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Stop environment
|
|
135
|
-
```bash
|
|
136
|
-
npx buwp-local stop
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### View logs
|
|
140
|
-
```bash
|
|
141
|
-
npx buwp-local logs [options]
|
|
142
|
-
|
|
143
|
-
Options:
|
|
144
|
-
-f, --follow Follow log output
|
|
145
|
-
-s, --service <service> Show logs for specific service
|
|
146
|
-
(wordpress, db, s3proxy, redis)
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Destroy environment
|
|
150
|
-
```bash
|
|
151
|
-
npx buwp-local destroy [options]
|
|
152
|
-
|
|
153
|
-
Options:
|
|
154
|
-
-f, --force Skip confirmation prompt
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Configuration management
|
|
158
|
-
```bash
|
|
159
|
-
npx buwp-local config [options]
|
|
160
|
-
|
|
161
|
-
Options:
|
|
162
|
-
--init Initialize configuration file
|
|
163
|
-
--validate Validate configuration file
|
|
164
|
-
--show Show resolved configuration (with masked secrets)
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## Configuration File
|
|
168
|
-
|
|
169
|
-
### Basic Structure
|
|
170
|
-
|
|
171
|
-
```json
|
|
172
|
-
{
|
|
173
|
-
"image": "ghcr.io/bu-ist/bu-wp-docker-mod_shib:arm64-latest",
|
|
174
|
-
"hostname": "wordpress.local",
|
|
175
|
-
"multisite": true,
|
|
176
|
-
"services": {
|
|
177
|
-
"redis": true,
|
|
178
|
-
"s3proxy": true,
|
|
179
|
-
"shibboleth": true
|
|
180
|
-
},
|
|
181
|
-
"ports": {
|
|
182
|
-
"http": 80,
|
|
183
|
-
"https": 443,
|
|
184
|
-
"db": 3306,
|
|
185
|
-
"redis": 6379
|
|
186
|
-
},
|
|
187
|
-
"mappings": [],
|
|
188
|
-
"env": {}
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Volume Mappings
|
|
193
|
-
|
|
194
|
-
Map your local code into the container:
|
|
195
|
-
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"mappings": [
|
|
199
|
-
{
|
|
200
|
-
"local": "./",
|
|
201
|
-
"container": "/var/www/html/wp-content/plugins/my-plugin"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"local": "../my-theme",
|
|
205
|
-
"container": "/var/www/html/wp-content/themes/my-theme"
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Custom Environment Variables
|
|
212
|
-
|
|
213
|
-
```json
|
|
214
|
-
{
|
|
215
|
-
"env": {
|
|
216
|
-
"WP_DEBUG": true,
|
|
217
|
-
"WP_DEBUG_LOG": true,
|
|
218
|
-
"XDEBUG": false
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Disabling Services
|
|
224
|
-
|
|
225
|
-
```json
|
|
226
|
-
{
|
|
227
|
-
"services": {
|
|
228
|
-
"redis": false,
|
|
229
|
-
"s3proxy": false,
|
|
230
|
-
"shibboleth": false
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## Security Best Practices
|
|
236
|
-
|
|
237
|
-
1. **Never commit `.env.local`** - This file contains secrets
|
|
238
|
-
2. **Never commit `.buwp-local/`** - This directory contains generated files
|
|
239
|
-
3. **Do commit `.buwp-local.json`** - This is your configuration template (no secrets)
|
|
240
|
-
4. **Use environment variables for all secrets** - Credentials stay in `.env.local` and are never written to generated files
|
|
241
|
-
5. **Review generated compose files** - The generated `docker-compose.yml` only contains variable references like `${WORDPRESS_DB_PASSWORD}`, not actual credentials
|
|
242
|
-
6. **Copy `.env.local.example`** - Use the provided template to create your `.env.local` file
|
|
243
|
-
7. **Consider using macOS Keychain** for even better security (future feature)
|
|
244
|
-
|
|
245
|
-
### How Credentials Work
|
|
246
|
-
|
|
247
|
-
buwp-local uses Docker Compose's native environment variable interpolation:
|
|
248
|
-
|
|
249
|
-
1. **You provide** credentials in `.env.local`
|
|
250
|
-
2. **buwp-local generates** `docker-compose.yml` with variable references like `${VAR_NAME}`
|
|
251
|
-
3. **Docker Compose reads** `.env.local` at runtime and substitutes the values
|
|
252
|
-
4. **Your secrets never** get written to any generated files
|
|
253
|
-
|
|
254
|
-
This means:
|
|
255
|
-
- ✅ Generated compose files are safe to review or share
|
|
256
|
-
- ✅ No credentials in version control (even accidentally)
|
|
257
|
-
- ✅ Industry-standard Docker Compose pattern
|
|
258
|
-
- ✅ Simple and secure
|
|
259
|
-
|
|
260
|
-
## File Structure
|
|
261
|
-
|
|
262
|
-
When you use `buwp-local`, these files are created:
|
|
263
|
-
|
|
264
|
-
```
|
|
265
|
-
your-project/
|
|
266
|
-
├── .buwp-local.json # Configuration (commit this)
|
|
267
|
-
├── .env.local # Secrets (NEVER commit)
|
|
268
|
-
├── .buwp-local/ # Generated files (don't commit)
|
|
269
|
-
│ └── docker-compose.yml # Generated compose file
|
|
270
|
-
└── package.json # Your project
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
## Troubleshooting
|
|
274
|
-
|
|
275
|
-
### Port conflicts
|
|
276
|
-
|
|
277
|
-
If you get port conflicts, you can change ports in `.buwp-local.json`:
|
|
278
|
-
|
|
279
|
-
```json
|
|
280
|
-
{
|
|
281
|
-
"ports": {
|
|
282
|
-
"http": 8080,
|
|
283
|
-
"https": 8443,
|
|
284
|
-
"db": 3307,
|
|
285
|
-
"redis": 6380
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### Docker not running
|
|
291
|
-
|
|
292
|
-
Make sure Docker Desktop is running:
|
|
293
|
-
```bash
|
|
294
|
-
docker info
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### Configuration errors
|
|
298
|
-
|
|
299
|
-
Validate your configuration:
|
|
300
|
-
```bash
|
|
301
|
-
npx buwp-local config --validate
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
### View current configuration
|
|
305
|
-
|
|
306
|
-
See the resolved configuration (with masked secrets):
|
|
307
|
-
```bash
|
|
308
|
-
npx buwp-local config --show
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
## WP-CLI Command
|
|
312
|
-
```bash
|
|
313
|
-
buwp-local wp user list
|
|
314
|
-
buwp-local wp post list --format=json
|
|
315
|
-
buwp-local wp plugin activate akismet
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
## Next Steps
|
|
320
|
-
|
|
321
|
-
- [ ] Phase 2: WP-CLI proxy command
|
|
322
|
-
- [ ] Phase 2: macOS Keychain integration
|
|
323
|
-
- [ ] Phase 3: Automatic /etc/hosts management
|
|
324
|
-
- [ ] Phase 3: SSL certificate generation
|