-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/rspamd: Allow worker type to be proxy again #51012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Eventually I'd like to implement a warning and assertion system into the module system directly, so it should be easier to issue warnings from submodules.
@infinisil if you need help building that I am willing. |
@@ -144,9 +158,10 @@ let | |||
${concatStringsSep "\n" (mapAttrsToList (name: value: let | |||
includeName = if name == "rspamd_proxy" then "proxy" else name; | |||
tryOverride = if value.extraConfig == "" then "true" else "false"; | |||
type = if value.type == "proxy" then "rspamd_proxy" else value.type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using apply
in the option declaration instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh nice, would be a lot easier. Would need a builtins.trace
in it though and couldn't use the NixOS warnings
options, but that's fine by me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly didn't use apply
in order to use config.warnings
which seems the standard way of handling warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll argue that having so much code just for this is not worth it just for being more conventional. And actually I think that other modules are also not using config.warnings
for submodules for the same reason.
When reworking the rspamd workers I disallowed `proxy` as a type and instead used `rspamd_proxy` which is the correct name for that worker type. That change breaks peoples existing config and so I have made this commit which allows `proxy` as a worker type again but makes it behave as `rspamd_proxy` and prints a warning if you use it.
4beca89
to
0d753af
Compare
Commit has now been rewritten to use |
Motivation for this change
When reworking the rspamd workers I disallowed
proxy
as a type andinstead used
rspamd_proxy
which is the correct name for that workertype. That change breaks peoples existing config and so I have made this
commit which allows
proxy
as a worker type again but makes it behaveas
rspamd_proxy
and prints a warning if you use it.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)