Skip to content

Commit 3ab2c10

Browse files
committed
chore: wip
1 parent ae41971 commit 3ab2c10

22 files changed

+2139
-111
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Launchpad transforms how you manage dependencies across your entire development
4343
- 🚀 **One-Command Service Control** — Start, stop, restart services with automatic configuration
4444
- 🏥 **Health Monitoring** — Built-in health checks with automatic status detection
4545
- 🔧 **Auto-Configuration** — Default configuration files generated for each service
46+
- 🔐 **Configurable Database Credentials** — Customize database usernames, passwords, and authentication methods
4647
- 🖥️ **Cross-Platform Service Management** — Uses launchd on macOS, systemd on Linux
4748

4849
### Project-Aware Environment Management
@@ -260,6 +261,31 @@ launchpad service enable postgres redis
260261
- **API & Backend**: Hasura, Keycloak
261262
- **Caching**: Memcached, Elasticsearch
262263

264+
#### Database Configuration
265+
266+
Customize database credentials for all database services:
267+
268+
```bash
269+
# Configure database credentials globally
270+
export LAUNCHPAD_DB_USERNAME="myuser"
271+
export LAUNCHPAD_DB_PASSWORD="mypassword"
272+
export LAUNCHPAD_DB_AUTH_METHOD="md5" # PostgreSQL: trust|md5|scram-sha-256
273+
274+
# Start databases with custom credentials
275+
launchpad service start postgres mysql
276+
# Creates project-specific databases with your configured credentials
277+
```
278+
279+
**Default Credentials** (secure for development):
280+
- Username: `root`
281+
- Password: `password`
282+
- Auth Method: `trust` (PostgreSQL)
283+
284+
**Configuration Options:**
285+
- Environment variables: `LAUNCHPAD_DB_USERNAME`, `LAUNCHPAD_DB_PASSWORD`, `LAUNCHPAD_DB_AUTH_METHOD`
286+
- Config file: `launchpad.config.ts``services.database`
287+
- Per-project databases automatically created with your credentials
288+
263289
### Advanced Operations
264290

265291
```bash

bun.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@stacksjs/docs": "^0.70.23",
88
"@stacksjs/eslint-config": "^4.14.0-beta.3",
99
"@types/bun": "^1.2.19",
10-
"buddy-bot": "^0.4.1",
10+
"buddy-bot": "^0.4.4",
1111
"bumpp": "^10.2.0",
1212
"bun-plugin-dtsx": "0.9.5",
1313
"changelogen": "^0.6.2",
@@ -42,7 +42,7 @@
4242
"dependencies": {
4343
"bunfig": "^0.10.1",
4444
"cac": "^6.7.14",
45-
"ts-pkgx": "0.4.15",
45+
"ts-pkgx": "0.4.19",
4646
},
4747
"devDependencies": {
4848
"bun-plugin-dtsx": "^0.9.5",
@@ -848,7 +848,7 @@
848848

849849
"browserslist": ["[email protected]", "", { "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw=="],
850850

851-
"buddy-bot": ["[email protected].1", "", { "dependencies": { "@types/prompts": "^2.4.9", "bunfig": "^0.10.1", "cac": "6.7.13", "prompts": "^2.4.2", "ts-pkgx": "0.4.4" }, "bin": { "buddy-bot": "dist/bin/cli.js" } }, "sha512-SUag3K2CxGzuxkg8olo0t0MFfsDPUEl3OwJtPyB30MBVjxLqWM1xc4sJWsAHO/eszD09CszNCko6OlkltDuILQ=="],
851+
"buddy-bot": ["[email protected].4", "", { "dependencies": { "@types/prompts": "^2.4.9", "bunfig": "^0.10.1", "cac": "6.7.13", "prompts": "^2.4.2", "ts-pkgx": "0.4.4" }, "bin": { "buddy-bot": "dist/bin/cli.js" } }, "sha512-TjAnFlK7oc8jjRCy1TVMWzx5g8MfAcaN+FeWZ+8uf2nHfV2DyZ/SYZgr3so+6rtY7IEJIRIuYjs3FcUgBCmfzw=="],
852852

853853
"buffer-crc32": ["[email protected]", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="],
854854

@@ -1884,7 +1884,7 @@
18841884

18851885
"ts-declaration-location": ["[email protected]", "", { "dependencies": { "picomatch": "^4.0.2" }, "peerDependencies": { "typescript": ">=4.0.0" } }, "sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA=="],
18861886

1887-
"ts-pkgx": ["[email protected].15", "", { "dependencies": { "chromium-bidi": "^7.2.0", "electron": "^37.2.4", "js-yaml": "^4.1.0", "playwright": "^1.54.1" }, "bin": { "pkgx-tools": "dist/bin/cli.js" } }, "sha512-A0SaaYXSrXfgd8aWDZRY6/8XVNS1FGSQtGgUgnSuvCdvKOTwz6JofZtUo0BYJQuO640BIPhftKnx4biQhZC0QQ=="],
1887+
"ts-pkgx": ["[email protected].19", "", { "dependencies": { "chromium-bidi": "^7.2.0", "electron": "^37.2.4", "js-yaml": "^4.1.0", "playwright": "^1.54.1" }, "bin": { "pkgx-tools": "dist/bin/cli.js" } }, "sha512-tu5VfSLRZV/o/RlHtez6QW51i0L5VLPMxT62leY5RWOccGzxM0eApy7axUNL3ndPWXXiNFnw5M6SpCM09LdxUA=="],
18881888

18891889
"tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
18901890

docs/config.md

Lines changed: 111 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ const config: LaunchpadConfig = {
9191

9292
// Service shutdown timeout in seconds (default: 10)
9393
shutdownTimeout: 10,
94+
95+
// Database configuration for services
96+
database: {
97+
// Default database username (default: 'root')
98+
username: 'root',
99+
100+
// Default database password (default: 'password')
101+
password: 'password',
102+
103+
// Database authentication method for local connections (default: 'trust')
104+
authMethod: 'trust', // 'trust' | 'md5' | 'scram-sha-256'
105+
},
94106
},
95107
}
96108

@@ -124,11 +136,106 @@ JavaScript format (`.launchpadrc`):
124136
"configDir": "~/.local/share/launchpad/services/config",
125137
"autoRestart": true,
126138
"startupTimeout": 30,
127-
"shutdownTimeout": 10
139+
"shutdownTimeout": 10,
140+
"database": {
141+
"username": "root",
142+
"password": "password",
143+
"authMethod": "trust"
144+
}
145+
}
146+
}
147+
```
148+
149+
## Database Configuration
150+
151+
Launchpad provides configurable database credentials for all database services. This allows you to customize authentication while maintaining secure defaults.
152+
153+
### Configuration Options
154+
155+
Database credentials can be configured through environment variables or configuration files:
156+
157+
#### Environment Variables
158+
159+
```bash
160+
# Database username (default: 'root')
161+
export LAUNCHPAD_DB_USERNAME="myuser"
162+
163+
# Database password (default: 'password')
164+
export LAUNCHPAD_DB_PASSWORD="mypassword"
165+
166+
# Database authentication method (default: 'trust')
167+
export LAUNCHPAD_DB_AUTH_METHOD="md5" # 'trust' | 'md5' | 'scram-sha-256'
168+
```
169+
170+
#### Configuration File
171+
172+
```ts
173+
// launchpad.config.ts
174+
const config: LaunchpadConfig = {
175+
services: {
176+
database: {
177+
username: 'myuser',
178+
password: 'mypassword',
179+
authMethod: 'md5' // 'trust' | 'md5' | 'scram-sha-256'
180+
}
128181
}
129182
}
130183
```
131184

