Re: [Zope] Apache 2 + Zope can't gzip HTTP response body?

2005-07-03 Thread Bakhtiar A Hamid
On 7/3/05, Daniel Dekany <[EMAIL PROTECTED]> wrote:
> Can I use HTTP "Content-Encoding: gzip" for Zope if I use Apache 2? (And
> should I use gzip content-encoding?)
> 
> The mod_gzip doesn't work with Apache 2, but instead it has mod_deflate.
> But mod_deflate can't chose which responses to gzip based on the
> MIME-type for responses that are coming through


would this help?  
#enable deflate on select contents

#AddOutputFilterByType DEFLATE text/html text/plain text/xml
hth
> ProxyPass/ProxyPassReverse. And with Zope I can't rely on extensions
> (like .html), just on the MIME-type. Do I think these well?
> 
> Somebody have solved this (gzip-ing the response bodies)?
> 
> --
> Best regards,
>  Daniel Dekany
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


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


Re: [Zope] blacklisting referers and/or specific hosts

2005-07-03 Thread David Pratt
Hi Tim.  I think what Jens has to say is the best solution. I have also 
made my own thing with zope as well since I don't always have control 
of the firewall.  I worked out a simple ip and country-ip solution. I 
made a simple interface for adding ips to a black list or selecting 
countries to add to black list. The logic makes a final connection to 
my main site template so ips in black list or ip turning out to be from 
a black listed country get nothing but an empty page (including an 
empty page header) while those that I want to view my site will get 
rendered pages.  I use a county-ip database that gets updated once per 
week (about 50,000 records) representing ranges from all countries.


I think is is becoming clearer that many of the threats on the Net come 
not only come from specific ips but specific countries as well.
To me, blacklisting and filtering those who see your site based on ip 
or ip ranges is just a little more risk management and less expense on 
bandwidth for those you don't want to invite in.  As Yens has pointed 
out, it would be best to stop this at the firewall if you can.  This 
may not be possible based on how you are serving your sites as in a 
hosted arrangement.  My feeling is that if someone is visiting (by 
looking at your site or sending a robot) it may deter some if they are 
seeing or collecting nothing. But it would do little for those sniffing 
for the server you are running and testing purely to see that your 
alive for some future exploit attempt.


Regards
David

On Sunday, July 3, 2005, at 04:05 PM, Tim Hicks wrote:


Hi,

I have a zope site up and running which has recently had a *lots* of 
hits

from a client (or clients) that show referers pointing at various
gambling, meds, and loan sites.  Requests only come in for the main 
page,

not for the associated images, css, etc that should go with it.

The consequence is that my server is working harder to service a client
that isn't interested in what it has to say, and my Z2.log is now far 
less

useful to me as all these bogus requests drown out most of the useful
information.

So, I'm wondering if there's a way to blacklist those clients that I 
don't

like based on host/ip and/or on referer.

If I hook into the traversal process in the same way as the virtual 
host

monster objects do, could I check the request against my blacklist and
then do a REQUEST.close()?  Would that still appear in my logs?  Does 
that

even make sense?  Is there a HTTP response code that I could return to
these clients that would stop them being interested in my server?

Any ideas much appreciated.

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


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Apache 2 + Zope can't gzip HTTP response body?

2005-07-03 Thread Daniel Dekany
Monday, July 4, 2005, 12:00:38 AM, Dieter Maurer wrote:

> Daniel Dekany wrote at 2005-7-2 20:56 +0200:
>>Can I use HTTP "Content-Encoding: gzip" for Zope if I use Apache 2? (And
>>should I use gzip content-encoding?)
>>
>>The mod_gzip doesn't work with Apache 2, but instead it has mod_deflate.
>>But mod_deflate can't chose which responses to gzip based on the
>>MIME-type for responses that are coming through
>>ProxyPass/ProxyPassReverse. And with Zope I can't rely on extensions
>>(like .html), just on the MIME-type. Do I think these well?
>
> Zope can do "gzip" compression by itself.
>
> You can activate it via
>
> "RESPONSE.enableHTTPCompression(REQUEST)"
>
> This activates "gzip" compression for precisely this response.

