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

Consolidate configuration/logging locations #1049

Open
kalvinnchau opened this issue Feb 3, 2025 · 0 comments · May be fixed by #1153
Open

Consolidate configuration/logging locations #1049

kalvinnchau opened this issue Feb 3, 2025 · 0 comments · May be fixed by #1153
Assignees
Labels
enhancement New feature or request

Comments

@kalvinnchau
Copy link
Collaborator

kalvinnchau commented Feb 3, 2025

Consolidate configuration & logging locations

Various crates use / hard code $HOME/.config as the location to store various configuration/output files, and using different approaches to resolve $HOME

We should consolidate on a single approach, and ensure whatever approach we take supports other OSs (windows, etc).

The XDG spec could be something an option to follow: https://specifications.freedesktop.org/basedir-spec/latest/.

We currently put the logs in ~/.config/goose/logs which imo should go somewhere else (maybe $HOME/.local/state/goose?)

I know the mac developer guide recommends things like ~/Library/Application Support (see MOSXAppProgrammingGuide an older guide but seems to still be relevant) , but I do like the ~/.config for MacOS personally, even more from a CLI perspective.

A couple crates we can evaluate:

etcetera seems to be the most popular, and can support the platforms we want, while enforcing xdg on macos.

@kalvinnchau kalvinnchau added the enhancement New feature or request label Feb 3, 2025
jasonkneen added a commit to jasonkneen/maverick that referenced this issue Feb 6, 2025
Fixes block#1049

Consolidate configuration and logging locations to use the `etcetera` crate.

* **Cargo.toml**
  - Add `etcetera` crate to `[dependencies]` section.

* **crates/goose-cli/src/log_usage.rs**
  - Replace `dirs::home_dir()` with `etcetera::base_strategy::get_config_dir()`.
  - Update log directory path to use `etcetera`.

* **crates/goose-server/src/logging.rs**
  - Replace `std::env::var("HOME")` with `etcetera::base_strategy::get_config_dir()`.
  - Update log directory path to use `etcetera`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/block/goose/issues/1049?shareId=XXXX-XXXX-XXXX-XXXX).
@kalvinnchau kalvinnchau self-assigned this Feb 6, 2025
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
1 participant