This is an automated email from the ASF dual-hosted git repository.
pgj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push:
new 4608df3a4 dev/run: complete Erlang cookie configuration
4608df3a4 is described below
commit 4608df3a4f1deee178f8f00f1e3109f39c595b01
Author: Gabor Pali <[email protected]>
AuthorDate: Sun May 4 22:15:07 2025 +0200
dev/run: complete Erlang cookie configuration
The `--erlang-cookie` configuration flag for the `dev/run` script
does not propagate the cookie value for `vm.args` so that the
nodes will not have it configured on starting up. That is why,
for example, pinging the Clouseau nodes with user-provided cookie
will not work, as well as Clouseau nodes will not be able to
connect even though they picked up the right value already.
Add the missing parts to tweak `vm.args` accordingly and make the
Erlang cookie configurable through the `Makefile` too.
---
Makefile | 4 ++++
Makefile.win | 4 ++++
README-DEV.rst | 6 +++---
dev/run | 23 +++++++++++++++--------
4 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 8b1df51e6..fdab740a0 100644
--- a/Makefile
+++ b/Makefile
@@ -95,6 +95,10 @@ EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
TEST_OPTS="-c 'startup_jitter=0' -c 'default_security=admin_local' -c
'iterations=9'"
+ifneq ($(ERLANG_COOKIE),)
+TEST_OPTS+=" --erlang-cookie=$(ERLANG_COOKIE)"
+endif
+
################################################################################
# Main commands
################################################################################
diff --git a/Makefile.win b/Makefile.win
index 000874b70..d510ee51d 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -93,6 +93,10 @@ EXUNIT_OPTS=$(subst $(comma),$(space),$(tests))
TEST_OPTS="-c startup_jitter=0 -c default_security=admin_local -c iterations=9"
+ifneq ($(ERLANG_COOKIE),)
+TEST_OPTS+=" --erlang-cookie=$(ERLANG_COOKIE)"
+endif
+
################################################################################
# Main commands
################################################################################
diff --git a/README-DEV.rst b/README-DEV.rst
index 1f0711b4a..12ad36473 100644
--- a/README-DEV.rst
+++ b/README-DEV.rst
@@ -311,9 +311,9 @@ follows::
dev/run --with-clouseau
-When a specific Erlang cookie string is set in
-``rel/overlay/etc/vm.args``, the ``--erlang-cookie`` flag could be
-used to configure Clouseau to work with that::
+When a specific Erlang cookie string is needed, the
+``--erlang-cookie`` flag could be used to configure CouchDB and
+Clouseau to work with that::
dev/run --with-clouseau --erlang-cookie=brumbrum
diff --git a/dev/run b/dev/run
index 85ea9622d..478fb2ae9 100755
--- a/dev/run
+++ b/dev/run
@@ -515,7 +515,7 @@ def write_config(ctx, node, env):
content = apply_config_overrides(ctx, content)
elif base == "local.ini":
content = hack_local_ini(ctx, content)
- elif ctx["enable_tls"] and base == "vm.args":
+ elif base == "vm.args":
content = hack_vm_args(ctx, node, content)
with open(tgt, "w") as handle:
@@ -839,16 +839,23 @@ def hack_local_ini(ctx, contents):
def hack_vm_args(ctx, node, contents):
- contents += f"""
+ if ctx["enable_tls"]:
+ contents += f"""
-proto_dist couch
-couch_dist no_tls '"clouseau{node[-1]}@127.0.0.1"'
-ssl_dist_optfile {ctx["rootdir"]}/src/couch_dist/certs/out/couch_dist.conf
- """
- if ctx["no_tls"]:
- no_tls_nodes = ctx["no_tls"].split(",")
- for node_name in no_tls_nodes:
- node_name = node_name if "@" in node_name else
f"{node_name}@127.0.0.1"
- contents += f"""\n-couch_dist no_tls '"{node_name}"'"""
+"""
+ if ctx["no_tls"]:
+ no_tls_nodes = ctx["no_tls"].split(",")
+ for node_name in no_tls_nodes:
+ node_name = node_name if "@" in node_name else
f"{node_name}@127.0.0.1"
+ contents += f"""
+-couch_dist no_tls '"{node_name}"'
+"""
+ if ctx["erlang_cookie"]:
+ contents += f"""
+-setcookie {ctx["erlang_cookie"]}
+"""
return contents