Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Use OS standard paths of application configuration files #1648

Closed
2 tasks
debris opened this issue Jul 17, 2016 · 15 comments
Closed
2 tasks

Use OS standard paths of application configuration files #1648

debris opened this issue Jul 17, 2016 · 15 comments
Labels
F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. Q5-substantial 📓 Can be fixed by a developer with decent experience.
Milestone

Comments

@debris
Copy link
Collaborator

debris commented Jul 17, 2016

Currently parity directory is located under ~/.parity on all operating systems.

Should be:

  • Mac OS: ~/Library/Parity;
  • Windows: \Users\Username\AppData\Roaming\Parity (* not sure if Roaming is correct here).

Steps:

  • Provide utility functions to determine correct path in an OS-independent way.
  • Switch directories and provide upgrade mechanism.
@debris debris added the F8-enhancement 🎊 An additional feature request. label Jul 17, 2016
@arkpar
Copy link
Collaborator

arkpar commented Jul 17, 2016

Why is it better?

@gavofyork gavofyork changed the title Location of .parity directory on mac os Use OS standard paths of application configuration files Jul 17, 2016
@gavofyork
Copy link
Contributor

gavofyork commented Jul 17, 2016

For Mac OS it's perhaps arguable at present. However as it becomes less of a Unix CLI tool and more a cross-platform background service, it becomes better practice to use actual Mac OS paths. In any case, it's an awful lot easier to find files (I'm thinking of keys and dapps here) in the Mac OS Finder when they're stored in ~/Library rather than dot-files which are ugly and a PITA to show.

The case is more easily made on Windows, where $HOME/.parity is plainly wrong.

@NikVolf
Copy link
Contributor

NikVolf commented Jul 17, 2016

cargo uses $HOME/.cargo with no issues on windows

@gavofyork
Copy link
Contributor

gavofyork commented Jul 17, 2016

Just because you can do it, doesn't mean you should do it. We have had issues with users being unable to find configuration files/keys precisely because they were not stored in the expected, OS-standardised, place.

@gavofyork gavofyork mentioned this issue Jul 17, 2016
@rphmeier
Copy link
Contributor

rphmeier commented Jul 17, 2016

cargo and rustup are currently getting a fair bit of flack for not using XDG Base dir specification as well.

@NikVolf
Copy link
Contributor

NikVolf commented Jul 20, 2016

@gavofyork yeah i agree but also one thing is that on windows $HOME/.<folder> is much more accessible for regular user than hidden-by-default AppData/Roaming folder

probably keys should not be stored in hidden folder

@gavofyork
Copy link
Contributor

gavofyork commented Aug 9, 2016

reports in the gitter channel have so far not supported that assertion. /Users/User/.parity is an unexpected and non-standard place, regardless of whether Explorer happens to show it by default.

If there's an argument for allowing users to access key files directly (and I'm not sure there is) then it should be done in a proper way such as placing them in /Users/User/AppData/Parity/Keys or whatever, not some half-assed, lazy, non-standard, platform-blind hangover from Linux.

@gavofyork gavofyork added this to the 1.4 Civility milestone Aug 9, 2016
@gavofyork gavofyork added the Q5-substantial 📓 Can be fixed by a developer with decent experience. label Aug 9, 2016
@MicahZoltu
Copy link
Contributor

AppData/Roaming is NOT the correct place for the blockchain as it is synced over the network on login/logout for Windows domain networks. It is the correct place for things that you would expect to roam with the user such as private keys, user configuration, etc.

At the moment, Parity installs will likely break horribly on a domain network because of the installation of the blockchain (currently ~6GB for me) into the user's home directory which is then synced over the network (assuming default network configuration). Not likely a big deal at the moment since not a lot of corporate users install it, but will become a bigger issue over time as Ethereum grows in popularity.

See #2159 for more details on layout, or feel free to @mention me if you want clarification on the proper (MS endorsed) location for various file types.

@gavofyork gavofyork added the M4-core ⛓ Core client code / Rust. label Sep 20, 2016
@gavofyork gavofyork modified the milestones: 1.4 Civility, 1.5 Tenuity Oct 8, 2016
@tomusdrw
Copy link
Collaborator

tomusdrw commented Nov 3, 2016

Might be useful: https://github.com/AndyBarron/app-dirs-rs

@gavofyork gavofyork modified the milestones: 1.5 Tenuity, 1.6 Nov 11, 2016
@tomusdrw
Copy link
Collaborator

Closed with #3828

@MicahZoltu
Copy link
Contributor

MicahZoltu commented Dec 28, 2016

@tomusdrw Unfortunately the attached change don't appear to resolve this issue. In particular, the chain data should go in AppDataType::UserCache of the used library, not AppDataType::UserData. By putting it in UserData, it is going to be put in a folder that may be a network share or a limited space disk (e.g. high performance low space SSD).

One could argue that the used library doesn't quite do the right thing for Windows as UserData should be in local, not roaming. I'll submit an issue over there about this as well.

@MicahZoltu
Copy link
Contributor

Also, config (keys) should go in UserConfig, but it appears this change throws everything into UserData.

@MicahZoltu
Copy link
Contributor

Issue to fix UserData in library: andybarron/app-dirs-rs#16

@MicahZoltu
Copy link
Contributor

I have submitted a PR at andybarron/app-dirs-rs#18, if/when it is accepted a library update will resolve this issue. However, because migration is difficult I strongly recommend resolving the issue before you release the current set of changes (if it isn't too late already).

I'm not sure if anyone is seeing these comments as this is a closed PR, if someone is reading these, please let me know. If I don't hear anything on this issue I'll open a new one to help get some visibility as I believe the current solution is bad as it breaks Windows functionality (roaming replication/backup/storage).

@rphmeier
Copy link
Contributor

rphmeier commented Jan 1, 2017

@MicahZoltu hearing you loud and clear :) Thanks for taking a closer look into the best locations to keep things. The set of changes hasn't been in a published release yet, so no issue in changing it to something more relevant now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. Q5-substantial 📓 Can be fixed by a developer with decent experience.
Projects
None yet
Development

No branches or pull requests

7 participants