IRC log of dig on 2013-01-19

Timestamps are in UTC.

00:26:01 [timbl]
timbl (~timbl@c-24-62-225-11.hsd1.ma.comcast.net) has joined #dig
00:29:20 [rszeno]
rszeno has quit (Quit: Leaving.)
00:39:12 [Pipian-Work]
Pipian-Work has quit (Quit: Pipian-Work)
00:55:49 [danbri]
danbri has quit (Remote host closed the connection)
01:06:17 [danbri]
danbri (~danbri@134.0.113.87.dyn.plus.net) has joined #dig
01:26:38 [danbri]
danbri has quit (Remote host closed the connection)
01:29:54 [danbri]
danbri (~danbri@134.0.113.87.dyn.plus.net) has joined #dig
01:47:36 [bblfish]
bblfish has quit (Read error: Connection reset by peer)
01:48:03 [melvster]
melvster (~melvin@ip-94-112-34-211.net.upcbroadband.cz) has joined #dig
01:48:11 [bblfish]
bblfish (~bblfish@AAubervilliers-651-1-273-103.w86-212.abo.wanadoo.fr) has joined #dig
02:06:23 [danbri]
danbri has quit (Remote host closed the connection)
02:33:29 [melvster]
melvster has quit (Ping timeout: 240 seconds)
09:16:07 [trueg_away]
trueg_away is now known as trueg
09:47:52 [trueg]
trueg is now known as trueg_away
10:19:09 [danbri]
danbri (~danbri@134.0.113.87.dyn.plus.net) has joined #dig
10:37:05 [melvster]
melvster (~melvin@ip-94-112-34-211.net.upcbroadband.cz) has joined #dig
11:06:43 [rszeno]
rszeno (~rszeno@79.114.102.157) has joined #dig
12:44:47 [deiu]
deiu (~andrei@2a01:e35:8b67:4160:35e6:ed02:d092:e2cb) has joined #dig
12:44:48 [deiu]
deiu has quit (Changing host)
12:44:48 [deiu]
deiu (~andrei@unaffiliated/deiu) has joined #dig
13:25:17 [cheater_]
cheater_ (~cheater@p57AEB37B.dip.t-dialin.net) has joined #dig
13:27:51 [cheater]
cheater has quit (Ping timeout: 244 seconds)
13:58:32 [scor]
scor (~scor@drupal.org/user/52142/view) has joined #dig
14:03:28 [scor]
scor has quit (Quit: scor)
17:26:22 [Pipian-Work]
Pipian-Work (~Pipian@pool-71-255-166-150.bstnma.east.verizon.net) has joined #dig
17:46:18 [deiu]
Does anyone know how to expose Apache environment values to python? (running mod_wsgi)
17:46:34 [deiu]
I can't get the certificate data
18:03:03 [scor]
scor (~scor@c-98-216-39-127.hsd1.ma.comcast.net) has joined #dig
18:03:06 [scor]
scor has quit (Changing host)
18:03:06 [scor]
scor (~scor@drupal.org/user/52142/view) has joined #dig
18:18:06 [manu1]
deiu: It depends on the Python stack you're using - are you using WSGI? If so, have you tried printing out os.environ ?
18:18:06 [scor]
scor has quit (Quit: scor)
18:18:41 [deiu]
manu1, I'm try to directly access the WSGI environ dict
18:18:55 [deiu]
I don't want to depend on a specific server implementation
18:19:19 [deiu]
os.environ doesn't contain any WSGI data in my case (for now)
18:20:32 [deiu]
this is what I have for now: {"LANG": "C", "APACHE_LOCK_DIR": "/var/lock/apache2", "APACHE_RUN_USER": "www-data", "APACHE_RUN_DIR": "/var/run/apache2", "APACHE_PID_FILE": "/var/run/apache2.pid", "PWD": "/var/www/py", "APACHE_LOG_DIR": "/var/log/apache2", "APACHE_RUN_GROUP": "www-data", "PATH": "/usr/local/bin:/usr/bin:/bin", "HOME": "/var/www"}
18:21:41 [manu1]
that is wsgi.environ ? You're printing that variable?
18:22:48 [manu1]
deiu: Just FYI, I haven't played around with this stuff in ages... but it seems strange that you don't have any HTTP_ values in there.
18:22:51 [deiu]
no, that's os.environ
18:23:03 [manu1]
oh... have you tried printing out wsgi.environ ?
18:23:58 [deiu]
hmm, I don't have a wsgi module to import
18:24:32 [manu1]
First thing to check: are you running mod_wsgi in Apache?
18:24:36 [deiu]
yes
18:25:11 [deiu]
that's how I run my py application
18:25:48 [manu1]
and you have entries that look like this in there:
18:26:22 [manu1]
WSGIDaemonProcess example.com processes=1 threads=15 display-name=%{GROUP}
18:26:24 [manu1]
WSGIProcessGroup example.com
18:26:26 [manu1]
18:26:27 [manu1]
WSGIScriptAlias / /home/foo/src/app.py
18:26:29 [manu1]
<Directory /home/foo/src>
18:26:30 [manu1]
Order allow,deny
18:26:32 [manu1]
Allow from all
18:26:34 [manu1]
</Directory>
18:26:47 [deiu]
yes
18:27:46 [manu1]
are you using wsgiref ?
18:27:49 [manu1]
import wsgiref ?
18:28:01 [manu1]
or something like this - from wsgiref.simple_server import make_server
18:28:31 [deiu]
yeah, just found out about wsgiref
18:29:00 [deiu]
I don't need make_server
18:29:02 [manu1]
and your handler looks like this: def http_callback(environ, response):
18:29:09 [deiu]
I just need to access then environ contents
18:29:17 [deiu]
the server is apache
18:29:30 [manu1]
okay, well - what happens when you print out environ, above?
18:29:30 [deiu]
or actually, it's bottle in my case
18:31:59 [manu1]
everything that Apache has should be accessible via environ... you can view it via print "Apache WSGI environment:", environ
18:32:22 [manu1]
(as long as you do so from within http_callback(environ, response):
18:32:40 [deiu]
I can't find a way to access environ without doing make_server
18:32:48 [deiu]
it's always inside a callback
18:34:14 [manu1]
deiu: Well, technically, that's when the environment is setup - when the callback is called... so you're trying to get the environment /before/ you get an HTTP request in?
18:35:59 [deiu]
not exactly, I've already set the environment during TLS authentication
18:36:39 [deiu]
If I use bottle's method, I can see the environ variables just fine
18:37:00 [deiu]
but I can't do it otherwise
18:37:45 [manu1]
hmm, then I'd look at bottle's method (look at the source) and see how they do it.
18:38:17 [deiu]
yeah, I hope there was an easier way
18:38:22 [deiu]
hoped
18:38:26 [manu1]
although, at a high level, it sounds like what you're doing is a bit strange.
18:38:59 [manu1]
like you're trying to do stuff after TLS is negotiated, but before the HTTP handler is called.
18:39:11 [manu1]
in which case, most middleware isn't going to be very kind to you.
18:39:28 [manu1]
and I don't have much familiarity with bottle, so you're on your own there... :(
18:40:25 [deiu]
well, I'm trying to do stuff during the HTTP handler call
18:40:42 [deiu]
like processing a GET request
18:41:14 [deiu]
but at that point, TLS negotiation is already finished
18:42:10 [deiu]
thanks though :)
18:46:49 [deiu]
deiu has quit (Ping timeout: 246 seconds)
18:59:28 [scor]
scor (~scor@c-98-216-39-127.hsd1.ma.comcast.net) has joined #dig
18:59:29 [scor]
scor has quit (Changing host)
18:59:29 [scor]
scor (~scor@drupal.org/user/52142/view) has joined #dig
19:14:18 [melvster]
melvster has quit (Ping timeout: 245 seconds)
19:23:10 [Pipian-Work]
Pipian-Work has quit (Quit: Pipian-Work)
23:02:16 [scor]
scor has quit (Quit: scor)
23:49:43 [danbri]
danbri has quit (Ping timeout: 245 seconds)