Re: [Webware-discuss] Redirect to non-SSL

2007-04-24 Thread Randall Randall

On Apr 24, 2007, at 11:58 PM, Chuck Esterbrook wrote:

 To anyone who is running https on their site with webware, do you
 have the following behavior?

 Enter URL into browser:
 https://mysite/somedir

 Redirects to:
 http://mysite/somedir/

 In other words, the https changes to http in the redirect?

I've run several SSL sites with webware in the past,
and have never had that happen.  I would think it's
a problem with the configuration of the webserver you're
using.


--
Randall Randall [EMAIL PROTECTED]
You don't help someone by looking at their list of options and
  eliminating the one they chose! -- David Henderson



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] howto check for https connection?

2005-10-05 Thread Randall Randall


On Oct 2, 2005, at 6:54 AM, Christoph Zwerschke wrote:

I need a way to check whether the current servlet was accessed  
through https or not. If not, I want to rewrite the url to https  
and inform the user. How can I check this?




You can overwrite the respond method with something like this:

def respond(self, transaction):
request = self.request()
if request.environ()['SERVER_PORT'] != 443:
url = request.serverURLDir()
if request.hasField('path'):
url += request.field('path')
url = 'https://' + url
self.sendRedirectAndEnd(url)
else:
SitePage.respond(self, transaction)

Or, try to do it using Apache rewrite (there are probably a lot of  
howtos in the Internet).


I have a subclass of my SitePage called SSLPage which
has in it:

  def awake(self, transaction):
SitePage.awake(self, transaction)
if not (transaction.request().serverDictionary().has_key 
('HTTPS') and \

transaction.request().serverDictionary()['HTTPS'] == 'on'):
  # Not SSL
  self.sendRedirectAndEnd('https://.../' + self.request 
().servletURI())

  #print INSECURE!

and that seems to work well.

--
Randall Randall [EMAIL PROTECTED]
Who made up all the rules / We follow them like fools ;
 Believe them to be true / Don't care to think them through.
 - They, Jem Griffiths






---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] AppServer shuts down after every error - new info

2003-11-07 Thread Randall Randall
On Friday, November 7, 2003, at 06:47 PM, Frank Barknecht wrote:

Hallo,
Randall Randall hat gesagt: // Randall Randall wrote:
Writing the deamontools startup script is about three lines.
Do you have some tips for setting up daemontools for Webware? I never
used them, but I now installed them and the documentation is, well,
sparse. I tried copying AppServer to run and ran supervise
Workdir but that does not seem to be all that is needed. I explicitly
crashed the server, and supervise tried to restart it failing with
error: (98, 'Address already in use')
I'm not sure why it would do that, but what you did isn't what
I did.  I made another directory which isn't under the Webware
workdir, and used that as my supervise directory.  Using the
workdir as the supervise directory seems like it should work,
though, if you're using the right run script.
It tried and tried and tried...

So there must be more to it that just what I did...
Yeah, the run script could look something like what's between
the lines:
== begin run script for Webware =
#!/bin/sh
exec 21
exec setuidgid yourusername /path/to/Launch.py ThreadedAppServer
== end run script for Webware =

The setuidgid program allows you to let your users run
Webware installs as themselves.  If you want to run it as
root, you should be able to omit the setuidgid yourusername
stuff.
The run file should NOT be writable by anyone but root, as
changing that line would allow the writer to run any program
as root!  This is not just a hypothetical problem, by the way.
If you want logging, and probably you do, you should make a
directory in the same directory that your run script is in,
called log, and in there have this:
== begin run script for logging =
#!/bin/sh
exec 21
exec setuidgid yourusername  multilog t ./main
== end run script for logging =

