PageRenderTime 43ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/projects/jupyterhub/roles/jupyterhub_manager/templates/jupyterhub_config_0.8.py.j2

https://bitbucket.org/jstubbs/deployer_v2
Jinja | 784 lines | 666 code | 118 blank | 0 comment | 1 complexity | 8626653e8a6f3760122d9d9262f83caf MD5 | raw file
  1. # Configuration file for jupyterhub.
  2. import os
  3. os.environ["DOCKER_HOST"] = "{{ hub_ip_for_notebooks }}:4000"
  4. #------------------------------------------------------------------------------
  5. # Application(SingletonConfigurable) configuration
  6. #------------------------------------------------------------------------------
  7. ## This is an application.
  8. ## The date format used by logging formatters for %(asctime)s
  9. #c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
  10. ## The Logging format template
  11. #c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s'
  12. ## Set the log level by value or name.
  13. #c.Application.log_level = 30
  14. #------------------------------------------------------------------------------
  15. # JupyterHub(Application) configuration
  16. #------------------------------------------------------------------------------
  17. ## An Application for starting a Multi-User Jupyter Notebook server.
  18. ## Maximum number of concurrent servers that can be active at a time.
  19. #
  20. # Setting this can limit the total resources your users can consume.
  21. #
  22. # An active server is any server that's not fully stopped. It is considered
  23. # active from the time it has been requested until the time that it has
  24. # completely stopped.
  25. #
  26. # If this many user servers are active, users will not be able to launch new
  27. # servers until a server is shutdown. Spawn requests will be rejected with a 429
  28. # error asking them to try again.
  29. #
  30. # If set to 0, no limit is enforced.
  31. #c.JupyterHub.active_server_limit = 0
  32. ## Grant admin users permission to access single-user servers.
  33. #
  34. # Users should be properly informed if this is enabled.
  35. #c.JupyterHub.admin_access = False
  36. ## DEPRECATED since version 0.7.2, use Authenticator.admin_users instead.
  37. #c.JupyterHub.admin_users = set()
  38. ## Allow named single-user servers per user
  39. #c.JupyterHub.allow_named_servers = False
  40. ## Answer yes to any questions (e.g. confirm overwrite)
  41. #c.JupyterHub.answer_yes = False
  42. ## PENDING DEPRECATION: consider using service_tokens
  43. #
  44. # Dict of token:username to be loaded into the database.
  45. #
  46. # Allows ahead-of-time generation of API tokens for use by externally managed
  47. # services, which authenticate as JupyterHub users.
  48. #
  49. # Consider using service_tokens for general services that talk to the JupyterHub
  50. # API.
  51. #c.JupyterHub.api_tokens = {}
  52. ## Class for authenticating users.
  53. #
  54. # This should be a class with the following form:
  55. #
  56. # - constructor takes one kwarg: `config`, the IPython config object.
  57. #
  58. # - is a tornado.gen.coroutine
  59. # - returns username on success, None on failure
  60. # - takes two arguments: (handler, data),
  61. # where `handler` is the calling web.RequestHandler,
  62. # and `data` is the POST form data from the login page.
  63. c.JupyterHub.authenticator_class = 'oauthenticator.agave.AgaveOAuthenticator'
  64. c.AgaveOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL']
  65. c.AgaveOAuthenticator.client_id = os.environ['AGAVE_CLIENT_ID']
  66. c.AgaveOAuthenticator.client_secret = os.environ['AGAVE_CLIENT_SECRET']
  67. c.AgaveOAuthenticator.agave_base_url = os.environ['AGAVE_BASE_URL']
  68. c.AgaveMixin.agave_base_url = os.environ['AGAVE_BASE_URL']
  69. ## The base URL of the entire application
  70. #c.JupyterHub.base_url = '/'
  71. ## Whether to shutdown the proxy when the Hub shuts down.
  72. #
  73. # Disable if you want to be able to teardown the Hub while leaving the proxy
  74. # running.
  75. #
  76. # Only valid if the proxy was starting by the Hub process.
  77. #
  78. # If both this and cleanup_servers are False, sending SIGINT to the Hub will
  79. # only shutdown the Hub, leaving everything else running.
  80. #
  81. # The Hub should be able to resume from database state.
  82. #c.JupyterHub.cleanup_proxy = True
  83. ## Whether to shutdown single-user servers when the Hub shuts down.
  84. #
  85. # Disable if you want to be able to teardown the Hub while leaving the single-
  86. # user servers running.
  87. #
  88. # If both this and cleanup_proxy are False, sending SIGINT to the Hub will only
  89. # shutdown the Hub, leaving everything else running.
  90. #
  91. # The Hub should be able to resume from database state.
  92. #c.JupyterHub.cleanup_servers = True
  93. ## Maximum number of concurrent users that can be spawning at a time.
  94. #
  95. # Spawning lots of servers at the same time can cause performance problems for
  96. # the Hub or the underlying spawning system. Set this limit to prevent bursts of
  97. # logins from attempting to spawn too many servers at the same time.
  98. #
  99. # This does not limit the number of total running servers. See
  100. # active_server_limit for that.
  101. #
  102. # If more than this many users attempt to spawn at a time, their requests will
  103. # be rejected with a 429 error asking them to try again. Users will have to wait
  104. # for some of the spawning services to finish starting before they can start
  105. # their own.
  106. #
  107. # If set to 0, no limit is enforced.
  108. #c.JupyterHub.concurrent_spawn_limit = 100
  109. ## The config file to load
  110. #c.JupyterHub.config_file = 'jupyterhub_config.py'
  111. ## DEPRECATED: does nothing
  112. #c.JupyterHub.confirm_no_ssl = False
  113. ## Number of days for a login cookie to be valid. Default is two weeks.
  114. #c.JupyterHub.cookie_max_age_days = 14
  115. ## The cookie secret to use to encrypt cookies.
  116. #
  117. # Loaded from the JPY_COOKIE_SECRET env variable by default.
  118. #
  119. # Should be exactly 256 bits (32 bytes).
  120. #c.JupyterHub.cookie_secret = b''
  121. ## File in which to store the cookie secret.
  122. #c.JupyterHub.cookie_secret_file = 'jupyterhub_cookie_secret'
  123. ## The location of jupyterhub data files (e.g. /usr/local/share/jupyter/hub)
  124. #c.JupyterHub.data_files_path = '/opt/conda/share/jupyter/hub'
  125. ## Include any kwargs to pass to the database connection. See
  126. # sqlalchemy.create_engine for details.
  127. #c.JupyterHub.db_kwargs = {}
  128. ## url for the database. e.g. `sqlite:///jupyterhub.sqlite`
  129. #c.JupyterHub.db_url = 'sqlite:///jupyterhub.sqlite'
  130. ## log all database transactions. This has A LOT of output
  131. #c.JupyterHub.debug_db = False
  132. ## DEPRECATED since version 0.8: Use ConfigurableHTTPProxy.debug
  133. #c.JupyterHub.debug_proxy = False
  134. ## Send JupyterHub's logs to this file.
  135. #
  136. # This will *only* include the logs of the Hub itself, not the logs of the proxy
  137. # or any single-user servers.
  138. #c.JupyterHub.extra_log_file = ''
  139. ## Extra log handlers to set on JupyterHub logger
  140. #c.JupyterHub.extra_log_handlers = []
  141. ## Generate default config file
  142. #c.JupyterHub.generate_config = False
  143. ## The ip or hostname for proxies and spawners to use for connecting to the Hub.
  144. #
  145. # Use when the bind address (`hub_ip`) is 0.0.0.0 or otherwise different from
  146. # the connect address.
  147. #
  148. # Default: when `hub_ip` is 0.0.0.0, use `socket.gethostname()`, otherwise use
  149. # `hub_ip`.
  150. #
  151. # .. versionadded:: 0.8
  152. #c.JupyterHub.hub_connect_ip = ''
  153. ## The port for proxies & spawners to connect to the hub on.
  154. #
  155. # Used alongside `hub_connect_ip`
  156. #
  157. # .. versionadded:: 0.8
  158. #c.JupyterHub.hub_connect_port = 0
  159. ## The ip address for the Hub process to *bind* to.
  160. #
  161. # See `hub_connect_ip` for cases where the bind and connect address should
  162. # differ.
  163. import netifaces
  164. docker0 = netifaces.ifaddresses('eth0')
  165. docker0_ipv4 = docker0[netifaces.AF_INET][0]
  166. c.JupyterHub.hub_ip = docker0_ipv4['addr']
  167. ## The port for the Hub process
  168. #c.JupyterHub.hub_port = 8081
  169. ## The public facing ip of the whole application (the proxy)
  170. #c.JupyterHub.ip = ''
  171. ## Supply extra arguments that will be passed to Jinja environment.
  172. #c.JupyterHub.jinja_environment_options = {}
  173. ## Interval (in seconds) at which to update last-activity timestamps.
  174. #c.JupyterHub.last_activity_interval = 300
  175. ## Dict of 'group': ['usernames'] to load at startup.
  176. #
  177. # This strictly *adds* groups and users to groups.
  178. #
  179. # Loading one set of groups, then starting JupyterHub again with a different set
  180. # will not remove users or groups from previous launches. That must be done
  181. # through the API.
  182. #c.JupyterHub.load_groups = {}
  183. ## Specify path to a logo image to override the Jupyter logo in the banner.
  184. #c.JupyterHub.logo_file = ''
  185. ## File to write PID Useful for daemonizing jupyterhub.
  186. #c.JupyterHub.pid_file = ''
  187. ## The public facing port of the proxy
  188. #c.JupyterHub.port = 8000
  189. ## DEPRECATED since version 0.8 : Use ConfigurableHTTPProxy.api_url
  190. #c.JupyterHub.proxy_api_ip = ''
  191. ## DEPRECATED since version 0.8 : Use ConfigurableHTTPProxy.api_url
  192. #c.JupyterHub.proxy_api_port = 0
  193. ## DEPRECATED since version 0.8: Use ConfigurableHTTPProxy.auth_token
  194. #c.JupyterHub.proxy_auth_token = ''
  195. ## Interval (in seconds) at which to check if the proxy is running.
  196. #c.JupyterHub.proxy_check_interval = 30
  197. ## Select the Proxy API implementation.
  198. #c.JupyterHub.proxy_class = 'jupyterhub.proxy.ConfigurableHTTPProxy'
  199. ## DEPRECATED since version 0.8. Use ConfigurableHTTPProxy.command
  200. #c.JupyterHub.proxy_cmd = []
  201. ## Purge and reset the database.
  202. #c.JupyterHub.reset_db = False
  203. ## Interval (in seconds) at which to check connectivity of services with web
  204. # endpoints.
  205. #c.JupyterHub.service_check_interval = 60
  206. ## Dict of token:servicename to be loaded into the database.
  207. #
  208. # Allows ahead-of-time generation of API tokens for use by externally managed
  209. # services.
  210. #c.JupyterHub.service_tokens = {}
  211. ## List of service specification dictionaries.
  212. #
  213. # A service
  214. #
  215. # For instance::
  216. #
  217. # services = [
  218. # {
  219. # 'name': 'cull_idle',
  220. # 'command': ['/path/to/cull_idle_servers.py'],
  221. # },
  222. # {
  223. # 'name': 'formgrader',
  224. # 'url': 'http://127.0.0.1:1234',
  225. # 'api_token': 'super-secret',
  226. # 'environment':
  227. # }
  228. # ]
  229. #c.JupyterHub.services = []
  230. ## The class to use for spawning single-user servers.
  231. #
  232. # Should be a subclass of Spawner.
  233. c.JupyterHub.spawner_class = 'jupyterhub.dockerspawner.DockerSpawner'
  234. {% if notebook_offer_lab is defined %}
  235. c.DockerSpawner.options_form = """
  236. Choose an Image:
  237. <select name="image" multiple="true">
  238. <option value="notebook">Jupyter Notebook</option>
  239. <option value="lab">Jupyter Lab</option>
  240. </select>
  241. """
  242. {% endif %}
  243. ## Path to SSL certificate file for the public facing interface of the proxy
  244. #
  245. # When setting this, you should also set ssl_key
  246. #c.JupyterHub.ssl_cert = ''
  247. ## Path to SSL key file for the public facing interface of the proxy
  248. #
  249. # When setting this, you should also set ssl_cert
  250. #c.JupyterHub.ssl_key = ''
  251. ## Host to send statsd metrics to
  252. #c.JupyterHub.statsd_host = ''
  253. ## Port on which to send statsd metrics about the hub
  254. #c.JupyterHub.statsd_port = 8125
  255. ## Prefix to use for all metrics sent by jupyterhub to statsd
  256. #c.JupyterHub.statsd_prefix = 'jupyterhub'
  257. ## Run single-user servers on subdomains of this host.
  258. #
  259. # This should be the full `https://hub.domain.tld[:port]`.
  260. #
  261. # Provides additional cross-site protections for javascript served by single-
  262. # user servers.
  263. #
  264. # Requires `<username>.hub.domain.tld` to resolve to the same host as
  265. # `hub.domain.tld`.
  266. #
  267. # In general, this is most easily achieved with wildcard DNS.
  268. #
  269. # When using SSL (i.e. always) this also requires a wildcard SSL certificate.
  270. #c.JupyterHub.subdomain_host = ''
  271. ## Paths to search for jinja templates.
  272. #c.JupyterHub.template_paths = []
  273. ## Extra settings overrides to pass to the tornado application.
  274. #c.JupyterHub.tornado_settings = {}
  275. ## Trust user-provided tokens (via JupyterHub.service_tokens) to have good
  276. # entropy.
  277. #
  278. # If you are not inserting additional tokens via configuration file, this flag
  279. # has no effect.
  280. #
  281. # In JupyterHub 0.8, internally generated tokens do not pass through additional
  282. # hashing because the hashing is costly and does not increase the entropy of
  283. # already-good UUIDs.
  284. #
  285. # User-provided tokens, on the other hand, are not trusted to have good entropy
  286. # by default, and are passed through many rounds of hashing to stretch the
  287. # entropy of the key (i.e. user-provided tokens are treated as passwords instead
  288. # of random keys). These keys are more costly to check.
  289. #
  290. # If your inserted tokens are generated by a good-quality mechanism, e.g.
  291. # `openssl rand -hex 32`, then you can set this flag to True to reduce the cost
  292. # of checking authentication tokens.
  293. #c.JupyterHub.trust_user_provided_tokens = False
  294. ## Upgrade the database automatically on start.
  295. #
  296. # Only safe if database is regularly backed up. Only SQLite databases will be
  297. # backed up to a local file automatically.
  298. #c.JupyterHub.upgrade_db = False
  299. #------------------------------------------------------------------------------
  300. # Spawner(LoggingConfigurable) configuration
  301. #------------------------------------------------------------------------------
  302. ## Base class for spawning single-user notebook servers.
  303. #
  304. # Subclass this, and override the following methods:
  305. #
  306. # - load_state - get_state - start - stop - poll
  307. #
  308. # As JupyterHub supports multiple users, an instance of the Spawner subclass is
  309. # created for each user. If there are 20 JupyterHub users, there will be 20
  310. # instances of the subclass.
  311. ## Extra arguments to be passed to the single-user server.
  312. #
  313. # Some spawners allow shell-style expansion here, allowing you to use
  314. # environment variables here. Most, including the default, do not. Consult the
  315. # documentation for your spawner to verify!
  316. #c.Spawner.args = []
  317. ## The command used for starting the single-user server.
  318. #
  319. # Provide either a string or a list containing the path to the startup script
  320. # command. Extra arguments, other than this path, should be provided via `args`.
  321. #
  322. # This is usually set if you want to start the single-user server in a different
  323. # python environment (with virtualenv/conda) than JupyterHub itself.
  324. #
  325. # Some spawners allow shell-style expansion here, allowing you to use
  326. # environment variables. Most, including the default, do not. Consult the
  327. # documentation for your spawner to verify!
  328. #c.Spawner.cmd = ['jupyterhub-singleuser']
  329. ## Minimum number of cpu-cores a single-user notebook server is guaranteed to
  330. # have available.
  331. #
  332. # If this value is set to 0.5, allows use of 50% of one CPU. If this value is
  333. # set to 2, allows use of up to 2 CPUs.
  334. #
  335. # Note that this needs to be supported by your spawner for it to work.
  336. #c.Spawner.cpu_guarantee = None
  337. ## Maximum number of cpu-cores a single-user notebook server is allowed to use.
  338. #
  339. # If this value is set to 0.5, allows use of 50% of one CPU. If this value is
  340. # set to 2, allows use of up to 2 CPUs.
  341. #
  342. # The single-user notebook server will never be scheduled by the kernel to use
  343. # more cpu-cores than this. There is no guarantee that it can access this many
  344. # cpu-cores.
  345. #
  346. # This needs to be supported by your spawner for it to work.
  347. #c.Spawner.cpu_limit = None
  348. ## Enable debug-logging of the single-user server
  349. #c.Spawner.debug = False
  350. ## The URL the single-user server should start in.
  351. #
  352. # `{username}` will be expanded to the user's username
  353. #
  354. # Example uses:
  355. #
  356. # - You can set `notebook_dir` to `/` and `default_url` to `/tree/home/{username}` to allow people to
  357. # navigate the whole filesystem from their notebook server, but still start in their home directory.
  358. # - Start with `/notebooks` instead of `/tree` if `default_url` points to a notebook instead of a directory.
  359. # - You can set this to `/lab` to have JupyterLab start by default, rather than Jupyter Notebook.
  360. #c.Spawner.default_url = ''
  361. ## Disable per-user configuration of single-user servers.
  362. #
  363. # When starting the user's single-user server, any config file found in the
  364. # user's $HOME directory will be ignored.
  365. #
  366. # Note: a user could circumvent this if the user modifies their Python
  367. # environment, such as when they have their own conda environments / virtualenvs
  368. # / containers.
  369. #c.Spawner.disable_user_config = False
  370. ## Whitelist of environment variables for the single-user server to inherit from
  371. # the JupyterHub process.
  372. #
  373. # This whitelist is used to ensure that sensitive information in the JupyterHub
  374. # process's environment (such as `CONFIGPROXY_AUTH_TOKEN`) is not passed to the
  375. # single-user server's process.
  376. #c.Spawner.env_keep = ['PATH', 'PYTHONPATH', 'CONDA_ROOT', 'CONDA_DEFAULT_ENV', 'VIRTUAL_ENV', 'LANG', 'LC_ALL']
  377. ## Extra environment variables to set for the single-user server's process.
  378. #
  379. # Environment variables that end up in the single-user server's process come from 3 sources:
  380. # - This `environment` configurable
  381. # - The JupyterHub process' environment variables that are whitelisted in `env_keep`
  382. # - Variables to establish contact between the single-user notebook and the hub (such as JUPYTERHUB_API_TOKEN)
  383. #
  384. # The `enviornment` configurable should be set by JupyterHub administrators to
  385. # add installation specific environment variables. It is a dict where the key is
  386. # the name of the environment variable, and the value can be a string or a
  387. # callable. If it is a callable, it will be called with one parameter (the
  388. # spawner instance), and should return a string fairly quickly (no blocking
  389. # operations please!).
  390. #
  391. # Note that the spawner class' interface is not guaranteed to be exactly same
  392. # across upgrades, so if you are using the callable take care to verify it
  393. # continues to work after upgrades!
  394. #c.Spawner.environment = {}
  395. ## Timeout (in seconds) before giving up on a spawned HTTP server
  396. #
  397. # Once a server has successfully been spawned, this is the amount of time we
  398. # wait before assuming that the server is unable to accept connections.
  399. #c.Spawner.http_timeout = 30
  400. ## The IP address (or hostname) the single-user server should listen on.
  401. #
  402. # The JupyterHub proxy implementation should be able to send packets to this
  403. # interface.
  404. #c.Spawner.ip = ''
  405. ## Minimum number of bytes a single-user notebook server is guaranteed to have
  406. # available.
  407. #
  408. # Allows the following suffixes:
  409. # - K -> Kilobytes
  410. # - M -> Megabytes
  411. # - G -> Gigabytes
  412. # - T -> Terabytes
  413. #
  414. # This needs to be supported by your spawner for it to work.
  415. #c.Spawner.mem_guarantee = None
  416. ## Maximum number of bytes a single-user notebook server is allowed to use.
  417. #
  418. # Allows the following suffixes:
  419. # - K -> Kilobytes
  420. # - M -> Megabytes
  421. # - G -> Gigabytes
  422. # - T -> Terabytes
  423. #
  424. # If the single user server tries to allocate more memory than this, it will
  425. # fail. There is no guarantee that the single-user notebook server will be able
  426. # to allocate this much memory - only that it can not allocate more than this.
  427. #
  428. # This needs to be supported by your spawner for it to work.
  429. #c.Spawner.mem_limit = None
  430. ## Path to the notebook directory for the single-user server.
  431. #
  432. # The user sees a file listing of this directory when the notebook interface is
  433. # started. The current interface does not easily allow browsing beyond the
  434. # subdirectories in this directory's tree.
  435. #
  436. # `~` will be expanded to the home directory of the user, and {username} will be
  437. # replaced with the name of the user.
  438. #
  439. # Note that this does *not* prevent users from accessing files outside of this
  440. # path! They can do so with many other means.
  441. #c.Spawner.notebook_dir = ''
  442. ## An HTML form for options a user can specify on launching their server.
  443. #
  444. # The surrounding `<form>` element and the submit button are already provided.
  445. #
  446. # For example:
  447. #
  448. # .. code:: html
  449. #
  450. # Set your key:
  451. # <input name="key" val="default_key"></input>
  452. # <br>
  453. # Choose a letter:
  454. # <select name="letter" multiple="true">
  455. # <option value="A">The letter A</option>
  456. # <option value="B">The letter B</option>
  457. # </select>
  458. #
  459. # The data from this form submission will be passed on to your spawner in
  460. # `self.user_options`
  461. #c.Spawner.options_form = ''
  462. ## Interval (in seconds) on which to poll the spawner for single-user server's
  463. # status.
  464. #
  465. # At every poll interval, each spawner's `.poll` method is called, which checks
  466. # if the single-user server is still running. If it isn't running, then
  467. # JupyterHub modifies its own state accordingly and removes appropriate routes
  468. # from the configurable proxy.
  469. #c.Spawner.poll_interval = 30
  470. ## The port for single-user servers to listen on.
  471. #
  472. # Defaults to `0`, which uses a randomly allocated port number each time.
  473. #
  474. # If set to a non-zero value, all Spawners will use the same port, which only
  475. # makes sense if each server is on a different address, e.g. in containers.
  476. #
  477. # New in version 0.7.
  478. #c.Spawner.port = 0
  479. ## An optional hook function that you can implement to do some bootstrapping work
  480. # before the spawner starts. For example, create a directory for your user or
  481. # load initial content.
  482. #
  483. # This can be set independent of any concrete spawner implementation.
  484. #
  485. # Example::
  486. #
  487. # from subprocess import check_call
  488. # def my_hook(spawner):
  489. # username = spawner.user.name
  490. # check_call(['./examples/bootstrap-script/bootstrap.sh', username])
  491. #
  492. # c.Spawner.pre_spawn_hook = my_hook
  493. #c.Spawner.pre_spawn_hook = None
  494. ## Timeout (in seconds) before giving up on starting of single-user server.
  495. #
  496. # This is the timeout for start to return, not the timeout for the server to
  497. # respond. Callers of spawner.start will assume that startup has failed if it
  498. # takes longer than this. start should return when the server process is started
  499. # and its location is known.
  500. #c.Spawner.start_timeout = 60
  501. c.DockerSpawner.container_ip = '0.0.0.0'
  502. c.DockerSpawner.hub_ip_connect = '{{ hub_ip_for_notebooks }}'
  503. c.DockerSpawner.use_internal_ip = False
  504. c.DockerSpawner.host_ip = "0.0.0.0"
  505. c.DockerSpawner.container_image = os.environ['USER_IMAGE']
  506. # We want to remove containers when the user logs out to preserve resources and to prevent stale access tokens from being
  507. # reused when they log back in.
  508. c.DockerSpawner.remove_containers = True
  509. #c.DockerSpawner.remove_containers = False
  510. c.Spawner.http_timeout = 90
  511. #------------------------------------------------------------------------------
  512. # LocalProcessSpawner(Spawner) configuration
  513. #------------------------------------------------------------------------------
  514. ## A Spawner that uses `subprocess.Popen` to start single-user servers as local
  515. # processes.
  516. #
  517. # Requires local UNIX users matching the authenticated users to exist. Does not
  518. # work on Windows.
  519. #
  520. # This is the default spawner for JupyterHub.
  521. ## Seconds to wait for single-user server process to halt after SIGINT.
  522. #
  523. # If the process has not exited cleanly after this many seconds, a SIGTERM is
  524. # sent.
  525. #c.LocalProcessSpawner.interrupt_timeout = 10
  526. ## Seconds to wait for process to halt after SIGKILL before giving up.
  527. #
  528. # If the process does not exit cleanly after this many seconds of SIGKILL, it
  529. # becomes a zombie process. The hub process will log a warning and then give up.
  530. #c.LocalProcessSpawner.kill_timeout = 5
  531. ## Extra keyword arguments to pass to Popen
  532. #
  533. # when spawning single-user servers.
  534. #
  535. # For example::
  536. #
  537. # popen_kwargs = dict(shell=True)
  538. #c.LocalProcessSpawner.popen_kwargs = {}
  539. ## Seconds to wait for single-user server process to halt after SIGTERM.
  540. #
  541. # If the process does not exit cleanly after this many seconds of SIGTERM, a
  542. # SIGKILL is sent.
  543. #c.LocalProcessSpawner.term_timeout = 5
  544. #------------------------------------------------------------------------------
  545. # Authenticator(LoggingConfigurable) configuration
  546. #------------------------------------------------------------------------------
  547. ## Base class for implementing an authentication provider for JupyterHub
  548. ## Set of users that will have admin rights on this JupyterHub.
  549. #
  550. # Admin users have extra privileges:
  551. # - Use the admin panel to see list of users logged in
  552. # - Add / remove users in some authenticators
  553. # - Restart / halt the hub
  554. # - Start / stop users' single-user servers
  555. # - Can access each individual users' single-user server (if configured)
  556. #
  557. # Admin access should be treated the same way root access is.
  558. #
  559. # Defaults to an empty set, in which case no user has admin access.
  560. #c.Authenticator.admin_users = set()
  561. ## Automatically begin the login process
  562. #
  563. # rather than starting with a "Login with..." link at `/hub/login`
  564. #
  565. # To work, `.login_url()` must give a URL other than the default `/hub/login`,
  566. # such as an oauth handler or another automatic login handler, registered with
  567. # `.get_handlers()`.
  568. #
  569. # .. versionadded:: 0.8
  570. #c.Authenticator.auto_login = False
  571. ## Enable persisting auth_state (if available).
  572. #
  573. # auth_state will be encrypted and stored in the Hub's database. This can
  574. # include things like authentication tokens, etc. to be passed to Spawners as
  575. # environment variables.
  576. #
  577. # Encrypting auth_state requires the cryptography package.
  578. #
  579. # Additionally, the JUPYTERHUB_CRYPTO_KEY envirionment variable must contain one
  580. # (or more, separated by ;) 32B encryption keys. These can be either base64 or
  581. # hex-encoded.
  582. #
  583. # If encryption is unavailable, auth_state cannot be persisted.
  584. #
  585. # New in JupyterHub 0.8
  586. #c.Authenticator.enable_auth_state = False
  587. ## Dictionary mapping authenticator usernames to JupyterHub users.
  588. #
  589. # Primarily used to normalize OAuth user names to local users.
  590. #c.Authenticator.username_map = {}
  591. ## Regular expression pattern that all valid usernames must match.
  592. #
  593. # If a username does not match the pattern specified here, authentication will
  594. # not be attempted.
  595. #
  596. # If not set, allow any username.
  597. #c.Authenticator.username_pattern = ''
  598. ## Whitelist of usernames that are allowed to log in.
  599. #
  600. # Use this with supported authenticators to restrict which users can log in.
  601. # This is an additional whitelist that further restricts users, beyond whatever
  602. # restrictions the authenticator has in place.
  603. #
  604. # If empty, does not perform any additional restriction.
  605. #c.Authenticator.whitelist = set()
  606. #------------------------------------------------------------------------------
  607. # LocalAuthenticator(Authenticator) configuration
  608. #------------------------------------------------------------------------------
  609. ## Base class for Authenticators that work with local Linux/UNIX users
  610. #
  611. # Checks for local users, and can attempt to create them if they exist.
  612. ## The command to use for creating users as a list of strings
  613. #
  614. # For each element in the list, the string USERNAME will be replaced with the
  615. # user's username. The username will also be appended as the final argument.
  616. #
  617. # For Linux, the default value is:
  618. #
  619. # ['adduser', '-q', '--gecos', '""', '--disabled-password']
  620. #
  621. # To specify a custom home directory, set this to:
  622. #
  623. # ['adduser', '-q', '--gecos', '""', '--home', '/customhome/USERNAME', '--
  624. # disabled-password']
  625. #
  626. # This will run the command:
  627. #
  628. # adduser -q --gecos "" --home /customhome/river --disabled-password river
  629. #
  630. # when the user 'river' is created.
  631. #c.LocalAuthenticator.add_user_cmd = []
  632. ## If set to True, will attempt to create local system users if they do not exist
  633. # already.
  634. #
  635. # Supports Linux and BSD variants only.
  636. #c.LocalAuthenticator.create_system_users = False
  637. ## Whitelist all users from this UNIX group.
  638. #
  639. # This makes the username whitelist ineffective.
  640. #c.LocalAuthenticator.group_whitelist = set()
  641. #------------------------------------------------------------------------------
  642. # PAMAuthenticator(LocalAuthenticator) configuration
  643. #------------------------------------------------------------------------------
  644. ## Authenticate local UNIX users with PAM
  645. ## The text encoding to use when communicating with PAM
  646. #c.PAMAuthenticator.encoding = 'utf8'
  647. ## Whether to open a new PAM session when spawners are started.
  648. #
  649. # This may trigger things like mounting shared filsystems, loading credentials,
  650. # etc. depending on system configuration, but it does not always work.
  651. #
  652. # If any errors are encountered when opening/closing PAM sessions, this is
  653. # automatically set to False.
  654. #c.PAMAuthenticator.open_sessions = True
  655. ## The name of the PAM service to use for authentication
  656. #c.PAMAuthenticator.service = 'login'
  657. #------------------------------------------------------------------------------
  658. # CryptKeeper(SingletonConfigurable) configuration
  659. #------------------------------------------------------------------------------
  660. ## Encapsulate encryption configuration
  661. #
  662. # Use via the encryption_config singleton below.
  663. ##
  664. #c.CryptKeeper.keys = []
  665. ## The number of threads to allocate for encryption
  666. #c.CryptKeeper.n_threads = 8