Skip to content

feat: selective config import/export (backup bundle) — RFC on credential handling #449

Closed

Description

@ARE404

Problem

There's no first-class way to back up a Maka setup or move it to another machine. Today the only path is the Data page's "quit Maka, copy the whole workspace directory" note — all-or-nothing (drags along every session / chat history), manual, and easy to get wrong.

Proposed feature

A selective config export/import, living on the Data settings page (数据) right under the existing backup notice — semantically the backup/restore home. Inspired by how some other agent desktop apps do backups (e.g. Alma):

  • The user picks which categories to include; a manifest records exactly what the file contains.
  • V1 categories: connections (provider connection metadata), settings, credentials, memory (MEMORY.md).
  • Output is a single versioned JSON bundle: { schemaVersion, exportedAt, appVersion, includedData: Category[], data: {…} }.
  • Import fails closed on an unknown schemaVersion (mirrors the credential-store read policy) and merges connections by slug with a skip / overwrite strategy.

Open question — credential handling (I'd like a maintainer call here)

This is the one decision I want to agree on before finalizing, given the project's security posture (SECURITY.md, #295, #296).

connections / settings export cleanly with secrets stripped. But a real machine-to-machine migration is far more useful if it can also carry the API keys. Options:

  1. Config-only — never export secrets. Safest; the export file is freely shareable; the user re-enters keys after import.
  2. credentials as an explicit opt-in category — plaintext + warning. Enables full migration; the file then contains cleartext keys, so the selection UI warns clearly ("keys are written in cleartext; anyone with this file can use them"). Off by default.
  3. Opt-in credentials, passphrase-encrypted. Same coverage as (2), but the credential payload is encrypted with a user passphrase (e.g. AES-256-GCM via scrypt). Safest of the "include secrets" options; more code + UX.

Note the credential store deliberately exposes no bulk-list API, so any credential export has to enumerate secrets from known slots (connection slugs → api_key / oauth_token) — i.e. this goes somewhat against the grain of the current store design, which is another reason to align first.

Prior art / constraints

  • Reuses existing patterns: versioned fail-closed reads (credential-store), the Data page backup notice, daily-review-archive-store (archive/export shape).
  • Not a zip: the repo has no zip dependency; a single JSON bundle keeps V1 dependency-free. Large session history (which would justify a zip-of-files layout) is intentionally out of V1 scope.

Status

I have a working prototype of option (2) (opt-in, default-off, prominent cleartext warning — the explicit opt-in + warning being the improvement over apps that just dump keys silently), with the pure bundle/merge logic unit-tested and the settings UI on shared @maka/ui primitives. Happy to open a PR against whichever option the maintainers prefer — including trimming to (1) for a first cut, or investing in (3).

Activity

  1. Astro-Han commented on Jul 9, 2026

    @Astro-Han
    Contributor

    Closing as done.

    Landed in #450 (merged 2026-07-06): selective config import/export on the Data settings page — categories connections / settings / credentials / memory, versioned JSON bundle, fail-closed on unknown schemaVersion, connection merge by slug with skip/overwrite.

    Credential handling matches the issue's option (2): explicit opt-in, off by default, cleartext warning; non-selected credentials are not smuggled in via undeclared payloads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions