Disabling directory listings

391 views
Skip to first unread message

Roy Sigurd Karlsbakk

unread,
Oct 18, 2017, 7:40:55 AM10/18/17
to noVNC

Hi

How can I disable directory listing in novnc? Looks like there's a file_only in websockify, but I have no idea how to set that. Please help :)

roy

Pierre Ossman

unread,
Oct 30, 2017, 6:15:37 AM10/30/17
to no...@googlegroups.com, Roy Sigurd Karlsbakk
I'm afraid that function is not exposed using the standard proxy server.
It can only be used when integrating websockify with your own server
software.

Regards
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600 https://plus.google.com/+CendioThinLinc

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Andrew Goodson

unread,
Nov 23, 2017, 12:01:56 AM11/23/17
to noVNC
Hey Pierre,

Do you have an example of it being used when integrated with the server? I'm not sure I'm following...

In an older version I could get it do disable but in the latest release the option in the python seems to be hidden.

V/r,

Andrew S. Goodson

Pierre Ossman

unread,
Nov 29, 2017, 3:14:22 AM11/29/17
to no...@googlegroups.com, Andrew Goodson
On 23/11/17 06:01, Andrew Goodson wrote:
> Hey Pierre,
>
> Do you have an example of it being used when integrated with the server?
> I'm not sure I'm following...
>

I don't have any code I can point to, but one example would be OpenStack.

> In an older version I could get it do disable but in the latest release the
> option in the python seems to be hidden.
>

Which version was that? I looked at the history and I couldn't see any
trace of this being exposed.

Andrew Goodson

unread,
Nov 29, 2017, 4:16:48 AM11/29/17
to noVNC
At the time I was using Version 0.6.1, but I upgraded to the latest in order to try out the client SSL update.

Inside the websocket.py   

def __init__(self, req, addr, server):
        # Retrieve a few configuration variables from the server
        self.only_upgrade = getattr(server, "only_upgrade", False)
        self.verbose = getattr(server, "verbose", False)
        self.daemon = getattr(server, "daemon", False)
        self.record = getattr(server, "record", False)
        self.run_once = getattr(server, "run_once", False)
        self.rec        = None
        self.handler_id = getattr(server, "handler_id", False)
        self.file_only = getattr(server, "file_only", False)
        self.traffic = getattr(server, "traffic", False)

        self.logger = getattr(server, "logger", None)
        if self.logger is None:
            self.logger = WebSocketServer.get_logger()

        SimpleHTTPRequestHandler.__init__(self, req, addr, server)


If you set that false to true it will kill the file directory listings. However in the latest 0.8 I couldn't find that setting to intercept. Not much of a python guy or I would dig deeper. Do you have a link to the openstack? I have been having a hard time getting Apache and websockify to play nice together.

Pierre Ossman

unread,
Nov 29, 2017, 5:05:52 AM11/29/17
to no...@googlegroups.com, Andrew Goodson
On 29/11/17 10:16, Andrew Goodson wrote:
>
>
> At the time I was using Version 0.6.1, but I upgraded to the latest in order to try out the client SSL update.
>
>
> Inside the websocket.py
>
> ...
>
> If you set that false to true it will kill the file directory listings.
> However in the latest 0.8 I couldn't find that setting to intercept. Not
> much of a python guy or I would dig deeper.

Ah. I thought you were running the command line, not poking around in
the Python code.

That part is now in websockifyserver.py.

> Do you have a link to the
> openstack? I have been having a hard time getting Apache and websockify to
> play nice together.
>

Afraid not as I haven't been directly involved myself. But there might
be OpenStack people hanging around on this list.
Reply all
Reply to author
Forward
0 new messages