Commit Graph

10645 Commits

Author SHA1 Message Date
Min RK
a69ddb6655 register contents_manager.files_handler_class directly
rather than trying to call one handler from another,
which is unreliable and can cause misbehavior.
2017-10-11 10:38:47 +02:00
Min RK
a8c6b8bab6 Fix some errors caused by raising 403 in get_current_user (#2919)
get_current_user is called in a few places that really shouldn’t raise

move the raising to `get_login_url`, which is called in `@web.authenticated`,
where we want to replace redirect logic with 403.
2017-10-10 14:43:39 -07:00
Min RK
91469d2672 allow setting token via JUPYTER_TOKEN env
more convenient for certain deployments than CLI arguments
2017-10-10 18:05:45 +02:00
Min RK
e4186c47c0 allow disabling offline message buffering
escape hatch if the new buffering is causing anyone trouble
2017-10-10 11:06:48 +02:00
Kyle Kelley
2ee51ab09f Merge pull request #2913 from gnestor/issue-2203-patch
Update viewable_extensions
2017-10-09 20:05:36 -07:00
Grant Nestor
b82ca09782 Update viewable_extensions 2017-10-09 17:36:01 -07:00
Grant Nestor
5841666647 release 5.2.0rc1 2017-10-09 14:55:34 -07:00
Kyle Kelley
5585fea392 Merge pull request #2912 from gnestor/issue-2904
Show edit shortcuts modal after shortcuts modal is hidden
2017-10-09 14:09:34 -07:00
Kyle Kelley
011270347a Merge pull request #2911 from gnestor/issue-2203
Improve Edit/View behavior
2017-10-09 14:04:47 -07:00
Grant Nestor
d537ef6350 Show edit shortcuts modal after shortcuts modal is hidden 2017-10-09 13:16:24 -07:00
Grant Nestor
2fdc5327e3 Clean up 2017-10-09 11:39:51 -07:00
Grant Nestor
cb8d88e8e5 Add viewable whitelist based on browser-supported file extensions 2017-10-09 11:39:45 -07:00
Grant Nestor
679a1a2985 Normalize inputs before comparing in item_in 2017-10-09 11:39:07 -07:00
Grant Nestor
4de3a4cc61 Default to edit if file type is unknown 2017-10-09 11:38:21 -07:00
Grant Nestor
c0b678c510 Remove editable whitelist 2017-10-09 11:34:25 -07:00
Michael Heilman
241c7e162c change cull_idle_timeout_minimum to 1 from 500 2017-10-09 13:05:15 -05:00
Thomas Kluyver
12592ef3bb The root directory of the notebook server should never be hidden (#2907)
* The root directory of the notebook server should never be hidden

Closes gh-2382

* Test that root dir is not hidden
2017-10-06 10:45:13 -07:00
Kyle Kelley
43a97807fc buffer messages when websocket connection is interrupted (#2871)
* provide some top level comments

* implement buffering of messages on last dropped connection

- buffer is per-kernel
- session_key is stored because only a single session can resume the buffer and we can't be sure
- on any new connection to a kernel, buffer is flushed.
  If session_key matches, it is replayed.
  Otherwise, it is discarded.
- buffer is an unbounded list for now

* restore actual zmq channels when resuming connection

rather than establishing new connections

fixes failure to resume shell channel

* hookup restart callbacks in open

instead of in `create_stream`, which is not called on reconnect

* improve handling of restored connections in js

- dismiss 'connection lost' dialog on reconnect
- set busy status on reconnect (if not busy, idle will come soon after via kernel_ready)
2017-10-06 09:15:06 -07:00
Min RK
9b4660fc43 Merge pull request #2753 from gabyx/master
added path to the resources metadata, the same as in from_filename(...) in nbconvert.exporters.py
2017-10-05 14:57:44 +02:00
jianzi123
de09c12980 Pull request i18n (#2804)
* ...

* ...

* ...

* add translated files in Chinese.

* Remove compiled message files

* Consolidate translations into one set of files

* Rename .pot files to .po

* Add zh-CN to list of supported languages

* Ignore compiled .mo files

* Revert a couple of unimportant changes
2017-10-02 16:02:06 -07:00
Kyle Kelley
82c33578e1 Merge pull request #2887 from jcb91/page_default_args
give Page constructor default arguments
2017-10-01 08:29:38 -07:00
Kyle Kelley
3c4c470a19 Merge pull request #2888 from jcb91/require_config
fix notebook require config to match tools/build-main
2017-10-01 08:25:26 -07:00
Josh Barnes
97d6ead5de fix notebook require config to match tools/build-main
as otherwise, any template based on page will fail to load unless
it already has its own minified js including the dependencies
2017-10-01 15:20:15 +01:00
Josh Barnes
9552fc1872 give Page constructor default arguments
for any extension template which relied on the old no-parameter formation
2017-10-01 14:26:38 +01:00
Kyle Kelley
1cdb41165f Merge pull request #2876 from SamLau95/master
Add x-xsrftoken to Access-Control-Allow-Headers
2017-09-30 16:51:16 -07:00
Kyle Kelley
099f83e11e Merge pull request #2880 from jcb91/codemirror_ruler
fix codemirror.less to match CodeMirror's expected padding layout
2017-09-30 16:36:14 -07:00
Josh Barnes
df19a51f59 fix codemirror.less to match CodeMirror's expected padding layout
fixes #2869 (I hope!)
2017-09-30 02:47:39 +01:00
Sam Lau
1c2a256add Add x-xsrftoken to Access-Control-Allow-Headers
When starting a kernel using the Jupyter Notebook Kernel API, web
browsers will automatically check for the presence of `x-xsrftoken` in
the Access-Control-Allow-Headers during the preflight CORS check
([ref][ref]).

[ref]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers

Since we didn't allow this header before, web browsers would fail the
preflight check even when the x-xsrftoken header isn't being used by the
notebook server.

This meant that running a webpage on localhost:8080 that used Javascript
to start a kernel on a notebook server running on localhost:8888 would
fail.

How I tested this commit:

1. Start a notebook server using

		jupyter notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''

2. Build the [web3](https://github.com/jupyter-widgets/ipywidgets/tree/master/examples/web3) example from ipywidgets.
3. In that directory, run `npm run host`.
4. Verify that visiting http://localhost:8080/ starts a kernel in the notebook server.
2017-09-28 15:42:41 -07:00
Kyle Kelley
b884ff9755 Merge pull request #2866 from rgbkrk/fix-dynamic-locale
load locale dynamically only when not en-us
2017-09-25 20:48:34 -07:00
Kyle Kelley
11e578f7fd load locale dynamically only when not en-us 2017-09-25 16:24:26 -07:00
Kyle Kelley
b2edf8963c Merge pull request #2853 from minrk/api-403
Update error handling on APIHandlers
2017-09-25 13:51:07 -07:00
Kyle Kelley
92354d5af2 Merge pull request #2861 from nl5887/patch-1
changed key strength to 2048 bits
2017-09-25 06:51:41 -07:00
Kyle Kelley
91addcf776 Merge pull request #2860 from minrk/jsversion
resync jsversion with Python version
2017-09-25 06:51:14 -07:00
Remco Verhoef
9b6975d137 changed key strength to 2048 bits
* using a key strength of 1024 bits is considered a bad practice
2017-09-25 13:39:20 +02:00
Kyle Kelley
63d4415edb Merge pull request #2854 from Madhu94/copy-dirty-readonly-notebook
Allow copy operation on modified, read-only notebook
2017-09-25 02:27:25 -07:00
Min RK
d59349ac15 resync jsversion with Python version
by running setup.py jsversion
2017-09-25 10:50:29 +02:00
Min RK
4467dc9f12 specify version for deprecation 2017-09-21 12:54:36 +02:00
Min RK
962c5ccd80 stop using @json_handlers 2017-09-21 12:53:51 +02:00
Min RK
ba353e20f7 use .write_error on APIHandler instead of @json_errors for JSON error messages
this is the standard tornado way to do it, and catches errors at the `prepare` stage, which method decorators do not
2017-09-21 12:03:21 +02:00
Min RK
92209228f6 raise 403 on APIHandler failed login
instead of redirecting to human login page, which can have side effects
2017-09-21 12:01:20 +02:00
Min RK
aa58dcbca4 Merge pull request #2852 from takluyver/travis-py36
Test Python 3.6 on Travis, drop 3.3
2017-09-20 19:49:48 +02:00
madhu
a5e64c3f77 fix(notebook): Allow copy operation on modified, read-only
notebooks
Should close #2541
2017-09-20 16:13:06 +05:30
Thomas Kluyver
11ba6be432 Merge pull request #2745 from gnestor/keymap-default
Make "extraKeys" consistent for notebook and editor
2017-09-20 11:22:19 +01:00
Thomas Kluyver
1ec12f7215 Test Python 3.6 on Travis, drop 3.3 2017-09-20 10:37:38 +01:00
Thomas Kluyver
39c27ac416 Merge pull request #2849 from cancan101/patch-1
Upgrade xterm.js to 2.9.2
2017-09-20 10:28:30 +01:00
Thomas Kluyver
447d79ffc0 Pass API path to get_os_path 2017-09-20 10:27:59 +01:00
Kyle Kelley
2d582e0e79 Merge pull request #2851 from minrk/fix-image-tests
avoid base64-literals in image tests
2017-09-19 11:09:51 -07:00
Min RK
ed139a1cea avoid base64-literals in image tests
use Python variables storing raw bytes
2017-09-19 18:31:56 +02:00
Alex Rothberg
132f042c88 Upgrade xterm.js to 2.9.2 2017-09-18 15:31:47 -04:00
Grant Nestor
f222978992 Remove comments 2017-09-16 07:50:29 -07:00