185+
### Supported Services
186+
187+
These database configurations apply to:
188+
189+
- **PostgreSQL** - Uses all three options (username, password, authMethod)
190+
- **MySQL** - Uses username and password
191+
- **Other databases** - Future database services will adopt these standards
192+
193+
### Authentication Methods (PostgreSQL)
194+
195+
| Method | Description | Use Case |
196+
|--------|-------------|----------|
197+
| `trust` | No password required for local connections | Development (default) |
198+
| `md5` | MD5-hashed password authentication | Basic production setup |
199+
| `scram-sha-256` | Modern SCRAM-SHA-256 authentication | Secure production environments |
200+
201+
### Template Variables
202+
203+
Services use these configurable template variables:
204+
205+
- `{dbUsername}` - Resolves to configured username
206+
- `{dbPassword}` - Resolves to configured password
207+
- `{authMethod}` - Resolves to configured auth method
208+
- `{projectDatabase}` - Resolves to project name
209+
210+
### Examples
211+
212+
#### Development Setup (Default)
213+
```bash
214+
# Uses: username=root, password=password, authMethod=trust
215+
launchpad start postgres
216+
```
217+
218+
#### Custom Development Setup
219+
```bash
220+
export LAUNCHPAD_DB_USERNAME="dev_user"
221+
export LAUNCHPAD_DB_PASSWORD="dev_password"
222+
launchpad start postgres
223+
```
224+
225+
#### Production-like Setup
226+
```bash
227+
export LAUNCHPAD_DB_AUTH_METHOD="md5"
228+
export LAUNCHPAD_DB_PASSWORD="secure_password123"
229+
launchpad start postgres
230+
```
231+
232+
### Security Considerations
233+
234+
1. **Development**: Default `trust` auth is suitable for local development
235+
2. **Production**: Use `md5` or `scram-sha-256` with strong passwords
236+
3. **Environment Variables**: Store sensitive credentials in `.env` files
237+
4. **Version Control**: Never commit passwords in configuration files
238+
132239
## Dependency File Configuration
133240

134241
Launchpad supports flexible dependency configuration with global installation options:
@@ -506,6 +613,9 @@ launchpad --verbose install --dry-run node
506613
```bash
507614
export LAUNCHPAD_VERBOSE=true
508615
export LAUNCHPAD_INSTALL_PATH=/custom/path
616+
export LAUNCHPAD_DB_USERNAME=myuser
617+
export LAUNCHPAD_DB_PASSWORD=mypassword
618+
export LAUNCHPAD_DB_AUTH_METHOD=md5
509619
```
510620

511621
3. Verify shell configuration:

