Adds import-directory, the other half of export-directory: it reads directory.json and sets up the same tenants, roles, domains, groups, users and mailing lists on an inbuxa server, using an administrator's credentials.
Objects are created in order: tenants, then roles (and after that their parent roles), domains, groups, users, mailing lists.
If the server already has an object with that name or address, it is skipped and left unchanged. A second run creates nothing.
Each user created gets a generated password: 24 characters from 56 letters and digits, with look-alike characters left out. The passwords are written as email,password to the --passwords file. That file must be new, is mode 600, and is written after each batch.
Creates go in batches no larger than maxObjectsInSet. Each batch is sent once and never retried. A refused object is counted with the server's reason, and the rest carry on.
--dry-run only reads and counts. It doesn't need --passwords.
Tests:
tests/mock_import_directory.rs runs against a stateful mock registry:
export, then import into an empty server, then export again gives the same directory.json;
each password in the file matches what was stored;
an existing password file is refused;
a second run creates nothing;
a refused account is counted and the others are still created.
Run by hand against an inbuxa 27.1-rc.4 container:
the dry run, then the import;
a rerun after a refusal creates only what was missing;
a generated password signs in.
The live sync_carddav rig still fails while provisioning Stalwart, as noted in earlier PRs. That is unrelated to this change.
Adds `import-directory`, the other half of `export-directory`: it reads `directory.json` and sets up the same tenants, roles, domains, groups, users and mailing lists on an inbuxa server, using an administrator's credentials.
- Objects are created in order: tenants, then roles (and after that their parent roles), domains, groups, users, mailing lists.
- If the server already has an object with that name or address, it is skipped and left unchanged. A second run creates nothing.
- Each user created gets a generated password: 24 characters from 56 letters and digits, with look-alike characters left out. The passwords are written as `email,password` to the `--passwords` file. That file must be new, is mode 600, and is written after each batch.
- Creates go in batches no larger than `maxObjectsInSet`. Each batch is sent once and never retried. A refused object is counted with the server's reason, and the rest carry on.
- `--dry-run` only reads and counts. It doesn't need `--passwords`.
Tests:
- `tests/mock_import_directory.rs` runs against a stateful mock registry:
- export, then import into an empty server, then export again gives the same `directory.json`;
- each password in the file matches what was stored;
- an existing password file is refused;
- a second run creates nothing;
- a refused account is counted and the others are still created.
- Run by hand against an inbuxa 27.1-rc.4 container:
- the dry run, then the import;
- a rerun after a refusal creates only what was missing;
- a generated password signs in.
The live `sync_carddav` rig still fails while provisioning Stalwart, as noted in earlier PRs. That is unrelated to this change.
Reads the directory.json export-directory writes and creates, through
the registry with an administrator's credentials, the tenants, roles
(then their parent roles), domains, groups, users and mailing lists,
in that order, with aliases, quotas, roles, permissions and group
memberships. What the server already has, by name or address, is
skipped and never changed, so a second run creates nothing.
Each user created gets a generated password (24 characters from 56
letters and digits without look-alikes, by rejection sampling from
getrandom), written as email,password to a new mode-600 file after
each batch is made. Creates go in batches within maxObjectsInSet and
are sent once, never retried; refusals are counted with the server's
reason and the rest go on. A dry run reads, counts and writes nothing.
Tested with a stateful mock registry (export, import into an empty
server, export again: same directory.json; passwords match what was
stored; a second run creates nothing) and against an inbuxa 27.1-rc.4
container, where a generated password signs in.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds
import-directory, the other half ofexport-directory: it readsdirectory.jsonand sets up the same tenants, roles, domains, groups, users and mailing lists on an inbuxa server, using an administrator's credentials.email,passwordto the--passwordsfile. That file must be new, is mode 600, and is written after each batch.maxObjectsInSet. Each batch is sent once and never retried. A refused object is counted with the server's reason, and the rest carry on.--dry-runonly reads and counts. It doesn't need--passwords.Tests:
tests/mock_import_directory.rsruns against a stateful mock registry:directory.json;The live
sync_carddavrig still fails while provisioning Stalwart, as noted in earlier PRs. That is unrelated to this change.