nats-io / nats-architecture-and-design

Architecture and Design Docs
Apache License 2.0
196 stars 21 forks source link

ADR-22: Client file locations #88

Open philpennock opened 2 years ago

philpennock commented 2 years ago

In discussion, it became clear that folks are more comfortable using a common directory holding things if there's some way to avoid multiple tools claiming the same files. There was also debate about how to manage migration safely, how to manage Windows, etc. I volunteered to write an ADR documenting a proposal.

At heart, we're using XDG on Unix with the https://github.com/adrg/xdg rules for mapping these locations to "native" locations on macOS and Windows.

This ADR has a proposal as a stake in the ground which folks can evaluate.

(Also, fixed the ADR template and parser to be a little more consistent, after I went wrong while following the template).

aricart commented 2 years ago

it would be great if @derekcollison could comment on this. As I understand as I understand his comments (he can elaborate) most unix tools don't use these locations. On my environment the only clis that I can find in OS X that store under ~/Library/Application Support are termshark and mkcert all other tools have an UI type component with the exception of the demon/services in OS X.

philpennock commented 2 years ago

I have reverted the main.go changes and adjusted the README and template, per @ripienaar's feedback above.

In a meeting with @derekcollison, @aricart and @scottf we settled on the approach documented now: we use the adrg/xdg locations, because particularly on Windows the XDG locations do not work. For darwin/macOS we compromise and want both the XDG location and the system-native paths to work. Tools should mostly use the system native path, the .config/nats works better for humans exploring. We think.

Suggestions on better phrasing welcome.