Commit Graph

6911 Commits

Author SHA1 Message Date
Scott Sanderson
cd1695fdb6 TEST: Use a temporary file instead of a local file for test db. 2014-10-30 01:51:03 -04:00
Scott Sanderson
8cfbe9b38e DEV: Close transactions at the end of HTTP Requests.
Fixes #84
2014-10-29 17:38:24 -04:00
Min RK
ae7b92c55e get rid of cookie tokens
use single cookie_id, since cookies themselves are already unique via `set_secure_cookie`

resetting cookie_id effectively logs out all browser sessions for a given user
2014-10-28 15:01:29 -07:00
Min RK
aed3efc557 Don't need passlib + sqlalchemy_utils for hashing
we can store hash+salt ourselves.
Since we need to implement prefix filtering, etc. ourselves,
there is little benefit to adding a large dependency just for implicit hashing.
2014-10-28 14:18:32 -07: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
536b9b5e17 remove API token from spawner state
it's not needed - new tokens are created when spawners start
2014-10-27 17:29:45 -07:00
MinRK
bce2be7401 only store hashed tokens
- use PasswordType
- store first 4 bytes for filtering by prefix
  since we can't filter by equality on the hashed value.
- user.new_foo_token() returns token string, not ORM object
2014-10-27 17:29:44 -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
Min RK
db5cf9cf99 Merge pull request #79 from quantopian/unicode_errors
BUG: Fix str/unicode warnings from SQLAlchemy on python 2.
2014-10-27 08:40:44 -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
Min RK
fa7250ecc3 Merge pull request #82 from minrk/secure_cookie
use secure cookies
2014-10-26 20:26:56 -07:00
MinRK
0bd03f0861 remove cookie_secret from single-user servers
pass encrypted cookies to Hub for verification
2014-10-26 20:23:24 -07:00
MinRK
5d9f9c5a3c use secure cookies
rather than setting tokens as plain cookies
2014-10-26 19:54:26 -07:00
Min RK
65b7ce289e Merge pull request #78 from dsblank/patch-2
Same typo
2014-10-25 12:31:19 -07:00
Min RK
05fc6e5ab8 Merge pull request #77 from dsblank/patch-1
Typo on div tag
2014-10-25 12:30:32 -07:00
Doug Blank
e2170ee922 Same typo
Should be a closing div tag.
2014-10-25 08:19:16 -04:00
Doug Blank
481f934eff Typo on div tag
I believe that this div should be a ending div tag.
2014-10-25 08:16:18 -04:00
Min RK
72ecbe8dc9 Merge pull request #75 from quantopian/same_thread_sqlite_only
BUG: Only pass check_same_thread when using sqlite.
2014-10-25 00:19:44 -07:00
Scott Sanderson
d7f1d6d2aa BUG: Only pass check_same_thread when using sqlite. 2014-10-23 16:31:44 -04:00
MinRK
9e75d8248f add sudo example Dockerfile 2014-10-21 20:04:12 -07:00
MinRK
cfd884459f clarify some installation in README 2014-10-21 20:04:12 -07:00
Min RK
8c2f09f306 Merge pull request #68 from minrk/sudo-kill-2
use `sudo kill` for signaling when subprocesses are started with sudo
2014-10-21 19:03:43 -07:00
MinRK
c9331702d5 use pgrep instead of ps to get sudo pid
not sure why it behaves differently, but it does.
2014-10-21 17:33:16 -07:00
Min RK
7048f9044a Merge pull request #70 from minrk/db-fail-init
better error messages on failed db connection
2014-10-19 19:53:08 -07:00
MinRK
c037f2b804 s/singleuserapp/singleuser 2014-10-19 19:52:29 -07: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
78bc79bcb9 use sudo kill for signaling when subprocesses are started with sudo
In order for this to work, add to `/etc/sudoers`:

    HUB_USER ALL=(JUPYTER_USERS) NOPASSWD:/bin/kill
2014-10-18 23:21:26 -07:00
Min RK
4ea63c05f3 Merge pull request #65 from minrk/six
use six instead of IPython.py3compat
2014-10-18 20:21:10 -07:00
Min RK
164ab068b8 Merge pull request #67 from minrk/check-for-bower
better message on OSError due to missing bower/less
2014-10-17 16:51:18 -07:00
MinRK
ae7232f22c better message on OSError due to missing bower/less 2014-10-17 13:52:48 -07:00
MinRK
063a35bb57 test --generate-config 2014-10-15 14:52:54 -07:00
Min RK
48852fd296 Merge pull request #64 from minrk/api-token
fix inappropriate clearing of API tokens
2014-10-15 12:15:32 -07:00
MinRK
919a342770 use six instead of IPython.py3compat 2014-10-15 12:10:57 -07:00
MinRK
ed84a3e107 fix inappropriate clearing of API tokens 2014-10-15 11:27:30 -07:00
Min RK
05004d3bb7 Merge pull request #63 from minrk/wait-http
wait for HTTP servers to start accepting requests
2014-10-14 15:59:32 -07:00
MinRK
e47ba13aa1 catch OSError/socket.error waiting for HTTPErrors
catches ECONNREFUSED
2014-10-14 15:44:35 -07:00
MinRK
08fd76d1e8 wait for HTTP servers to start accepting requests
avoids error messages in the proxy when servers are slow to start.
2014-10-14 14:39:53 -07:00
Min RK
2991468a32 Merge pull request #62 from minrk/shutdown-state
adjustments to Spawner.stop
2014-10-14 11:56:24 -07:00
MinRK
58f4d39372 use debug logging during testing 2014-10-14 11:45:23 -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
d8ef6d59c1 adjustments to Spawner.stop
- call start/stop_polling outside Spawner
  (avoids need for custom spawners to reimplement)
- don't clear state when stopping Spawner
  (should enable spawners to resume)
2014-10-08 13:54:17 -07:00
Min RK
a8de3bbe8f Merge pull request #60 from minrk/master
only add current user as admin if no other admin users
2014-10-06 14:23:34 -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
Min RK
795c57d5d5 Merge pull request #59 from quantopian/fix_unicode_error
BUG: Fix unicode/str error when generating config file.
2014-10-06 12:10:28 -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
05320804c6 preserve URL when being redirected to user server 2014-10-01 14:03:44 -07:00
MinRK
6e22933c63 only look at user routes
when loading last_activity from the proxy
2014-09-26 17:30:23 -07:00
Min RK
e3dbca24c5 Merge pull request #55 from minrk/add_user_fail
raise 400 when failing to create users
2014-09-25 15:13:31 -07:00
MinRK
e07affe28f system_user_exists and add_system_user are static methods 2014-09-25 14:57:25 -07:00