Thanks! Just on more thing... According to
http://sourceforge.net/mailarchive/forum.php?thread_id=7393296&forum_id=12354
the gzip compression was enabled by default in Plone 2.0.x (only from
2.0.4 I guess), but will be disabled in 2.1. If it is true, why? Is it
not recommenced after all? (Actually I try to gzip only because my
predecessor did...)

-- 
Best regards,
 Daniel Dekany

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


Re: [Zope] Starting a search from the correct folder

2005-07-03 Thread Dieter Maurer
John Poltorak wrote at 2005-7-2 15:52 +0100:
>On Fri, Jul 01, 2005 at 08:15:20PM +0200, Dieter Maurer wrote:
>> John Poltorak wrote at 2005-6-30 22:27 +0100:
>> > ...
>> >If I want to generate a list 
>> >of folders in say the 'groups' folder, how would I change the code above?
>> 
>> You are aware that you will not get a list (but a tree) when you
>> look down from some starting point?
>
>I have problems with the terminology which Zope uses, but I think you 
>understand what I meant.

I know now that I did not understand what you meant...

To get the subfolders of a folder, you can use its "tpValues" method.

As as you like code: it looks like "folder.tpValues()".

> ...
>> When you are ready to look up (in the hierarchy), then
>> 
>>  obj.aq_inner.aq_parent
>> 
>> is the hierarchy parent of "obj".
>
>Well that would be useful if I understood what you meant. Is there a 
>suggested explanation anywhere with some sample code which uses this 
>construct?

We are on completely different wavelengths:

  I do not understand your questions because they are wrapped
  in (irrelevant) examples.

  An you do not understand my answer

   * first, because it is not an answer to your question as
 I did not correctly understood this

   * second, because I use abstract terms and hate examples larger
 than necessary.


Had you simply asked: how can I get the list of a folder's
subfolders, my answer would have been "folder.tpValues()"
and both of us could have been happy

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


Re: [Zope] Starting a search from the correct folder

2005-07-03 Thread Dieter Maurer
Nikko Wolf wrote at 2005-7-1 15:40 -0600:
>Dieter Maurer wrote:
>> 
>> You are aware that you will not get a list (but a tree) when you
>> look down from some starting point?
>>
> ...
>But Dieter, can you elaborate on what you mean?  Isn't the result from 
>objectValues() a tuple [which would be a "list" in most languages].

The poster described his aim *very* vaguely -- by an
example that can be interpreted in different ways.

I concentrated on the "PARENTS[...]" part of the example.
It could mean that the poster is interested in part of
a path but it unhappy with the point where the path starts.

Now, if I choose a point and look upward, I see a single path,
however, when I look downward, I usually see more than one.

>Do you simply mean that the Folder objects may contain File, Document, 
>Image or Folder objects, recursively?  If not I'm not sure I follow.

Is the explanation above enough to explain what I meant?

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


Re: [Zope] strcoll_nocase gone after moving site?

2005-07-03 Thread Dieter Maurer
Daniel Dekany wrote at 2005-7-2 09:34 +0200:
>Friday, July 1, 2005, 8:11:22 PM, Dieter Maurer wrote:
>
>> Daniel Dekany wrote at 2005-6-30 22:28 +0200:
>>>I have to move a Plone site to another server (from some FreeBSD to a
>>>new Trustix), while also switching from Zope 2.7.x<5 to 2.7.6, and from
>>>Python 2.3.x<5 to Python 2.3.5.
>>
>> Define "locale" in your Zope configuration file.
>>
>> Then "locale" should be imported when Zope is initialized.
>
>It was/is set in the etc/zope.conf:
>
>  locale hu_HU.UTF-8
>
>And exactly this same locale works in C programs, so it is installed on
>the OS.

Maybe, the import order has changed and "sequence" is now imported
before reading the config file (although that would be very astonishing).

Anyway, the "if modules.has_key('locale')" seems stupid.
Remove it and file a bug report.


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


Re: [Zope] Apache 2 + Zope can't gzip HTTP response body?

2005-07-03 Thread Dieter Maurer
Daniel Dekany wrote at 2005-7-2 20:56 +0200:
>Can I use HTTP "Content-Encoding: gzip" for Zope if I use Apache 2? (And
>should I use gzip content-encoding?)
>
>The mod_gzip doesn't work with Apache 2, but instead it has mod_deflate.
>But mod_deflate can't chose which responses to gzip based on the
>MIME-type for responses that are coming through
>ProxyPass/ProxyPassReverse. And with Zope I can't rely on extensions
>(like .html), just on the MIME-type. Do I think these well?

