Commit Graph

176 Commits

Author SHA1 Message Date
Min RK
dd01a4ba99 add common config aliases to token subcommand
and load config from the file

allows `jupyterhub token -f configfile.py [user]`
2015-02-05 21:32:48 -08:00
Min RK
f2b818e685 Merge pull request #132 from minrk/admin-access
add JupyterHub.admin_access
2015-01-31 16:48:32 -08:00
Min RK
ab23998f9c Merge pull request #143 from quantopian/non-async-add-user
DEV: Allow Authenticator.add_user to not be a future.
2015-01-30 09:45:57 -08:00
Scott Sanderson
b578e7527d DEV: Allow Authenticator.add_user to not be a future. 2015-01-30 12:30:28 -05:00
Min RK
e07fb87af8 Merge pull request #140 from minrk/logging
more info in log prefix
2015-01-29 11:46:25 -08:00
Min RK
e9c20c3f00 more info in log prefix
- include date, in addition to time
- show module:line
- put username in single-user log prefix

It's more information, making the log prefix pretty long now, but I think it makes sense,
given the number of log sources and likely duration of a JupyterHub instance.
2015-01-28 14:47:42 -08:00
Min RK
7753428dd7 cache control on static files
same principle as used in IPython,
slightly different implementation.
2015-01-28 14:21:43 -08:00
Min RK
c608e4a915 turn on xheaders
logs real IP, rather than proxy IP
2015-01-28 09:56:23 -08:00
Min RK
6b9f73ba1f add JupyterHub.admin_access
optionally allow admin users to login to user servers by visiting a special admin-only URL that sets the relevant cookie

- disabled by default
- an 'access server' button is added to the admin panel, which sets the necessary cookie to log in to the user server
2015-01-27 17:04:30 -08:00
Min RK
8cd2a55aa8 give Spawners, Authenticators db access
as self.db
2015-01-16 16:38:30 -08:00
Min RK
7c8bdc8b01 make app initialize/start async
avoids need for run_sync
2015-01-12 16:29:26 -08:00
Min RK
e21ce1c5da ensure loop is current when doing run_sync
in app startup
2015-01-12 16:26:37 -08:00
Min RK
e186b5a3a8 add_user can be async in Hub.init_users 2015-01-12 16:26:37 -08:00
Min RK
321ce54077 Merge pull request #117 from minrk/cli-token
allow creating new API tokens on the command line
2015-01-07 17:15:45 -08:00
Min RK
f7096a62fb Call Authenticator.add_user for new users at startup
Ensures consistency between users created from config and from REST API
2015-01-07 15:07:10 -08:00
Min RK
6766c662d2 init users when creating tokens 2015-01-06 15:50:53 -08:00
Min RK
00b7f47324 reduce default last-activity interval to 5 minutes
from 10 minutes
2015-01-06 15:41:41 -08:00
Min RK
0abe4653ca default to whoami for creating tokens 2015-01-06 15:41:31 -08:00
Min RK
826f07e37b allow creating new API tokens on the command line
with

    jupyterhub token [username]
2015-01-06 13:02:18 -08:00
Min RK
d125abbffe move static files to share/jupyter/hub
avoids conflict with other jupyter projects
2014-12-23 20:31:59 -08:00
Min RK
ee0be96f2c deprecate JupyterHubApp config
instead of breaking it outright
2014-11-25 21:17:49 -08:00
Min RK
fb7cc171c6 s/JupyterHubApp/JupyterHub/
users shouldn't need to know wtf Applications are
2014-11-25 19:55:24 -08:00
Min RK
3c204e6297 remove a few dangling IPythons 2014-11-25 19:28:54 -08:00
Min RK
d6c6ae2c0f add URLPrefix traitlet
ensures leading, trailing /
2014-11-21 17:44:18 -08:00
Min RK
e6335482c5 update some file names
default config file is now `jupyterhub_config.py`,
to be consistent with everything else

