snakeviz icon indicating copy to clipboard operation
snakeviz copied to clipboard

limit accessible paths

Open girtsf opened this issue 5 years ago • 4 comments

Previously one could browse the whole filesystem on the machine that snakeviz server was running on. Now we limit what can be viewed to the filename that was passed in on command line.

In the future the CLI could be extended to allow browsing a directory of profile files.

girtsf avatar Nov 29 '19 17:11 girtsf

Let me know if you think this is a good direction. I'm thinking maybe we can change the cli to accept <file or dir> [<file or dir> ...] and those automatically get added to allowed paths?

girtsf avatar Nov 29 '19 17:11 girtsf

(It's failing on 2.7, but with py2 going EOL at end of year, maybe not worth supporting it?)

girtsf avatar Nov 29 '19 17:11 girtsf

this seems to be available with self._list_dirs already (somewhat broken but I just submitted a pull request that should fix it)

joranbeasley avatar Apr 25 '20 21:04 joranbeasley

Thanks for submitting this! I don't think I'm quite ready to drop Python 2.7 support yet. Could this also be done with os.path operations? I'm also curious about the motivation for this, are you running into a specific situation in which you want to limit the browsable directory?

jiffyclub avatar Apr 26 '20 23:04 jiffyclub