Zope can do "gzip" compression by itself.

You can activate it via

"RESPONSE.enableHTTPCompression(REQUEST)"

This activates "gzip" compression for precisely this response.


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


[Zope] ZPT with Zope 3 queries - repeat over contained items; accessing adapters

2005-07-03 Thread Jim Vine
Hello,

I'm building an application in Zope 3. I have a
container object called a PropertyFolder, which holds
Property objects.

* Repeating over contained items.

I'm trying to create a view which displays a list of
all the Property objects in a property folder. I've
tried doing this as described in the ZPT chapter of
the Zope Book (2.6 edition), using a tal:repeat
statement, but I can't seem to get it working. Has
something changed in Zope 3? I've tried looking in the
Zope 3 book, but none of the references to tal:repeat
in there seem to be used for this type of thing.

* Accessing adapters in ZPT

I've created an adapter that provides a method called
getStars that can be used on Property objects. Can I
access this directly from my ZPT, as I can any other
attribute of a property object? At the moment I've got
it implemented via a Python view class, so my ZPT
accesses it like:



but other attributes can be accessed like:



so I guess I want to be able to do:



and negate the need for the Python View Class, which
only says:

def stars(self):
"""Get the stars for the property"""
rate = IPropertyRate(self.context)
stars = rate.getStars()
return stars

Thanks in advance for any tips.

Thanks,
Jim





___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] A function like a FTP Object

2005-07-03 Thread Peter Bengtsson
> Hi!
> does this work on a folder?
> 
Sure it does. Did you understand any of my code? I subclassed it on
the folder class.

> The struct.xml function is on a folder object and I would like
> struct.xml as an object contained by the folder one
> 
This is completely outside the zope management interface. Perhaps it
is possible to override the PUT() function inside Zope but I doubt it.
Look into writing your own python product.


> Thanks!
> 
> --
> Mis Cosas
> http://blogs.sistes.net/Garito/
> 
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] blacklisting referers and/or specific hosts

2005-07-03 Thread Jens Vagelpohl


On 3 Jul 2005, at 20:05, Tim Hicks wrote:
So, I'm wondering if there's a way to blacklist those clients that  
I don't

like based on host/ip and/or on referer.


If there is a set of distinguishable IPs/hosts, then use a tool that  
was *made* for that purpose such as a firewalling/filtering tool  
(IPTables, IPChains, fw, etc) and not Zope.


jens

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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] blacklisting referers and/or specific hosts

2005-07-03 Thread Tim Hicks
Hi,

I have a zope site up and running which has recently had a *lots* of hits
from a client (or clients) that show referers pointing at various
gambling, meds, and loan sites.  Requests only come in for the main page,
not for the associated images, css, etc that should go with it.

The consequence is that my server is working harder to service a client
that isn't interested in what it has to say, and my Z2.log is now far less
useful to me as all these bogus requests drown out most of the useful
information.

So, I'm wondering if there's a way to blacklist those clients that I don't
like based on host/ip and/or on referer.

If I hook into the traversal process in the same way as the virtual host
monster objects do, could I check the request against my blacklist and
then do a REQUEST.close()?  Would that still appear in my logs?  Does that
even make sense?  Is there a HTTP response code that I could return to
these clients that would stop them being interested in my server?

Any ideas much appreciated.

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


Re: [Zope] A function like a FTP Object

2005-07-03 Thread Garito

Peter Bengtsson escribió:

Sure you can. Any object/method that is in Zope becomes available via FTP. 
Some example code::


class MyProduct(Folder):
   def struct_xml(self):
 return "1"
   def PUT(self, REQUEST, RESPONSE):
   if not REQUEST.get('BODY'):
   get_transaction.abort()
   RESPONSE.setStatus(405)
   else:
   body = REQUEST.get('BODY')
   self._save_struct_body(body)
   RESPONSE.setStatus(204)
   return RESPONSE


setattr(MyProduct, 'struct.xml', MyProduct.struct_xml)

   


On 7/3/05, Garito <[EMAIL PROTECTED]> wrote:
 


Hi all
I would like to create a product with a function called struct.xml

