ИСПРАВЛЕНИЕ: На новом Nextcloud S3 примонтирован как /crm, но внутри папка crm2 Правильный путь: /crm/crm2/CRM_Active_Files/ Выполнено в БД (rollback_and_fix.sql): - Откат предыдущей неправильной миграции из backup - s3_key: crm2/ → crm/crm2/ (17386 записей) - nc_path: /crm2/crm2/ → /crm/crm2/ (72 записи) - nc_path: /crm2/ → /crm/crm2/ (все остальные) Обновлены файлы кода: - crm_extensions/file_storage/config.php: active_folder = /crm/crm2/CRM_Active_Files/ - crm_extensions/nextcloud_editor/js/nextcloud-editor.js (5 путей) - crm_extensions/file_storage/api/get_edit_urls.php (6 путей) - modules/Documents/actions/NcPrepareEdit.php (2 пути) - crm_extensions/file_storage/api/prepare_edit.php (1 путь) - crm_extensions/file_storage/NextcloudClient.php (1 путь) Документ 395695: - s3_key: crm/crm2/CRM_Active_Files/Documents/395695/zayavlenie_proekt.docx ✓ - nc_path: /crm/crm2/CRM_Active_Files/Documents/395695/zayavlenie_proekt.docx ✓
75 lines
2.7 KiB
PHP
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/crm2/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),
|
|
]
|
|
];
|