Commit Graph

176 Commits

Author SHA1 Message Date
Min RK
f626d2f6e5 use 127.0.0.1 instead of localhost
localhost can cause some issues on badly behaved or misconfigured systems,
and 127 seems simpler.
2016-02-03 10:30:09 +01:00
Min RK
0555ee44e7 turn on jinja autoescape
now that we are putting user content on the page
2016-01-22 16:02:51 +01:00
Min RK
b9df681115 Merge pull request #353 from minrk/try-localhost
Ensure that we can bind and connect to localhost
2016-01-20 15:37:42 +01:00
Min RK
9441fa37c5 validate usernames
via Authenticator.validate_username

base class configurable with Authenticator.username_pattern
2016-01-13 14:02:50 +01:00
Min RK
887fdaf9d3 add username normalization
Handlers call `get_authenticated_user`, which in turn calls

- authenticate
- normalize_username
- check_whitelist

get_authenticated_user shouldn't need to be overridden.

Normalization can be handled via overriding normalize_username.
2016-01-13 14:02:50 +01:00
Min RK
41ea696546 Instantiate Spawner on User init
shrinks `User.spawn` to take single argument, grants User more direct access to state.
2015-12-30 13:55:36 +01:00
Min RK
4785a1ef87 Ensure that we can bind and connect to localhost
otherwise fallback to 127.0.0.1 for defaults
2015-12-15 13:37:30 +01:00
Min RK
6f128758db move non-persisted User objects (spawner-related) off of orm.User
adds higher level User object, which handles spawning.
This object has running, spawner, etc. attributes.
2015-11-30 14:05:00 +01:00
Carl Waldbieser
91ff31f688 Change the order for handlers so that the authenticator handler is added before the default handlers. 2015-11-09 14:17:26 -05:00
Min RK
a267174a03 Remove implicit admin of launching user
instead, warn about missing admins and point to config.
2015-09-21 10:52:19 +02:00
Min RK
a451f11cd3 give Spawners a handle on the Authenticator
band-aid for spawner-authenticator pairs
2015-09-11 11:57:41 +02:00
Min RK
e866abe1a0 use thread-local properties for hub, proxy 2015-07-09 11:34:35 -05:00
Min RK
48fe642c44 use thread local db sessions
to avoid segfaults on Travis
2015-07-09 11:34:35 -05:00
Min RK
c289cdfaec remove dependency on IPython
- Standalone traitlets has been released, use it directly.
- Copy url_path_join from notebook
2015-06-22 16:02:45 -07:00
Min RK
86e31dffa5 add command traitlet
allows specifying commands as either strings or list.

This enables adding arguments to JupyterHub.proxy_cmd without breaking backward-compatibility.
2015-06-03 20:05:20 -08:00
Min RK
de40310f54 fix jupyterhub --version output 2015-05-11 10:32:46 -07:00
Tim Shawver
e5d9d136da One more place where template_path needed to be changed to template_paths 2015-04-23 12:32:59 -04:00
Scott Sanderson
1d6b16060b DEV: Make template search path configurable. 2015-04-23 11:08:32 -04:00
Min RK
5dc38b85eb reorder server init
So the Hub private interface isn't the last thing logged,
which caused lots of confusion.
2015-04-17 10:33:03 -07:00
Min RK
b30be43d22 move admin_users from JupyterHub to Authenticator 2015-04-12 14:12:02 -07:00
Min RK
637cc1a7bb split user init into two stages
- init_users populates users table
- init_spawners initializes spawner objects

only the first is needed by the token app
2015-04-08 11:47:49 -07:00
Min RK
6aae4be54d assign hub in token app
avoids AttributeError on hub if there are
users with running servers.

Don't call init_hub,
which can modify the Hub's entries in the database,
which shouldn't happen in the token command.
2015-04-08 11:06:09 -07:00
Min RK
998fc28c32 various testing cleanup
- Disable signal register during testing.
  It doesn't work in background threads.
- Fix IOLoop instance management.
  Some instances were being reused across tests.
