nbformat icon indicating copy to clipboard operation
nbformat copied to clipboard

NotebookNotary does not accept data_dir config option

Open Pugio opened this issue 5 years ago • 2 comments

The docs specify I should be able to set the notary's data_dir as:

c.NotebookNotary.data_dir = "/path/to/signature_dir"

but this produces [TrustNotebookApp] WARNING | Config option 'data_dir' not recognized by 'NotebookNotary'

jupyter notebook --generate-config and --help-all also do not specify data_dir as an allowable config option. This seems to be caused by https://github.com/jupyter/nbformat/blob/a06f4c84738b338fee5ad6316b21918a8709b636/nbformat/sign.py#L315 not having something like:

data_dir = Unicode(
        help="""The storage directory for notary secret and database."""
    ).tag(config=True)

For reference, I am trying to share a set of trusted notebooks amongst many users, and was hoping I could point all users at some shared directory location.

Pugio avatar Jun 29 '20 02:06 Pugio

I don't have the history of that command moving, but based on the commit history it looks like it you're correct and it was intended to be a config change. If you wanted to make the change in a PR I can get it merged.

As a workaround, and in most cases I've seen, the data_directory is set by environment variable: https://jupyter.readthedocs.io/en/latest/projects/jupyter-directories.html#envvar-JUPYTER_DATA_DIR.

MSeal avatar Jul 01 '20 05:07 MSeal

I had the same problem, c.NotebookNotary.data_dir by the docs can't work, I tried environment variable:JUPYTER_DATA_DIR, it worked. but it's very confused that what the docs says did not work

mofanke avatar Oct 30 '20 14:10 mofanke