PageRenderTime 26ms CodeModel.GetById 39ms RepoModel.GetById 1ms app.codeStats 0ms

/README.md

https://github.com/sagemath/sagecell
Markdown | 93 lines | 63 code | 30 blank | 0 comment | 0 complexity | 754edfdd89bc3d5ab70ded5468afb7f6 MD5 | raw file
  1. This is SageMathCell - a Sage computation web service.
  2. Our mailing list is https://groups.google.com/forum/#!forum/sage-cell
  3. # Security Warning
  4. If you are going to run a world accessible SageMathCell server, you must understand security implications and should be able to implement reasonable precautions.
  5. The worker account (which is your own one by default) will be able to execute arbitrary code, which may be malicious. Make **sure** that you are securing the account properly. Working with a professional IT person is a very good idea here. Since the untrusted accounts can be on any computer, one way to isolate these accounts is to host them in a virtual machine that can be reset if the machine is compromised.
  6. # Simple Installation
  7. We assume that you have access to the Internet and can install any needed dependencies. If you need to know more precisely what tools are needed, please consult the scripts for building virtual machine images in [contrib/vm](contrib/vm).
  8. In particular, system packages installed in the base container are listed [here](https://github.com/sagemath/sagecell/blob/master/contrib/vm/container_manager.py#L58).
  9. 1. Install requirejs:
  10. ```bash
  11. sudo apt-get install npm
  12. # On Debian based systems we need to make an alias
  13. sudo ln -s /usr/bin/nodejs /usr/bin/node
  14. sudo npm install -g requirejs
  15. ```
  16. 2. Get and build Sage (`export MAKE="make -j8"` or something similar can speed things up):
  17. ```bash
  18. git clone https://github.com/sagemath/sage.git
  19. pushd sage
  20. ./bootstrap
  21. ./configure --enable-download-from-upstream-url
  22. # read messages at the end, follow instructions given there.
  23. # possibly install more system packages (using apt-get, if on Debian/Ubuntu)
  24. make
  25. popd
  26. ```
  27. 3. Prepare Sage for SageMathCell:
  28. ```bash
  29. sage/sage -pip install lockfile
  30. sage/sage -pip install paramiko
  31. sage/sage -pip install sockjs-tornado
  32. sage/sage -pip install sqlalchemy
  33. ```
  34. 4. Build SageMathCell:
  35. ```bash
  36. git clone https://github.com/sagemath/sagecell.git
  37. pushd sagecell
  38. git submodule update --init --recursive
  39. ../sage/sage -sh -c make
  40. ```
  41. Major JavaScript dependencies, including Require.js and CodeMirror.js, are [copied](https://github.com/sagemath/sagecell/blob/master/Makefile#L23) from the [Jupyter notebook](https://github.com/jupyter/notebook) bundled with SageMath.
  42. # Configuration
  43. 1. Go into the `sagecell` directory (you are there in the end of the above instructions).
  44. 2. Copy `config_default.py` to `config.py`. (Or fill `config.py` only with entries that you wish to change from default values.)
  45. 3. Edit `config.py` according to your needs. Of particular interest are `host` and `username` entries of the `provider_info` dictionary: you should be able to SSH to `username@host` *without typing in a password*. For example, by default, it assumes you can do `ssh localhost` without typing in a password. Unless you are running a private and **firewalled** server for youself, youll want to change this to a more restrictive account; otherwise **anyone will be able to execute any code under your username**. You can set up a passwordless account using SSH: type ssh passwordless login into Google to find lots of guides for doing this, like http://www.debian-administration.org/articles/152. You may also wish to adjust `db_config["uri"]` (make the database files readable *only* by the trusted account).
  46. 4. You may want to adjust `log.py` to suit your needs and/or adjust system configuration. By default logging is done via syslog which handles multiple processes better than plain files.
  47. 5. Start the server via
  48. ```bash
  49. ../sage/sage web_server.py [-p <PORT_NUMBER>]
  50. ```
  51. where the default `<PORT_NUMBER>` is `8888` and go to `http://localhost:<PORT_NUMBER>` to use the Sage Cell server.
  52. When you want to shut down the server, press `Ctrl-C` in the same terminal.
  53. # License
  54. See the [LICENSE.txt](LICENSE.txt) file for terms and conditions for usage and a
  55. DISCLAIMER OF ALL WARRANTIES.
  56. # Browser Compatibility
  57. SageMathCell is designed to be compatible with recent versions of:
  58. * Chrome
  59. * Firefox
  60. * Internet Explorer
  61. * Opera
  62. * Safari
  63. If you notice issues with any of these browsers, please let us know.