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

Use $HOME/.config/Microsoft/ASP.NET instead of $HOME/.aspnet in unix-like environments #43278

Open
1 task done
etki opened this issue Aug 14, 2022 · 3 comments
Open
1 task done
Labels
area-dataprotection Includes: DataProtection
Milestone

Comments

@etki
Copy link

etki commented Aug 14, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Henlo. This is a classic issue raised in any project.
Currently ASP.NET pollutes user $HOME directories by placing an unnecessary folder there:

const baseFolder =
  process.env.APPDATA !== undefined && process.env.APPDATA !== ''
    ? `${process.env.APPDATA}/ASP.NET/https`
    : `${process.env.HOME}/.aspnet/https`;
// Use*NIX conventions for a folder name.
retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName));

// Use*NIX conventions for a folder name.
retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName));

This is a common pain for a long time for many people on unix-like platforms. I, as a user, want to have a sane output of directory listing, however any search that includes hidden dot-directories brings serious distraction when every tool strives to create a separate directory there:

find $HOME -maxdepth 1 -name '.*' | wc -l
70

Describe the solution you'd like

There is a long-standing and widely adopted solution for that called XDG convention. Long story short, it defines several folders for common usage (configuration, state, cache, etc.) which can be additionally configured via environmental variables, and suggests that applications should create sub-directories there and store their own files in an organized fashion. In example above JS code uses AppData folder, which is the experience i expect as user; XDG convention provides AppData folder equivalent for unix-like environments.

I suggest adopting XDG convention and bring some relief to end users during one of the major releases, and also placing ASP.NET folder within Microsoft folder, since without any grouping .config listings are a pain as well.

Additional context

No response

@javiercn javiercn added the area-dataprotection Includes: DataProtection label Aug 15, 2022
@adityamandaleeka adityamandaleeka added this to the .NET 8 Planning milestone Aug 15, 2022
@adityamandaleeka
Copy link
Member

We should look into this in .NET 8.

It'll be important to make sure that the upgrade scenarios work (e.g. data protection keys in the old location don't get lost).

@Spacefish
Copy link

Maybe implement the following behaviour:

  • If $HOME/.aspnet exists -> move $HOME/.aspnet to $HOME/.config/Microsoft/ASP.NET and create a Symlink under $HOME/.aspnet to the new folder
  • If it does not exists, don´t create a symlink

ratio: If the folder exists, the user might have used it with an older version, if it does not exist, it´s unlinkely that the user will use .NET 8 and switch back to .NET 7 or older later on an expect his configs from .NET 8.0 to carry over.
Furthermore the user can just delete the symlink if he plans to only use .NET 8.0+

@amcasey amcasey modified the milestones: .NET 8 Planning, Backlog Jan 26, 2024
@ghost
Copy link

ghost commented Jan 26, 2024

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dataprotection Includes: DataProtection
Projects
None yet
Development

No branches or pull requests

5 participants