Environment variables
The MADO_* variables mado reads, found by grepping the crates and verified at
their read sites. Only the four in the first table are ordinary user-facing
configuration.
User-facing
| Variable | Read by | Meaning |
|---|---|---|
MADO_REMOTE_ADDR | crates/mado/src/bin/mado.rs (remote_addr) | Server address (e.g. http://server:50051). Set = the workspace’s object reads/writes go to a mado serve server over the cached client stack; unset/empty = a local on-disk store under .jj/repo/store. A remote-inited workspace that is loaded with this unset errors clearly. |
MADO_TOKEN | crates/mado-client/src/auth.rs (token_from_env) | Client bearer token attached as authorization: Bearer <token> to every RPC. Must match the server’s --auth-token. Unset or empty = no auth header (matches a server started without --auth-token). |
MADO_REMOTE_PREFIX | crates/mado/src/bin/mado.rs (remote_prefix) | The client’s repo prefix (blob namespace) for per-repo ACL authorization of op-heads / lease requests. Unset or empty = the default namespace (""), matching a single-tenant mado serve. |
MADO_DISK_CACHE_MAX_BYTES | crates/mado/src/lib.rs (with_disk_cache) | Byte cap on the persistent disk blob cache. Set = the tier evicts least-recently-used blobs to stay at or below the cap. Unset, empty, 0, or unparseable = unbounded (the default). Read once at client-stack construction, so it applies uniformly to the mount daemon, serve-virtiofs, and the CLI. |
Internal / not user-set
These appear in the codebase but are not ordinary configuration knobs:
| Variable | Where | Why it is not a config knob |
|---|---|---|
MADO_GIT_TOKEN, MADO_GIT_USERNAME | crates/mado/src/git_credential.rs | mado sets these itself in the child git process’s environment to feed a server-held credential to interop git over the GIT_ASKPASS pattern. You configure the credential with mado serve --git-credential-file (etc.), not by exporting these. |
MADO_BENCH_N | crates/mado-index/src/store.rs, crates/mado-index/src/tests.rs | Sizes the N of #[ignore]d benchmark tests only. No effect on the shipped binary. |
MADO_REAL_TREE | crates/mado/src/real_tree_study.rs | Points the env-gated real-tree study bench at a directory. Test-only; unset skips the bench cleanly. |
Note.
MADO_INDEX_TYPEshows up as a re-export alias incrates/mado-index/src/lib.rs(pub use store::INDEX_TYPE as MADO_INDEX_TYPE) for a compile-time constant string ("mado", the jj index type name). It is not read from the environment and is not a configuration variable — it is named here only because aMADO_grep surfaces it.