From 731ed07a25df4fc60c3bc464ab87de142849f746 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 15 Feb 2024 18:19:54 +0000 Subject: [PATCH] Implement imagemagick policy for `convert` calls --- conf/policy.xml | 23 +++++++++++++++++++++++ manifest.toml | 2 +- scripts/install | 6 ++++++ scripts/upgrade | 6 ++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 conf/policy.xml diff --git a/conf/policy.xml b/conf/policy.xml new file mode 100644 index 0000000..35ec974 --- /dev/null +++ b/conf/policy.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/manifest.toml b/manifest.toml index fb8556e..3206098 100644 --- a/manifest.toml +++ b/manifest.toml @@ -70,7 +70,7 @@ ram.runtime = "350M" [resources.install_dir] [resources.data_dir] - subdirs = ["consume", "data", "media"] + subdirs = ["consume", "data", "media", "imagemagick"] [resources.permissions] main.url = "/" diff --git a/scripts/install b/scripts/install index 438bd16..f5f87df 100755 --- a/scripts/install +++ b/scripts/install @@ -103,6 +103,12 @@ ynh_add_config --template="paperless.conf.example" --destination="$install_dir/p chmod 400 "$install_dir/paperless.conf" chown $app:$app "$install_dir/paperless.conf" +# ImageMagick configuration +mkdir -p "$install_dir/.config/ImageMagick" +ynh_add_config --template="policy.xml" --destination="$install_dir/.config/ImageMagick/policy.xml" +chmod 400 "$install_dir/.config/ImageMagick/policy.xml" +chown -R $app:$app "$install_dir/.config" + #================================================= # SETUP THE DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d10352d..6be9942 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -128,6 +128,12 @@ ynh_add_config --template="paperless.conf.example" --destination="$install_dir/p chmod 400 "$install_dir/paperless.conf" chown $app:$app "$install_dir/paperless.conf" +# ImageMagick configuration +mkdir -p "$install_dir/.config/ImageMagick" +ynh_add_config --template="policy.xml" --destination="$install_dir/.config/ImageMagick/policy.xml" +chmod 400 "$install_dir/.config/ImageMagick/policy.xml" +chown -R $app:$app "$install_dir/.config" + #================================================= # SETUP THE DATABASE #=================================================