add config files, runtime files to .gitignore
2014-11-04 11:58:33 -08:00
Min RK
40a99e61ac drop support for old Python, IPython < 3
Require IPython >= 3.0, Python >= 3.3
2014-11-02 15:51:06 -08:00
Min RK
27e51cd0b4 Merge pull request #81 from minrk/crypto-db
hash tokens in database

closes #80
closes #83
2014-10-30 16:20:16 -07:00
Scott Sanderson
8cfbe9b38e DEV: Close transactions at the end of HTTP Requests.
Fixes #84
2014-10-29 17:38:24 -04:00
MinRK
548c404265 Don't persist proxy auth token to db
removes last need for encrypted database fields, so db_secret is removed as well.
2014-10-27 17:29:45 -07:00
MinRK
73706632d5 database security
- add files for cookie and database secrets
- store cookie secret on disk, instead of in database
- encrypt auth tokens with EncryptedType
2014-10-27 16:23:46 -07:00
Scott Sanderson
a34d514d66 BUG: Fix str/unicode warnings from SQLAlchemy on python 2.
When running with `reset_db=True` on python 2, several SQLAlchemy operations
were performed with bytes where unicode was expected, resulting in
warnings like the following.

```
/home/ssanderson/.virtualenvs/jupyterhub/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py:573:
SAWarning: Unicode type received non-unicodebind param value.
  param.append(processors[key](compiled_params[key]))
```

Fixes a few stray non-unicode literals and adds a unicode safe wrapper
for `getpass.getuser`.
2014-10-27 03:40:52 -04:00
MinRK
9f149b20f4 better error messages on failed db connection
check for file existence and write access
2014-10-19 16:24:44 -07:00
MinRK
919a342770 use six instead of IPython.py3compat 2014-10-15 12:10:57 -07:00
MinRK
a8548164cd remove Spawner.fromJSON
load state on `__init__` instead

Makes more sense now that state can persist
across server instances (e.g. docker container_id)
2014-10-14 11:44:46 -07:00
MinRK
754c9a83fc only add current user as admin if no other admin users
handles case where admin could be loaded from db
2014-10-06 12:18:35 -07:00
Scott Sanderson
b5d2efeeae BUG: Fix unicode/str error when generating config file. 2014-10-06 14:20:14 -04:00
MinRK
b24df4f104 consistent log name for tornado loggers 2014-10-03 11:04:39 -07:00
MinRK
6e22933c63 only look at user routes
when loading last_activity from the proxy
2014-09-26 17:30:23 -07:00
MinRK
0577e10276 more hooks for authenticators
Allow authenticators to:

- register custom handlers
- change login and logout URLs
- replace the entire login form

This appears to be enough to get oauth working.
2014-09-22 22:17:00 -07:00
MinRK
bb9ca0e040 store last_activity in the database
fetch it periodically (10 minutes) from the proxy
and display it on the admin page
2014-09-22 17:25:10 -07:00
MinRK
7af715864c periodically poll single-user servers
If they aren't running, unregister them
and remove them from the proxy so that future
logins are handled by the hub, and spawn new servers.
2014-09-22 16:04:17 -07:00
MinRK
2a46893448 update proxy with already-running users at startup 2014-09-21 22:50:01 -07:00
MinRK
01323833bb enable resuming Hub state from database 2014-09-21 22:50:01 -07:00
MinRK
3a0f19f1a4 cookie_secret is no longer bytes
add utils.random_hex for generating a unicode object
with random hex bytes
2014-09-21 22:44:50 -07:00
MinRK
deae294858 use 302 redirects 2014-09-21 13:45:51 -07:00
Matthias Bussonnier
d56e8b9186 fix some redirect.
login redict to home if already loged in
/hub redirect to /hub/
2014-09-21 19:56:54 +02:00
MinRK
82c06ebe98 always use transient IOLoop for run_sync 2014-09-19 17:21:55 -07:00
MinRK
58b32f634a restart the proxy if it goes down
and populate its table from the database
2014-09-18 17:04:17 -07:00
MinRK
a77e106488 move some utility functions to ORM classes
simplify handler methods
2014-09-18 15:37:39 -07:00
MinRK
97ac3ebf32 make hub-starting user admin by default 2014-09-16 16:19:15 -07:00