Collective.xsendfile、ZODB blob 和 UNIX 文件权限
我目前正在尝试配置 Collective.xsendfile、Apache mod_xsendfile 和 Plone 4。
显然,Apache 进程在文件系统上看不到 blobstrage 文件,因为它们包含权限:
ls -lh var/blobstorage/0x00/0x00/0x00/0x00/0x00/0x18/0xd5/0x19/0x038ea09d0eddc611.blob -r-------- 1 plone plone 1006K May 28 15:30 var/blobstorage/0x00/0x00/0x00/0x00/0x00/0x18/0xd5/0x19/0x038ea09d0eddc611.blob
如何配置 blobstorage 以提供额外的权限,以便 Apache 可以访问这些文件?
I am currently trying to configure collective.xsendfile, Apache mod_xsendfile and Plone 4.
Apparently the Apache process does not see blobstrage files on the file system because they contain permissions:
ls -lh var/blobstorage/0x00/0x00/0x00/0x00/0x00/0x18/0xd5/0x19/0x038ea09d0eddc611.blob
-r-------- 1 plone plone 1006K May 28 15:30 var/blobstorage/0x00/0x00/0x00/0x00/0x00/0x18/0xd5/0x19/0x038ea09d0eddc611.blob
How do I configure blobstorage to give additional permissions, so that Apache could access these files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
blobstorage 写入其目录和文件的模式被硬编码在
ZODB.blob
中。具体来说,标准ZODB.blob.FileSystemHelper
类默认创建安全目录(仅当前用户可读可写)。您可以提供自己的
FileSystemHelper
实现,使其可配置,或者仅将目录模式设置为0750
,然后修补ZODB.blob.BlobStorageMixin< /code> 使用您的类而不是默认类:
相当麻烦,您可能希望将此作为 ZODB3 的功能请求:-)
The modes with which the blobstorage writes it's directories and files is hardcoded in
ZODB.blob
. Specifically, the standardZODB.blob.FileSystemHelper
class creates secure directories (only readable and writable for the current user) by default.You could provide your own implementation of
FileSystemHelper
that would either make this configurable, or just sets the directory modes to0750
, and then patchZODB.blob.BlobStorageMixin
to use your class instead of the default:Quite a hand-full, you may want to make this a feature request for ZODB3 :-)
在为 ZOPE/ZEO 设置设置备份例程时,我遇到了与 Blob 权限相同的问题。
在尝试应用 Mikko 编写的猴子补丁(这并不容易)之后,我想出了一个“真正的”补丁来解决问题。
Martijn 建议的补丁并不完整,它仍然没有在 blob 文件上设置正确的模式。
所以这是我的解决方案:
1.) 创建一个补丁,其中包含:
您还可以在此处查看补丁 -> http://pastebin.com/wNLYyXvw
2.) 将补丁存储在构建中的“blob.patch”名称下根目录
3.) 扩展您的构建配置:
安装后部分对已存在的 blob 设置所需的组读取权限。请注意,还必须向 blob 文件夹授予执行权限,该组可以进入目录。
我已使用 ZODB 3.10.2 和 3.10.3 测试了此补丁。
正如 Martijn 所建议的,这应该是可配置的并且直接是 ZODB 的一部分。
While setting up a backup routine for a ZOPE/ZEO setup, I ran into the same problem with blob permissions.
After trying to apply the monkey patch that Mikko wrote (which is not that easy) i came up with a "real" patch to solve the problem.
The patch suggested by Martijn is not complete, it still does not set the right mode on blob files.
So here's my solution:
1.) Create a patch containing:
You can also take a look at the patch here -> http://pastebin.com/wNLYyXvw
2.) Store the patch under name 'blob.patch' in your buildout root directory
3.) Extend your buildout configuration:
The postinstall sections sets desired group read permissions on already existing blobs. Note, also execute permission must be given to the blob folders, that group can enter the directories.
I've tested this patch with ZODB 3.10.2 and 3.10.3.
As Martijn suggested, this should be configurable and part of the ZODB directly.