diff --git a/app/Services/TldRegistryService.php b/app/Services/TldRegistryService.php index 1d03bc6..e25da01 100644 --- a/app/Services/TldRegistryService.php +++ b/app/Services/TldRegistryService.php @@ -479,7 +479,7 @@ class TldRegistryService /** * Get count of TLDs that need WHOIS data */ - public function getTldsNeedingWhoisCount(int $logId = null): int + public function getTldsNeedingWhoisCount(?int $logId = null): int { if ($logId) { // For a specific import session, count TLDs that haven't been processed yet diff --git a/app/Services/TwoFactorService.php b/app/Services/TwoFactorService.php index 3575262..2254934 100644 --- a/app/Services/TwoFactorService.php +++ b/app/Services/TwoFactorService.php @@ -278,7 +278,7 @@ class TwoFactorService /** * Check rate limiting for 2FA attempts */ - public function checkRateLimit(string $ipAddress, int $userId = null): bool + public function checkRateLimit(string $ipAddress, ?int $userId = null): bool { $rateLimitMinutes = (int)$this->settingModel->getValue('two_factor_rate_limit_minutes', 15); $since = date('Y-m-d H:i:s', time() - ($rateLimitMinutes * 60)); diff --git a/core/Application.php b/core/Application.php index fe38d33..0fab170 100644 --- a/core/Application.php +++ b/core/Application.php @@ -12,12 +12,30 @@ class Application public function __construct() { + // Configure error reporting based on environment + $this->configureErrorReporting(); + self::$router = new Router(); self::$db = new Database(); // Initialize error handler $this->errorHandler = new ErrorHandler(); } + + private function configureErrorReporting() + { + $env = $_ENV['APP_ENV'] ?? 'development'; + + if ($env === 'production') { + // In production, suppress deprecation warnings to prevent header issues + error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); + ini_set('display_errors', '0'); + } else { + // In development, show all errors including deprecations + error_reporting(E_ALL); + ini_set('display_errors', '1'); + } + } public function run() { diff --git a/domain-monitor-docker/bootstrap.sh b/domain-monitor-docker/bootstrap.sh index c5b09f1..41ff32d 100644 --- a/domain-monitor-docker/bootstrap.sh +++ b/domain-monitor-docker/bootstrap.sh @@ -114,6 +114,9 @@ for d in logs storage cache tmp runtime; do fi done +# Allow installer to create .installed at project root +chmod 775 "$APP_DIR" + # .env readable by root & group only chmod 640 "$APP_DIR/.env" || true