lftools.ini¶
lftools.ini holds the credentials and per-server settings that
lftools-uv commands read. lftools-uv config get and
lftools-uv config set read and change it from the command line.
Location¶
lftools-uv reads lftools.ini from the directory that
platformdirs.user_config_dir("lftools") returns:
Linux:
$XDG_CONFIG_HOME/lftools/lftools.ini, which defaults to~/.config/lftools/lftools.ini.macOS:
$XDG_CONFIG_HOME/lftools/lftools.iniwhenXDG_CONFIG_HOMEhas a value, otherwise~/Library/Application Support/lftools/lftools.ini.
The directory carries the name lftools, not lftools-uv, so
lftools-uv and legacy lftools share one configuration.
Where the platform’s directory differs from ~/.config/lftools and does
not exist yet, but ~/.config/lftools does, lftools-uv copies the whole
~/.config/lftools directory to the platform’s directory the first time
it runs, and reads from the copy from then on. Later edits to the files in
~/.config/lftools have no effect. When the copy fails, lftools-uv logs
a warning and keeps reading ~/.config/lftools.
Permissions¶
The file holds passwords and API tokens. Make the file that lftools-uv reads, at the path Location gives, readable and writable by its owner alone. On Linux:
chmod 600 "${XDG_CONFIG_HOME:-$HOME/.config}/lftools/lftools.ini"
On macOS:
chmod 600 "${XDG_CONFIG_HOME:-$HOME/Library/Application Support}/lftools/lftools.ini"
The copy made on the first run keeps the modes of the files in
~/.config/lftools, and leaves those files in place with the same
credentials: restrict or remove them too.
lftools-uv config set creates a missing file with mode 600, and
leaves the mode of an existing file unchanged.
Sections and options¶
The file uses INI syntax: a [section] header followed by
option = value lines. A section named after a server takes the
server’s host name, without https://, for example
[gerrit.example.org].
Section |
Options |
Read by |
|---|---|---|
|
|
Every command, as the default for the top-level |
|
|
|
|
|
The same commands, for the organization |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Gerrit API’s |
|
|
|
|
|
Example¶
[global]
username = lfid
password = REDACTED
[github]
token = REDACTED
[rtd]
token = REDACTED
endpoint = https://readthedocs.org/api/v3/
[gerrit.example.org]
username = lfid
password = REDACTED
endpoint = https://gerrit.example.org/
email = your@email.org
sob = Your Name <your@email.org>
[nexus.example.org]
username = lfid
password = REDACTED
endpoint = https://nexus.example.org/
Jenkins servers and OpenStack clouds have their own files,
jenkins_job.ini and clouds.yaml, not sections of lftools.ini.