Skip to content

Commit

Permalink
nixos/plausible: Default to disabling Erlang distribution features.
Browse files Browse the repository at this point in the history
This is a safer default configuration, changing

* the Erlang Beam VM inter-node RPC port
* the Erlang EPMD port

to not listen to any sockets at all.
  • Loading branch information
nh2 committed Jul 22, 2021
1 parent 0a29fb3 commit d4a8b47
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion nixos/modules/services/web-apps/plausible.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ in {
};

erlang = {
enableDistribution = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable Erlang's distributed multi-machine features.
'';
};
vmListenAddress = mkOption {
default = "127.0.0.1";
type = types.str;
Expand All @@ -140,6 +147,10 @@ in {
The value given here is a normal IP address; it is translated
to an Erlang IP address tuple by this module.
This setting has no effect if
<xref linkend="opt-services.plausible.erlang.enableDistribution" />
is <literal>false</literal>.
'';
};
epmdListenAddress = mkOption {
Expand All @@ -151,6 +162,11 @@ in {
<link xlink:href="https://erlang.org/doc/man/epmd.html#environment-variables">
<literal>ERL_EPMD_ADDRESS</literal>
</link>.
is <literal>false</literal>.
This setting has no effect if
<xref linkend="opt-services.plausible.erlang.enableDistribution" />
is <literal>false</literal>.
'';
};
};
Expand Down Expand Up @@ -302,7 +318,9 @@ in {
SMTP_HOST_SSL_ENABLED = boolToString cfg.mail.smtp.enableSSL;

SELFHOST = "true";
} // (optionalAttrs (cfg.mail.smtp.user != null) {
} // (optionalAttrs (!cfg.erlang.enableDistribution) {
RELEASE_DISTRIBUTION = "none";
}) // (optionalAttrs (cfg.mail.smtp.user != null) {
SMTP_USER_NAME = cfg.mail.smtp.user;
});

Expand Down

0 comments on commit d4a8b47

Please sign in to comment.