-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
publishing a worksheet displays the URL without the hostname #5263
Comments
comment:1
Yes it does use address. I just discovered that on my computer if I set address='sagenb.org' then I can't start the notebook. |
comment:2
#5675 appears to be a duplicate, but with wider scope. |
comment:4
It looks like this has been a long standing bug, which nobody has worked on. I would make two suggestion, though. Firstly, if this gets fixed, it would be sensible to detect the following range of IP addresses, and indicate they can not be routed over the internet.
Secondly, perhaps a further reminder about the security risks would not go amiss either. Dave |
comment:6
Following the suggestions here and here, I get: sage: import socket
sage: socket.gethostbyname(socket.gethostname())
'127.0.0.1'
sage: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sage: s.connect(('google.com', 0))
sage: s.getsockname()[0]
'192.168.x.y'
sage: import urllib
sage: urllib.urlopen('http://whatismyip.org').read()
'a.b.c.d' I'm looking now for ways to iterate over the available interfaces in Twisted... By the way, there are a few suggestions to the main problem at #5675. What is a good name for a keyword option that's inserted instead of the |
comment:7
Replying to @qed777:
I think Twisted just uses socket, which |
comment:8
I think using the HTTP-HOST header will be easier and more reliable. Here's a patch implementing that. Feel free to comment. |
Uses the HTTP-HOST header to attempt to get the host name. |
Author: Tim Dumol |
comment:9
Attachment: trac_5263-publish-url.patch.gz Nice! |
Reviewer: Mitesh Patel |
Merged: sagenb-0.7 |
When I publish a worksheet on sagenb.org, it says I can find the sheet at: http://:8000/home/pub/243
Of course, this is silly nonsense.
It might have to do with starting the notebook with address='', maybe?
CC: @kcrisman @williamstein @qed777
Component: notebook
Author: Tim Dumol
Reviewer: Mitesh Patel
Merged: sagenb-0.7
Issue created by migration from https://trac.sagemath.org/ticket/5263
The text was updated successfully, but these errors were encountered: