Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ services:
- shared.env
environment:
- EVENTSTORE_GOSSIP_SEED=172.30.240.12:2113,172.30.240.13:2113
- EVENTSTORE_INT_IP=172.30.240.11
- EVENTSTORE_REPLICATION_IP=172.30.240.11
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node1/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node1/node.key
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=127.0.0.1
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2111
- EVENTSTORE_ADVERTISE_NODE_PORT_TO_CLIENT_AS=2111
ports:
- 2111:2113
networks:
Expand All @@ -51,11 +51,11 @@ services:
- shared.env
environment:
- EVENTSTORE_GOSSIP_SEED=172.30.240.11:2113,172.30.240.13:2113
- EVENTSTORE_INT_IP=172.30.240.12
- EVENTSTORE_REPLICATION_IP=172.30.240.12
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node2/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node2/node.key
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=127.0.0.1
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2112
- EVENTSTORE_ADVERTISE_NODE_PORT_TO_CLIENT_AS=2112
ports:
- 2112:2113
networks:
Expand All @@ -73,11 +73,11 @@ services:
- shared.env
environment:
- EVENTSTORE_GOSSIP_SEED=172.30.240.11:2113,172.30.240.12:2113
- EVENTSTORE_INT_IP=172.30.240.13
- EVENTSTORE_REPLICATION_IP=172.30.240.13
- EVENTSTORE_CERTIFICATE_FILE=/etc/eventstore/certs/node3/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/etc/eventstore/certs/node3/node.key
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=127.0.0.1
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2113
- EVENTSTORE_ADVERTISE_NODE_PORT_TO_CLIENT_AS=2113
ports:
- 2113:2113
networks:
Expand Down
2 changes: 1 addition & 1 deletion samples/server/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
- EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
- EVENTSTORE_HTTP_PORT=2113
- EVENTSTORE_NODE_PORT=2113
- EVENTSTORE_INSECURE=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
ports:
Expand Down
6 changes: 3 additions & 3 deletions shared.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EVENTSTORE_CLUSTER_SIZE=3
EVENTSTORE_RUN_PROJECTIONS=All
EVENTSTORE_INT_TCP_PORT=1112
EVENTSTORE_HTTP_PORT=2113
EVENTSTORE_REPLICATION_PORT=1112
EVENTSTORE_NODE_PORT=2113
Comment on lines +3 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Env var rename: replication/http → replication/node; verify image support

The renames to EVENTSTORE_REPLICATION_PORT and EVENTSTORE_NODE_PORT look aligned with the codebase-wide shift to replication/node semantics. Please double-check that the Docker images used in this repo (and in your deployment pipelines) recognize these env vars to avoid silent misconfigurations.

Run this from the repo root to spot usages and ensure these are the canonical names in the codebase:

If you're relying on the prebuilt docker image tag in samples (eventstore/eventstore:24.2.0-jammy), confirm that tag supports these new names in its docs/changelog.


🏁 Script executed:

#!/bin/bash
# Verify env var names are recognized by the server's option binding
rg -nP '\bEVENTSTORE_(REPLICATION|NODE)_(PORT|IP)\b|AdvertiseNodePortToClientAs|NodePortAdvertiseAs|ReplicationPort\b'

# Also list any leftover deprecated names to catch stragglers
rg -nP '\bEVENTSTORE_(INT(_TCP)?|HTTP)_'

Length of output: 4161


Verify env var usage and update deprecated samples

The codebase correctly recognizes EVENTSTORE_REPLICATION_PORT and EVENTSTORE_NODE_PORT, but there are still deprecated variables in one of the sample manifests that need updating to prevent misconfiguration:

• In samples/server/docker-compose-cluster.yaml, replace all occurrences of

EVENTSTORE_INT_IP=…

with

EVENTSTORE_REPLICATION_IP=…

(lines 25, 57, and 82).

Additionally, please confirm that the Docker image tag you’re using (e.g. eventstore/eventstore:24.2.0-jammy) supports the new environment variable names—EVENTSTORE_REPLICATION_PORT and EVENTSTORE_NODE_PORT—in its documentation or changelog to avoid silent mismatches.

🤖 Prompt for AI Agents
In shared.env around lines 3-4, the sample manifests still use the deprecated
EVENTSTORE_INT_IP variable; open samples/server/docker-compose-cluster.yaml and
replace all occurrences of EVENTSTORE_INT_IP with EVENTSTORE_REPLICATION_IP at
lines 25, 57, and 82, update any related comments to reflect the new name, and
verify the docker image tag used (e.g., eventstore/eventstore:24.2.0-jammy)
supports EVENTSTORE_REPLICATION_PORT and EVENTSTORE_NODE_PORT by checking the
image documentation/changelog and, if needed, bump or change the image tag to
one that documents support for the new environment variable names.

EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/etc/eventstore/certs/ca
EVENTSTORE_DISCOVER_VIA_DNS=false
EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
1 change: 0 additions & 1 deletion src/EventStore.Core.Tests/Helpers/MiniClusterNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public MiniClusterNode(string pathname, int debugIndex, IPEndPoint internalTcp,
NodeIp = ExternalTcpEndPoint.Address,
ReplicationPort = InternalTcpEndPoint.Port,
NodePort = HttpEndPoint.Port,
DisableInternalTcpTls = false,
ReplicationHeartbeatTimeout = 2_000,
ReplicationHeartbeatInterval = 2_000,
EnableAtomPubOverHttp = true,
Expand Down
8 changes: 4 additions & 4 deletions src/EventStore.Core.Tests/Helpers/MiniNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ public MiniNode(string pathname,
.Build()),
}.Secure(new X509Certificate2Collection(ssl_connections.GetRootCertificate()),
ssl_connections.GetServerCertificate())
.WithInternalSecureTcpOn(IntTcpEndPoint)
.WithExternalSecureTcpOn(TcpEndPoint)
.WithHttpOn(HttpEndPoint);
.WithReplicationEndpointOn(IntTcpEndPoint)
.WithExternalTcpOn(TcpEndPoint)
.WithNodeEndpointOn(HttpEndPoint);

var inMemConf = new ConfigurationBuilder()
.AddInMemoryCollection(new KeyValuePair<string, string>[] {
Expand All @@ -178,7 +178,7 @@ public MiniNode(string pathname,
}).Build();

if (advertisedExtHostAddress != null)
options = options.AdvertiseHttpHostAs(new DnsEndPoint(advertisedExtHostAddress, advertisedHttpPort));
options = options.AdvertiseNodeAs(new DnsEndPoint(advertisedExtHostAddress, advertisedHttpPort));

options = inMemDb
? options.RunInMemory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
return options
.Insecure()
.WithExternalTcpOn(new IPEndPoint(IPAddress.Loopback, 11130))
.WithInternalTcpOn(new IPEndPoint(IPAddress.Loopback, 11120))
.WithReplicationEndpointOn(new IPEndPoint(IPAddress.Loopback, 11120))
.AdvertiseExternalHostAs(new DnsEndPoint("196.168.1.1", 11131))
.AdvertiseHttpHostAs(new DnsEndPoint("196.168.1.1", 21130));
.AdvertiseNodeAs(new DnsEndPoint("196.168.1.1", 21130));
}

[Test]
Expand All @@ -158,7 +158,7 @@ protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options
.Insecure()
.WithInternalTcpOn(new IPEndPoint(IPAddress.Any, 11120))
.WithReplicationEndpointOn(new IPEndPoint(IPAddress.Any, 11120))
.WithExternalTcpOn(new IPEndPoint(IPAddress.Any, 11130))
.AdvertiseExternalHostAs(new DnsEndPoint("10.0.0.1", 11131));
}
Expand Down Expand Up @@ -186,9 +186,9 @@ protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options
.Insecure()
.WithHttpOn(new IPEndPoint(IPAddress.Any, 21130))
.WithNodeEndpointOn(new IPEndPoint(IPAddress.Any, 21130))
.WithExternalTcpOn(new IPEndPoint(IPAddress.Any, 11130))
.WithInternalTcpOn(new IPEndPoint(IPAddress.Loopback, 11120));
.WithReplicationEndpointOn(new IPEndPoint(IPAddress.Loopback, 11120));
}

[Test]
Expand All @@ -214,11 +214,11 @@ protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options
.Insecure()
.WithHttpOn(new IPEndPoint(IPAddress.Loopback, 21130))
.WithNodeEndpointOn(new IPEndPoint(IPAddress.Loopback, 21130))
.WithExternalTcpOn(new IPEndPoint(IPAddress.Loopback, 11130))
.WithInternalTcpOn(new IPEndPoint(IPAddress.Any, 11120))
.WithReplicationEndpointOn(new IPEndPoint(IPAddress.Any, 11120))
.AdvertiseExternalHostAs(new DnsEndPoint("10.0.0.1", 11131))
.AdvertiseHttpHostAs(new DnsEndPoint("10.0.0.1", 21131));
.AdvertiseNodeAs(new DnsEndPoint("10.0.0.1", 21131));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ public void should_have_default_endpoints()
Assert.AreEqual(new IPEndPoint(IPAddress.Loopback, 2113), _node.NodeInfo.HttpEndPoint);
}

[Test]
public void should_use_tls()
{
Assert.IsFalse(_options.Interface.DisableInternalTcpTls);
}

[Test]
public void should_set_command_line_args_to_default_values()
{
Expand Down Expand Up @@ -110,12 +104,6 @@ public void should_have_default_secure_endpoints()
Assert.AreEqual(httpEndPoint.ToDnsEndPoint(), _node.GossipAdvertiseInfo.HttpEndPoint);
}

[Test]
public void should_use_tls()
{
Assert.IsFalse(_options.Interface.DisableInternalTcpTls);
}

protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class with_ssl_enabled_and_using_a_security_certificate_from_file<TLogFor
protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{

return options.WithInternalSecureTcpOn(_internalSecTcp).WithExternalSecureTcpOn(_externalSecTcp) with
return options.WithReplicationEndpointOn(_internalSecTcp).WithExternalTcpOn(_externalSecTcp) with
{
CertificateFile = new()
{
Expand All @@ -32,12 +32,6 @@ protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
};
}

[Test]
public void should_set_tls_to_enabled()
{
Assert.IsFalse(_options.Interface.DisableInternalTcpTls);
}

[Test]
public void should_set_certificate()
{
Expand Down Expand Up @@ -73,17 +67,11 @@ public class with_ssl_enabled_and_using_a_security_certificate<TLogFormat, TStre
protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options
.WithInternalSecureTcpOn(_internalSecTcp)
.WithExternalSecureTcpOn(_externalSecTcp)
.WithReplicationEndpointOn(_internalSecTcp)
.WithExternalTcpOn(_externalSecTcp)
.Secure(new X509Certificate2Collection(ssl_connections.GetRootCertificate()), _certificate);
}

[Test]
public void should_set_tls_to_enabled()
{
Assert.IsFalse(_options.Interface.DisableInternalTcpTls);
}

[Test]
public void should_set_certificate()
{
Expand Down Expand Up @@ -113,8 +101,8 @@ public void SetUp()
_options = new ClusterVNodeOptions()
.ReduceMemoryUsageForTests()
.RunInMemory()
.WithInternalSecureTcpOn(internalSecTcp)
.WithExternalSecureTcpOn(externalSecTcp);
.WithReplicationEndpointOn(internalSecTcp)
.WithExternalTcpOn(externalSecTcp);
try
{
_ = new ClusterVNode<TStreamId>(_options, LogFormatHelper<TLogFormat, TStreamId>.LogFormatFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public class with_custom_ip_endpoints<TLogFormat, TStreamId> : SingleNodeScenari
protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options
.WithHttpOn(_httpEndPoint)
.WithExternalSecureTcpOn(_externalTcp)
.WithInternalSecureTcpOn(_internalTcp);
.WithNodeEndpointOn(_httpEndPoint)
.WithExternalTcpOn(_externalTcp)
.WithReplicationEndpointOn(_internalTcp);
}

[Test]
Expand Down Expand Up @@ -154,12 +154,12 @@ public class with_custom_advertise_as<TLogFormat, TStreamId> : SingleNodeScenari
protected override ClusterVNodeOptions WithOptions(ClusterVNodeOptions options)
{
return options
.WithHttpOn(_httpEndpoint)
.WithExternalSecureTcpOn(_extTcpEndpoint)
.WithInternalSecureTcpOn(_intTcpEndpoint)
.WithNodeEndpointOn(_httpEndpoint)
.WithExternalTcpOn(_extTcpEndpoint)
.WithReplicationEndpointOn(_intTcpEndpoint)
.AdvertiseInternalHostAs(new DnsEndPoint($"{InternalIp}.com", _intTcpEndpoint.Port + 1000))
.AdvertiseExternalHostAs(new DnsEndPoint($"{ExternalIp}.com", _extTcpEndpoint.Port + 1000))
.AdvertiseHttpHostAs(new DnsEndPoint($"{ExternalIp}.com", _httpEndpoint.Port + 1000));
.AdvertiseNodeAs(new DnsEndPoint($"{ExternalIp}.com", _httpEndpoint.Port + 1000));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#nullable enable

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -169,6 +170,24 @@ public void can_set_gossip_seed_values()
options.Cluster.GossipSeed.Should().BeEquivalentTo(endpoints);
}

[Fact]
public void can_set_gossip_seed_values_via_array()
{
var config = new ConfigurationBuilder()
.AddInMemoryCollection([
new KeyValuePair<string, string?>("EventStore:GossipSeed:0", "127.0.0.1:1113"),
new KeyValuePair<string, string?>("EventStore:GossipSeed:1", "some-host:1114"),
])
.Build();

var options = ClusterVNodeOptions.FromConfiguration(config);

options.Cluster.GossipSeed.Should().BeEquivalentTo(new EndPoint[]
{
new IPEndPoint(IPAddress.Loopback, 1113), new DnsEndPoint("some-host", 1114),
});
}

[Theory]
[InlineData("127.0.0.1", "You must specify the ports in the gossip seed.")]
[InlineData("127.0.0.1:3.1415", "Invalid format for gossip seed port: 3.1415.")]
Expand All @@ -188,6 +207,18 @@ public void reports_gossip_seed_errors(string gossipSeed, string expectedError)
ex.Message);
}

[Fact]
public void can_set_node_ip()
{
var config = new ConfigurationBuilder()
.AddEventStoreEnvironmentVariables(("EVENTSTORE_NODE_IP", "192.168.0.1"))
.Build();

var options = ClusterVNodeOptions.FromConfiguration(config);

options.Interface.NodeIp.Should().Be(IPAddress.Parse("192.168.0.1"));
}

[Theory]
[InlineData("127.0.0.1.0", "An invalid IP address was specified.")]
public void reports_ip_address_errors(string nodeIp, string expectedError)
Expand Down
Loading