Home

Awesome

pyxterm: Pure python websocket terminal server for term.js

Uses term.js from https://github.com/chjj/term.js

Requires the tornado web server from http://www.tornadoweb.org

Note: To be consistent with term.js, this package should have been named either term.py or tty.py, but those names are already in use. Hence the name pyxterm.

Main files

Testing

To try it out, run:

./pyxterm.py --auth_type=none --terminal

to start the server with no authentication and open a bash shell terminal.

The default URL to a create a new terminal is http://localhost:8700/new. To create a named terminal, open http://localhost:8700/terminal_name

Other authentication/shell options are

For more help information, type

./pyxterm.py -h

Google authentication

To set up the pyxterm for Google authentication:

Start the server with the command:

./pyxterm.py --auth_type=google

and use the URLs http://localhost:8700/_gauth/_info and http://localhost:8700/_gauth/_test to display setup information and test Google authentication.

Settings file

Settings may be provided in JSON format in the file .pyxterm.json in the home directory. If present, it contains information of the form:

{"google_oauth": {"key": "0123456789-code.apps.googleusercontent.com",
                  "secret": "ABCDEFABCDEF"},
 "auth_emails": ["user1@gmail.com", "user2@gmail.com"] }

auth_emails is the list of gmail accounts authorized to access the server. An empty list implies all accounts are authorized.

History and goals

The goal is to provide a simple Python terminal server for term.js using websockets, akin to tty.js.

pyxterm contains code simplified and factored out of more complex GraphTerm code (https://github.com/mitotic/graphterm), which itself used some old code from AjaxTerm

Licenses: MIT, BSD

Version: 0.10 (alpha)