Commit Graph

7 Commits

Author SHA1 Message Date
ff
cbe7d13dd2 feat: add auto-import toggle to restore latest backup after rclone pull
Adds autoImportEnabled/autoImportHour to rclone config. A separate
hourly cron finds the latest .zip in backups/ and restores it to the
database (drop schema, psql restore, apply migrations). Frontend shows
toggle + time picker + Import Now button in the Receiver PC section.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 23:45:15 -04:00
ff
5e881c9ff7 feat: integrate rclone WebDAV backup for PC-to-PC file sync
Source PC serves backups/ folder via rclone WebDAV server (auto-starts with app).
Receiver PC pulls backups on schedule using rclone sync.
Network Backup UI now has two tabs: Rclone and API Key.
Rclone installed automatically via postinstall script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 23:29:36 -04:00
Summit Dental Care
cee84bcd61 feat: add eye icon toggle to source PC API key field
Allows verifying the pasted key is correct before saving.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:34:07 -04:00
Summit Dental Care
8572f44386 fix: move network sync form population out of queryFn into useEffect
Side effects inside queryFn caused the enabled toggle and other fields to
reset on refetch because SyncStatus shares the same query key with a
different queryFn, making formLoaded unreliable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:32:04 -04:00
Summit Dental Care
8e18e96db4 fix: trim whitespace from network sync URL and API key; clarify source URL format in UI
Copy-paste often adds trailing whitespace that breaks the API key comparison.
Updated placeholder and description to show the correct URL format (no port number).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 23:14:00 -04:00
ff
a8ec1a21c0 feat: include uploads folder in network sync (all three subfolders)
Daily sync and Sync Now both pull database + uploads in one operation.
PC1 streams uploads/ as a zip via GET /network-backup-files (archiver).
PC2 clears cloud-storage, patients, and patient-documents then extracts
the fresh copy before resolving. Timeout extended to 5 min for large files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 10:10:46 -04:00
ff
f5f3768108 feat: add Network Backup section to Database Management
PC2 can now automatically pull and restore a fresh copy of PC1's database
on a daily schedule. Config and API key are stored in local JSON files so
they survive database restores.

- New networkSyncConfigService: file-based config (network-backup-key.json,
  network-sync-config.json) that persists through DB restores
- New networkSyncService: streams live pg_dump from source PC over HTTP and
  pipes into psql, then reconnects Prisma and applies missing migrations
- 6 new endpoints: get/regenerate API key, serve backup stream (key-auth
  only), get/save sync config, trigger immediate sync
- Hourly cron job that fires only when current hour matches configured syncHour
- NetworkBackupManager component: shows this machine's key (show/copy/regen)
  and receiver config (enable toggle, hour picker 0-23, source URL + key,
  Save + Sync Now, last sync status)
- README setup guide for both PCs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 00:15:42 -04:00