Your supervise directory might then look like this, if
it's called myapp:
[EMAIL PROTECTED] testing $ ls -l myapp/*
-rwxr--r--1 root root   93 Nov  8 01:34 myapp/run
myapp/log:
total 8
drwx--2 randall  users4096 Nov  8 01:40 main
-rwxr--r--1 root root   61 Nov  8 01:29 run
Note that daemontools will restart the appserver if it quits
for *any* reason, so the restart on changes thing works
normally even though you're not running the shell code that
checks the return code of the Launch.py script.
If you want to stop it for a while, as root do
svc -d /service/myapp/
assuming you called yours myapp, which you probably won't. :)
Then,
svc -u /service/myapp
resumes normal services and will restart the appserver if it
stops for any reason.
--
Randall Randall
[EMAIL PROTECTED]


---
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] AppServer shuts down after every error - new info

2003-11-06 Thread Randall Randall
On Thursday, November 6, 2003, at 09:39 PM, Michal Mikolajczyk wrote:

AppServer is configured with autoreload enabled but when I make any 
changes to my python scripts it detects the changes, shuts down but 
never comes back up.  This is only happening when I start the 
AppServer via the init.d script webkit start.
I don't have a solution for you with respect to the init.d script.

However, if it turns out to be a lot of trouble to fix it, you might
consider using daemontools to start and stop your appserver.  Not
only does it have the basic flexibility of the init.d-style script,
but if the appserver quits because of an error, daemontools will
restart it.
Writing the deamontools startup script is about three lines.

--
Randall Randall
[EMAIL PROTECTED]


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] Oneshot cgi on same machine as mod_webkit?

2003-11-04 Thread Randall Randall
On Tuesday, November 4, 2003, at 06:05 PM, Geoffrey Talvola wrote:
Why not just run an additional instance of the AppServer on a different
port?  Then you can restart it independently of the original 
appserver.  You
can also if you prefer make use of the Auto-Restart feature (I can't
remember if that's in 0.8.1 or only in CVS).
It's in 0.8 and up.  Works like a charm. :)

--
Randall Randall
[EMAIL PROTECTED]


---
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] FormKit vs. FunFormKit

2003-09-21 Thread Randall Randall
On Sunday, September 21, 2003, at 05:43 AM, Tripp Lilley wrote:

On Sat, 20 Sep 2003, Randall Randall wrote:

Well, layout building and umpteen incredibly specific validators and
field types. These things didn't seem very useful for what I wanted
to do, and made FFK's learning curve steeper, so I gave it up in
favor of building forms by hand.  I had a deadline. :)
FWIW, I've built my forms without the layout-building. Well, that is 
to
say, I only used the layout-building to generate the field itself, but 
I
placed the fields individually myself. That was actually more work in 
FFK
can letting FFK do the heavy lifting, but I guess that's obvious :)
Yeah, I was able to do that, too, but I didn't see the value in using
FFK for only validation when I needed to build most of my validators
myself anyway (most of them were db-based).  Of course, I still have
to do that with FormKit, but doing so with FormKit seems more natural
to me (although that may well be a measure of my understanding of Python
now vs. then).
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] Re: When should one use TaskKit?

2003-09-21 Thread Randall Randall
On Sunday, September 21, 2003, at 12:45 PM, Wari Wahab wrote:

Uzo Uzo wrote:
I have a web application, and at the end of every day,
I do love to run a task and generate reports... It
seems that if I use TaskKit, I have to go to a page to
activate it.  I do love my tasks to start
automatically everytime I start my web application
without me actually going to a page to start it up.  I
have thought about using crontab to schedule it, I
feel that cron calling my python script in this case
will be simpler.  Please offer me your opinions.
I'm no webware expert, you can startup/schedule your task in your 
workdir/app/__init__.py, this will ensure that your task gets picked 
up at Appserver boot time. I've done it before as a proof of concept 
and it works nicely. Just not sure if it's the way to do things.
This is how I do it, too.

You can start and stop tasks via the application.taskManager()
methods.  Documentation is sparse, but the code is pretty clear.
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] dAlchemy's FormKit

2003-09-20 Thread Randall Randall
On Friday, September 19, 2003, at 10:21 AM, Aaron Held wrote:
This has the disadvantage of building up the form class each run.

You may want to use some instance caching in initForm to save the form 
between runs, and then call something to .sleep each form in 
servlet.sleep.
My servlet currently builds any number of forms for each run.  :(
I may eventually implement some caching of form classes, but I'm
not sure if that'll be helpful.  When the servlet is accessed by
Bob, it may have 2 forms, and by Cecil, 17 forms, so any
caching I do would have to ignore extras.
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] FormKit vs. FunFormKit

2003-09-20 Thread Randall Randall
On Saturday, September 20, 2003, at 03:00 PM, Matt Feifarek wrote:

Randall Randall wrote:

On Friday, September 19, 2003, at 10:58 AM, [EMAIL PROTECTED] wrote:

Hi there,

What's the major difference between FormKit and FunFormKit? Which 
form kit should be used?


One major difference seems to be that FFK expects you to use it to
build your form layout as well as the tags and validation methods,
whereas FormKit is less featureful, but (in my opinion) is more
flexible with respect to using templating systems like tplCompiler.
What features would you say that FFK has that FK is missing, out of 
curiosity?
Well, layout building and umpteen incredibly specific validators and
field types. These things didn't seem very useful for what I wanted
to do, and made FFK's learning curve steeper, so I gave it up in
favor of building forms by hand.  I had a deadline. :)
FormKit is, as you know, what I'm using now.  This is mostly because
it takes less to set up, has less syntax (like colons and asterisks),
and has fewer US-specific things like PhoneNumber fields that only
accept phone numbers in North America, and PostalCode fields that
only accept 5 or 9 digit postal codes...
These are useful, I'm sure, for lots of people; just not me.

So that's what I meant by less featureful.  There are some things
that I'd like to see in future versions of FK, like handling unexpected
lists and so on, but I haven't really come up with a FK specific
resolution to that.  My installation currently throws away all but the
first entry in any lists in self.request().fields(), unless the field
in question specifies a list, and then it makes any single inputs into
a list.  I'm not sure if anyone else wants to handle that in this way,
though.
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] dAlchemy's FormKit

2003-09-19 Thread Randall Randall
On Thursday, September 18, 2003, at 11:03 PM, Matt Feifarek wrote:
Randall Randall wrote:
It turns out that this works for me.  Those extra forms still
crept into self._forms, but simply checking to see whether
the new submit method was registered for each iteration of
creating a form was sufficient to weed it out.
Oh, I see what you mean, now. Since you don't know how many forms 
you'll have, the name of the submit method isn't necessarily 
predictable. Yes, I'd stick with one submit method, and just make it a 
bit more sophisticated about how it does processing. Grabbing 
__formID__ from the posted fields, and corresponding that to 
self._forms should help.
Yeah, I finally opted not to use the Mix-in machinery, although
it's mixed into my SitePage, for convenience.  Setting a preAction
method took care of that, though.
It might be that I'll be able to do it cleanly with the Mix-in, but
right now I'm going to leave it as it is: working. :)
I'm still not very clear on the recommended way to create
forms in awake(), since the way I'm doing it, by manipulating
self._forms, doesn't seem very natural.  If this is the right
way, I can create an example for your Examples folder.  If
not, and you find the time before the next release, an example
of a form created in awake() would be helpful, I think.  :)
There's nothing special about awake, really. It's just a method, like 
any other. The fact that it's called every page load may lead to an 
explanation about why you're getting extra forms, but it's certainly 
not designed to work that way.

That having been said, if you come up with a cool example, of course 
we're interested.
I'll try to see how I can generalize what I did into an example,
and send it along.
Thanks!

--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] dAlchemy's FormKit

2003-09-18 Thread Randall Randall
On Thursday, September 18, 2003, at 12:54 PM, Matt Feifarek wrote:
Randall Randall wrote:
I need to create a number of forms that depend on how
many objects there are to modify.  If there are 3, there
need to be 3 forms, one of which will be used.
This should be no problem; we do it all the time. Just make sure that 
you're using different submit methods (actions) for each one.
That seems tricky; I'd had every form using the same submit method
and the method was cycling through every form in self._forms to
find the successful one that had called it.
So, to do this, I'd need to define a generic method and use
setattr to set the name of each copy to the name of the
submit button as it's generated?
At first, my servlets were creating extra forms for
each form I create in awake() on every refresh of the
page.  This suggests that the forms themselves were
persisting through sleep(), so I added a statement to
delete self._forms, but now the form never seems to be
successful.
There is a reset forms method that is typically called from sleep() 
(but can be called by you whenever you like)-- make sure that you 
haven't accidentally removed it.
I use the FormKitMixIn, and self.resetForms() , but my
problem hasn't been the contents being uncleared, but
extra forms.  That is, if I use
f = Form.Form()
in awake(), the second load has two forms dumped by
for form in self._forms:
  wr( form.dump() )
and the third time I reload the page, I have three
forms on it, etc.  I hope that using different submit
methods, as mentioned above, fixes this. :)
Is there a right way to handle variable numbers of
anonymous forms with FormKit, or should I try to
shove all possible objects into one form?
Look in the examples for the MultiFormExample.py and follow that 
precedent.
Those are named forms, though.  The example didn't seem
to apply for a variable number of forms, only a static
number.
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] dAlchemy's FormKit

2003-09-18 Thread Randall Randall
On Thursday, September 18, 2003, at 02:39 PM, Randall Randall wrote:
On Thursday, September 18, 2003, at 12:54 PM, Matt Feifarek wrote:
Randall Randall wrote:
I need to create a number of forms that depend on how
many objects there are to modify.  If there are 3, there
need to be 3 forms, one of which will be used.
This should be no problem; we do it all the time. Just make sure that 
you're using different submit methods (actions) for each one.
That seems tricky; I'd had every form using the same submit method
and the method was cycling through every form in self._forms to
find the successful one that had called it.
So, to do this, I'd need to define a generic method and use
setattr to set the name of each copy to the name of the
submit button as it's generated?
It turns out that this works for me.  Those extra forms still
crept into self._forms, but simply checking to see whether
the new submit method was registered for each iteration of
creating a form was sufficient to weed it out.
I'm still not very clear on the recommended way to create
forms in awake(), since the way I'm doing it, by manipulating
self._forms, doesn't seem very natural.  If this is the right
way, I can create an example for your Examples folder.  If
not, and you find the time before the next release, an example
of a form created in awake() would be helpful, I think.  :)
Thanks!

--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] dAlchemy's FormKit

2003-09-17 Thread Randall Randall
Hi, all.

I've been using dAlchemy's FormKit, and until now, all
has been well.
Today, I was writing a servlet to display multiple forms,
and I start getting some weird behavior.
I need to create a number of forms that depend on how
many objects there are to modify.  If there are 3, there
need to be 3 forms, one of which will be used.
At first, my servlets were creating extra forms for
each form I create in awake() on every refresh of the
page.  This suggests that the forms themselves were
persisting through sleep(), so I added a statement to
delete self._forms, but now the form never seems to be
successful.
Is there a right way to handle variable numbers of
anonymous forms with FormKit, or should I try to
shove all possible objects into one form?
--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] AssertionError in ServletFactory?

2003-09-10 Thread Randall Randall
This is a followup for people Googling on this problem.

On Monday, June 30, 2003, at 07:57 PM, Randall Randall wrote:
On Wednesday, June 25, 2003, at 04:38 PM, Randall Randall wrote:
I'm getting a weird traceback from one of my servlets:
/Users/randall/Devel/Work/shadowcash/context/editprofile.py
Traceback (most recent call last):
  File /opt/Webware/WebKit/Application.py, line 415, in 
dispatchRequest
self.handleGoodURL(transaction)
  File /opt/Webware/WebKit/Application.py, line 568, in 
handleGoodURL
self.createServletInTransaction(transaction)
  File /opt/Webware/WebKit/Application.py, line 1061, in 
createServletInTransaction
inst = self.getServlet(transaction, path)
  File /opt/Webware/WebKit/Application.py, line 995, in getServlet
inst = factory.servletForTransaction(transaction)
  File ./WebKit/ServletFactory.py, line 199, in 
servletForTransaction
AssertionError
[snip]
I found a similar problem had by Edmund Lian on the Cheetah list,
but the cause there (class name not being the same as the filename)
doesn't seem to apply.
Anyone know why this could be happening?
Well, evidently no one did.

So, having finally got to the deploy on Linux stage, I find
that this error doesn't happen on Linux, but only Mac OS X (my
development platform), which makes me very happy. :)
So, if anyone needs additional information and wants to try to
track this down in Webware 0.8, I'd be happy to give you more
info, but don't know what would be useful.  Eventually I'll try
to do that myself, but it may be some time before I'm able to
take the time.
This turns out to be a problem only in Python 2.2 (and maybe
earlier), and only on Mac OS X, at least for me.
Upgrading to 2.3 earlier this week made it go away completely.

--
Randall Randall [EMAIL PROTECTED]
When you advocate any government action, you must first
believe that violence is the best answer to the question
at hand. -- Allen Thornton


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] extrapathinfo (Re: virtual paths without mod_rewrite)

2003-08-14 Thread Randall Randall
On Sunday, August 10, 2003, at 06:40 AM, deelan wrote:
the problem is that webware searches for such CSS files
under the /param1/param2/ folders (of course both are
fictional):
/WK/weblog/index/param1/param2/styles/print.css

obviously the CSS are not imported and then the page
looks unstyled.
for various reasons i cannot use absolute paths
for resources. is this the intentended behavior?
instead should webware strip extrapathinfo from request
URL prior to start serving resources to the client?
How would it know where to find it, then?  If it
found index, it would have to use index.py and
pass the print.css to it in the pathinfo, no?
One solution might be to have your SitePage look
for .css in the pathinfo, and if it's there,
do something other than the normal writeHTML stuff
to send back a stylesheet instead.  This seems
like it would do what you want.
--
Randall Randall [EMAIL PROTECTED]
Not only can money buy happiness,
 it isn't even particularly expensive any more.  -- Spike Jones


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] AssertionError in ServletFactory?

2003-06-30 Thread Randall Randall
On Wednesday, June 25, 2003, at 04:38 PM, Randall Randall wrote:

Hi, all.

I'm getting a weird traceback from one of my servlets:
/Users/randall/Devel/Work/shadowcash/context/editprofile.py
Traceback (most recent call last):
  File /opt/Webware/WebKit/Application.py, line 415, in 
dispatchRequest
self.handleGoodURL(transaction)
  File /opt/Webware/WebKit/Application.py, line 568, in handleGoodURL
self.createServletInTransaction(transaction)
  File /opt/Webware/WebKit/Application.py, line 1061, in 
createServletInTransaction
inst = self.getServlet(transaction, path)
  File /opt/Webware/WebKit/Application.py, line 995, in getServlet
inst = factory.servletForTransaction(transaction)
  File ./WebKit/ServletFactory.py, line 199, in servletForTransaction
AssertionError
[snip]
I found a similar problem had by Edmund Lian on the Cheetah list,
but the cause there (class name not being the same as the filename)
doesn't seem to apply.
Anyone know why this could be happening?
Well, evidently no one did.

So, having finally got to the deploy on Linux stage, I find
that this error doesn't happen on Linux, but only Mac OS X (my
development platform), which makes me very happy. :)
So, if anyone needs additional information and wants to try to
track this down in Webware 0.8, I'd be happy to give you more
info, but don't know what would be useful.  Eventually I'll try
to do that myself, but it may be some time before I'm able to
take the time.
--
Randall Randall [EMAIL PROTECTED]
Not only can money buy happiness,
 it isn't even particularly expensive any more.  -- Spike Jones


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] AssertionError in ServletFactory?

2003-06-30 Thread Randall Randall
On Monday, June 30, 2003, at 09:49 PM, Ian Bicking wrote:
Sorry, I thought someone else might pipe up about it.
Oh, no problem.  It turned out not to be a really serious
problem, but it is annoying. :)
Anyway, this was at one point commonly caused by path problems
(sys.path), where a module can be imported more than once.  Imagine a
path like:
Hm.  The sys.path as reported by the traceback page looks normal; no
duplicates.
Python doesn't recognize that these are the same module, so there are
two classes going by the same name.  You might look at the class's
__module__ attribute to find out more.  It might depend on the way you
are running the AppServer, environmental variables, etc., which would
explain why it works in one environment and not another.
Hm.  Okay.  I'll instrument things a bit and see what happens. :)

Thanks!

--
Randall Randall [EMAIL PROTECTED]
Not only can money buy happiness,
 it isn't even particularly expensive any more.  -- Spike Jones


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] AssertionError in ServletFactory?

2003-06-25 Thread Randall Randall
Hi, all.

I'm getting a weird traceback from one of my servlets:
/Users/randall/Devel/Work/shadowcash/context/editprofile.py
Traceback (most recent call last):
  File /opt/Webware/WebKit/Application.py, line 415, in 
dispatchRequest
self.handleGoodURL(transaction)
  File /opt/Webware/WebKit/Application.py, line 568, in handleGoodURL
self.createServletInTransaction(transaction)
  File /opt/Webware/WebKit/Application.py, line 1061, in 
createServletInTransaction
inst = self.getServlet(transaction, path)
  File /opt/Webware/WebKit/Application.py, line 995, in getServlet
inst = factory.servletForTransaction(transaction)
  File ./WebKit/ServletFactory.py, line 199, in servletForTransaction
AssertionError

on which line I find:
assert issubclass(theClass, Servlet)
which would seem to indicate that my class (editprofile) is not
inheriting from Page.  I have a class called Profile that this
servlet subclasses, and all of my servlets that subclass Profile
have the same error, unless they subclass a class that has itself
subclassed Profile.  If that makes sense. :)
So my createprofile servlet inherits from editprofile, but works
fine until it forwards to editprofile after a new profile was
created.
I found a similar problem had by Edmund Lian on the Cheetah list,
but the cause there (class name not being the same as the filename)
doesn't seem to apply.
Anyone know why this could be happening?

--
Randall Randall [EMAIL PROTECTED]
Not only can money buy happiness,
 it isn't even particularly expensive any more.  -- Spike Jones


---
This SF.Net email is sponsored by: INetU
Attention Web Developers  Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] fields and ExtraPathInfo question

2003-03-14 Thread Randall Randall
Ian Bicking wrote:
 No, not related to ExtraPathInfo.  The action stuff is handled in Page. 
 I assume that either the empty fields are being thrown away (when
 FieldStorage is called) or Page is ignoring empty fields.  The latter if
 you're seeing those fields in request.fields().  Hmm... I suppose it's a
 bug.

You might think so, but when I submitted a patch to cgi.py to fix it, Guido
did not agree. :(  So I just patch all my local copies of cgi.py now.

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


[Webware-discuss] AppServer restart from servlet

2003-03-01 Thread Randall Randall
Hi, all.

Is there a 'normal' way to restart the AppServer from within
a page?  Calling self.application().server().restart() doesn't
seem to do it (though it does prevent the page from actually
being served).

It *does* work to alter the file that is doing the restarting, in
0.8, but that seems kludgy.

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] AppServer restart from servlet

2003-03-01 Thread Randall Randall
Ian Bicking wrote:
 On Sat, 2003-03-01 at 20:43, Randall Randall wrote:
 
Is there a 'normal' way to restart the AppServer from within
a page?  Calling self.application().server().restart() doesn't
seem to do it (though it does prevent the page from actually
being served).
 
 
 I think you should call shouldRestart() instead of restart() -- only the
 main thread can initiate the restart, and shouldRestart() asks it to do
 so.

Great!  This is exactly what I was looking for.

Thanks!

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] Session and DB Cursors

2003-02-25 Thread Randall Randall
Huy Do wrote:
 Hi,
 
 I was just wondering if anyone stores their db cursors (psycopg) in the
 session so the user can reuse the same cursor if necessary (i.e so the
 program does not have to re query the database). I am basically using
 this for a web page which for eg. List 30 rows at a time from a result
 set of 1000. This way, I don't need to requery when the user clicks
 next, prev etc. 
 
 Can someone give me some comments on whether this will this work in
 Webware ?

This gave me lots of problems, though it seemed to work at first.  So, for
instance, when the AppServer tried to save it on disk, it would throw an
exception.  If you really want to store the results in the session, why not
pull them out of the cursor all at once into a list of dictionaries or whatever,
and store that in the session?

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] encrypt admin password

2003-02-23 Thread Randall Randall
Michael Engelhart wrote:
 I agree. Here's some code I use for hashing passwords.  Warning - I am
 not a security or encryption expert so please be aware that this may not
 be cryptographically secure although I do believe it is much more secure
 than a plain text file.

Uh, I'm not a cryptographer either, so at the risk of sourding uninformed,
what's wrong with a two line script like:

import sha
passwd = 'testing'
passwd_hash = sha.new(passwd).hexdigest()

Is your version much more secure than straight SHA1?

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] encrypt admin password

2003-02-23 Thread Randall Randall
Ian Bicking wrote:
 On Sun, 2003-02-23 at 11:10, Randall Randall wrote:
 
Uh, I'm not a cryptographer either, so at the risk of sourding uninformed,
what's wrong with a two line script like:

import sha
passwd = 'testing'
passwd_hash = sha.new(passwd).hexdigest()

Is your version much more secure than straight SHA1?
 
 
 Using a salt makes a dictionary-based attack harder.  You can, ahead of
 time, create SHA1 hashes of all the words in the dictionary (or a
 dictionary of likely passwords), and then compare those against the hash
 when you get the chance.  By introducing a random prefix (salt) you
 force the attacker to do more work when trying a dictionary attack.
 
 For passwords associated with usernames (which isn't the case here) you
 can usually derive the salt (the prefix) from the username itself.  Then
 the attacker has hash all the passwords in their dictionary for each
 user, as opposed to doing it once for all users on a system.

Thank you Stuart, Michael, and Ian for correcting my ignorance. :)  I
had assumed that dictionary attacks just had to be lived with.

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss


Re: [Webware-discuss] Dynamic switching between cookie and URL basedSID's

2003-02-18 Thread Randall Randall
Frank Barknecht wrote:
 Hallo,
 
 in my shop application I'm currently using cookie based sessions, and
 this should be the default for security reasons. But if some visitor
 has cookies disabled I'd like to fall back on URL-id's. Is this
 possible in Webware? When I tried the config option
 
 'UseAutomaticPathSessions': 1,
 
 *all* sessions were put in the URL-path, which is not what I want.

I do this in my SitePage.awake():
if not self.request().hasPathSession():
  if self.session().value('nocookies', None) or
self.request().fields().has_key('pathsessions'):
url = extraURL + '_SID_='+ self.session().identifier() + '/' +
self.request().servletURI()
if self.request().queryString():
  url = url + '?' + self.request().queryString()
self.transaction().response().sendRedirect(url)

which is similar to what Application.handleMissingPathSession()
does.  Then I have a note on each page that requires a session
that says something like 'Click here to enable a different session
method', which links to page?pathsessions=yes .  After that, all
your relative URLs will continue to work correctly.

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] Session timeouts

2003-02-15 Thread Randall Randall
Stuart Donaldson wrote:

 Probably what should happen, is that the SecureCountVisits example
 should be updated to include a check for isSessionExpired() and then
 display an expired sesion page.

Shoudn't this be in SecurePage itself?  Is it useful to have a page one
only inherits to enforce login that doesn't always enforce logins?

-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] Keeping Webware running.

2003-01-25 Thread Randall Randall
Ben Logan wrote:
 Hi, everyone.
 
 I am running Webware on a shared Linux web server (I don't have root
 priveleges), and am wondering what I can do to make certain that it
 stays running.  I've been starting the appserver by logging in via
 ssh, and running 'nohup Appserver ', and that works, but sometimes it
 dies for no apparent reason.  I also need a way to make sure that it
 gets restarted if they reboot the server.  I am hoping for a solution
 that doesn't involve the server admins installing Webware system wide.
 
 Has anyone else solved this problem?

Well, if you're willing to run from your Webware install directory,
Monitor.py is supposed to do what you want.

Unfortunately, that doesn't seem to work if you have a separate
Application directory, and so I'm unable to use it.  I've been
having the same problem of unexpected Appserver death, for which
there are no error logs, and which only happens if I'm no longer
shelled into that box.  :(


-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] forward() question

2003-01-22 Thread Randall Randall
Stuart Donaldson wrote:
 Awake and sleep are both called while in the forward() call to a new
 servlet.  The forwarding servlet (the one calling forward()) does not
 finish processing until after the forward() call is through, so the
 forwarding servlet will not go to sleep until then.


Thanks!


-- 
Randall Randall [EMAIL PROTECTED]
'Institute regime change everywhere...
 to None of the above.' -- Alex Future Bokov



---
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



[Webware-discuss] FunFormKit defaults

2003-01-10 Thread Randall Randall
Hi, all.

As per the last messages on the FunFormKit discuss list,
I'm using webware-discuss...

There appears to be a bug in SelectField in the Field.py
file in FunFormKit, such that defaults are not properly
carried through an error condition, unless they are strings.

That is, in SelectField.selected(self, key, default), there
is
return key == default
which doesn't work when the key is an integer, as most (of
my) selectbox values are.  Changing this line to
return str(key) == str(default)
seems to fix the problem for me, but may simply be covering
it up...



-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] New documentation: Application Development

2003-01-10 Thread Randall Randall
Roger Haase wrote:

 ...and these from line 58:
 
   # Check if they can successfully log in.  The loginid 
must match
 what was previously
   # sent.
   if request.field('loginid', 'nologin')==loginid and
 self.loginUser(username, password):
   # Successful login.
   # Clear out the login parameters
   request.delField('username')
   request.delField('password')
   request.delField('login')
   request.delField('loginid')
 
 I have never understood where session.value('loginid') is being set,
 why it is being deleted if it exists, why the incoming id must match
 the old value, and what is the benefit of doing request.delField(...).

loginid is set in login.py, another Example page.  The answers to the
others aren't clear to me, except that perhaps it is supposed to be a
defense against replay attacks.


-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] Sessions for dumb clients?

2003-01-04 Thread Randall Randall
[EMAIL PROTECTED] wrote:
 On Saturday 04 January 2003 04:28, Randall Randall wrote:
 
 Anyway, session id are usually made by a combined 
 user-agent/remote_add/agent-langage ..etc some stuff that it
 more unique as possible and you just need to check it validation
 by marshall all the ENV_VAR pushed by the client. By this way 
 even a stollen SID make it hard to use. 
 
 I never used the SID of webware, but I think it should use this
 mecanism 

Currently I have an option in my sites to track IP, so if the client
wants to be somewhat more secure against session hijacking at the
cost of not being able to connect from behind some proxying firewalls,
they can do so.



-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



[Webware-discuss] remoteName

2003-01-04 Thread Randall Randall
In HTTPRequest.py, there is:

def remoteName(self):
  ''' Returns the fully qualified name of the client that sent the request,
or the IP address of the client if the name cannot be determined. '''
  raise self.remoteName()

Has this just not been written, or wasn't in 0.7 but is in CVS, or
has it some purpose I don't understand?

-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] Sessions for dumb clients?

2003-01-03 Thread Randall Randall
Edmund Lian wrote:
 On 01/03/2003 07:57:08 PM Edmund Lian wrote:
 Oh yes, there is another even simpler way to get at a URL-encoded session
 ID... the rogue user only has to post an image with a href pointing back to
 their computer. This way, a victim doesn't even have to click on a URL to
 be exposed, he/she only has to view a message with the externally-sourced
 image.

Ah.  I've now been enlightened. :)  Thank you, Edmund, Stuart, and Tavis.
The referer header is something which I certainly need to watch for.  Sites
I develop are more usually shopping cart or product sites than community
sites, so I hadn't encountered that possibility.

-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



[Webware-discuss] mod_webkit recursion?

2002-12-15 Thread Randall Randall
Hi, all.

I'm trying out mod_webkit (I usually don't use
Apache, but I'm considering it these days), and
followed the instructions at:
http://webware.colorstudy.net/twiki/bin/view/Webware/RunWebkitAsApacheRoot

Now, when I was using WebKit.cgi, going to a URL like
http://127.0.0.1/WebKit.cgi
would immediately redirect to
http://127.0.0.1/WebKit.cgi/

This wasn't what I'd prefer, but I could deal with it.
Now, however, an attempt to go to
http://127.0.0.1/
results in an attempt to redirect to
http://127.0.0.1//
which then wants
http://127.0.0.1///
and so on.This quits after about 10 cycles, but
the end result is no page. :)

However, if I go to
http://127.0.0.1/defaultContext/
that works fine.

I'm sure this must be a simple Apache-mod_webkit
config issue?  Anyone know?

-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



[Webware-discuss] Newbie question

2002-11-27 Thread Randall Randall
Hi, all.

I think I'm failing to understand something fundamental, here:

When, in my writeContent() in a Page class, I do 
obj1 = Myobject.Myobject(stuff=1)
obj2 = Myobject.Myobject(stuff=2)

(having imported Myobject first), both obj1 and obj2 have
stuff=2.  Where did obj1 go?  How can I make a number of
the same object to put in my pages?

Thanks!

Randall Randall.



---
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power  Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss



Re: [Webware-discuss] mxODBC and DBPool

2002-11-06 Thread Randall Randall
Ian Sparks wrote:
 Is anyone else using mxODBC with dbPool? I'm having trouble working out what to pass 
to the DBPool constructor.
 
 pool = DBPool(WhatGoesHere?,5,'DSN=...')

Just 'mxODBC', if it works like psycopg.  You'll need
to have imported mxODBC first.

-- 
Randall Randall [EMAIL PROTECTED]
[The] poetic justice of cause and effect compels
 respect, compassion. -- Faithless, God is a DJ.



---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss