Files
server-manager/config/config.php
Agent 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

72 lines
2.4 KiB
PHP
Executable File

<?php
declare(strict_types=1);
return [
'app' => [
'name' => $_ENV['APP_NAME'] ?? 'ServerManager',
'env' => $_ENV['APP_ENV'] ?? 'production',
'debug' => filter_var($_ENV['APP_DEBUG'] ?? false, FILTER_VALIDATE_BOOLEAN),
'url' => $_ENV['APP_URL'] ?? 'http://localhost',
'timezone' => $_ENV['APP_TIMEZONE'] ?? 'America/Santo_Domingo',
],
'database' => [
'host' => $_ENV['DB_HOST'] ?? '127.0.0.1',
'port' => (int) ($_ENV['DB_PORT'] ?? 3306),
'database' => $_ENV['DB_DATABASE'] ?? 'servermanager',
'username' => $_ENV['DB_USERNAME'] ?? 'root',
'password' => $_ENV['DB_PASSWORD'] ?? '',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
],
'session' => [
'lifetime' => (int) ($_ENV['SESSION_LIFETIME'] ?? 1440),
'secure' => filter_var($_ENV['SESSION_SECURE'] ?? true, FILTER_VALIDATE_BOOLEAN),
'http_only' => filter_var($_ENV['SESSION_HTTP_ONLY'] ?? true, FILTER_VALIDATE_BOOLEAN),
'same_site' => $_ENV['SESSION_SAME_SITE'] ?? 'Lax',
],
'csrf' => [
'token_length' => (int) ($_ENV['CSRF_TOKEN_LENGTH'] ?? 64),
'token_expiry' => (int) ($_ENV['CSRF_TOKEN_EXPIRY'] ?? 7200),
],
'rate_limit' => [
'max_attempts' => (int) ($_ENV['RATE_LIMIT_MAX_ATTEMPTS'] ?? 5),
'decay_minutes' => (int) ($_ENV['RATE_LIMIT_DECAY_MINUTES'] ?? 15),
],
'encryption' => [
'method' => 'aes-256-cbc',
'master_key' => $_ENV['MASTER_ENCRYPTION_KEY'] ?? null,
'master_key_file' => $_ENV['MASTER_ENCRYPTION_KEY_FILE'] ?? null,
],
'ssh' => [
'timeout' => (int) ($_ENV['SSH_TIMEOUT'] ?? 30),
'keepalive_interval' => (int) ($_ENV['SSH_KEEPALIVE_INTERVAL'] ?? 10),
'command_timeout' => (int) ($_ENV['SSH_COMMAND_TIMEOUT'] ?? 60),
],
'monitoring' => [
'interval' => (int) ($_ENV['MONITORING_INTERVAL'] ?? 30),
'retention_days' => (int) ($_ENV['MONITORING_RETENTION_DAYS'] ?? 30),
],
'api' => [
'rate_limit' => (int) ($_ENV['API_RATE_LIMIT'] ?? 60),
'rate_limit_window' => (int) ($_ENV['API_RATE_LIMIT_WINDOW'] ?? 60),
],
'fcm' => [
'server_key' => $_ENV['FCM_SERVER_KEY'] ?? '',
],
'log' => [
'path' => $_ENV['LOG_PATH'] ?? __DIR__ . '/../logs/',
'level' => $_ENV['LOG_LEVEL'] ?? 'warning',
],
];