0

I would like to open a Jupyter notebook page on the boot of my Mac. Specifically, I use the launchctl to start the Jupyter notebook.

However, after the reboot, the web page showed the password or token to verify:

enter image description here

Here is the launchctl script I use on High Sierra. I find it painstaking to bother to type in the token. So is it possible to ignore the token verification on reboot, just like it is when you type in jupyter notebook?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
           http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>me.jupyter</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/bin/jupyter</string>
      <string>notebook</string>
      <string>--no-browser</string>
      <string>--port</string>
      <string>9090</string>
      <string>--notebook-dir</string>
      <string>/Users/me/jupyter/</string>
    </array>
    <key>KeepAlive</key>
    <true />
    <key>RunAtLoad</key>
    <true />
    <key>StandardErrorPath</key>
    <string>/Users/me/jupyter/jupyter-notebook.stderr</string>
    <key>StandardOutPath</key>
    <string>/Users/mejupyter/jupyter-notebook.stdout</string>
  </dict>
</plist>
Blaszard
  • 30,954
  • 51
  • 153
  • 233

2 Answers2

1

This might work for you:

If you do not care about the security of the server, you can first create a jupyer config file with: cd ~/.jupyter jupyter notebook --generate-config Then set the c.NotebookApp.token parameter to an empty string in the configuration file created c.NotebookApp.token = '' As said in comment, Setting to an empty string disables authentication altogether, which is NOT RECOMMENDED.

Source: https://github.com/jupyter/notebook/issues/2254

Blaszard
  • 30,954
  • 51
  • 153
  • 233
BoboDarph
  • 2,751
  • 1
  • 10
  • 15
  • I see. But as long as I run the server on localhost, it would not be that unsafe, right? – Blaszard Nov 10 '17 at 19:32
  • 1
    It's perfectly safe if you run it only locally. The reason password/token protection was made the default is presumably that a lot of people do not understand the difference between a public webserver and localhost. – Håken Lid Nov 10 '17 at 19:48
  • I wouldnt call running a local instance of anything without any authentication safe, but, as they say, "Security is a state of mind". – BoboDarph Nov 17 '17 at 15:46
1

Actually in later versions of Jupyter notebook, you must explicitly run the server with the parameter --NotebookApp.token=. So add it to the plist file.

And as the other answer notes, writes the following on the config file:

c.NotebookApp.token = '' 
Blaszard
  • 30,954
  • 51
  • 153
  • 233