2015-04-07 16:09:27 -07:00
Kyle Solan
80531341c0 switched app and singleuser to run under python3 by default 2015-03-31 19:54:13 +00:00
Peter Ruppel
904c848bcc Make the hub bind to address specified in hub_ip
Bug: the hub binds to all interfaces and ignores the address given in 'hub_ip'. The 'address' parameter was missing in the call http_server.listen().
2015-03-24 20:15:29 +01:00
Min RK
038aae7e0a Merge pull request #208 from minrk/log-requests
customize request logging
2015-03-24 11:54:04 -07:00
Min RK
ba81bd4a01 Merge pull request #190 from minrk/bind_url
url logging
2015-03-24 11:52:33 -07:00
Min RK
3d6a0c126f custom request logging
adapted from IPython

- demotes static page success, cache hits to debug-level
- removes auth info from log messages
- logs usernames for authenticated requests
2015-03-23 15:45:57 -07:00
Min RK
5529774c1d url logging
log the actual bind url (Server.bind_url),
rather than the connect url (Server.url),
which converts all-interfaces IPs to 'localhost'
2015-03-23 12:12:10 -07:00
Min RK
ffb2ba055a remove inappropriate argv in Hub.instance() 2015-03-23 12:06:07 -07:00
Min RK
3e89f45954 Merge pull request #197 from minrk/expire-token
expire login cookies
2015-03-23 11:51:08 -07:00
Min RK
3fb2afc2bd expire login cookies
via tornado's max_age_days mechanism

default expiry is two weeks
2015-03-17 12:56:06 -06:00
Min RK
ce45fde74a better error when proxy command isn't found 2015-03-17 11:46:12 -06:00
Min RK
4616e42ca6 die on failed startup
when init, start were made async, the eventloop would continue to run after an exception
2015-03-06 16:28:31 -08:00
Min RK
1e8f3e9448 cleanup after SIGTERM 2015-03-05 10:42:05 -08:00
Min RK
94180d1c6c Merge pull request #166 from minrk/debug-proxy
add JupyterHub.debug_proxy
2015-03-04 15:30:39 -08:00
Min RK
4f3fcb92da add JupyterHub.debug_proxy 2015-03-04 14:42:39 -08:00
Min RK
dfa8b601d1 use scoped session
doesn't actually matter for real usage,
but may help in multi-threaded tests
2015-03-04 14:14:03 -08:00
Min RK
a14fa9124a Merge pull request #157 from minrk/shutdown-without-cleanup
make shutdown of servers and proxy optional during Hub shutdown
2015-03-01 21:53:13 -08:00
Min RK
91d8a8efef cleanup_servers, _proxy helpstrings 2015-03-01 21:49:36 -08:00
Min RK
e39388f7a2 more logging during cleanup 2015-02-27 14:09:51 -08:00
Min RK
71ada39027 add /api/shutdown handler
POST /api/shutdown triggers clean shutdown.
URL parameters allow specifying whether servers and/or proxy should be cleaned up.
2015-02-27 14:09:30 -08:00
Min RK
daeb650228 add cleanup_proxy and cleanup_servers config
allows selective shutdown of just the Hub
without needing to shutdown with different signals.
2015-02-27 13:43:15 -08:00
Min RK
0439a3f79c scrub repetitive gen.py, coroutine.py frames from coroutine tracebacks
when logging exceptions
2015-02-27 13:19:18 -08:00
Scott Sanderson
228068b541 DEV: Don't override if a user has set a formatter. 2015-02-24 20:36:39 -05:00
Scott Sanderson
2a39fbe00a DEV: Allow a list of log handlers. 2015-02-23 09:51:28 -05:00
Scott Sanderson
17e4f2f2d1 DOC: Add help for extra_log_file and extra_log_handler. 2015-02-23 09:05:53 -05:00
Scott Sanderson
6fa51c770e DEV: Add support for logging to a file. 2015-02-22 22:35:18 -05:00
Min RK
088893e3dc cleanup HTTP server in JupyterHub.stop
and cleanup MockHub instance in between uses
2015-02-08 10:16:46 -08:00
Min RK
0dc3150762 add Proxy.check_routes
checks to ensure proxy table and user db are in sync

called on each last-activity check with the proxy (5 minutes)
2015-02-06 17:06:01 -08:00