[PR #5479] [CLOSED] feat(db): add portable export option for host-specific settings #5893

Closed
opened 2026-11-02 04:04:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5479
Author: @m4tinbeigi-official
Created: 6/22/2026
Status: ❌ Closed

Base: main ← Head: feat/portable-db-export


📝 Commits (4)

  • 13074cc feat(db): add portable export option
  • f1e698f Merge branch 'main' into feat/portable-db-export
  • 0f0b565 Merge branch 'main' into feat/portable-db-export
  • 065c168 Merge branch 'main' into feat/portable-db-export

📊 Changes

5 files changed (+168 additions, -7 deletions)

View changed files

📝 internal/database/dump_sqlite.go (+80 -3)
➕ internal/database/dump_sqlite_portable_test.go (+70 -0)
📝 internal/web/controller/server.go (+2 -1)
📝 internal/web/service/server.go (+3 -2)
📝 main.go (+13 -1)

📄 Description

Refs #5004

Summary

  • Add PortableDumpOptions for SQLite dump export.
  • Add sanitization for host-specific SSL certificate/key path settings:
    • webCertFile
    • webKeyFile
    • subCertFile
    • subKeyFile
  • Expose the option through:
    • /server/getMigration?excludeHostSpecific=true
    • x-ui migrate-db --dump <file> --exclude-host-specific
  • Add regression coverage to ensure portable dumps do not leak host-specific cert/key paths while preserving unrelated settings.

Test

  • Not completed locally: dependency download failed because proxy.golang.org returned 403 Forbidden for some Go modules.

Notes

This keeps the default raw database backup behavior unchanged and adds an explicit portable export path for migrations to another host.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5479 **Author:** [@m4tinbeigi-official](https://github.com/m4tinbeigi-official) **Created:** 6/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/portable-db-export` --- ### 📝 Commits (4) - [`13074cc`](https://github.com/MHSanaei/3x-ui/commit/13074cc9d1480a29293847cc6dfe1c50e57bd899) feat(db): add portable export option - [`f1e698f`](https://github.com/MHSanaei/3x-ui/commit/f1e698fd87843b80d5337b2f200c930256914996) Merge branch 'main' into feat/portable-db-export - [`0f0b565`](https://github.com/MHSanaei/3x-ui/commit/0f0b56554197d8518f304b595512f294a703241a) Merge branch 'main' into feat/portable-db-export - [`065c168`](https://github.com/MHSanaei/3x-ui/commit/065c168d91f83c6d339d4deabe0277cb5beb5b5c) Merge branch 'main' into feat/portable-db-export ### 📊 Changes **5 files changed** (+168 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/dump_sqlite.go` (+80 -3) ➕ `internal/database/dump_sqlite_portable_test.go` (+70 -0) 📝 `internal/web/controller/server.go` (+2 -1) 📝 `internal/web/service/server.go` (+3 -2) 📝 `main.go` (+13 -1) </details> ### 📄 Description Refs #5004 ## Summary - Add `PortableDumpOptions` for SQLite dump export. - Add sanitization for host-specific SSL certificate/key path settings: - `webCertFile` - `webKeyFile` - `subCertFile` - `subKeyFile` - Expose the option through: - `/server/getMigration?excludeHostSpecific=true` - `x-ui migrate-db --dump <file> --exclude-host-specific` - Add regression coverage to ensure portable dumps do not leak host-specific cert/key paths while preserving unrelated settings. ## Test - Not completed locally: dependency download failed because `proxy.golang.org` returned `403 Forbidden` for some Go modules. ## Notes This keeps the default raw database backup behavior unchanged and adds an explicit portable export path for migrations to another host. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:04:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5893
No description provided.