I would like if I could access it via FTP because I would like editor
integration

I open the file via FTP and I save it via FTP and PUT_factory mechamism

Can I make struct.xml accesible via a FTP file?

Thanks!!!

--
Mis Cosas
http://blogs.sistes.net/Garito/


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

   




 


Hi!
does this work on a folder?

The struct.xml function is on a folder object and I would like 
struct.xml as an object contained by the folder one


Thanks!

--
Mis Cosas
http://blogs.sistes.net/Garito/


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

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] A function like a FTP Object

2005-07-03 Thread Peter Bengtsson
Sure you can. Any object/method that is in Zope becomes available via FTP. 
Some example code::

class MyProduct(Folder):
def struct_xml(self):
  return "1"
def PUT(self, REQUEST, RESPONSE):
if not REQUEST.get('BODY'):
get_transaction.abort()
RESPONSE.setStatus(405)
else:
body = REQUEST.get('BODY')
self._save_struct_body(body)
RESPONSE.setStatus(204)
return RESPONSE


setattr(MyProduct, 'struct.xml', MyProduct.struct_xml)



On 7/3/05, Garito <[EMAIL PROTECTED]> wrote:
> Hi all
> I would like to create a product with a function called struct.xml
> 
> I would like if I could access it via FTP because I would like editor
> integration
> 
> I open the file via FTP and I save it via FTP and PUT_factory mechamism
> 
> Can I make struct.xml accesible via a FTP file?
> 
> Thanks!!!
> 
> --
> Mis Cosas
> http://blogs.sistes.net/Garito/
> 
> 
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] [ANN] TextIndexNG 3.0.4 released

2005-07-03 Thread Andreas Jung


I am pleased to announce the release of TextIndexNG V 3.0.4.

TextIndexNG V 3 is a complete new implementation based on Zope 3 
technologies and can be used both in Zope 2.8 or 2.7 (with Five) or in

Zope 3.

What's new?

- multi-field indexing and query support

- multi-lingual support

- configurable converters (through ZCML)

- new indexing API (allowing you to hook your custom content types with 
TextIndexNG

  through Zope 3 adapters).


Changes since V 3.0.2:

  - added stemming support for eleven languages

  - fixed several bugs in the multi-field query support

  - keyForDocument() no longer raises an exception causing a crash of the 
ZCatalog ZMI screen for

documents not indexed by a TextIndexNG3 instance

  - now licensed under the Zope Public License V 2.1 (ZPL) - was formerly 
GPL



Requirements:

 - Zope 2.8 or Zope 2.7 (+ Five) or Zope 3 (Zope 3 has nothing like 
catalogs yet)


 TextIndexNG V3 will *not* run with bare Zope 2.7 installations without 
Five

 (and this will not be changed in the future).

Download:

 http://sf.net/projects/textindexng


For installation and documentation issues refer to doc/README.txt from the 
archive.
It's basically the same procedure as with former versions except you *need* 
to
recompile the extension modules. Windows binaries of the required extension 
modules

are currently not available (any volunteers?).

TextIndexNG V 3 is published under the ZPL.

Andreas Jung

   ---
  -   Andreas JungZOPYX Software Development and Consulting -
 -   E-mail: [EMAIL PROTECTED]   Web: www.zopyx.com   -
  ---   


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


[Zope] A function like a FTP Object

2005-07-03 Thread Garito

Hi all
I would like to create a product with a function called struct.xml

I would like if I could access it via FTP because I would like editor 
integration


I open the file via FTP and I save it via FTP and PUT_factory mechamism

Can I make struct.xml accesible via a FTP file?

Thanks!!!

--
Mis Cosas
http://blogs.sistes.net/Garito/


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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] [ANN] Zope 2.7.7 b1 released

2005-07-03 Thread Andreas Jung


Dear Zope Community,

on behalf of Zope Corporation and all Zope 2 developers and contributors
I am pleased to announce the release of Zope 2.7.7 b1.

Zope 2.7.7 b1 can be downloaded from

  http://www.zope.org/Products/Zope/2.7.7b1

The release notes can be found at

  http://www.zope.org/Products/Zope/2.7.7b1/CHANGES.txt

For information on using Python 2.4 with Zope 2.7.7b1: see doc/INSTALL.txt

Andreas Jung
Zope 2 Release Manager  

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