docs/features/service-management.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,138 @@ nano ~/.local/share/launchpad/services/config/nginx.conf
249249
launchpad service restart redis
250250
```
251251

252+
## Database Configuration
253+
254+
Launchpad provides configurable database credentials for all database services. These settings allow you to customize database authentication while maintaining secure defaults.
255+
256+
### Default Database Credentials
257+
258+
By default, all database services use these standardized credentials:
259+
260+
| Setting | Default Value | Description |
261+
|---------|---------------|-------------|
262+
| Username | `root` | Default database user |
263+
| Password | `password` | Default database password |
264+
| Auth Method | `trust` | PostgreSQL authentication method |
265+
266+
### Configuring Database Credentials
267+
268+
#### Environment Variables
269+
270+
Set database credentials globally using environment variables:
271+
272+
```bash
273+
# Database username (default: 'root')
274+
export LAUNCHPAD_DB_USERNAME="myuser"
275+
276+
# Database password (default: 'password')
277+
export LAUNCHPAD_DB_PASSWORD="mypassword"
278+
279+
# Database authentication method (default: 'trust')
280+
export LAUNCHPAD_DB_AUTH_METHOD="md5" # PostgreSQL only
281+
```
282+
283+
#### Configuration File
284+
285+
Configure credentials in your `launchpad.config.ts`:
286+
287+
```typescript
288+
// launchpad.config.ts
289+
const config: LaunchpadConfig = {
290+
services: {
291+
database: {
292+
username: 'myuser',
293+
password: 'mypassword',
294+
authMethod: 'md5' // 'trust' | 'md5' | 'scram-sha-256'
295+
}
296+
}
297+
}
298+
```
299+
300+
### Database-Specific Configuration
301+
302+
#### PostgreSQL
303+
304+
PostgreSQL services support all configuration options:
305+
306+
```bash
307+
# Start PostgreSQL with custom credentials
308+
export LAUNCHPAD_DB_USERNAME="postgres_user"
309+
export LAUNCHPAD_DB_PASSWORD="secure_password"
310+
export LAUNCHPAD_DB_AUTH_METHOD="md5"
311+
launchpad service start postgres
312+
```
313+
314+
**Authentication Methods:**
315+
- `trust` - No password required (development)
316+
- `md5` - MD5-hashed password authentication
317+
- `scram-sha-256` - Modern SCRAM authentication (recommended for production)
318+
319+
#### MySQL
320+
321+
MySQL services use username and password configuration:
322+
323+
```bash
324+
# Start MySQL with custom credentials
325+
export LAUNCHPAD_DB_USERNAME="mysql_user"
326+
export LAUNCHPAD_DB_PASSWORD="mysql_password"
327+
launchpad service start mysql
328+
```
329+
330+
#### Database Creation
331+
332+
Each service automatically creates a project-specific database:
333+
334+
```bash
335+
# For project "my-app", databases are created as:
336+
# PostgreSQL: my_app
337+
# MySQL: my_app
338+
# With the configured username having full access
339+
```
340+
341+
### Security Considerations
342+
343+
#### Development Setup
344+
- Default `trust` authentication is suitable for local development
345+
- Credentials are simple and predictable for quick setup
346+
347+
#### Production-like Setup
348+
- Use `md5` or `scram-sha-256` for PostgreSQL authentication
349+
- Set strong, unique passwords
350+
- Consider per-project credentials
351+
352+
#### Best Practices
353+
- Store sensitive credentials in `.env` files (never commit)
354+
- Use environment variables for production deployments
355+
- Avoid hardcoding passwords in configuration files
356+
- Regularly rotate database passwords in production
357+
358+
### Examples
359+
360+
#### Default Development Setup
361+
```bash
362+
# Uses: username=root, password=password, authMethod=trust
363+
launchpad service start postgres
364+
# Database URL: postgresql://root:password@localhost:5432/my_project
365+
```
366+
367+
#### Custom Development Setup
368+
```bash
369+
export LAUNCHPAD_DB_USERNAME="dev_user"
370+
export LAUNCHPAD_DB_PASSWORD="dev_password"
371+
launchpad service start postgres mysql
372+
# PostgreSQL: postgresql://dev_user:dev_password@localhost:5432/my_project
373+
# MySQL: mysql://dev_user:dev_password@localhost:3306/my_project
374+
```
375+
376+
#### Production-like Setup
377+
```bash
378+
export LAUNCHPAD_DB_USERNAME="app_user"
379+
export LAUNCHPAD_DB_PASSWORD="$(openssl rand -base64 32)"
380+
export LAUNCHPAD_DB_AUTH_METHOD="scram-sha-256"
381+
launchpad service start postgres
382+
```
383+
252384
## Health Monitoring
253385

254386
### Automatic Health Checks

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@stacksjs/docs": "^0.70.23",
3333
"@stacksjs/eslint-config": "^4.14.0-beta.3",
3434
"@types/bun": "^1.2.19",
35-
"buddy-bot": "^0.4.1",
35+
"buddy-bot": "^0.5.27",
3636
"bumpp": "^10.2.0",
3737
"bun-plugin-dtsx": "0.9.5",
3838
"changelogen": "^0.6.2",

packages/launchpad/launchpad.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ export const defaultConfig: LaunchpadConfig = {
6666
autoRestart: true,
6767
startupTimeout: 30,
6868
shutdownTimeout: 10,
69+
database: {
70+
username: 'root',
71+
password: 'password',
72+
authMethod: 'trust',
73+
},
74+
frameworks: {
75+
enabled: true,
76+
preferredDatabase: 'postgres',
77+
laravel: {
78+
enabled: true,
79+
autoDetect: true,
80+
},
81+
stacks: {
82+
enabled: true,
83+
autoDetect: true,
84+
},
85+
},
6986
},
7087
}
7188

packages/launchpad/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"dependencies": {
6666
"bunfig": "^0.10.1",
6767
"cac": "^6.7.14",
68-
"ts-pkgx": "0.4.15"
68+
"ts-pkgx": "0.4.19"
6969
},
7070
"devDependencies": {
7171
"bun-plugin-dtsx": "^0.9.5"

0 commit comments

Comments
 (0)