Skip to Content Skip to Search

Adds Active Storage’s ImageMagick security policy to every ImageMagick process MiniMagick spawns.

ImageMagick reads every policy.xml on its configuration search path and applies all of them, so the shipped policy adds to the operator’s policy rather than replacing it. MAGICK_CONFIGURE_PATH prepends to that search path; a value the operator has already set, in the environment or in MiniMagick.cli_env, is kept after the shipped directory.

Methods
C

Constants

POLICY_DIRECTORY = File.expand_path("image_magick", __dir__)
 

Class Public methods

configure_path(operator_path)

# File activestorage/lib/active_storage/image_magick.rb, line 37
def self.configure_path(operator_path)
  [ POLICY_DIRECTORY, *operator_paths(operator_path) ].join(File::PATH_SEPARATOR)
end