-
Notifications
You must be signed in to change notification settings - Fork 147
RavenDB: improve hosting integration (ports, log volumes, ensure database) #1072
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
base: main
Are you sure you want to change the base?
Conversation
…w to specify Port via RavenDBServerSetting (issues/1026)
…le that is generated in secured setup - we need to use the PublicServerUrl when we're running in secured setup
…ted in secured setup
…pers (issues/1025)
…artup (issues/1024) and add ClientCertificate to RavenDBServerSettings and RavenDBServerResource, which will be used by hosting code (health checks, database creation) when connecting to a RavenDB server in secured setups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the RavenDB hosting integration by adding configurable port settings, log volume management helpers, and optional database creation at startup. It also improves secured-mode handling by properly threading client certificates through health checks and database operations.
Key changes:
- Added configurable HTTP and TCP port support via
RavenDBServerSettings - Added log volume/bind-mount helper methods for RavenDB logs directory
- Added
ensureCreatedparameter toAddDatabasefor automatic database creation at startup
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
RavenDBServerSettings.cs |
Added Port and TcpPort properties; fixed typo in comment; added ClientCertificate parameter to secured factory methods |
RavenDBServerResource.cs |
Added PublicServerUrl and ClientCertificate internal properties; updated ConnectionStringExpression to use public URL in secured mode |
RavenDBBuilderExtensions.cs |
Refactored to support configurable ports; added ensureCreated logic with OnResourceReady; added WithLogBindMount and WithLogVolume helpers; improved TCP endpoint configuration |
HealthChecksExtensions.cs |
Added certificate parameter to health check registration methods |
AddRavenDBTests.cs |
Added tests for custom port configuration and log volume/bind-mount helpers |
AppHostTests.cs |
Removed CreateDatabase setting from client configuration |
Program.cs (example) |
Updated to use ensureCreated: true instead of client-side database creation |
| internal string TcpEndpointName = "tcp"; | ||
|
|
||
| /// <summary> | ||
| /// The public server URL (domain) configured for this resource./>. |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XML doc comment has a malformed closing tag. The closing summary tag should be </summary> instead of />.
| /// The public server URL (domain) configured for this resource./>. | |
| /// The public server URL (domain) configured for this resource. |
@dotnet-policy-service agree company="RavenDB" |
Closes #1022, #1024, #1025, #1026
Overview
This PR refines the RavenDB hosting integration and addresses several related issues.
This PR:
RavenDBServerSettings, and wires those into the generated endpoints and environment variables (RavenDb: Add the ability to specify the DataPort #1022, RavenDb: When you use AddRaenDb(name, settings) you cannot specify the port #1026).ensureCreatedflag toAddDatabaseso a database can be created at startup (RavenDb: Ensure Database created #1024).RavenDBServerSettingsflows intoRavenDBServerResourceand is reused from the health check and from the “ensure database created” path.Details
Ports and TCP data port (#1022, #1026)
RavenDBServerSettingsnow exposes optionalPort(HTTP) andTcpPort(TCP/data) properties.AddRavenDBuses these when configuring the HTTP and TCP endpoints.RAVEN_PublicServerUrl_Tcp), while still defaulting to38888when no TCP port is specified.Log bind-mount / volume helpers (#1025)
IResourceBuilder<RavenDBServerResource>:WithLogBindMount(source, isReadOnly = false)WithLogVolume(name = null, isReadOnly = false)Optional database creation at startup (#1024)
AddDatabase(..., bool ensureCreated = false)now supports creating the database at startup.ensureCreatedistrue, the builder usesOnResourceReadyto:DocumentStore(using a client certificate when configured).GetDatabaseRecordOperationand create it withCreateDatabaseOperationif it does not exist.Secured setups & health checks
RavenDBSecuredServerSettingsandRavenDBServerResourcenow carry optional client certificate information.ensureCreatedpath to talk to the server in secured mode.Testing
ensureCreatedbehaviourPR Checklist