Repository navigation
Commit 3a6fd9f
Introduce structured configuration model for YARP container app (#3017)
* Introduce structured configuration model for YARP container app
Replace ad-hoc config keys (YARP_ENABLE_STATIC_FILES, etc.) with a
structured object model (YarpAppConfig) bound from IConfiguration.
- Configuration/YarpAppConfig.cs: Root config POCO with all sections
- Configuration/YarpAppConfigBinder.cs: Single IConfiguration -> object
model conversion, with legacy key mapping
- Features/: Modular extension methods per feature (StaticFiles,
NavigationFallback, ReverseProxy)
- Program.cs: Clean pipeline - ordering is explicit, feature logic
is in extension methods
- Extensions.cs: Takes YarpAppConfig instead of reading IConfiguration
Legacy env vars (YARP_ENABLE_STATIC_FILES, YARP_DISABLE_SPA_FALLBACK,
YARP_UNSAFE_OLTP_CERT_ACCEPT_ANY_SERVER_CERTIFICATE) continue to work.
New config format:
StaticFiles:Enabled=true
NavigationFallback:Path=/index.html
Refs #3015
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add StaticSite sample and fix config file webroot resolution
Set ContentRootPath and WebRootPath via WebApplicationOptions when a
config file is passed, so the default wwwroot directory resolves relative
to the config file's location.
Add samples/StaticSite/ with index.html, 404.html, hashed CSS, and
nested directory pages to exercise static file hosting.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add StaticSite sample to samples README
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add startup banner and suppress framework console noise
Print a clean startup summary showing config file, webroot, SPA
fallback, and listening URLs. Suppress noisy framework logs
(DataProtection, Hosting.Lifetime, etc.) on the console provider
so docker logs shows only useful information.
Banner writes to Console directly so it always shows regardless
of log level. Framework logs still flow to other providers (OTEL).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix logging escape hatch: re-add Logging config after default filters
Use the AddConfiguration pattern from Aspire to allow users to
override our default console log suppression via the standard
Logging:Console:LogLevel config section.
Our defaults suppress framework noise, but users can re-enable
specific categories when debugging.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Trim schema, options, and README to implemented features only
Remove unimplemented config sections (Compression, Https, Headers,
Redirects, CleanUrls, TrailingSlash, PreCompressed, ErrorPages,
NavigationFallback.Exclude) from the schema, options classes, binder,
and README. These get added when their features are implemented.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix review findings: clear AsyncLocal after use, handle null directory path
- Clear TestConfiguration AsyncLocal value after consuming to prevent
test pollution between sequential tests
- Handle Path.GetDirectoryName returning null for root paths by
falling back to current directory
- Improve README with startup banner example, logging docs, accurate
project structure
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify README intro
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* README: describe as opinionated YARP distribution
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* README: mention ASP.NET Core and YARP
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* README: reverse proxy first, not static file host
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* README: web server and reverse proxy
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove auto-generated yarp.sln
Was accidentally created by dotnet build. The repo uses YARP.slnx.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add StaticSite sample to YARP.slnx
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix markdown lint errors in READMEs
Add language specifiers to fenced code blocks and fix table
column spacing to pass markdownlint.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Improve test infrastructure and coverage
- Add YarpAppConfig object model support to YarpTestApp: tests can
construct config as strongly-typed objects that serialize to JSON
- Add YarpAppConfigBinderTests: 13 unit tests covering new config
format, legacy key mapping, precedence rules, and edge cases
- Disable parallel test execution to prevent AsyncLocal race conditions
- Update integration tests to demonstrate both object model and
dictionary-based config patterns
27 tests total (14 integration + 13 binder unit tests)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove unnecessary DisableTestParallelization
AsyncLocal is per-execution-context, not per-thread. Each test's
WebApplicationFactory runs in its own async context so parallel
tests don't interfere with each other's config values.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Simplify AddReverseProxy: use builder.Configuration directly
No need to pass IConfiguration separately — it's available on
the builder.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix outdated links
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Replace section name string literals with nameof in YarpAppConfigBinder
Agent-Logs-Url: https://github.com/dotnet/yarp/sessions/539722f2-db88-4a86-9362-d5701423a238
Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>
* Fix PR feedback on container README
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>1 parent 2df9fb4 commit 3a6fd9f
25 files changed
Lines changed: 910 additions & 61 deletions
File tree
- samples
- StaticSite
- wwwroot
- _astro
- docs/getting-started
- src/Application
- Configuration
- Features
- test/Application.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments