@bostonuniversity/buwp-local 0.7.3 → 0.7.4
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/docs/CHANGELOG.md +6 -0
- package/docs/ROADMAP.md +33 -23
- package/lib/compose-generator.js +2 -2
- package/package.json +1 -1
package/docs/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to buwp-local will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.7.4]
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Localhost-Only Port Binding for Database & Redis**
|
|
12
|
+
- Database and Redis services now bind to `127.0.0.1` instead of `0.0.0.0` for improved security and local development isolation
|
|
13
|
+
|
|
8
14
|
## [0.7.3]
|
|
9
15
|
|
|
10
16
|
### Added
|
package/docs/ROADMAP.md
CHANGED
|
@@ -174,39 +174,49 @@ hostile.remove('127.0.0.1', config.hostname);
|
|
|
174
174
|
|
|
175
175
|
### Shipped in v0.7.3
|
|
176
176
|
|
|
177
|
-
- **Job Watcher Command**
|
|
177
|
+
- **Job Watcher Command** ✅
|
|
178
178
|
- New `watch-jobs` command to periodically run `wp site-manager process-jobs`
|
|
179
|
-
- Configurable polling interval (default:
|
|
179
|
+
- Configurable polling interval (default: 60 seconds)
|
|
180
180
|
- Runs as standalone process in terminal window
|
|
181
181
|
- Timestamped output for job processing visibility
|
|
182
|
+
- True quiet mode for long-running background monitoring
|
|
182
183
|
- Graceful shutdown (Ctrl+C)
|
|
183
184
|
|
|
184
185
|
**Problem:** Production environments use cron/AWS EventBridge to automatically process site-manager jobs (content migration, deployments). Local developers currently must manually run `npx buwp-local wp site-manager process-jobs` to see queued jobs complete.
|
|
185
186
|
|
|
186
187
|
**Solution:** Standalone `watch-jobs` command that runs indefinitely, polling for jobs at configurable intervals. Mirrors production behavior without requiring cron setup. Enables developers to use the site-manager web UI for content operations and see jobs complete automatically.
|
|
188
|
+
|
|
189
|
+
### Shipped in v0.7.4
|
|
190
|
+
|
|
191
|
+
- **Localhost-Only Port Binding for Database & Redis** ✅
|
|
192
|
+
- Bind database (3306) and Redis (6379) ports to 127.0.0.1 only
|
|
193
|
+
- Prevents network exposure of confidential database content
|
|
194
|
+
- HTTP/HTTPS remain on all interfaces (0.0.0.0) for device testing
|
|
195
|
+
- Local database tools (TablePlus, Sequel Pro, etc.) still work perfectly
|
|
187
196
|
|
|
188
|
-
**
|
|
197
|
+
**Security Problem:** Default Docker port binding (`3306:3306`) exposes database on all network interfaces (0.0.0.0), including public WiFi. Confidential data accessible to anyone on the network.
|
|
189
198
|
|
|
190
|
-
**
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
199
|
+
**Solution:** Explicit localhost binding (`127.0.0.1:3306:3306`) restricts access to the laptop only. Network isolation provides defense-in-depth beyond password protection.
|
|
200
|
+
|
|
201
|
+
**Implementation:**
|
|
202
|
+
```javascript
|
|
203
|
+
// Database - localhost only (network isolated)
|
|
204
|
+
ports: [`127.0.0.1:${config.ports.db}:3306`]
|
|
205
|
+
|
|
206
|
+
// Redis - localhost only (session data protected)
|
|
207
|
+
ports: [`127.0.0.1:${config.ports.redis}:6379`]
|
|
196
208
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
buwp-local watch-jobs [--interval 200] [--quiet]
|
|
209
|
+
// HTTP/HTTPS - all interfaces (device testing enabled)
|
|
210
|
+
ports: [`${config.ports.http}:80`, `${config.ports.https}:443`]
|
|
200
211
|
```
|
|
201
212
|
|
|
202
|
-
**
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
- Output includes timestamps for audit trail
|
|
213
|
+
**Benefits:**
|
|
214
|
+
- Coffee shop/airport WiFi cannot reach database
|
|
215
|
+
- Brute-force attacks prevented by network isolation
|
|
216
|
+
- Zero performance impact
|
|
217
|
+
- Industry best practice (matching Laravel Sail, wp-env)
|
|
208
218
|
|
|
209
|
-
**
|
|
219
|
+
**Breaking Change Note:** Existing projects will need `buwp-local update` or restart to apply new port bindings. Database access from phones/tablets/other computers will no longer work (rare use case).
|
|
210
220
|
|
|
211
221
|
### Potential Features
|
|
212
222
|
|
|
@@ -217,10 +227,10 @@ hostile.remove('127.0.0.1', config.hostname);
|
|
|
217
227
|
- Commands to export credentials to JSON file
|
|
218
228
|
- Useful for migrating between machines or sharing setup
|
|
219
229
|
|
|
220
|
-
- **
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
230
|
+
- **Advanced Port Binding Configuration**
|
|
231
|
+
- Optional config to override localhost-only binding for database/Redis
|
|
232
|
+
- For advanced users who need network access to services
|
|
233
|
+
- Example: `"portBindings": { "db": "0.0.0.0", "redis": "127.0.0.1" }`
|
|
224
234
|
|
|
225
235
|
- **Xdebug Integration**
|
|
226
236
|
- Command to help generate Xdebug configuration for IDEs (VSCode, Zed)
|
package/lib/compose-generator.js
CHANGED
|
@@ -66,7 +66,7 @@ function generateDbService(config, dbVolumeName) {
|
|
|
66
66
|
MYSQL_PASSWORD: '${WORDPRESS_DB_PASSWORD:-password}',
|
|
67
67
|
MYSQL_ROOT_PASSWORD: '${DB_ROOT_PASSWORD:-rootpassword}'
|
|
68
68
|
},
|
|
69
|
-
ports: [
|
|
69
|
+
ports: [`127.0.0.1:${config.ports.db}:3306`],
|
|
70
70
|
networks: ['wp-network']
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -212,7 +212,7 @@ function generateRedisService(config) {
|
|
|
212
212
|
return {
|
|
213
213
|
image: 'redis:alpine',
|
|
214
214
|
restart: 'always',
|
|
215
|
-
ports: [
|
|
215
|
+
ports: [`127.0.0.1:${config.ports.redis}:6379`],
|
|
216
216
|
networks: ['wp-network']
|
|
217
217
|
};
|
|
218
218
|
}
|