[or-cvs] r12727: Apache fastCGI hooks (weather/trunk)
pde at seul.org
pde at seul.org
Sun Dec 9 00:59:39 UTC 2007
Author: pde
Date: 2007-12-08 19:59:39 -0500 (Sat, 08 Dec 2007)
New Revision: 12727
Modified:
weather/trunk/config.py
weather/trunk/weather.py
Log:
Apache fastCGI hooks
Modified: weather/trunk/config.py
===================================================================
--- weather/trunk/config.py 2007-12-09 00:45:56 UTC (rev 12726)
+++ weather/trunk/config.py 2007-12-09 00:59:39 UTC (rev 12727)
@@ -1,11 +1,12 @@
#!/usr/bin/env python2.5
-authenticator = "frogzify" # customise this
URLbase = "http://weather.torproject.org"
weather_storage = "/var/lib/torweather/"
+authenticator = open(weather_storage + "auth_token").read()
+
weather_email = "tor-ops at torproject.org"
# these respond to pings (for now!) and are geographically dispersed
@@ -16,3 +17,5 @@
# down
poll_period = 1800 # try to wait this number of seconds in between polling
+
+apache_fcgi = True # set this if we're trying to operate in an apache / fastCGI
Modified: weather/trunk/weather.py
===================================================================
--- weather/trunk/weather.py 2007-12-09 00:45:56 UTC (rev 12726)
+++ weather/trunk/weather.py 2007-12-09 00:59:39 UTC (rev 12727)
@@ -11,7 +11,7 @@
import signal # does this help with keyboard interrupts?
import base64
-from config import URLbase, weather_email, weather_storage
+from config import URLbase, weather_email, weather_storage, apache_fcgi
debug = 0
dummy_testing = 0
@@ -24,6 +24,9 @@
'/unsubscribe/(.*)', 'unsubscribe'
)
+if apache_fcgi:
+ web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
+
# Should do something more elegant with this!
if __name__ == "__main__":
More information about the tor-commits
mailing list