User configuration#
Settings that belong to a person and a machine rather than to a project live
in config.toml in the user configuration directory:
Platform |
File |
|---|---|
Linux |
|
macOS |
|
Windows |
|
ODX_CONFIG_DIR names another directory. A missing file is an empty
configuration; unknown keys are errors, as in [tool.odx]. ~/ at the start
of a path is expanded.
[cache]
dir = "~/cache/odx"
max_size = "20GB"
register_workspaces = true
[clones]
dirs = ["~/git/OCA", "~/git/acme"]
mode = "reference"
[sync]
interval = "30m"
max_duration = "20m"
jobs = 2
[mirrors]
"github.com/OCA" = { url = "https://forge.example.com/mirrors/oca.git", prefer = true }
[verdicts]
repo = "https://forge.example.com/acme/odx-verdicts.git"
[trust]
projects = ["~/work/acme"]
[cache]#
Key |
Type |
Description |
|---|---|---|
|
path |
The shared cache directory. Default: |
|
string |
The size |
|
boolean |
Register a workspace for |
|
string |
Accepted, not used yet. |
[clones]#
Local clones the cache borrows objects from; see Using your local clones.
Key |
Type |
Description |
|---|---|---|
|
list of paths |
Directories holding one clone per subdirectory. |
|
|
|
[sync]#
Background prefetching; see Prefetching in the background.
Key |
Type |
Description |
|---|---|---|
|
boolean |
Whether the scheduled job is installed; |
|
duration |
Time between scheduled syncs. Default: |
|
duration |
Longest run of one sync. Default: |
|
integer |
Concurrent fetches per workspace. Default: |
|
boolean |
Run at low CPU and IO priority. Default: on. |
|
boolean |
Skip scheduled syncs on battery power (systemd and Task Scheduler). Default: off. |
|
number |
Accepted, not used yet. |
[mirrors]#
Private mirrors that serve commits of upstream repositories for every project
on the machine, like a project’s vault. Keys are a host, optionally with a
path prefix ("github.com", "github.com/OCA"); the most specific key that
matches a repository’s URL wins.
Key |
Type |
Description |
|---|---|---|
|
string |
The mirror’s URL. |
|
boolean |
Fetch commits from the mirror before upstream; otherwise the mirror only serves commits upstream no longer has. Default: off. |
[workspaces]#
The workspaces odx sync --all visits, keyed by path, with registered
(a date) and series. odx maintains this table; there is no need to edit it.
[verdicts]#
Key |
Type |
Description |
|---|---|---|
|
string |
URL of the private repository holding verdicts and project mutes; see Verdicts and mutes. |
[trust]#
Key |
Type |
Description |
|---|---|---|
|
list of paths |
Project roots whose shell hooks (the |
Forge tokens#
$ odx auth login forge.example.com # prompts for the token
$ odx auth login forge.example.com < token.txt # or reads it from standard input
$ odx auth status # per host of the project: where its token comes from
forge.example.com: token from the system keyring
github.com: token from GITHUB_TOKEN
$ odx auth logout forge.example.com
odx looks for a host’s token in this order: ODX_TOKEN_<HOST> (the host in
capitals, other characters as _), the forge’s usual variables
(GITHUB_TOKEN, GH_TOKEN, GITLAB_TOKEN, GITEA_TOKEN,
FORGEJO_TOKEN), gh auth token for GitHub, and finally the token odx auth login stored in the system keyring (Keychain on macOS, Credential
Manager on Windows, the Secret Service on Linux). Tokens are never written
to pyproject.toml or the user configuration. On a machine without a
keyring, ODX_SECRETS_FILE names a file to keep them in instead, readable
only by its owner.
Without a token odx still works against public repositories, within the
forge’s anonymous API limits (60 requests an hour on GitHub); odx doctor
says which hosts have none.
Environment variables#
Variable |
Effect |
|---|---|
|
the user configuration directory |
|
the shared cache directory |
|
the forge token for a host, e.g. |
|
a file for tokens on machines without a keyring |
|
the |
|
the |
|
the odoo-lint executable ( |
|
the |
|
the package index JSON API (default PyPI’s) |
|
where the OpenUpgrade rename lists are read |
|
|
|
when set (and not |
The custom platform profile’s hooks receive ODX_PROJECT_ROOT,
ODX_SERIES, ODX_ENVIRONMENT, ODX_LOCKFILE, ODX_REQUIREMENTS and
ODX_VENDOR_MANIFEST; see Custom platforms.