Skip to content

Support isolated Sage data roots - #863

Open
Rigidity wants to merge 1 commit into
mainfrom
feat/sage-root
Open

Support isolated Sage data roots#863
Rigidity wants to merge 1 commit into
mainfrom
feat/sage-root

Conversation

@Rigidity

@Rigidity Rigidity commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a shared SAGE_ROOT override for desktop, CLI, and RPC clients
  • route wallet, app database, app storage, and Windows webview profile data through the selected root
  • document multi-instance usage and the need for distinct RPC ports

Test plan

  • cargo fmt --all -- --files-with-diff --check
  • cargo clippy --workspace --all-features --all-targets
  • cargo test -p sage-config -p sage-apps -p sage-client -p sage-cli -p sage-tauri

Note

Medium Risk
Changes where wallets, TLS material, app DB, and webview storage live; misconfigured or shared roots could mix instances, though default behavior is unchanged when SAGE_ROOT is unset.

Overview
Adds a shared SAGE_ROOT override so desktop, sage rpc, and the RPC client can use the same on-disk root instead of only the default OS data directory (com.rigidnetwork.sage).

sage-config centralizes resolution in sage_root() / sage_root_override(); CLI and client drop direct dirs usage and read config/certs from that root. The Tauri setup uses the override when set, otherwise keeps Tauri’s app data dir, and passes that path into Sage and the apps DB.

sage-apps stores the root on AppsHostState and routes bridge grants, storage rotation, Windows WebView2 profile dirs, and abandoned-profile cleanup under it (profiles live under {root}/profiles/...). README documents running multiple dev instances and using distinct RPC ports per root’s config.toml.

Reviewed by Cursor Bugbot for commit c6f7d11. Bugbot is set up for automated code reviews on this repo. Configure here.

Honor SAGE_ROOT across desktop and RPC entry points so independent instances can keep wallet and app state separate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant