On Thu, Jun 29, 2023 at 3:24 AM Michael Orlitzky <mich...@orlitzky.com> wrote:
>
> On 2023-06-28 23:27:22, Dima Pasechnik wrote:
> > One can always start a web server on localhost, instead of using file:/// :P
> >
>
> I know you're mostly joking, but that's not as easy as it sounds.

no, why? If you run ./sage -n you'll see something like

    To access the notebook, open this file in a browser:
        file:///home/dima/.local/share/jupyter/runtime/nbserver-15031-open.html
    Or copy and paste one of these URLs:
        
http://localhost:8888/?token=067f4b0aab24836fd21c349e9cfa2e78c29b183444e6b44d
     or 
http://127.0.0.1:8888/?token=067f4b0aab24836fd21c349e9cfa2e78c29b183444e6b44d

- so jupyter offers you an alternative like this. And it's very useful
if e.g. your Sage session is run in a VM-like
environment, e.g. in a Crostini container (an LXC container)  so that
the browser can't directly access files, but
HTTP has a tunnel set up.


> To
> start the local web server as a non-root user, you have to run it on
> an unprivileged (i.e. not the default of 80) port. Then you have to
> teach it about mime types and gzip, and probably add a line or two
> about image/svg+xml and the svgz extension.
>
> Then you have to secure it somehow. Other local users can hit that TCP
> port, and it will be running with your desktop user's privileges, so
> it can see all of your files. Your server might support path
> restrictions, but does it protect against the past 30 years' worth of
> path traversal hacks and stupid symlink tricks? Maybe if you're using
> apache or nginx, but if you're using "python -m http.server", I
> wouldn't count on it.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/ZJzrXxtT1lnmuywr%40stitch.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq2AuQntrb3xoeL7r7TF2uUK2QCHObu9N%3DUyewiOf18H6Q%40mail.gmail.com.

Reply via email to