Skip to content

feat(docker): allow dynamic Erlang cookie via environment variable#104

Merged
Annopaolo merged 1 commit intoastarte-platform:release-1.2from
davidebriani:erlang-cookie-via-env-variable
Apr 4, 2025
Merged

feat(docker): allow dynamic Erlang cookie via environment variable#104
Annopaolo merged 1 commit intoastarte-platform:release-1.2from
davidebriani:erlang-cookie-via-env-variable

Conversation

@davidebriani
Copy link
Copy Markdown
Collaborator

This PR modifies the vernemq.sh entrypoint script to support dynamic configuration of the Erlang distribution cookie used for clustering VerneMQ nodes.

Key changes:

  • The script now reads the RELEASE_COOKIE environment variable, if set, and injects it into the vm.args file at runtime.
  • If RELEASE_COOKIE is not set, the behavior falls back to the default (previously set value vmq in vm.args), ensuring backward compatibility.

In our deployment architecture, each instance of Astarte (Elixir services + VerneMQ with the custom plugin) will require a possibly unique Erlang cookie to securely form a cluster between the Erlang nodes. This change enables per-instance configuration without modifying the Docker image or baked-in vm.args file.

This PR modifies the `vernemq.sh` entrypoint script to support dynamic
configuration of the Erlang distribution cookie used for clustering
VerneMQ nodes.

Key changes:
- The script now reads the `RELEASE_COOKIE` environment variable, if
set, and injects it into the vm.args file at runtime.
- If `RELEASE_COOKIE` is not set, the behavior falls back to the default
(previously set value `vmq` in vm.args), ensuring backward
compatibility.

Motivation:
In our deployment architecture, each instance of Astarte (Elixir
services + VerneMQ with the custom plugin) will require a possibly
unique Erlang cookie to securely form a cluster between the Erlang
nodes. This change enables per-instance configuration without modifying
the Docker image or baked-in vm.args file.

Signed-off-by: Davide Briani <davide.briani@secomind.com>
Copy link
Copy Markdown
Contributor

@lusergit lusergit left a comment

Choose a reason for hiding this comment

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

🔥

@Annopaolo Annopaolo merged commit 220631c into astarte-platform:release-1.2 Apr 4, 2025
4 checks passed
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.

3 participants