Files
crm.clientright.ru/crm_extensions/file_storage/config.php
Fedor 0f32f271d5 fix: Обновлен путь Nextcloud с /crm2/ на /crm/ для нового сервера
- Изменен active_folder с '/crm2/CRM_Active_Files/' на '/crm/CRM_Active_Files/'
- Причина: На новом Nextcloud (office.clientright.ru) S3 примонтирован как /crm (не /crm2)
- Папка /crm/CRM_Active_Files/ существует и содержит подпапки Documents и crm2
- Конфигурация соответствует реальной структуре External Storage
2025-10-20 17:11:27 +03:00

75 lines
2.7 KiB
PHP

<?php
/**
* File Storage Integration Configuration
* Конфигурация интеграции S3 + Nextcloud + vTiger
*/
require_once __DIR__ . '/../shared/EnvLoader.php';
// Загружаем переменные окружения из правильного пути
$envPath = __DIR__ . '/../.env';
if (!file_exists($envPath)) {
throw new Exception('Environment file not found at: ' . $envPath);
}
EnvLoader::load($envPath);
return [
// S3 Configuration
's3' => [
'key' => EnvLoader::getRequired('S3_ACCESS_KEY'),
'secret' => EnvLoader::getRequired('S3_SECRET_KEY'),
'endpoint' => EnvLoader::getRequired('S3_ENDPOINT'),
'bucket' => EnvLoader::getRequired('S3_BUCKET'),
'region' => EnvLoader::get('S3_REGION', 'ru-1'),
'use_path_style_endpoint' => true,
'version' => 'latest',
],
// Nextcloud Configuration
'nextcloud' => [
'base_url' => EnvLoader::getRequired('NEXTCLOUD_URL'),
'username' => EnvLoader::getRequired('NEXTCLOUD_USERNAME'),
'password' => EnvLoader::getRequired('NEXTCLOUD_PASSWORD'),
'active_folder' => '/crm/CRM_Active_Files/',
'timeout' => 30,
],
// n8n Configuration (отключено)
// 'n8n' => [
// 'webhook_url' => EnvLoader::getRequired('N8N_WEBHOOK_URL'),
// 'api_key' => EnvLoader::get('N8N_API_KEY'),
// 'timeout' => 60,
// ],
// Application Settings
'app' => [
'debug' => EnvLoader::getBool('DEBUG_MODE', false),
'log_level' => EnvLoader::get('LOG_LEVEL', 'INFO'),
'encryption_key' => EnvLoader::getRequired('ENCRYPTION_KEY'),
],
// File Storage Behavior
'storage' => [
'cleanup_after_sync' => EnvLoader::getBool('CLEANUP_AFTER_SYNC', true),
'keep_versions' => EnvLoader::getInt('KEEP_VERSIONS', 5),
'temp_files_ttl' => EnvLoader::getInt('TEMP_FILES_TTL', 86400),
'max_file_size' => EnvLoader::getInt('MAX_FILE_SIZE', 100 * 1024 * 1024), // 100MB
],
// Supported file formats for editing
'editable_formats' => [
'documents' => ['doc', 'docx', 'odt', 'rtf', 'txt'],
'spreadsheets' => ['xls', 'xlsx', 'ods', 'csv'],
'presentations' => ['ppt', 'pptx', 'odp'],
'text' => ['txt', 'md', 'html', 'xml'],
'images' => ['jpg', 'jpeg', 'png', 'gif', 'bmp'],
],
// AI Drawer Integration
'ai_drawer' => [
'history_preload' => EnvLoader::getBool('AI_HISTORY_PRELOAD', true),
'mobile_keyboard_fix' => EnvLoader::getBool('AI_MOBILE_KEYBOARD_FIX', true),
'session_timeout' => EnvLoader::getInt('AI_SESSION_TIMEOUT', 3600),
]
];