Files
sides/STATE.md
2026-05-30 23:41:15 +08:00

53 lines
3.0 KiB
Markdown

# SIDES Deploy — STATE.md
## Deployment Status
- **App**: Running on Proxmox LXC (Docker Compose)
- **URL**: http://localhost:8080 (or server IP:8080)
- **Timezone**: Asia/Kuala_Lumpur (UTC+8) on all containers
## User Accounts
| Username | Password | Access Level | Notes |
|----------|----------|-------------|-------|
| admin | sides2026 | 1 (Admin) | Full access |
| jpskedah | kedah2026 | 1 (Admin) | Full access (upgraded from level 2) |
| ijantck | sides2026 | 1 (Admin) | Full access |
| imam14 | sides2026 | 1 (Admin) | Full access |
## Bugs Fixed
### Critical
- **RainfallController SQL binding**: Off-by-one (11 params vs 10 `?` placeholders) + Carbon object passed as string binding. Fixed to use formatted strings.
- **WaterLevelController displayDate**: Carbon object passed instead of string. Fixed.
- **Storage permissions**: `storage/` and `bootstrap/cache/` chowned to UID 1000 (`www`). Log file truncated.
- **PHP-FPM 502 Bad Gateway**: Nginx cached stale DNS for `app` container. Fixed by restarting nginx.
- **Asset URL generation**: Added `ForceRequestScheme` middleware + `TrustProxies(at: '*')` so `asset()` uses the client's actual host instead of hardcoded `localhost:8080`.
- **Nginx X-Forwarded headers**: Added to fastcgi params for proper proxy support.
- **JS null guards**: `script.js` — guard `#map` and flatpickr elements. `graph.js` — guard `#hourlyGraph`. `homemap.js` — no guard needed (public homepage always has `#map`).
- **graph.js comma typo**: `input:not([readonly]),,``input:not([readonly]),`
### Browser Cache Issues
- Added `?h=<md5>` cache-busting suffixes to JS/CSS URLs
- Added `Cache-Control: no-cache, no-store, must-revalidate` headers via nginx for `.js`/`.css`
- Added `Cache-Control: no-cache, no-store, must-revalidate` via ForceRequestScheme middleware for HTML
- Added `<meta http-equiv="Cache-Control/Pragma/Expires">` no-cache tags in header blade
### Configuration
- **Timezone**: `TZ=Asia/Kuala_Lumpur` in `.env`, applied to all containers via `docker-compose.yml`
- **APP_TIMEZONE**: `Asia/Kuala_Lumpur` in `src/.env`, used by `config/app.php`
### Data
- PostgreSQL 18: Data dir path fixed to `/var/lib/postgresql/data`, PGDATA set, non-empty password
- Backup data restored from `backup/sides_20260528` (users, stations, rainfall, waterlevel, notification)
- `users.email` made nullable (admin, jpskedah have NULL emails)
- DB sequences reset to 300K+ to avoid duplicate key errors
- PostgreSQL RULEs for `ON CONFLICT DO NOTHING` on sensor tables
- Admin password reset to `sides2026` (hash compatible with Laravel)
## Quick Tasks Completed
| Date | Slug | Description | Status |
|------|------|-------------|--------|
| 2026-05-29 | browser-cache-fix | Added cache-busting hashes, no-cache headers, HTML meta tags | Complete |
| 2026-05-29 | login-passwords | Set known passwords for all 4 users, upgraded jpskedah to admin | Complete |
| 2026-05-29 | timezone-config | Added TZ=Asia/Kuala_Lumpur to all containers via docker-compose | Complete |