twisted 11

29 views
Skip to first unread message

Jason Grout

unread,
Oct 15, 2011, 5:20:57 PM10/15/11
to sage-...@googlegroups.com
I've been looking at Rado's patch to upgrade the sage notebook to
twisted 11, and it looks like his patch effectively removes the
'subnets' option from the notebook command:

- ``subnets`` -- list of strings (default: None) a list of
strings that define subnets; if given, requests to the
notebook server from ip addresses that are not in any of the
listed subnets are ignored. See `this Wikipedia article`_
more about subnets. An example input is
``subnets=['192.168.1.0/24', '216.34.0.0/16']``, which
accepts any address of the form ``192.168.1.*`` or of the
form ``216.34.*.*``. For serious use, you may want to
instead use your operating system's firewall, which is
probably more robust and reduces the load on the server.
Note that ``127.0.0.1`` is always allowed no matter what.


So: does anyone use the subnets option? As mentioned in the docstring,
it would probably be better to use a firewall rather than this option.
Does anyone object to getting rid of the subnets option?

Thanks,

Jason

Dima Pasechnik

unread,
Oct 16, 2011, 2:05:41 AM10/16/11
to sage-...@googlegroups.com
It could have been the haste rather than a pressing necessity to remove this functionality.
(unless it was implemented using the now gone web2 module, of which not everything went back into twisted-11 proper).

But, indeed, it can be perfectly done with a firewall rather than a built-in feature.

Dima Pasechnik

unread,
Oct 16, 2011, 5:12:10 AM10/16/11
to sage-...@googlegroups.com
by the way, here is a problem I was hitting while trying to doctest twisted-11 + flack-nb.
Any idea what is happening there? It's quite weird:

....
File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/notebook/notebook.py",
line 1238:
   sage: nb.html_worksheet_revision_list('admin', W)
Exception raised:
   Traceback (most recent call last):
     File "/usr/local/src/sage/sage-4.7.1/local/bin/ncadoctest.py",
line 1231, in run_one_test
       self.run_one_example(test, example, filename, compileflags)
     File "/usr/local/src/sage/sage-4.7.1/local/bin/sagedoctest.py",
line 38, in run_one_example
       OrigDocTestRunner.run_one_example(self, test, example,
filename, compileflags)
     File "/usr/local/src/sage/sage-4.7.1/local/bin/ncadoctest.py",
line 1172, in run_one_example
       compileflags, 1) in test.globs
     File "<doctest __main__.example_26[6]>", line 1, in <module>
       nb.html_worksheet_revision_list('admin', W)###line 1238:
   sage: nb.html_worksheet_revision_list('admin', W)
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/notebook/notebook.py",
line 1246, in html_worksheet_revision_list
       username = username)
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/notebook/template.py",
line 155, in template
       r = tmpl.render(**context)
     File "/usr/local/src/sage/sage-4.7.1/local/lib/python2.6/site-packages/Jinja2-2.5.5-py2.6.egg/jinja2/environment.py",
line 892, in render
       return self.environment.handle_exception(exc_info, True)
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/notebook/worksheet_revision_list.html",
line 9, in top-level template code
       {% set select = "revisions" %}
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/notebook/base_aux.html",
line 1, in top-level template code
       {% extends "html/notebook/base.html" %}
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/notebook/base.html",
line 11, in top-level template code
       {% set system_names = worksheet.notebook().system_names() %}
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/base_authenticated.html",
line 1, in top-level template code
       {% extends "html/base.html" %}
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/base.html",
line 26, in top-level template code
       {% block body %}
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/base.html",
line 28, in block "body"
       {% block header %}
     File "/usr/local/src/sage/sage-4.7.1/devel/rkirov-flask/sagenb/data/sage/html/base.html",
line 32, in block "header"
       <img align="top" src="/images/sagenb.png" alt="Sage"
/><span>{{ gettext('The Sage Notebook') }}</span>
   UndefinedError: 'gettext' is undefined
*

thanks,
Dima


leif

unread,
Oct 17, 2011, 12:19:00 PM10/17/11
to sage-devel
If the user is privileged to do so...

Hopefully specifying subnets gives an appropriate error message in the
new code.


-leif

Jason Grout

unread,
Oct 17, 2011, 12:21:15 PM10/17/11
to sage-...@googlegroups.com

Good point about permissions. Okay, is there someone that can figure
out Twisted enough to write the equivalent Twisted 11 code?

Thanks,

Jason

Rado

unread,
Oct 18, 2011, 12:09:48 AM10/18/11
to sage-...@googlegroups.com
That's the reason I never pushed that patch to my repository. It was an experiment to see if twisted11 will fix a weekly crash problem we were experiencing (Dima will say if it did).

I added the bare minimum needed to get the server up and running. I am almost certain all the other features (subnets and https) are possible in twisted11, but never had the time to put them back in.

Rado 

Dima Pasechnik

unread,
Oct 18, 2011, 12:38:53 AM10/18/11
to sage-...@googlegroups.com
Hi Rado,
well, since we upgraded all the 3 servers to twisted 11, they stopped crashing :)

P Purkayastha

unread,
Oct 18, 2011, 1:10:57 AM10/18/11
to sage-...@googlegroups.com


On Tuesday, October 18, 2011 12:38:53 PM UTC+8, Dima Pasechnik wrote:
Hi Rado,
well, since we upgraded all the 3 servers to twisted 11, they stopped crashing :)
 
In fact the servers were running so well, that the frontend Windows machines started crashing :D 

Dima Pasechnik

unread,
Oct 18, 2011, 4:40:22 AM10/18/11
to sage-...@googlegroups.com
that's our local networking problems, not relevant to twisted AFAIK.

P Purkayastha

unread,
Oct 18, 2011, 8:24:32 AM10/18/11
to sage-...@googlegroups.com


On Tuesday, October 18, 2011 4:40:22 PM UTC+8, Dima Pasechnik wrote:
that's our local networking problems, not relevant to twisted AFAIK.

I was just kidding :) 
Reply all
Reply to author
Forward
0 new messages