fastboxex.config¶
from fastboxex import load_config
cfg = load_config() # the standard search below
cfg = load_config(profile="campus") # select a profile by name substring
Search order¶
The first Config.toml found wins:
FASTBOXEX_CONFIG: an explicit file- Central:
~/.config/fastboxex/Config.toml($XDG_CONFIG_HOME,%APPDATA%\fastboxexon Windows, orFASTBOXEX_CONFIG_DIR) - Local:
Config.tomlin the current folder or a parent, up to your home folder
Nothing found means no server: Platform.auto_login() then asks for one. No file is
ever created without you asking.
Credentials follow the same scheme: real environment variables win, then the central
.env next to the central Config.toml, then a local .env found from the current
folder upward. .env holds FASTBOXEX_USER and FASTBOXEX_PASS.
Config.toml¶
[connection]
[[connection.profiles]]
name = "Campus"
host = "202.120.13.117"
auth = "202.120.13.117:11001"
[[connection.profiles]]
name = "Singapore"
host = "exchange.samuel-drapeau.info"
auth = "exchange.samuel-drapeau.info:11001"
[storage]
runs_dir = "~/fastboxex-runs" # optional
Profiles are tried in order and the first that answers is used. All other addresses
are derived from host or advertised by the server.
Environment variables¶
| Variable | Effect |
|---|---|
FASTBOXEX_CONFIG |
Use this Config.toml |
FASTBOXEX_CONFIG_DIR |
Central folder instead of ~/.config/fastboxex |
FASTBOXEX_DATA_DIR |
Data folder instead of ~/.local/share/fastboxex |
FASTBOXEX_PROFILE |
Select a profile by name substring |
FASTBOXEX_HOST |
Use this host for every address, overriding the file |
FASTBOXEX_USER |
Login |
FASTBOXEX_PASS, FASTBOXEX_PASSWORD |
Password |
FASTBOXEX_RUNTIME_ID |
Runtime to log in to, unless the code selects one |
FASTBOXEX_RUNTIME |
TUI only: auto, exchange or arena |
ClientConfig¶
| Member | Returns |
|---|---|
auth_endpoint() |
host:11001, or None |
arena_endpoint() |
host:11002, or None |
profile_name() |
Name of the active profile |
all_profile_configs() |
One ClientConfig per profile, in order |
source_path() |
The Config.toml in use, or None |
username |
[connection] username, or "" |
runs_dir |
Absolute folder for recordings (default ~/.local/share/fastboxex/runs) |
ClientConfig.central_config_dir() |
The central settings folder |
ClientConfig.central_data_dir() |
The central data folder |