Files
crm.clientright.ru/crm_extensions/file_storage/REDIS_ACCESS.md
Fedor 9245768987 🚀 CRM Files Migration & Real-time Features
 Features:
- Migrated ALL files to new S3 structure (Projects, Contacts, Accounts, HelpDesk, Invoice, etc.)
- Added Nextcloud folder buttons to ALL modules
- Fixed Nextcloud editor integration
- WebSocket server for real-time updates
- Redis Pub/Sub integration
- File path manager for organized storage
- Redis caching for performance (Functions.php)

📁 New Structure:
Documents/Project/ProjectName_ID/file_docID.ext
Documents/Contacts/FirstName_LastName_ID/file_docID.ext
Documents/Accounts/AccountName_ID/file_docID.ext

🔧 Technical:
- FilePathManager for standardized paths
- S3StorageService integration
- WebSocket server (Node.js + Docker)
- Redis cache for getBasicModuleInfo()
- Predis library for Redis connectivity

📝 Scripts:
- Migration scripts for all modules
- Test pages for WebSocket/SSE/Polling
- Documentation (MIGRATION_*.md, REDIS_*.md)

🎯 Result: 15,000+ files migrated successfully!
2025-10-24 19:59:28 +03:00

3.0 KiB
Raw Blame History

🔐 REDIS ДОСТУП ДЛЯ N8N

📡 ПОДКЛЮЧЕНИЕ:

Хост: crm.clientright.ru
Порт: 6379
Пароль: CRM_Redis_Pass_2025_Secure!
База: 0 (по умолчанию)


🔧 НАСТРОЙКА В N8N:

Redis Node:

Host: crm.clientright.ru
Port: 6379
Password: CRM_Redis_Pass_2025_Secure!
Database: 0

Redis Pub/Sub:

Подписка на события файлов:

  • Channel: crm:file:events
  • Host: crm.clientright.ru:6379
  • Auth: CRM_Redis_Pass_2025_Secure!

Формат событий:

{
  "type": "file_created",
  "data": {
    "module": "Project",
    "recordId": "123",
    "documentId": "456",
    "fileName": "test.pdf"
  },
  "timestamp": 1761154370
}

📋 ДОСТУПНЫЕ СОБЫТИЯ:

  • file_created - файл создан
  • file_updated - файл обновлен
  • file_deleted - файл удален
  • file_renamed - файл переименован
  • folder_renamed - папка переименована
  • folder_deleted - папка удалена

🧪 ТЕСТ ПОДКЛЮЧЕНИЯ:

Из командной строки:

redis-cli -h crm.clientright.ru -p 6379 -a 'CRM_Redis_Pass_2025_Secure!' ping

Ответ: PONG

Подписка на канал:

redis-cli -h crm.clientright.ru -p 6379 -a 'CRM_Redis_Pass_2025_Secure!' \
  SUBSCRIBE crm:file:events

Публикация тестового события:

redis-cli -h crm.clientright.ru -p 6379 -a 'CRM_Redis_Pass_2025_Secure!' \
  PUBLISH crm:file:events '{"type":"test","data":{"message":"Hello from n8n"}}'

🔒 БЕЗОПАСНОСТЬ:

Пароль установлен - требуется для всех подключений
Maxmemory - 256MB (автоочистка старых ключей)
Protected mode - отключен для внешних подключений
Порт - 6379 (стандартный)


📊 МОНИТОРИНГ:

Просмотр активных подписчиков:

redis-cli -a 'CRM_Redis_Pass_2025_Secure!' PUBSUB NUMSUB crm:file:events

Просмотр активных каналов:

redis-cli -a 'CRM_Redis_Pass_2025_Secure!' PUBSUB CHANNELS

Статистика:

redis-cli -a 'CRM_Redis_Pass_2025_Secure!' INFO

🚀 ПРИМЕР N8N WORKFLOW:

{
  "nodes": [
    {
      "parameters": {
        "channel": "crm:file:events",
        "options": {
          "host": "crm.clientright.ru",
          "port": 6379,
          "password": "CRM_Redis_Pass_2025_Secure!"
        }
      },
      "name": "Redis Subscribe",
      "type": "n8n-nodes-base.redisTrigger",
      "position": [250, 300]
    }
  ]
}

Дата: 22 октября 2025
Сервер: crm.clientright.ru
Redis Version: 4.0.9