Files
crm.clientright.ru/explore_s3_backups.php
Fedor ac7467f0b4 Major CRM updates: AI Assistant, Court Status API, S3 integration improvements, and extensive file storage system
- Added comprehensive AI Assistant system (aiassist/ directory):
  * Vector search and embedding capabilities
  * Typebot proxy integration
  * Elastic search functionality
  * Message classification and chat history
  * MCP proxy for external integrations

- Implemented Court Status API (GetCourtStatus.php):
  * Real-time court document status checking
  * Integration with external court systems
  * Comprehensive error handling and logging

- Enhanced S3 integration:
  * Improved file backup system with metadata
  * Batch processing capabilities
  * Enhanced error logging and recovery
  * Copy operations with URL fixing

- Added Telegram contact creation API
- Improved error logging across all modules
- Enhanced callback system for AI responses
- Extensive backup file storage with timestamps
- Updated documentation and README files

- File storage improvements:
  * Thousands of backup files with proper metadata
  * Fix operations for broken file references
  * Project-specific backup and recovery systems
  * Comprehensive file integrity checking

Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
2025-10-16 11:17:21 +03:00

150 lines
4.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* Исследование содержимого S3 архива
*/
require_once 'crm_extensions/shared/EnvLoader.php';
require_once 'crm_extensions/vendor/autoload.php';
use Aws\S3\S3Client;
// Загружаем переменные окружения
EnvLoader::load();
// S3 настройки
$s3Endpoint = EnvLoader::get('S3_ENDPOINT');
$s3Bucket = EnvLoader::get('S3_BUCKET');
$s3AccessKey = EnvLoader::get('S3_ACCESS_KEY');
$s3SecretKey = EnvLoader::get('S3_SECRET_KEY');
$s3Region = EnvLoader::get('S3_REGION');
echo "=== Исследование S3 архива ===\n\n";
// Создаем S3 клиент
$s3Client = new S3Client([
'version' => 'latest',
'region' => $s3Region,
'endpoint' => $s3Endpoint,
'use_path_style_endpoint' => true,
'credentials' => [
'key' => $s3AccessKey,
'secret' => $s3SecretKey,
],
'http' => [
'verify' => false,
]
]);
echo "S3 Bucket: {$s3Bucket}\n\n";
// Список всех папок в корне
echo "=== Содержимое корневой папки ===\n";
try {
$result = $s3Client->listObjectsV2([
'Bucket' => $s3Bucket,
'Delimiter' => '/',
'MaxKeys' => 100
]);
if (isset($result['CommonPrefixes'])) {
foreach ($result['CommonPrefixes'] as $prefix) {
echo "📁 " . $prefix['Prefix'] . "\n";
}
}
if (isset($result['Contents'])) {
foreach ($result['Contents'] as $object) {
echo "📄 " . $object['Key'] . " (" . $object['Size'] . " bytes)\n";
}
}
} catch (Exception $e) {
echo "❌ Ошибка: " . $e->getMessage() . "\n";
}
echo "\n=== Содержимое папки backups ===\n";
try {
$result = $s3Client->listObjectsV2([
'Bucket' => $s3Bucket,
'Prefix' => 'backups/',
'MaxKeys' => 1000
]);
if (isset($result['Contents'])) {
echo "Найдено " . count($result['Contents']) . " файлов в backups:\n";
foreach ($result['Contents'] as $object) {
$key = $object['Key'];
$size = $object['Size'];
$modified = $object['LastModified']->format('Y-m-d H:i:s');
echo " 📄 {$key} ({$size} bytes, {$modified})\n";
}
} else {
echo "Папка backups пуста\n";
}
} catch (Exception $e) {
echo "❌ Ошибка: " . $e->getMessage() . "\n";
}
echo "\n=== Поиск файлов с именем 722fb330f1bcbfa6dc3975013fbf9b4a ===\n";
try {
$result = $s3Client->listObjectsV2([
'Bucket' => $s3Bucket,
'MaxKeys' => 10000
]);
$foundFiles = [];
if (isset($result['Contents'])) {
foreach ($result['Contents'] as $object) {
$key = $object['Key'];
if (strpos($key, '722fb330f1bcbfa6dc3975013fbf9b4a') !== false) {
$foundFiles[] = $key;
}
}
}
if (!empty($foundFiles)) {
echo "✅ НАЙДЕНЫ ФАЙЛЫ:\n";
foreach ($foundFiles as $foundFile) {
echo " 📄 {$foundFile}\n";
}
} else {
echo "❌ Файлы с именем 722fb330f1bcbfa6dc3975013fbf9b4a не найдены\n";
}
} catch (Exception $e) {
echo "❌ Ошибка поиска: " . $e->getMessage() . "\n";
}
echo "\n=== Поиск файлов августа 2025 ===\n";
try {
$result = $s3Client->listObjectsV2([
'Bucket' => $s3Bucket,
'Prefix' => '',
'MaxKeys' => 10000
]);
$augustFiles = [];
if (isset($result['Contents'])) {
foreach ($result['Contents'] as $object) {
$key = $object['Key'];
if (strpos($key, '2025/August') !== false || strpos($key, 'August/2025') !== false) {
$augustFiles[] = $key;
}
}
}
if (!empty($augustFiles)) {
echo "✅ НАЙДЕНЫ ФАЙЛЫ АВГУСТА 2025:\n";
foreach ($augustFiles as $augustFile) {
echo " 📄 {$augustFile}\n";
}
} else {
echo "❌ Файлы августа 2025 не найдены\n";
}
} catch (Exception $e) {
echo "❌ Ошибка поиска: " . $e->getMessage() . "\n";
}
echo "\n=== Готово ===\n";
?>