jupyter_notebook_config.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. common = [
  2. "--no-browser",
  3. "--debug",
  4. "--port={port}",
  5. "--ServerApp.ip=127.0.0.1",
  6. '--ServerApp.token=""',
  7. # Disable dns rebinding protection here, since our 'Host' header
  8. # is not going to be localhost when coming from hub.mybinder.org
  9. "--ServerApp.allow_remote_access=True",
  10. ]
  11. lab_command = " ".join(
  12. [
  13. "jupyter",
  14. "lab",
  15. "--dev-mode",
  16. "--extensions-in-dev-mode",
  17. "--collaborative",
  18. "--ServerApp.base_url={base_url}lab-dev",
  19. ]
  20. + common
  21. + [">jupyterlab-dev.log 2>&1"]
  22. )
  23. lab_splice_command = " ".join(
  24. [
  25. "jupyter",
  26. "lab",
  27. "build",
  28. "--splice-source",
  29. "--minimize=False",
  30. "--dev-build=True",
  31. "--debug",
  32. ">jupyterlab-spliced.log 2>&1",
  33. "&&",
  34. "jupyter",
  35. "lab",
  36. "--ServerApp.base_url={base_url}lab-spliced",
  37. ]
  38. + common
  39. + [">jupyterlab-spliced.log 2>&1"]
  40. )
  41. c.ServerProxy.servers = {
  42. "lab-dev": {"command": ["/bin/bash", "-c", lab_command], "timeout": 60, "absolute_url": True},
  43. "lab-spliced": {
  44. "command": ["/bin/bash", "-c", lab_splice_command],
  45. "timeout": 300,
  46. "absolute_url": True,
  47. },
  48. }
  49. c.NotebookApp.default_url = "/lab-dev"
  50. import logging
  51. c.NotebookApp.log_level = logging.DEBUG