Skip to content
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/nextcloud: Conditionally enable ImageMagick PHP extension #115372

Merged
merged 4 commits into from
Mar 11, 2021

Conversation

BBBSnowball
Copy link
Contributor

@BBBSnowball BBBSnowball commented Mar 8, 2021

Motivation for this change

This adds an option that disables the ImageMagick PHP extension for NextCloud. Admins may want to do so if they don't trust ImageMagick to be secure. This fixes #115279

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@BBBSnowball BBBSnowball marked this pull request as ready for review March 11, 2021 02:23
@Ma27 Ma27 self-requested a review March 11, 2021 09:41
@Ma27 Ma27 merged commit 7ecc3b0 into NixOS:master Mar 11, 2021
@dasJ
Copy link
Member

dasJ commented Apr 17, 2021

Huh? Why is this a disable option now instead of an enable option? I thought the de-facto standard in nixpkgs was to do enable options. This starts an annoying inconsistency here

@BBBSnowball
Copy link
Contributor Author

The reason is in the discussion of the associated issue:

As imagemagick enabled will remain the default, I'd suggest services.nextcloud.disableImagemagick.

I have a slight preference for the enable option because it avoids thinking in double negation. However, I don't think we should do incompatible config changes without a good reason (even in unstable). Some documentation that states "please use enable" would certainly be a good reason, I think. NixOS option search finds a few disable options but not many and half of them are probably just named after what ends up in the config file (i.e. we haven't choosen that name).

In any case, I think "ImageMagick is enabled" should remain the default.

If we want it changed, I can create a PR for that.

@Ma27
Copy link
Member

Ma27 commented Apr 18, 2021

However, I don't think we should do incompatible config changes without a good reason (even in unstable).

Using mkRemovedOptionModule isn't a problem though.

In any case, I think "ImageMagick is enabled" should remain the default.

Agreed. I'd suggest to set it to true by default. Would you agree with that, @dasJ?

@dasJ
Copy link
Member

dasJ commented Apr 18, 2021

Yes, keeping it enabled by default is a good idea. Something like mkEnableOption "some fancy description" // { default = true; } is probably what's needed here

@Ma27
Copy link
Member

Ma27 commented Apr 18, 2021

Yup, agree with that. Sorry for missing this in the first place :)

@BBBSnowball
Copy link
Contributor Author

No problem ^^ :)
PR created.

Ma27 pushed a commit that referenced this pull request Apr 23, 2021
…o services.nextcloud.nginx.enableImagemagick

Enable options are preferred. Suggested here:
#115372 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to disable imagick in NextCloud
3 participants