Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider using standard XDG paths for configs and data #2563

Open
bendavis78 opened this issue Jul 2, 2024 · 0 comments
Open

Please consider using standard XDG paths for configs and data #2563

bendavis78 opened this issue Jul 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bendavis78
Copy link

bendavis78 commented Jul 2, 2024

Modern *nix-based applications use the XDG path standard for configuration and data. It used to be that everyone stored things under a dot-dir in the home directory, but this clutters the home directory and doesn't give the user much say in where things are stored. Most *nix systems now have XDG_* environment variables set that specify where apps should store their configuration and data files.

Right now, tabby-agent hard-codes configs AND data under the same folder in the user's home dir.

Instead, tabby should use XDG_* dirs for any paths that write to filesystem to give users the control they expect when using a *nix system.

const xdg = require('@folder/xdg');
const dirs = xdg()

const configFilePath = path.join(dirs.config, "tabby", "config.toml") 
// ~/.config/tabby/config.toml

const dataFile = path.join(dirs.data, "tabby", "agent", "data.json")
// ~/.local/share/tabby/agent/data.json

const logDir = path.join(dirs.data, "tabby", "agent", "logs")
// ~/.local/share/tabby/agent/logs/ 

In my case this is convenient because now I can make my all configurations portable, trusting they will all be in the same place while keeping non-config data such as logs or databases separate.

It's not such a big deal with the server as I can specify the volume mount for the docker server (eg, $XDG_DATA_DIR/tabby or /.local/share/tabby.

@bendavis78 bendavis78 added the enhancement New feature or request label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants