[Zope-dev] ZCatalog caching with memcached

2008-10-24 Thread Hedley Roos
Hi all

The past few weeks I've been optimizing a busy Plone site and so 
collective.catalogcache was born.

It uses memcached as a distributed ZCatalog cache. It is currently in 
production and seems to be holding just fine. The site went from being 
unusable to serving quite a bit of data.

I'll modify it in future to not be too tied to just memcached, but 
that's still some way off. BTW, if you do not have memcached available 
the catalog functions as usual.

It's only been tested for Zope 2.9.6 - 2.10.6.

The repo is at 
http://dev.plone.org/collective/browser/collective.catalogcache. The URL 
may contain the word Plone but it's all Zope :) The readme contains more 
info and instructions.

The product is a monkey patch to Catalog.py. I'd love some feedback and 
suggestions.

Hedley

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Issues with restricted Python (was Re: Zope 2.12 - supported Python versions)

2008-10-24 Thread Chris Withers
Jim Fulton wrote:
 The problem is that it it starts with an environment in which things  
 are allowed by default, and takes things away. This means that if  
 anything is forgotten, then you end up with holes.

Isn't there a way we could change the AST manipulation such that we 
start with nothing and only allow opcodes as and when they're added to 
the RestrictedPython implementation?

 The Zope 3 security proxy approach is much better 

I agree, but it doesn't solve all the problems. My understanding of the 
original set of requirements which we're trying to solve here was 
basically that of Python Scripts: to allow python code to be written 
through the web. This means:

- restricting access to atributes of objects
   (security proxies give us this, right?)

- restricting access to features of the language such as imports such
   that unsafe things such as stripping security proxies can't be done.
   (security proxies *don't* give us this, right?)

...and some nice to haves:

- restricting memory used by executing the code
- restricting cpu used by executing the code

I know RestrictedPython doesn't support these last two very well, but 
there are hints that it would have liked to if it could.

 to do code manipulation. It still uses restricted Python do deal in a  
 narrow way with basic objects, like strings and numbers, that are  
 unproxied. It's use of restricted Python is so narrow that it is far  
 less problematic. It would be really great if Zope 2 would switch to  
 security proxies, although the transition is likely to be painful.

How would you see the problem of the second requirement above being met?

 I'm not sure that the PyPy guys are really authorities on the sorts of  
 problems we're trying to address, although there is some overlap. 

Who is then? ;-)

 If  
 I remember correctly, they are just focussed on protecting the system  
 from untrusted scripts.  Our problem is harder because we also want to  
 protect objects available to the scripts.

Indeed :-(

Chris

-- 
Simplistix - Content Management, Zope  Python Consulting
- http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Bounty for Breaking RestrictedPython?

2008-10-24 Thread Alan Runyan
So maybe we could crowd source the RestrictedPython problem?
If we could create a pool of money from various people/organizations.
And offer someone 50$ per scenario where they can break Restricted
Python?  Then it turns into sort of a game.  Not only do you get
bragging rights but some money (or something from Amazon).

-- 
Alan Runyan
Enfold Systems, Inc.
http://www.enfoldsystems.com/
phone: +1.713.942.2377x111
fax: +1.832.201.8856
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Blobs and modes

2008-10-24 Thread Jim Fulton

On Oct 24, 2008, at 3:24 PM, Benji York wrote:

 Is there a good reason blobs don't support b or t in the mode
 strings passed to open?  I'm refactoring some code that expects a
 file-like object to use blobs and it wants to pass wb as the mode
 (which is a sane thing to do).

Blobs are implicitly binary. (Note the B in Blob.)

 I'll add support for b and t to the blob code if no one objects.

I object.

BTW, this questions should have been asked o zodb-dev.

Jim

--
Jim Fulton
Zope Corporation


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )