Skip to content

Commit 23a8f7f

Browse files
committed
upDocs
1 parent b32beb9 commit 23a8f7f

3 files changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ OpenAPI (Swagger) docs, and zero code generation.
4747

4848
**🛡️ [SECURE YOUR DASHBOARD NOW →](docs/DASHBOARD_SECURITY.md)** - Complete protection guide
4949

50-
**Quick Fix (5 minutes):** Add IP whitelist to `.htaccess`:
50+
**Quick Fix (5 minutes):** Add IP whitelist to `.htaccess` (Apache 2.4+):
5151
```apache
5252
<Files "dashboard.html">
53-
Order Deny,Allow
54-
Deny from all
55-
Allow from YOUR.IP.ADDRESS # Replace with your IP
53+
# Allow only localhost by default
54+
Require ip 127.0.0.1 ::1
55+
56+
# To allow your public IP, add an extra line like:
57+
# Require ip YOUR.PUBLIC.IP.ADDRESS
5658
</Files>
5759
```
5860

@@ -186,6 +188,19 @@ return [
186188
];
187189
```
188190

191+
### Environment variables (.env)
192+
193+
For easier secret management and 12-factor style deployments, the project also supports a root-level `.env` file.
194+
195+
- Copy `.env.example` to `.env` and adjust values for your environment.
196+
- The following keys override values from `config/db.php` and `config/api.php` when defined:
197+
- `DB_HOST`, `DB_NAME`, `DB_USER`, `DB_PASS`, `DB_CHARSET`
198+
- `API_AUTH_METHOD`
199+
- `API_KEYS` (comma-separated list)
200+
- `BASIC_ADMIN_PASSWORD`, `BASIC_USER_PASSWORD`
201+
- `JWT_SECRET`, `JWT_EXPIRATION`, `JWT_ISSUER`, `JWT_AUDIENCE`
202+
- The public entrypoint loads `.env` before configs, and `.htaccess` protects `.env` from direct web access.
203+
189204
---
190205

191206
## 🔒 Security Setup (Production)

SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ With `debug = false`:
184184
Before deploying to production, verify:
185185

186186
- [ ] Dashboard and health endpoint are protected (IP whitelist or Basic Auth)
187+
- [ ] Sensitive folders (`config`, `src`, `storage`, `logs`, `vendor`, `private-vault`, `sql`, `tests`) are not web-accessible (web root points to `public/` **or** per-folder `.htaccess` uses `Require all denied`)
187188
- [ ] Authentication is enabled (`authentication.enabled = true`)
188189
- [ ] Strong API keys generated (not defaults or examples)
190+
- [ ] Secrets (DB credentials, JWT secret, API keys, Basic passwords) are not committed in Git and are configured via environment variables / `.env` or secure config files
189191
- [ ] Rate limiting is enabled
190192
- [ ] Request logging is enabled
191193
- [ ] Debug mode is disabled (`debug = false`)

docs/CONFIG_FLOW.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ return [
8484
];
8585
```
8686

87+
> 💡 **Environment overrides:** For deployments that use environment variables or a `.env` file, some sensitive values from `config/api.php` can be overridden at runtime (for example: `API_AUTH_METHOD`, `API_KEYS`, `BASIC_ADMIN_PASSWORD`, `BASIC_USER_PASSWORD`, `JWT_SECRET`, `JWT_EXPIRATION`, `JWT_ISSUER`, `JWT_AUDIENCE`). This keeps the configuration flow the same while allowing secrets to live outside of versioned PHP config files.
88+
8789
### Step 2: Router Loads Config via Config Class
8890

8991
**File:** `src/Router.php`

0 commit comments

Comments
 (0)