Skip to content

Commit

Permalink
freeradius: make debug logging optional
Browse files Browse the repository at this point in the history
(cherry picked from commit 0587329)
  • Loading branch information
lheckemann authored and globin committed Apr 13, 2020
1 parent ef7f478 commit 9f0f06a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nixos/modules/services/networking/freeradius.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ let
'';

serviceConfig = {
ExecStart = "${pkgs.freeradius}/bin/radiusd -f -d ${cfg.configDir} -l stdout -xx";
ExecStart = "${pkgs.freeradius}/bin/radiusd -f -d ${cfg.configDir} -l stdout" +
optionalString cfg.debug " -xx";
ExecReload = [
"${pkgs.freeradius}/bin/radiusd -C -d ${cfg.configDir} -l stdout"
"${pkgs.coreutils}/bin/kill -HUP $MAINPID"
Expand All @@ -41,6 +42,16 @@ let
'';
};

debug = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable debug logging for freeradius (-xx
option). This should not be left on, since it includes
sensitive data such as passwords in the logs.
'';
};

};

in
Expand All @@ -66,6 +77,7 @@ in
};

systemd.services.freeradius = freeradiusService cfg;
warnings = optional cfg.debug "Freeradius debug logging is enabled. This will log passwords in plaintext to the journal!";

};

Expand Down

0 comments on commit 9f0f06a

Please sign in to comment.