GithubHelp home page GithubHelp logo

njisrawi / sagecell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sagemath/sagecell

0.0 2.0 0.0 6.48 MB

The Sage Cell Server---providing a way to embed Sage computations into any web page.

License: Other

Makefile 0.22% Python 33.11% HTML 19.80% JavaScript 35.59% CSS 9.89% PHP 0.54% Jupyter Notebook 0.56% Shell 0.28%

sagecell's Introduction

This is SageMathCell - a Sage computation web service.

Our mailing list is https://groups.google.com/forum/#!forum/sage-cell

Security Warning

If you are going to run a world accessible SageMathCell server, you must understand security implications and should be able to implement reasonable precautions.

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.

Simple Installation

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 contib/vm. In particular, system packages installed in the base container are listed here.

  1. Install requirejs:

    sudo apt-get install npm
    # On Debian based systems we need to make an alias
    sudo ln -s /usr/bin/nodejs /usr/bin/node
    sudo npm install -g requirejs
  2. Get and build Sage (export MAKE="make -j8" or something similar can speed things up):

    git clone https://github.com/sagemath/sage.git
    pushd sage
    make
    popd
  3. Prepare Sage for SageMathCell:

    sage/sage -pip install --upgrade lockfile
    sage/sage -pip install --upgrade paramiko
    sage/sage -pip install --upgrade sockjs-tornado

    Note that version 1.0.3 of sockjs-tornado has a CORS issue fixed by mrjoes/sockjs-tornado#83 You may delete these lines manually from sage/local/lib/python2.7/site-packages/sockjs/tornado/basehandler.py

  4. Build SageMathCell:

    git clone https://github.com/sagemath/sagecell.git
    pushd sagecell
    git submodule update --init --recursive
    ../sage/sage -sh -c make

Major JavaScript dependencies, including Require.js and CodeMirror.js, are copied from the Jupyter notebook bundled with SageMath.

Configuration

  1. Go into the sagecell directory (you are there in the end of the above instructions).

  2. Copy config_default.py to config.py. (Or fill config.py only with entries that you wish to change from default values.)

  3. Edit config.py according to your needs. Of particular interest are host and username entries of the _default_config 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, you’ll 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).

  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.

  5. Start the server via

    ../sage/sage web_server.py [-p <PORT_NUMBER>]

    where the default <PORT_NUMBER> is 8888 and go to http://localhost:<PORT_NUMBER> to use the Sage Cell server.

    When you want to shut down the server, press Ctrl-C in the same terminal.

License

See the LICENSE.txt file for terms and conditions for usage and a DISCLAIMER OF ALL WARRANTIES.

Browser Compatibility

SageMathCell is designed to be compatible with recent versions of:

  • Chrome
  • Firefox
  • Internet Explorer
  • Opera
  • Safari

If you notice issues with any of these browsers, please let us know.

sagecell's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.