Commit Graph

189 Commits

Author SHA1 Message Date
95066d9aea remove plan file from tracking 2026-06-13 17:29:07 -04:00
2c6728be12 feat: add notifications_enabled toggle for users (web + Android) 2026-06-13 17:28:59 -04:00
4fa57e8688 feat: send notification to all users when app version is updated 2026-06-13 17:12:54 -04:00
eda923dc44 Merge pull request 'send FCM push for threshold breach notifications' (#74) from feat/fcm-apk-v1.8.2 into master
Reviewed-on: #74
2026-06-13 16:24:20 -04:00
ebb7cba53d send FCM push for threshold breach notifications 2026-06-13 16:23:20 -04:00
22a6eb8d29 Merge pull request 'feat: per-server notification thresholds with alert on agent metrics push' (#73) from feat/fcm-apk-v1.8.2 into master
Reviewed-on: #73
2026-06-13 16:15:54 -04:00
c63c5ffcfd feat: per-server notification thresholds with alert on agent metrics push 2026-06-13 16:12:36 -04:00
a932def7c4 Merge pull request 'chore: drop unused tables (scheduled_tasks, api_tokens, rate_limits, sessions)' (#72) from feat/fcm-apk-v1.8.2 into master
Reviewed-on: #72
2026-06-13 15:59:28 -04:00
b6c7275437 docs: add PR creation workflow to AGENTS.md 2026-06-13 15:59:05 -04:00
0a3ae63621 chore: add config/firebase-service-account.json to .gitignore 2026-06-13 15:56:52 -04:00
cf9a8402cf remove firebase service account from tracking (local only) 2026-06-13 15:56:01 -04:00
d386df637d remove firebase-setup.sh and servermanager-agent.service from install/ 2026-06-13 15:55:56 -04:00
756a6d8d14 move install scripts to bin/, remove unused install directory 2026-06-13 15:55:49 -04:00
b19c3c7a3a remove standalone agent.sh — replaced by installer-generated inline agent 2026-06-13 15:52:20 -04:00
6c6ad957bc remove monitor.php — SSH pull monitoring replaced by push-based agent 2026-06-13 15:49:35 -04:00
a9f21810b1 chore: drop unused tables (scheduled_tasks, api_tokens, rate_limits, sessions) 2026-06-13 15:42:59 -04:00
77af8dd6b0 Merge pull request 'fix: remove invalid priority field from AndroidNotification in FCM v1 payload' (#71) from feat/fcm-apk-v1.8.2 into master
Reviewed-on: #71
2026-06-13 14:42:47 -04:00
d231af1c91 fix: remove invalid priority field from AndroidNotification in FCM v1 payload 2026-06-13 14:41:56 -04:00
3a677ea334 Merge pull request 'bump to 1.8.2 with FCM registration fix and APK rebuild' (#70) from feat/fcm-apk-v1.8.2 into master
Reviewed-on: #70
Reviewed-by: rafaga21 <rafaelminaya20@hotmail.com>
2026-06-13 14:32:25 -04:00
d37edd7d54 bump to 1.8.2 (versionCode 14) and rebuild APK with FCM registration fix 2026-06-13 14:31:35 -04:00
d977ec9a47 Merge pull request 'remove Firebase service account file from repo (keep local only)' (#69) from feat/fcm-config into master
Reviewed-on: #69
2026-06-13 14:27:14 -04:00
d8425a69dc remove Firebase service account file from repo (keep local only) 2026-06-13 14:26:45 -04:00
6eaf3811db Merge pull request 'add Firebase service account for FCM push notifications' (#68) from feat/fcm-config into master
Reviewed-on: #68
Reviewed-by: rafaga21 <rafaelminaya20@hotmail.com>
2026-06-13 14:25:36 -04:00
f34c10df91 add Firebase service account file for FCM push notifications 2026-06-13 14:23:47 -04:00
63e55ecf7e Merge pull request 'feat: Firebase Cloud Messaging push notifications' (#66) from feat/fcm-notifications into master
Reviewed-on: #66
2026-06-13 14:05:44 -04:00
7876a730c8 Merge branch 'master' into feat/fcm-notifications 2026-06-13 14:05:13 -04:00
a988b88077 bump to 1.8.1 (versionCode 13) and rebuild APK 2026-06-13 14:04:10 -04:00
60e91b56d3 fix: register FCM token on app startup and improve error logging 2026-06-13 14:04:10 -04:00
e1e68f5f11 fix: actively fetch FCM token on login if not cached
- LoginViewModel now calls Tasks.await(FirebaseMessaging.getInstance().token)
  to actively fetch the FCM token if not yet saved in prefs
- Previous code relied solely on onNewToken callback, which may not fire
  before the user logs in on a fresh install
2026-06-13 14:04:10 -04:00
45dc21461c fix: FCM push not sending — add v1 API + better diagnostics
- FCMService now supports both HTTP v1 API (service account) and legacy API (server key)
- v1 API uses OAuth2 JWT auth with Firebase service account; tries this first
- Falls back to legacy HTTP API if only server key is configured
- Removes invalid tokens from DB automatically (NotRegistered, INVALID_ARGUMENT, etc.)
- AdminController now logs push result status and shows in UI response
- .env updated with FCM_SERVER_KEY placeholder and docs
- Migration 010 run in dev
2026-06-13 14:04:09 -04:00
c3a736f927 chore: add real Firebase config and messaging dependency
- google-services.json now has real Firebase project values
- Added firebase-messaging-ktx dependency (was missing)
- Updated google-services plugin to 4.4.4
2026-06-13 14:04:09 -04:00
32740b1ee0 feat: Firebase Cloud Messaging push notifications
Backend:
- New user_fcm_tokens table (migration 010) for storing device tokens
- FCMService sends push via Firebase HTTP legacy API (server key from .env)
- POST /api/fcm/register endpoint for Android to register its FCM token
- AdminController::sendNotification() triggers FCM push after DB insert
- FCM config added to config.php

Android:
- Firebase Cloud Messaging service (ServerManagerFirebaseService)
  receives push notifications and shows them via NotificationHelper
- FCM token registered with backend on new token and on login
- google-services.json template (must be replaced with real Firebase config)
- firebase-setup.sh script with configuration instructions
- FCM dependency + google-services plugin added to Gradle
- Bump to v1.8.0 (versionCode 12)
2026-06-13 14:04:09 -04:00
4c71beb180 Merge pull request 'fix: register FCM token on app startup + rebuild APK 1.8.1' (#65) from feat/dashboard-aggregated-chart into master
Reviewed-on: #65
Reviewed-by: rafaga21 <rafaelminaya20@hotmail.com>
2026-06-13 13:49:52 -04:00
5ff3b255c4 bump to 1.8.1 (versionCode 13) and rebuild APK 2026-06-13 13:48:51 -04:00
35c5d43f74 Merge pull request 'fix: register FCM token on app startup and improve error logging' (#64) from feat/dashboard-aggregated-chart into master
Reviewed-on: #64
2026-06-13 13:47:06 -04:00
94e3dfe236 fix: register FCM token on app startup and improve error logging 2026-06-13 13:46:03 -04:00
80833cf256 Merge pull request 'fix: actively fetch FCM token on login if not cached' (#63) from feat/dashboard-aggregated-chart into master
Reviewed-on: #63
2026-06-13 13:24:22 -04:00
395c84f75e fix: actively fetch FCM token on login if not cached
- LoginViewModel now calls Tasks.await(FirebaseMessaging.getInstance().token)
  to actively fetch the FCM token if not yet saved in prefs
- Previous code relied solely on onNewToken callback, which may not fire
  before the user logs in on a fresh install
2026-06-13 13:23:29 -04:00
dcc57e08f0 Merge pull request 'fix: FCM push not sending — add v1 API + better diagnostics' (#62) from feat/dashboard-aggregated-chart into master
Reviewed-on: #62
2026-06-13 13:15:36 -04:00
f1f263225f fix: FCM push not sending — add v1 API + better diagnostics
- FCMService now supports both HTTP v1 API (service account) and legacy API (server key)
- v1 API uses OAuth2 JWT auth with Firebase service account; tries this first
- Falls back to legacy HTTP API if only server key is configured
- Removes invalid tokens from DB automatically (NotRegistered, INVALID_ARGUMENT, etc.)
- AdminController now logs push result status and shows in UI response
- .env updated with FCM_SERVER_KEY placeholder and docs
- Migration 010 run in dev
2026-06-13 13:11:12 -04:00
1277a460b6 Merge pull request 'feat: Firebase Cloud Messaging push notifications' (#61) from feat/dashboard-aggregated-chart into master
Reviewed-on: #61
2026-06-13 13:01:58 -04:00
988ea118b0 chore: add real Firebase config and messaging dependency
- google-services.json now has real Firebase project values
- Added firebase-messaging-ktx dependency (was missing)
- Updated google-services plugin to 4.4.4
2026-06-13 13:00:54 -04:00
136eebc4c3 feat: Firebase Cloud Messaging push notifications
Backend:
- New user_fcm_tokens table (migration 010) for storing device tokens
- FCMService sends push via Firebase HTTP legacy API (server key from .env)
- POST /api/fcm/register endpoint for Android to register its FCM token
- AdminController::sendNotification() triggers FCM push after DB insert
- FCM config added to config.php

Android:
- Firebase Cloud Messaging service (ServerManagerFirebaseService)
  receives push notifications and shows them via NotificationHelper
- FCM token registered with backend on new token and on login
- google-services.json template (must be replaced with real Firebase config)
- firebase-setup.sh script with configuration instructions
- FCM dependency + google-services plugin added to Gradle
- Bump to v1.8.0 (versionCode 12)
2026-06-13 12:37:40 -04:00
090294d856 Merge pull request 'feat(android): foreground service for real-time notification polling' (#60) from feat/dashboard-aggregated-chart into master
Reviewed-on: #60
2026-06-13 12:21:07 -04:00
bdc4d73d89 feat(android): foreground service for real-time notification polling
- New NotificationForegroundService: persistent foreground coroutine-based
  polling every 30s, keeps app alive in background
- Manifest: FOREGROUND_SERVICE + FOREGROUND_SERVICE_DATA_SYNC permissions,
  service declaration with foregroundServiceType=dataSync
- NotificationHelper: added silent channel for persistent service notification
- ServerManagerApp: starts foreground service on app launch
- MainActivity: removed redundant NotificationWorker.checkNow (service handles
  background polling; NotificationPoller still handles in-app refresh)
- Bump to v1.8.0 (versionCode 12)
2026-06-13 12:20:09 -04:00
d5431353dd Merge pull request 'refactor: drop is_read and read_at from notifications table' (#59) from feat/dashboard-aggregated-chart into master
Reviewed-on: #59
2026-06-13 12:05:24 -04:00
80f5893d92 refactor: drop is_read and read_at from notifications table
- is_read and read_at columns are now obsolete since notification_reads
  tracks per-user read receipts
- Removed UPDATE statements in markAsRead/markAllAsRead that touched
  the old columns
- API response still includes computed is_read field via SQL CASE in
  getForUser() JOIN with notification_reads, maintaining Android
  compatibility
- Migration 009 drops both columns
2026-06-13 11:57:56 -04:00
839d5a190f Merge pull request 'fix: remove duplicate old() function causing 500 on create page' (#58) from feat/dashboard-aggregated-chart into master
Reviewed-on: #58
2026-06-13 11:54:18 -04:00
12c3e23d9c feat: track notification read receipts per user
- New notification_reads table (migration 008) with unique (notification_id, user_id)
- Notification model: markAsRead inserts into notification_reads; getForUser JOINs
  to show per-user read status; getUnreadCount checks NOT EXISTS in reads table
- getAll() includes read_count subquery for admin view
- Admin view shows 'X / Y' read count for broadcast notifications,
  'Read'/'Unread' badge for user-targeted ones
- Migrates existing read notifications into notification_reads
- AGENTS.md updated with new conventions
2026-06-13 11:48:05 -04:00
b94ae16f69 fix: remove duplicate old() function causing 500 on create page
- Removed the local old() function definition from views/servers/create.php
  which conflicted with the global old() in src/Helpers/functions.php:37
- Replaced all old() calls with direct htmlspecialchars([...]) lookups
2026-06-13 11:31:52 -04:00