# Elderly Support deployment — 16 October 2026

## Active installation

- Project: `mamserver:/var/www/html/artcare`.
- Public host: `https://elderly.mam-app.org`; MAM-style sign-in: `/login`.
- Account: existing `ElderlyEntry@MAM`, user type 21; password was not reset.
- Registration: `/elderly-support/register`; management: `/elderly-support/register/manage`.
- Monitoring checklist: `/elderly-support/followup`; management: `/elderly-support/followup/manage`.
- Database connection and physical database: `MAM_NAP`.
- Apache origin: `127.0.0.1:8089`, same project `public/` directory.
- Dedicated tunnel: `mam-elderly-support`, UUID `0582853d-dc8f-40c2-a15c-2eca95ee3f8d`.
- Tunnel service: `cloudflared-elderly-support.service`; configuration: `/etc/cloudflared/elderly-support.yml`; readiness endpoint: `127.0.0.1:20249/ready`.

The existing main tunnel configuration at `/root/.cloudflared/config.yml` was not edited or restarted. Apache received a graceful reload to add the loopback listener and virtual host. Other PHP/ART/Child Support services were not stopped. The public host inherits the existing Cloudflare Access sign-in; the user confirmed reaching Elderly Support after completing it.

The local source and deployed runtime are kept aligned using an explicit SHA-256 manifest. The current runtime consists of 36 files, including four minimal shared integration files from the registration phase: Kernel, RouteServiceProvider and both User model copies. Production Composer resolves `App\Models\User` from `app/remote_models/Models/User.php`, so both copies carry the access helper. The MAM-style elderly login is module-owned; existing shared login views/controllers are not overwritten. Phase 3 changed only Elderly module files.

## Database and secrets

The registration phase applied only `database/migrations/2026_10_16_000100_create_elderly_support_registration_tables.php`, explicitly with `--database=MAM_NAP --path=... --force`. It created `elderly_support_registers`, `elderly_support_sync_events` and `elderly_support_sync_counters`. Phase 3 applied only `2026_10_16_000200_create_elderly_support_followup_tables.php`, adding `elderly_support_followups`, `elderly_support_followup_sync_events` and `elderly_support_followup_sync_counters`. Both counters have their initialization row. No unrelated pending migration or role-column change was run.

The persistent elderly payload secret was generated privately on mamserver. It is distinct from Child Support and was not copied to the local `.env` or included in deployment archives. Existing credentials were preserved. The live `.env` is owned by `zeya:www-data`, mode 0640. Preserve the server secret and private backups when replacing a server; changing it makes earlier encrypted payloads unreadable.

## Deployment artifacts and backups

Local deployment package: `outputs/elderly-support-deploy-20261016/`.

Remote staging/results: `/var/www/html/artcare/storage/app/elderly-support-deploy-20261016/` (private, outside `public/`).

- Initial source/environment backup: `/var/www/html/artcare/.local-backups/elderly-support-20261016T035334Z`.
- Registration/login/PWA correction backup: `/var/www/html/artcare/.local-backups/elderly-support-review-20261016T041044Z`.
- Apache/tunnel activation backup: `/root/elderly-support-activation-20261016T040247Z`.

The root activation script is retained at `scripts/elderly-support/activate-origin.sh`. Its successful activation output included an empty `/dev/null` config diagnostic before DNS creation; DNS creation and tunnel readiness succeeded. The retained script now uses the valid dedicated configuration for that DNS command. No rerun is required.

## Verification and limits

| Check | Evidence |
| --- | --- |
| Existing application routes | All 94 pre-existing route definitions preserved; now 25 Elderly host routes |
| Main service continuity | Apache and original Cloudflare process identities/start times retained; ART login 200 and Child Support register 302 remained healthy |
| Dedicated origin and tunnel | Port 8089 listening; tunnel ready with four connections |
| Public HTTPS and account login | TLS certificate verification passed; user confirmed reaching Elderly Support through Cloudflare Access and signing in with the existing account |
| Guest protection and PWA dependencies | Phase 3: 24 read-only live origin checks passed, including no-store 401 APIs, all four shells, login, manifest, worker, styles, scripts and both icons |
| Local automated checks after corrections | 28 backend integration, 19 real-Chrome browser, and 4 JavaScript logic checks passed; synthetic data on disposable MySQL |
| Registration source | Printed questions in registration images 1–3 checked; see `SOURCE_COMPARISON.md` |

## Program ID update

The user-confirmed ID rule is deployed: clinic `HTY`, `SPT`, `SDG` or `TL`, year `26`, and a manually entered five-digit serial from `00001` to `99999`, stored as one string such as `HTY-26-00001`. Three controls compose the ID; browser and server validation agree, leading zeros survive offline/reload/sync, and changing the code preserves the registration UUID. Duplicate combined IDs remain rejected.

Seven module files were updated without a migration or service restart. Backup: `/var/www/html/artcare/.local-backups/elderly-support-id-20261016T045523Z`. Patch staging/results: `/var/www/html/artcare/storage/app/elderly-support-id-20261016/`; local copy: `outputs/elderly-support-id-20261016/`. The full local runtime package was refreshed and still contains 29 files. There were no production registrations at this patch's preflight; no record data was rewritten.

After this update, 31 backend, 20 browser and 5 JavaScript checks passed on disposable local data. Live read-only checks passed for all 19 origin endpoints/assets and five production PHP format cases. Worker cache is now `elderly-support-shell-v4-program-id-20261016`; refresh online after saving current work to load the new controls.

The automated write/sync browser suite was not run against the live database. No production test case was inserted or deleted. Actual account login was confirmed by the user through Cloudflare Access. Browser vault creation and a device's installation/offline cycle are still being confirmed; the form is hidden until first-time offline password setup is complete. Firefox/Safari, native installation prompts, follow-up, reports and source-format Excel export remain outside the completed verification.

Read-only origin checks can be repeated on mamserver without migrations or service changes:

```bash
python3 /var/www/html/artcare/storage/app/elderly-support-deploy-20261016/verify-origin.py
```

Do not run the disposable database fixture tests against production or deploy the QA router as a public entry point.

## Phase 3 follow-up deployment

Deployed with `scripts/elderly-support/deploy-phase3.py`. It checked the existing source checksums, the physical `MAM_NAP` database and uncached routes/configuration before changing files. Eighteen module runtime files were installed atomically per file, with new dependencies and the specific follow-up migration before activating the pages. The full backup package now contains 36 runtime files.

- Private backup: `/var/www/html/artcare/.local-backups/elderly-support-phase3-20261016T105956Z`.
- Server staging, migration logs and result: `/var/www/html/artcare/storage/app/elderly-support-phase3-deploy-20261016/`.
- Local deployment copy: `outputs/elderly-support-phase3-deploy-20261016/`.
- Only the follow-up migration was invoked; the existing registration count stayed at one, and follow-up tables began with zero cases. No live test registration/visit was inserted or deleted.
- Environment/secrets were unchanged. Apache and both tunnel process IDs were retained; ART login remained 200 and Child Support registration remained 302. No service was restarted.
- Verification: 31 registration backend, 35 follow-up backend, 20 registration browser, 20 follow-up browser and 6 core checks passed locally. All 24 production origin checks passed.

The same offline password opens both forms. Browser storage upgrades add follow-up stores while preserving the earlier account key and registration data/queue. The test suite verified a version-one vault upgrade and an offline parent/visit sync. Save open work before refreshing online to load the new navigation and worker. Lock/logout also clears the identity heading as well as form and table data.

See [PHASE_3.md](PHASE_3.md) for the source comparison, visit snapshots, management filters, sync/deletion behavior and remaining scope.
