Most int traits are now Integers
Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:
Integer(4L) => 4
Long(4) => 4L
closes gh-942, closes gh-996.
Rebased to avoid recursive merge for just one commit.
Add hashing of passwords to notebook configuration.
From now on, we do NOT support plain text passwords in the notebook configuration file, only hashed ones.
To create a properly hashed password, you can use `IPython.lib.security.passwd()`.
Written with Mateusz Paprocki (@mattpap at github).
Websocket fixes:
1. alert client on failed and lost web socket connections
A long message is given if the connection fails within 1s, which assumes the connection did not succeed. Otherwise, it is a short 'connection closed unexpectedly'.
This also means that clients are notified on server termination (for better or worse).
2. remove superfluous ws-hostname parameter from notebook
This made the notebook server artificially and unnecessarily brittle against tunneling and explicit hostname resolution. Now, the ws_url is defined based on the Origin of the request for the url, so it always matches the http[s] url. This means that it will follow the same tunnel, and the hostname will be already resolved. Resolving the hostname twice makes no sense at all unless the websockets are going to a different server than the http requests.
Implemented as a property, so it should still be easy to change for future cases where it might behave differently (e.g. websockets on a different host, or at a non-root url).
Split likely multiline text when writing JSON notebooks, and reduce indentation in the JSON file to 1 space per level.
These changes are aimed at making the notebook files more friendly to use in version-control environments. With multiline blocks split as lines, diffs will be much more readable (version control systems think in terms of lines as their atomic unit). And reducing the amount of indentation will also make code blocks easier to read without unnecessary scrolling.
A long message is given if the connection fails within 1s. Otherwise, it is a short 'connection closed unexpectedly'.
This also means that clients are notified on server termination.
This made the notebook server artificially and unnecessarily brittle to tunneling, and non-local hostname resolution. The ws_url is now defined based on the Origin of the request. This allows tunneled hosts and ports to preserve connections, as the ws_url always matches the one in use by the client.
Implemented as a property, to facilitate future cases where it might behave differently.
Add directory for startup files, enabling users to add local configuration more simply without having to know how the config system works much at all.
Now, `profile/startup` dir is checked for files, and they are run prior to explicit exec_code and exec_files.
A short README is added to the dir explaining how they work, and a short paragraph is added to the docs, in both the interactive tutorial and config overview.
Monkeypatch Tornado 2.1.{0, 1} so it works with Google Chrome 16.
This uses a fix from Tornado itself that's just a protocol number check, no actual protocol handling code is necessary.
The notebook now supports a `--read-only` flag, which allows users to view all notebooks being served but not to edit them or execute any code. These actions are not allowed and the buttons, shortcuts, etc. are removed, but the requests will raise authentication errors if they manage to send the events anyway. Save/print functions remain available.
This flag can be used in two modes:
1. When running an unauthenticated server, one can run a *second* read-only server in the same directory on a public IP address. This will let users connect to the read-only view without having to worry about configuring passwords and certificates for the execution server.
2. When running a server configured with authentication (and hopefully an SSL certificate), starting it with `--read-only` allows unauthenticated users read-only access to notebooks. This means that the same server on a single port can be both used by authenticated users for execution and by the public for viewing the available notebooks.
Show invalid config message on TraitErrors during initialization.
implemented via `@catch_config` decorator
Now, the event that was triggered by invalid app config (see `--log-level 5`) is triggered by bad config at any point during initialization.
This *will* catch TraitError-raising bugs in IPython itself, but only during initialization.
Also, deregister crash handler on use to avoid it being triggered recursively/repeatedly.
If a user has Chrome set as their default browser (system-wide or via
the `BROWSER` environment variable), opening the notebook hangs
because the chrome call doesn't return immediately. This solves the
issue by opening the browser in a thread.
Note that there remains an issue where killing the notebook will kill
Chrome if the Chrome session was started by us. I haven't found a way
to work around that despite attempts by making the webbrowser.open()
call in a subprocess.
When using a password, read-only mode allows unauthenticated users
read-only access to notebooks. Editing, execution, etc. are not
allowed in read-only mode, but save/print functions are available.
No kernels are started until an authenticated user opens a notebook.
implemented via @catch_config decorator
Now, the event that was triggered by invalid app config (see `--log-level 5`) is triggered by bad config at any point during initialization.
This *will* catch TraitError bugs in IPython itself, but only during initialization.
closes gh-908
The History will always appear empty, so history magics, etc. don't do anything. Readline history for a single session works fine.
Test suite should now pass without sqlite