-
Notifications
You must be signed in to change notification settings - Fork 733
Description
Hi 👋🏻
Disclaimer: Since my issue is more a feature request than an API change, I decided not to use one of the predefined templates, but I'm happy to provide any further information you need.
I'm running the Aspire Dashboard as a standalone app via Docker which works nicely 👌🏻 this is my current docker-compose.yml:
services:
aspire-dashboard:
image: mcr.microsoft.com/dotnet/aspire-dashboard
container_name: aspire-dashboard
ports:
- 4317:18889
- 18888:18888
environment:
- Dashboard__Frontend__BrowserToken=TralalaYou immediately see the flaw: it contains the browser token as cleartext. Especially since I put my docker-compose.yml files under version control, that's not really great.
For my other .NET apps, I'm using the key-per-file configuration provider which would allow the following setting:
services:
aspire-dashboard:
image: mcr.microsoft.com/dotnet/aspire-dashboard
container_name: aspire-dashboard
ports:
- 4317:18889
- 18888:18888
secrets:
- Dashboard__Frontend__BrowserToken
secrets:
Dashboard__Frontend__BrowserToken:
file: Dashboard__Frontend__BrowserToken.txtThis way, I could easily put my docker-compose.yml under version control.
After a quick and non-comprehensive look, I think this might be implemented by adding the following lines here:
if (!string.IsNullOrEmpty(builder.Configuration[DashboardConfigNames.SecretsPath]))
{
builder.Configuration.AddKeyPerFile(directoryPath: builder.Configuration[DashboardConfigNames.SecretsPath], optional: false);
}With this change, the final docker-compose.yml could look like this:
services:
aspire-dashboard:
image: mcr.microsoft.com/dotnet/aspire-dashboard
container_name: aspire-dashboard
ports:
- 4317:18889
- 18888:18888
environment:
- Dashboard__SecretsPath=/run/secrets
secrets:
- Dashboard__Frontend__BrowserToken
secrets:
Dashboard__Frontend__BrowserToken:
file: Dashboard__Frontend__BrowserToken.txtIf you'd consider this a useful feature, I'm happy to provide a PR.