Bỏ qua, đến nội dung

@digiforce-nc/plugin-backups

Plugin sao lưu dữ liệu nâng cao — backup database và file storage lên cloud, hỗ trợ lịch trình tự động, point-in-time restore và multi-destination.

Plugin này làm gì?

Mất dữ liệu là thảm họa cho mọi hệ thống. Plugin cung cấp giải pháp backup toàn diện: sao lưu database (full/incremental), sao lưu file storage (uploads, attachments), lên cloud (S3, GCS, Azure Blob), với lịch trình cron và khả năng restore tại bất kỳ thời điểm nào.

Cơ chế hoạt động

Tính năng chính

#Tính năngMô tả
1Full backupSao lưu toàn bộ database
2IncrementalChỉ backup phần thay đổi (WAL archiving)
3File backupSao lưu file uploads và attachments
4ScheduledLịch trình cron (hàng ngày, hàng tuần...)
5Multi-destinationGửi backup đến nhiều nơi đồng thời
6EncryptionMã hóa AES-256 trước khi upload
7Retention policyTự xóa backup cũ theo policy (giữ N bản)
8One-click restoreKhôi phục từ bất kỳ backup nào

API endpoints

EndpointMô tả
backups:createTạo backup thủ công
backups:listDanh sách backup
backups:restoreKhôi phục từ backup
backups:deleteXóa backup
backups:scheduleCấu hình lịch trình
backups:destinationsCRUD destination (S3, GCS...)

Database

BảngMô tả
backupsMetadata backup (timestamp, size, checksum, status)
backupSchedulesLịch trình backup (cron expression, destination)
backupDestinationsCấu hình đích lưu trữ (credentials, bucket)

Thành phần client

Thành phầnMô tả
BackupDashboardTổng quan backup (last backup, next scheduled, storage used)
BackupListDanh sách backup với download/restore/delete
ScheduleConfigCấu hình lịch trình backup
DestinationFormForm cấu hình cloud destination
RestoreWizardWizard khôi phục dữ liệu từ backup

Dependencies

PackageVai trò
@digiforce-nc/serverServer framework
@digiforce-nc/databaseDatabase ORM
@digiforce-nc/clientClient UI framework
@aws-sdk/client-s3AWS S3 client
archiverNén file backup
node-cronLịch trình cron

Mục lục chi tiết