imagemagick - 在heroku上更改policy.xml [英] imagemagick - change policy.xml on heroku
问题描述
我试图通过https与heroma上的imagemagick访问图像。如何更改heroku上的策略(在policy.xml中)?
heroku在2016年5月发布了ImageMagick安全更新:
我可以在输入 heroku run bash
和 convert -list policy
后看到策略列表:
路径:[内置]
策略:未定义
权限:无
路径:/etc/ImageMagick/policy.xml
[...]
策略:编码器
权利:无
模式:HTTPS
[...]
我该如何更改政策?
更新1:这是日志文件中的错误:
命令失败:convert.im6:not authorized`//scontent-fra3-1.xx.fbcdn.net/v/t1.0-9/13962741_132344500547278_4974691444630710043_n.jpg?oh=c169b4ffce9e5ce330ee99214cc6b8d5&oe = 5880F245'
我们需要在heroku上安装第三方软件ImageMagick。我使用了 https://github.com/ello/heroku-buildpack-imagemagick 用于安装ImageMagick的构建包。
因此,在bin / compile中,有一个策略文件限制图片通过Https读取,启用属性 rights
至读
,允许读取Https
分叉回购并进行更改,提交并将该存储库url添加到您的heroku buildpack中。
I'm trying to access images via https on heroku with imagemagick. How can I change the policies (in policy.xml) on heroku?
heroku made an "ImageMagick security update" in May, 2016: https://devcenter.heroku.com/changelog-items/891
I can see the policy list, after typing heroku run bash
and convert -list policy
:
Path: [built-in]
Policy: Undefined
rights: None
Path: /etc/ImageMagick/policy.xml
[...]
Policy: Coder
rights: None
pattern: HTTPS
[...]
How can I change the policy?
update 1: this is the error in the log file:
Command failed: convert.im6: not authorized `//scontent-fra3-1.xx.fbcdn.net/v/t1.0-9/13962741_132344500547278_4974691444630710043_n.jpg?oh=c169b4ffce9e5ce330ee99214cc6b8d5&oe=5880F245'
We need to install the third party software ImageMagick on heroku. I used this https://github.com/ello/heroku-buildpack-imagemagick build pack for installing ImageMagick.
So, inside bin/compile, there is a policy file, which is restricting the images to read over Https, enable the attribute rights
to read
which allows to read over Https
Fork the repo and do your changes, commit and add that repository url to your heroku buildpacks
这篇关于imagemagick - 在heroku上更改policy.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!