Fixed docker errors and improved error logging..

This commit is contained in:
Hosteroid
2025-10-29 12:45:01 +02:00
parent 0e08e807d3
commit a0ada0b2c2
4 changed files with 23 additions and 2 deletions

View File

@@ -479,7 +479,7 @@ class TldRegistryService
/** /**
* Get count of TLDs that need WHOIS data * Get count of TLDs that need WHOIS data
*/ */
public function getTldsNeedingWhoisCount(int $logId = null): int public function getTldsNeedingWhoisCount(?int $logId = null): int
{ {
if ($logId) { if ($logId) {
// For a specific import session, count TLDs that haven't been processed yet // For a specific import session, count TLDs that haven't been processed yet

View File

@@ -278,7 +278,7 @@ class TwoFactorService
/** /**
* Check rate limiting for 2FA attempts * 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); $rateLimitMinutes = (int)$this->settingModel->getValue('two_factor_rate_limit_minutes', 15);
$since = date('Y-m-d H:i:s', time() - ($rateLimitMinutes * 60)); $since = date('Y-m-d H:i:s', time() - ($rateLimitMinutes * 60));

View File

@@ -12,6 +12,9 @@ class Application
public function __construct() public function __construct()
{ {
// Configure error reporting based on environment
$this->configureErrorReporting();
self::$router = new Router(); self::$router = new Router();
self::$db = new Database(); self::$db = new Database();
@@ -19,6 +22,21 @@ class Application
$this->errorHandler = new ErrorHandler(); $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() public function run()
{ {
try { try {

View File

@@ -114,6 +114,9 @@ for d in logs storage cache tmp runtime; do
fi fi
done done
# Allow installer to create .installed at project root
chmod 775 "$APP_DIR"
# .env readable by root & group only # .env readable by root & group only
chmod 640 "$APP_DIR/.env" || true chmod 640 "$APP_DIR/.env" || true