Commit Graph

38 Commits

Author SHA1 Message Date
Awuqing
a581c4f30b 修复: 存储目标创建/连接测试/类型选择三个关键问题
1. 修复 oneof 白名单仅含 4 种类型,阿里云/腾讯/七牛/FTP/Rclone
   类型的存储目标无法创建(binding 验证直接拒绝)
2. 修复本地磁盘 TestConnection 报 "directory not found",
   在 List 前先 Mkdir 确保目录存在
3. 前端存储类型选项明确标注 Rclone 支持 SFTP/Azure/Dropbox 等
2026-04-01 00:06:08 +08:00
Wu Qing
31f996490f 功能: 集成 rclone 高级传输特性 + 全 70+ 后端支持 (#23)
功能: 集成 rclone 高级传输特性 + 全 70+ 后端支持
v1.3.1
2026-03-31 23:46:02 +08:00
Awuqing
1003302bdd 功能: 集成 rclone 高级传输特性 + 全 70+ 后端支持
1. 失败自动重试:rclone Pacer 指数退避,默认 10 次底层 HTTP 重试
2. 带宽限制:配置 bandwidth_limit + Settings 运行时可调
3. 上传实时进度:progressReader + LogHub SSE 推送字节级进度/速率
4. 存储空间查询:StorageAbout 可选接口,GetUsage 返回远端真实空间
5. 全 rclone 后端:backend/all 引入 70+ 后端,新增 rclone 存储类型,
   API 驱动的可搜索后端选择器 + 动态配置表单
2026-03-31 23:37:59 +08:00
Wu Qing
cf5740b573 重构: 存储传输层集成 rclone 替代自研实现 (#22)
重构: 存储传输层集成 rclone 替代自研实现
v1.3.0
2026-03-31 22:55:41 +08:00
Awuqing
b2872f5143 重构: 存储传输层集成 rclone 替代自研实现
将 8 种存储后端(本地磁盘、S3、WebDAV、Google Drive、FTP、阿里云 OSS、
腾讯云 COS、七牛 Kodo)的底层传输从 4 个独立 SDK 自研实现替换为 rclone
fs 接口统一驱动。

- 新建 storage/rclone/ 包(~410 行胶水代码),包含通用 Provider 和 8 种
  配置映射 Factory
- 删除 10 个旧 provider 包(~1000 行),净减少约 1000 行代码
- StorageProvider 接口、前端 UI、数据库模型、备份执行引擎全部零改动
- 获得 rclone 工业级传输能力(分片上传、断点续传、自动重试)
2026-03-31 22:52:16 +08:00
Wu Qing
fab3669ffa Merge pull request #21 from Awuqing/feat/community-enhancements
feat: community enhancements, CI/CD pipeline, and backup integrity verification
v1.2.2
2026-03-31 13:23:11 +08:00
Awuqing
19fa8f632e fix(test): use test TempDir for backup execution tests
The test passed an empty tempDir which defaulted to /tmp/backupx —
a directory that does not exist in CI runners. Use t.TempDir() based
path instead so the test is self-contained.
2026-03-31 13:20:11 +08:00
Awuqing
f388b98943 refactor: single-pass hashing during upload via TeeReader
Previous approach read the file twice (once for SHA-256, once for upload),
doubling disk I/O. Under concurrent multi-target uploads this becomes a
bottleneck.

New design — hashingReader wraps io.TeeReader + sha256.Hash:
  file.Read() → TeeReader → sha256.Write() (hash) + provider (upload)
Single read pass yields both byte count and SHA-256 simultaneously.

Each upload goroutine independently opens the file and computes its own
hash. The first successful target writes checksum to the record via
sync.Once. Zero extra disk I/O, zero extra memory copies, fully
concurrent-safe.
2026-03-31 13:08:10 +08:00
Awuqing
7631cca01d refactor: use CountingReader for upload integrity instead of List API
List()-based size check depends on the storage backend returning accurate
file sizes, which is not guaranteed (some WebDAV/Google Drive impls may
return 0 or omit the size field).

New approach: wrap the upload io.Reader with a CountingReader that counts
bytes as they flow through during upload. After upload completes, compare
counter.n against the expected fileSize. This is:
- Zero extra network calls (no List, no Download)
- Zero extra CPU/memory overhead (just an int64 increment per Read)
- Storage-backend agnostic (works with any provider)

If bytes transmitted != expected size → mark failed + auto-delete remote.
2026-03-31 12:40:12 +08:00
Awuqing
1d5923f747 refactor: replace download-based hash verification with lightweight size check
The previous approach downloaded the entire backup file after upload to
compute a remote SHA-256, which doubles bandwidth cost for every backup.

New approach:
- Local SHA-256 is still computed before upload (stored in record for audit)
- After upload, use provider.List() to check remote file size (single API call)
- If remote size is 0 or mismatches local size → mark failed + auto-delete
- If List() fails, log a warning but don't block (file may have uploaded fine)

This catches 0KB corrupted uploads with zero download overhead.
2026-03-31 12:36:29 +08:00
Awuqing
2537149b39 feat: add SHA-256 checksum verification for backup integrity
Addresses community feedback about 0KB corrupted backup files going
undetected after upload.

Implementation:
- Compute SHA-256 hash of final artifact (after compress/encrypt) before upload
- After each storage target upload, download the file back and verify
  the hash matches the local checksum
- If verification fails: mark that target as failed, auto-delete the
  corrupted remote file, and log detailed mismatch info
- Store checksum in BackupRecord model (new `checksum` column)
- Display truncated SHA-256 with copy button in backup records UI

Verification flow per storage target:
  local SHA-256 → upload → download → remote SHA-256 → compare
  - match: mark success
  - mismatch: mark failed + delete corrupted remote file
2026-03-31 07:46:12 +08:00
Wu Qing
d4fc0b726c Merge pull request #20 from Awuqing/feat/community-enhancements
fix: directory picker cannot navigate into subdirectories (#19)
V1.2.1
2026-03-31 00:37:50 +08:00
Awuqing
2ace5a5352 fix: directory picker cannot navigate into subdirectories (#19)
Root cause: ArcoDesign Tree loadMore callback receives NodeInstance where
the key is at node.props.dataRef.key, not node.props.key. The old code
passed node.props directly which resulted in undefined key, causing
child directory loading to silently fail.

Fix:
- Access node key via node.props.dataRef?.key ?? node.props._key
- Add showLine + blockNode + folder icons for better visual hierarchy
- Add path display with copy button in selection modal
- Add unmountOnExit to reset state on close

Closes #19
2026-03-31 00:32:02 +08:00
Wu Qing
f7fb5126d1 Merge pull request #18 from Awuqing/feat/community-enhancements
Feat/community enhancements
2026-03-31 00:22:08 +08:00
Awuqing
9033ccabb7 docs: update Docker deployment to use published image from Docker Hub
- docker-compose.yml: change from local build to awuqing/backupx:latest
  with clear comments for mounting host volumes
- README: Docker quick start now uses `docker run` / `docker compose`
  directly without cloning the repo first
- Add Docker Hub badge and link to awuqing/backupx
- Keep source build instructions as a separate option
2026-03-31 00:16:31 +08:00
Awuqing
6c1e988920 docs: restructure README with user-friendly guides and deployment instructions
Rewrite both README.md and README_EN.md:
- Reorganize around user journey: install → setup → add storage → create task → monitor
- Add step-by-step "Quick Start" guide (5 steps from zero to first backup)
- Add storage target config reference table
- Consolidate duplicate deployment sections into single "Deployment Guide"
- Remove redundant password reset entries (was listed twice)
- Move Project Structure / Architecture to end (dev-facing, not user-facing)
- Compact API reference table (remove verbose endpoint prefixes)
- Add screenshot grid layout for better visual impact
2026-03-31 00:10:06 +08:00
Wu Qing
23d667a8c3 Merge pull request #17 from Awuqing/feat/community-enhancements
ci: add automated release pipeline with Docker Hub push and China mir…
V1.2.0
2026-03-30 23:45:13 +08:00
Awuqing
0aa25d99f2 ci: add automated release pipeline with Docker Hub push and China mirror support
- Fix Go/Node version mismatch in CI (1.21→1.25, 18→20)
- Rewrite release.yml: 3-job pipeline (frontend → binary release + Docker push)
  - Supports both tag push and manual workflow_dispatch trigger
  - Builds linux/amd64 + linux/arm64 binaries → GitHub Release tar.gz
  - Builds multi-arch Docker image → Docker Hub (awuqing/backupx)
- Dockerfile: add ARG USE_CHINA_MIRROR for China network acceleration
  (npm→npmmirror, go→goproxy.cn, apk→aliyun), add ARG VERSION injection
- Makefile: auto version from git tag, add docker/docker-cn targets
- README: add beginner-friendly China build guide and release instructions
2026-03-30 23:32:14 +08:00
Wu Qing
f4f79394bd Merge pull request #16 from Awuqing/feat/community-enhancements
feat: community enhancements — password reset, audit logs, multi-source backup
2026-03-30 23:10:07 +08:00
Awuqing
5a25690f3f feat: add community enhancements — password reset, audit logs, multi-source backup
Three community-requested features:

1. CLI password reset: `backupx reset-password --username admin --password xxx`
   Docker users can run via `docker exec`. No full app init needed.

2. Audit logging: async fire-and-forget audit trail for all key operations
   (login, CRUD on tasks/targets/records, settings changes).
   New UI page at /audit with category filter and pagination.

3. Multi-source path backup: file backup tasks now support multiple source
   directories packed into a single tar archive. Backward compatible with
   existing single sourcePath field.
2026-03-30 23:04:37 +08:00
Wu Qing
4b60c74b51 Merge pull request #15 from Awuqing/feat/docker-support
feat: add Docker deployment support
2026-03-30 12:33:43 +08:00
Awuqing
8cf97e439e feat: add Docker deployment support
- Multi-stage Dockerfile (Node build + Go build + Alpine runtime)
- docker-compose.yml with named volume for data persistence
- In-container Nginx reverse proxy (static files + API)
- Entrypoint script for graceful process management
- .dockerignore for optimized build context
- Updated README (zh/en) with Docker quick start and deployment docs

Closes #14
2026-03-30 07:56:15 +08:00
Wu Qing
2ccea28e34 Merge pull request #12 from Awuqing/Awuqing-patch-1
Update SAP HANA tool description in README
2026-03-24 23:39:20 +08:00
Wu Qing
b6c33cbd42 Update SAP HANA tool description in README 2026-03-24 22:56:10 +08:00
Wu Qing
bdd4294efc Merge pull request #11 from Awuqing/feat/saphana-backup-data
feat(saphana): refactor backup from SQL export to BACKUP DATA USING FILE
2026-03-24 18:31:04 +08:00
Awuqing
fe803e2296 feat(saphana): refactor backup from SQL export to BACKUP DATA USING FILE
Replace the hdbsql SELECT-based schema DDL export with SAP HANA's official
BACKUP DATA USING FILE for proper data-level backup.

Changes:
- Run: issue BACKUP DATA [FOR <tenant>] USING FILE via hdbsql, package
  resulting backup files into tar archive as artifact
- Restore: extract tar, locate backup prefix, issue RECOVER DATA
  [FOR <tenant>] USING FILE ... CLEAR LOG
- Add helper functions: buildHdbsqlArgs, packageBackupFiles,
  extractTarArchive, findBackupPrefix
- Add 7 unit tests covering backup/restore/error paths
2026-03-24 18:24:12 +08:00
Wu Qing
6562a53c7f Merge pull request #10 from Awuqing/feat/saphana-ftp-support
docs: 更新 README 文档,添加 SAP HANA 和 FTP 支持说明
2026-03-22 11:18:36 +08:00
Awuqing
80196eae93 docs: 更新 README 文档,添加 SAP HANA 和 FTP 支持说明
- 简介描述新增 FTP/FTPS 存储选项
- 备份类型列表新增 SAP HANA(通过 hdbsql 工具)
- 存储后端表格新增 FTP / FTPS 行
- 架构图 Storage Registry 新增 FTP / FTPS
- 项目结构树新增 backup/saphana 和 storage/ftp
- 技术栈表格新增 jlaffaye/ftp 依赖
- 同步更新中英文双语 README
2026-03-21 16:22:26 +08:00
Wu Qing
cc8db690a7 Merge pull request #9 from Awuqing/feat/saphana-ftp-support
feat: 新增 SAP HANA 数据库备份支持和 FTP 存储后端
V1.1.0
2026-03-21 16:15:43 +08:00
Awuqing
aa24442c45 feat: 新增 SAP HANA 数据库备份支持和 FTP 存储后端
后端变更:
- 新增 SAP HANA 备份 Runner (saphana_runner.go),使用 hdbsql CLI 工具执行数据库导出/恢复
- 新增 FTP 存储 Provider (storage/ftp/provider.go),支持 FTP/FTPS 协议上传下载备份文件
- 在 storage/types.go 中添加 FTP 类型常量和 FTPConfig 配置结构
- 在 app.go 中注册 FTP Storage Factory 和 SAP HANA Backup Runner
- 添加 github.com/jlaffaye/ftp 依赖

前端变更:
- BackupTaskType 联合类型新增 'saphana',默认端口 30015
- StorageTargetType 联合类型新增 'ftp'
- 备份任务表单支持 SAP HANA 类型选择及数据库连接配置
- 存储目标表单新增 FTP 配置字段(主机/端口/用户名/密码/基础目录/TLS)

参考:backint_minio1.0.0/ Java 实现
2026-03-21 16:09:14 +08:00
Wu Qing
be856fe06b Merge pull request #7 from Awuqing/readme
docs: 为README添加界面截图展示
2026-03-19 23:11:03 +08:00
Awuqing
df43cefae0 docs: 为README添加界面截图展示
添加了八个界面截图文件,并在中英文README文档中新增"Screenshots"章节,用于直观展示应用各主要功能页面的用户界面,方便用户快速了解软件外观和功能布局。
2026-03-19 23:04:03 +08:00
Wu Qing
c2494b1bf2 Merge pull request #2 from Awuqing/dependabot/go_modules/server/go_modules-dd7da38a6b
Bump golang.org/x/crypto from 0.33.0 to 0.45.0 in /server in the go_modules group across 1 directory
2026-03-17 23:41:04 +08:00
dependabot[bot]
b4201e0d0d Bump golang.org/x/crypto
Bumps the go_modules group with 1 update in the /server directory: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.33.0 to 0.45.0
- [Commits](https://github.com/golang/crypto/compare/v0.33.0...v0.45.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.45.0
  dependency-type: direct:production
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-17 15:36:02 +00:00
Wu Qing
464202356b Update README for BackupX project references 2026-03-17 18:19:20 +08:00
Wu Qing
c04f2454fc Update README for BackupX project references 2026-03-17 18:19:03 +08:00
Awuqing
aff334e1af add some tips V1.0.0 2026-03-17 13:45:31 +08:00
Awuqing
eadd3f8961 first commit 2026-03-17 13:29:09 +08:00