Skip to content
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

Closed
jasongrout opened this issue Feb 14, 2009 · 12 comments
Closed

publishing a worksheet displays the URL without the hostname #5263

jasongrout opened this issue Feb 14, 2009 · 12 comments

Comments

@jasongrout
Copy link
Member

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

@TimothyClemans
Copy link
Mannequin

TimothyClemans mannequin commented Feb 14, 2009

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.

@qed777
Copy link
Mannequin

qed777 mannequin commented Aug 10, 2009

comment:2

#5675 appears to be a duplicate, but with wider scope.

@jasongrout
Copy link
Member Author

comment:3

I agree that this will probably be closed when #5675 is closed. I think that when #5675 is closed, this ought to be checked, and then closed if everything works.

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Dec 21, 2009

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.

  • 10.x.x.x
  • 172.16.x.x to 172.31.x.x
  • 192.168.x.x

Secondly, perhaps a further reminder about the security risks would not go amiss either.

Dave

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 16, 2010

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 interface (post-#7639, address is deprecated) when interface=''?

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 16, 2010

comment:7

Replying to @qed777:

I'm looking now for ways to iterate over the available interfaces in Twisted...

I think Twisted just uses socket, which
uses the underlying system's socket library. I don't know if there is a local, cross-platform way to iterate over '0.0.0.0' (all interfaces) and map each to an IP address.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

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.

@TimDumol TimDumol mannequin added the s: needs review label Jan 19, 2010
@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

Uses the HTTP-HOST header to attempt to get the host name.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 20, 2010

Author: Tim Dumol

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 20, 2010

comment:9

Attachment: trac_5263-publish-url.patch.gz

Nice!

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 20, 2010

Reviewer: Mitesh Patel

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 25, 2010

Merged: sagenb-0.7

@qed777 qed777 mannequin removed the s: positive review label Jan 25, 2010
@qed777 qed777 mannequin closed this as completed Jan 25, 2010
@qed777 qed777 mannequin mentioned this issue Feb 10, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants