Add export-directory: a server's accounts, groups, lists and aliases, without secrets #28

Merged
jcoffey-dev merged 1 commits from feat/export-directory into main 2026-10-30 06:57:06 +00:00
Owner

inbuxa-migrate export-directory --url … --auth-basic admin [--domain example.org] DIR writes who has an address on a server: domains, users, groups, mailing lists, their aliases and quotas, and the tenants and roles they belong to. The output is directory.json plus domains.csv, users.csv, groups.csv, lists.csv and aliases.csv, so the same accounts can be set up on another server.

  • No secrets: every registry read names its properties, so credentials, encryption keys and DKIM keys are never fetched. Only named fields are written, even when a server sends more (there's a test for that).
  • Ids become addresses and names. A group lists its members, a user its groups. --domain keeps the export to some domains, with the tenants and roles they use.
  • CSV cells a spreadsheet would run as formulas start with '; directory.json keeps every value as it is.
  • The directory must be new or empty, is 0700, and gets directory.json last.
  • Session::registry_account finds the account that advertises the registry. inbuxa lists it per account, not session-wide.

Tested against a live inbuxa 27.1-rc.4 container (users, a group, a list, aliases, a quota, a tenant with a custom role, --domain, a dry run, a non-empty directory, a non-admin login) and with a mock registry in tests/mock_export_directory.rs. cargo test --locked and clippy are clean.

`inbuxa-migrate export-directory --url … --auth-basic admin [--domain example.org] DIR` writes who has an address on a server: domains, users, groups, mailing lists, their aliases and quotas, and the tenants and roles they belong to. The output is `directory.json` plus `domains.csv`, `users.csv`, `groups.csv`, `lists.csv` and `aliases.csv`, so the same accounts can be set up on another server. - No secrets: every registry read names its properties, so credentials, encryption keys and DKIM keys are never fetched. Only named fields are written, even when a server sends more (there's a test for that). - Ids become addresses and names. A group lists its members, a user its groups. `--domain` keeps the export to some domains, with the tenants and roles they use. - CSV cells a spreadsheet would run as formulas start with `'`; `directory.json` keeps every value as it is. - The directory must be new or empty, is 0700, and gets `directory.json` last. - `Session::registry_account` finds the account that advertises the registry. inbuxa lists it per account, not session-wide. Tested against a live inbuxa 27.1-rc.4 container (users, a group, a list, aliases, a quota, a tenant with a custom role, `--domain`, a dry run, a non-empty directory, a non-admin login) and with a mock registry in `tests/mock_export_directory.rs`. `cargo test --locked` and clippy are clean.
jcoffey-dev added 1 commit 2026-10-30 06:52:21 +00:00
Add export-directory: a server's accounts, groups, lists and aliases, without secrets
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 4m11s
ci / announce (pull_request) Skipped
960d2ff1cf
Reads domains, users, groups, mailing lists, tenants and roles from the
registry with an administrator's login and writes directory.json with
domains.csv, users.csv, groups.csv, lists.csv and aliases.csv. Every read
names its properties, so credentials, encryption keys and DKIM keys are
never fetched, and only named fields are written even if a server sends
more. Ids become addresses and names; --domain keeps the export to some
domains with the tenants and roles they use. CSV cells a spreadsheet
would run as formulas start with '.

Session::registry_account finds the account that advertises the
registry, as inbuxa and upstream list it per account.
jcoffey-dev merged commit 979a94c097 into main 2026-10-30 06:57:06 +00:00
jcoffey-dev deleted branch feat/export-directory 2026-10-30 06:57:06 +00:00
Sign in to join this conversation.