Initial commit of the Asset Management System, including project structure, Docker configuration, database migrations, and core application files. Added user authentication, asset management features, and basic UI components.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Application Configuration
|
||||
*/
|
||||
|
||||
// Database configuration
|
||||
define('DB_HOST', $_ENV['DB_HOST'] ?? 'localhost');
|
||||
define('DB_PORT', $_ENV['DB_PORT'] ?? 3306);
|
||||
define('DB_NAME', $_ENV['DB_NAME'] ?? 'inventory');
|
||||
define('DB_USER', $_ENV['DB_USER'] ?? 'root');
|
||||
define('DB_PASS', $_ENV['DB_PASS'] ?? '');
|
||||
|
||||
// Application settings
|
||||
define('APP_ENV', $_ENV['APP_ENV'] ?? 'production');
|
||||
define('APP_URL', $_ENV['APP_URL'] ?? 'http://localhost:8080');
|
||||
define('APP_DEBUG', $_ENV['APP_DEBUG'] ?? false);
|
||||
define('APP_KEY', $_ENV['APP_KEY'] ?? 'base64:default-key-change-in-production');
|
||||
|
||||
// Session settings
|
||||
define('SESSION_SECURE', $_ENV['SESSION_SECURE'] ?? false);
|
||||
define('SESSION_LIFETIME', $_ENV['SESSION_LIFETIME'] ?? 3600);
|
||||
|
||||
// File upload settings
|
||||
define('UPLOAD_MAX_SIZE', $_ENV['UPLOAD_MAX_SIZE'] ?? '50M');
|
||||
define('ALLOWED_FILE_TYPES', $_ENV['ALLOWED_FILE_TYPES'] ?? 'pdf,jpg,jpeg,png,gif,doc,docx,xls,xlsx');
|
||||
|
||||
// Security settings
|
||||
define('CSRF_TOKEN_LIFETIME', $_ENV['CSRF_TOKEN_LIFETIME'] ?? 3600);
|
||||
define('PASSWORD_MIN_LENGTH', $_ENV['PASSWORD_MIN_LENGTH'] ?? 8);
|
||||
define('LOGIN_MAX_ATTEMPTS', $_ENV['LOGIN_MAX_ATTEMPTS'] ?? 5);
|
||||
define('LOGIN_LOCKOUT_TIME', $_ENV['LOGIN_LOCKOUT_TIME'] ?? 900);
|
||||
|
||||
// Paths
|
||||
define('ROOT_PATH', dirname(__DIR__));
|
||||
define('APP_PATH', ROOT_PATH . '/app');
|
||||
define('CONFIG_PATH', ROOT_PATH . '/config');
|
||||
define('STORAGE_PATH', ROOT_PATH . '/storage');
|
||||
define('PUBLIC_PATH', ROOT_PATH . '/public');
|
||||
define('LANG_PATH', ROOT_PATH . '/lang');
|
||||
|
||||
// Error reporting
|
||||
if (APP_DEBUG) {
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
} else {
|
||||
error_reporting(0);
|
||||
ini_set('display_errors', 0);
|
||||
}
|
||||
|
||||
// Set timezone
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
// Configure session
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.cookie_secure', SESSION_SECURE ? 1 : 0);
|
||||
ini_set('session.cookie_samesite', 'Strict');
|
||||
ini_set('session.use_strict_mode', 1);
|
||||
ini_set('session.gc_maxlifetime', SESSION_LIFETIME);
|
||||
Reference in New Issue
Block a user