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

Auto browser open of notebook does not open to a valid url when interface="" #5675

Closed
williamstein opened this issue Apr 3, 2009 · 11 comments

Comments

@williamstein
Copy link
Contributor

On Thu, 02 Apr 2009 at 11:53PM -0700, Ondrej Certik wrote:
>
> Hi,
>
[...]
> sage: notebook(secure=False, address="")
> [...]
>
> and it starts firefox on the local machine with this address:
>
> http://[www.:8000.com]/?startup_token=41e2a34e89e40139333a8113e9be2a50
>
> which obviously fails. This also happens with sage 3.2.3 (I didn't try
> other versions).

This has been around for a while; I haven't filed a ticket for it, since
I just retype the URL.

It used to be in the notebook that address="" was an error. Then when we switched to twisted, it suddenly meant "listen on all interfaces". Now it's a common option to give.

CC: @sagetrac-acleone

Component: notebook

Author: Tim Dumol

Reviewer: Alex Leone

Merged: sagenb-0.7

Issue created by migration from https://trac.sagemath.org/ticket/5675

@qed777
Copy link
Mannequin

qed777 mannequin commented Aug 10, 2009

comment:1

This ticket subsumes #5263.

@qed777
Copy link
Mannequin

qed777 mannequin commented Jan 16, 2010

comment:2

There is socket.getfqdn, but does it help? On boxen:

sage: import socket
sage: socket.getfqdn()
'localhost'
sage: socket.gethostbyname_ex(socket.gethostname())
('localhost', ['boxen', 'boxen'], ['127.0.0.1', '128.208.160.197'])

On a local Linux machine, I get

sage: import socket
sage: socket.getfqdn()
'localhost.localdomain'
sage: socket.gethostbyname_ex(socket.gethostname())
('localhost.localdomain', ['localhost', 'foo'], ['127.0.0.1'])

all of which happen to be in /etc/hosts.

What if we just add an option published_host=* (or a variation) and insert it into URLs for published (and remote!) worksheets when interface=*? We could print a warning or raise an error, if both are left empty.

@TimDumol

This comment has been minimized.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

comment:3

Renaming this to a more appropriate title.

@TimDumol TimDumol mannequin changed the title notebook with address="" option should set the address to something useful Auto browser open of notebook does not open to a valid url when interface="" Jan 19, 2010
@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

Attachment: trac_5675-address-launch.patch.gz

This sets the hostname to localhost if interface="" when launching the page

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

Author: Tim Dumol

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jan 19, 2010

comment:4

This fixes the issue described.

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

sagetrac-acleone mannequin commented Jan 19, 2010

comment:5

LGTM. See #5263. This bug is only for a blank option passed to sage -n interface=''.

@sagetrac-acleone
Copy link
Mannequin

sagetrac-acleone mannequin commented Jan 19, 2010

Reviewer: Alex Leone

@sagetrac-acleone
Copy link
Mannequin

sagetrac-acleone mannequin commented Jan 19, 2010

comment:6

I see a few cases:

  1. The user starts the server on his/her computer. localhost works fine
  2. The user starts the server on a network computer via ssh, in which case the browser should probably auto-open to whatever address the user used to ssh into computer. However we can't get this information, and last time I tried firefox doesn't open anyway (when starting the notebook in an ssh session).

See #5263 for the publish url bug.

@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