Skip to content

Use Aspire endpoints for host addresses - #1621

Draft
afscrome wants to merge 4 commits into
mainfrom
afscrome-replace-0000-with-ipv4host
Draft

afscrome wants to merge 4 commits into
mainfrom
afscrome-replace-0000-with-ipv4host

Conversation

@afscrome

@afscrome afscrome commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Use Endpoints to configure hosts / ports

Updated various community toolkit resources to use endpoints rather than hardcoding host.docker.internal.

Not using endpoints meant that many integrations had to build their own logic up around whether being consumed form a container or not. It also meant they were inconsistent over whether they used static/dynamic ports by default, or what the default port binding is.

Some of this is historic as the apis required to do this cleanly were a complex or even unavaialble to use until 13.1 and 13.2:

(Note, this may result in some breaking changes as resources may now bind to 127.0.0.1 rather than 0.0.0.0). Any such occurrences can be mitigated via .WithEndpoint(name, x => x.TargetHost = "0.0.0.0")

Implemented WithHostPort() pattern for configuring static ports

A general pattern in aspire for ports is to default to a random port, and provide a WithHostPort() method to allow that port to be changed. Added the WithHostPort() methods where needed.

Not included in this pr

  • Posta - it does some funky non idiomatic patterns wereby everything is set as as parameter expression via options objects, rather than idiomatic extensions (e.g. WithSmtpRelayHost())

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1621

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1621"

@afscrome
afscrome deployed to azure-artifacts September 24, 2026 07:58 — with GitHub Actions Active
@github-actions github-actions Bot added the Stale label Oct 7, 2026
@afscrome
afscrome force-pushed the afscrome-replace-0000-with-ipv4host branch from f3e485b to 3468b93 Compare October 10, 2026 08:58
afscrome and others added 4 commits October 10, 2026 10:11
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use structured endpoint properties and caller-aware resolution across hosting integrations, and update endpoint allocation tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ing integrations

Adds the idiomatic host-port configuration pattern (matching Adminer, DbGate,
Elasticvue, etc.) to every AddXyz() extension that takes a port parameter but
was missing a matching fluent helper: ActiveMQ, Azure.DataApiBuilder, Flagd,
Floci (Aws/Azure/Gcp), GoFeatureFlag, K3s, KurrentDB, LavinMQ, Listmonk, Logto,
MailPit, McpInspector, Meilisearch, Mosquitto, Ngrok, Ollama, PapercutSmtp,
Posta, RavenDB, RustFs, Sftp, Solr, StableDiffusionCpp, SurrealDb, Umami,
Zitadel, and k6.

Single-endpoint resources get WithHostPort(); multi-endpoint resources get
With<EndpointName>HostPort() for each endpoint (e.g. WithAmqpHostPort,
WithManagementHostPort, WithAdminHostPort, WithSmtpHostPort).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use endpoint properties for RustFS bind addresses and fake endpoint allocations in unit tests so endpoint resolution remains deterministic without reverting the endpoint-refactor behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@afscrome
afscrome force-pushed the afscrome-replace-0000-with-ipv4host branch from 3468b93 to 1787e1d Compare October 10, 2026 09:11
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.GoFeatureFlag 83% 81% 36 ✔
CommunityToolkit.Aspire.Hosting.ActiveMQ 85% 48% 62 ✔
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 16% 4% 217 ❌
CommunityToolkit.Aspire.Hosting.Adminer 98% 70% 12 ✔
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 80% 83% 19 ✔
CommunityToolkit.Aspire.Hosting.DbGate 97% 62% 12 ✔
CommunityToolkit.Aspire.Hosting.Dbx 92% 68% 38 ✔
CommunityToolkit.Aspire.Hosting.Flagd 90% 100% 18 ✔
CommunityToolkit.Aspire.Hosting.Floci 95% 86% 415 ✔
CommunityToolkit.Aspire.Hosting.Floci.ApiService 65% 60% 67 ➖
CommunityToolkit.Aspire.Hosting.Flyway 88% 100% 3 ✔
CommunityToolkit.Aspire.Hosting.GoFeatureFlag 77% 50% 25 ➖
CommunityToolkit.Aspire.Hosting.GoFeatureFlag.ApiService 100% 100% 3 ✔
CommunityToolkit.Aspire.Hosting.K3s 76% 58% 264 ➖
CommunityToolkit.Aspire.Hosting.k6 75% 56% 14 ➖
CommunityToolkit.Aspire.Hosting.k6.ApiService 64% 67% 6 ➖
CommunityToolkit.Aspire.Hosting.KurrentDB 94% 88% 20 ✔
CommunityToolkit.Aspire.Hosting.LavinMQ 85% 83% 20 ✔
CommunityToolkit.Aspire.Hosting.LavinMQ.MassTransit 16% 4% 217 ❌
CommunityToolkit.Aspire.Hosting.Listmonk 98% 100% 25 ✔
CommunityToolkit.Aspire.Hosting.Logto 70% 67% 26 ➖
CommunityToolkit.Aspire.Hosting.MailPit 85% 100% 15 ✔
CommunityToolkit.Aspire.Hosting.McpInspector 84% 60% 82 ✔
CommunityToolkit.Aspire.Hosting.McpInspector.McpServer 89% 100% 2 ✔
CommunityToolkit.Aspire.Hosting.Meilisearch 92% 80% 30 ✔
CommunityToolkit.Aspire.Hosting.Meilisearch.ApiService 80% 100% 9 ✔
CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 88% 81% 18 ✔
CommunityToolkit.Aspire.Hosting.Mosquitto 94% 67% 18 ✔
CommunityToolkit.Aspire.Hosting.MySql.Extensions 94% 88% 36 ✔
CommunityToolkit.Aspire.Hosting.Ngrok 50% 48% 89 ❌
CommunityToolkit.Aspire.Hosting.Ollama 78% 67% 269 ➖
CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector 79% 70% 28 ➖
CommunityToolkit.Aspire.Hosting.PapercutSmtp 88% 100% 11 ✔
CommunityToolkit.Aspire.Hosting.Posta 97% 80% 81 ✔
CommunityToolkit.Aspire.Hosting.PostgreSQL.Extensions 91% 87% 46 ✔
CommunityToolkit.Aspire.Hosting.Python.Extensions 45% 32% 44 ❌
CommunityToolkit.Aspire.Hosting.RavenDB 68% 49% 105 ➖
CommunityToolkit.Aspire.Hosting.RavenDB.ApiService 24% 33% 8 ❌
CommunityToolkit.Aspire.Hosting.Redis.Extensions 92% 78% 18 ✔
CommunityToolkit.Aspire.Hosting.RedPanda 99% 88% 37 ✔
CommunityToolkit.Aspire.Hosting.RedPanda.Consumer 69% 83% 10 ➖
CommunityToolkit.Aspire.Hosting.RustFs 87% 66% 104 ✔
CommunityToolkit.Aspire.Hosting.Sftp 87% 62% 16 ✔
CommunityToolkit.Aspire.Hosting.Sftp.ApiService 94% 100% 10 ✔
CommunityToolkit.Aspire.Hosting.Solr 97% 100% 16 ✔
CommunityToolkit.Aspire.Hosting.SqlServer.Extensions 85% 79% 40 ✔
CommunityToolkit.Aspire.Hosting.StableDiffusionCpp 55% 50% 83 ❌
CommunityToolkit.Aspire.Hosting.SurrealDb 88% 74% 193 ✔
CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService 52% 38% 440 ❌
CommunityToolkit.Aspire.Hosting.Umami 96% 75% 8 ✔
CommunityToolkit.Aspire.Hosting.Zitadel 96% 86% 28 ✔
CommunityToolkit.Aspire.KurrentDB 55% 70% 25 ❌
CommunityToolkit.Aspire.Meilisearch 81% 71% 30 ✔
CommunityToolkit.Aspire.RavenDB.Client 35% 38% 67 ❌
CommunityToolkit.Aspire.Sftp 90% 94% 38 ✔
CommunityToolkit.Aspire.SurrealDb 49% 46% 30 ❌
Summary 77% (7535 / 9800) 55% (1745 / 3194) 3603 ➖

@afscrome
afscrome deployed to azure-artifacts October 10, 2026 09:19 — with GitHub Actions Active
@github-actions github-actions Bot removed the Stale label Oct 11, 2026

This branch was successfully deployed

1 active deployment
azure-artifacts — 1787e1dc Deployed Oct 10, 2026 by afscrome via publish-azure-artifacts #4629
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant