Skip to content
This repository

Node.js port of Multi-user SocialCalc

branch: master
Octocat-spinner-32 .dotcloud * Add .dotclout/config. November 11, 2012
Octocat-spinner-32 bin * Add ethercalc binary wrapper. April 06, 2012
Octocat-spinner-32 images * Add icons from infojunkie July 03, 2012
Octocat-spinner-32 nginx * Rename share.png to export.png to avoid AdBlock February 25, 2014
Octocat-spinner-32 src * Fix PUT SC format, thx isacl++ April 16, 2014
Octocat-spinner-32 static * Sketch of XLSX and CSV import March 14, 2014
Octocat-spinner-32 third-party * Initial commit for Stackato Sample App Contest. August 20, 2011
Octocat-spinner-32 Changes.txt * Initial commit for Stackato Sample App Contest. August 20, 2011
Octocat-spinner-32 Dockerfile * Now build Dockerfile from dockerfile/nodejs March 17, 2014
Octocat-spinner-32 LEGAL.txt * Incorporated charting framework from OLPC Sugar into player.coffee. April 21, 2012
Octocat-spinner-32 LICENSE.txt * Initial commit for Stackato Sample App Contest. August 20, 2011
Octocat-spinner-32 Makefile * Implement menu option to export to CSV. February 12, 2014
Octocat-spinner-32 README.mkdn * Sketch of XLSX and CSV import March 14, 2014
Octocat-spinner-32 SocialCalcModule.js * Various wheel and onunload tweaks May 04, 2013
Octocat-spinner-32 _start * Detect PK* March 14, 2014
Octocat-spinner-32 app.js * --expire flag as proposed and sponsored by @axfelix. October 04, 2013
Octocat-spinner-32 db.js * Fix #79. Thanks @lawrencek-phasespace! January 25, 2014
Octocat-spinner-32 dotcloud.js * Regen with LiveScript 1.2.0 August 03, 2013
Octocat-spinner-32 dotcloud.yml use node 0.8.x for dotcloud September 09, 2012
Octocat-spinner-32 exports.js * Implement setTimeout in terms of .nextTick. November 03, 2012
Octocat-spinner-32 formatnumber2.js * Sync up with infojunkie/socialcalc July 01, 2012
Octocat-spinner-32 formula1.js * Support column-only ranges such as =SUM(A:A) for @artem. February 17, 2013
Octocat-spinner-32 index.html * Implement menu option to export to CSV. February 12, 2014
Octocat-spinner-32 main.js * Fix PUT SC format, thx isacl++ April 16, 2014
Octocat-spinner-32 manifest.appcache * Bump appcache again April 15, 2014
Octocat-spinner-32 package.json * 0.20140416.0 April 16, 2014
Octocat-spinner-32 package.json.ls * 0.20140416.0 April 16, 2014
Octocat-spinner-32 player-broadcast.js * Regen with LiveScript 1.2.0 August 03, 2013
Octocat-spinner-32 player-graph.js * Regen with LiveScript 1.2.0 August 03, 2013
Octocat-spinner-32 player.js * Implement menu option to export to CSV. February 12, 2014
Octocat-spinner-32 privacy.png * Add ToS & Privacy Policy of ethercalc.org February 25, 2014
Octocat-spinner-32 requirements.txt * Initial commit for Stackato Sample App Contest. August 20, 2011
Octocat-spinner-32 sc.js * Remove duplicated class Node definition. (#71) October 07, 2013
Octocat-spinner-32 server.js * First try at deploying to Joyent. September 15, 2011
Octocat-spinner-32 socialcalc-3.js * Support column-only ranges such as =SUM(A:A) for @artem. February 17, 2013
Octocat-spinner-32 socialcalcconstants.js * Workaround #37 by making row count overflow to the left. February 17, 2013
Octocat-spinner-32 socialcalcpopup.js * Sync up with infojunkie/socialcalc July 01, 2012
Octocat-spinner-32 socialcalcspreadsheetcontrol.js * Sync up with infojunkie/socialcalc July 01, 2012
Octocat-spinner-32 socialcalctableeditor.js * Various wheel and onunload tweaks May 04, 2013
Octocat-spinner-32 socialcalcviewer.js * Sync up with infojunkie/socialcalc July 01, 2012
Octocat-spinner-32 stackato.yml * s/MeetingCalc/EtherCalc/g August 29, 2011
Octocat-spinner-32 start.html * Detect PK* March 14, 2014
Octocat-spinner-32 supervisord.conf app.coffee no longer exists September 09, 2012
README.mkdn

EtherCalc

Installation

For global installation (may need root)

npm i -g ethercalc
ethercalc

For local non-root installation

npm i
make

Or install with our Docker image, which comes with a built-in Redis server and webworker-threads support:

# Runs at port 6967
sudo docker run -d -p 6967:6967 -v /var/lib/redis:/redis:rw audreyt/ethercalc

# Runs at another port, for example 8080
sudo docker run -d -p 8080:6967 -v /var/lib/redis:/redis:rw audreyt/ethercalc

Note the use of -v flag to store the Redis database in /var/lib/redis on the host server. In Docker versions 0.4.x, the flag was called -b instead.

REST API

Note that POST endpoints accept only application/json requests, and will reject regular form posts.

GET /_/page

Fetch the page as a serialization in SocialCalc save format.

PUT /_/page

Replaces the page with a serialization in SocialCalc save format.

Also takes a CSV structure that contains the new spreadsheet's content.

POST /_

Takes a JSON structure with room and snapshot fields.

Replaces the page with a serialization in Socialtext save format. If room is not specified, returns a new page.

Also takes a CSV structure that contains the new spreadsheet's content.

POST /_/page

Takes a JSON structure with a command field (either as a string or an array of strings), or a plain-text command string.

Runs one or more commands specified in the command field.

Also takes a CSV structure that contains fields to be appended to the first column after the last row.

GET /_/page/cells

Returns a JSON representation of all defined cells in the page.

GET /_/page/cells/A1

Returns a JSON representation of a single cell in the page.

GET /_/page/html

Returns a HTML rendering of the page. (GET /page.html also works.)

GET /_/page/csv

Returns a CSV rendering of the page. (GET /page.csv also works.)

Flags

Using SSL: --keyfile / --certfile

openssl genrsa -out ethercalc-key.pem 1024
openssl req -new -key ethercalc-key.pem -out certrequest.csr
openssl x509 -req -in certrequest.csr -signkey ethercalc-key.pem -out ethercalc-cert.pem
ethercalc --keyfile ethercalc-key.pem --certfile ethercalc-cert.pem

Prefers polling over Websocket: --polling

Useful when running behind a proxy without WebSocket support.

Enable Cross-Origin Resource Sharing: --cors

Useful when setting up EtherCalc as a public REST API server.

URL Prefix: --basepath /path/prefix

Useful when running under an URL rewriter.

Access Control: --key secret

Offers read-write vs. read-only modes. See issues #1 and #4 for details on setting this up.

Disable server-side WebWorkers: --vm

Runs a single-thread background loop with vm.createContext instead of webworker-threads.

Useful for running custom functions in server side that requires full VM access.

Expires inactive spreadsheets: --expire 86400

Deletes a spreadsheet's content after N seconds of inactivity. Activities include accessing with REST API as well as Web UI, including moving the active cell cursor on an opened page.

Licensing

Common Public Attribution License (Socialtext Inc.)

  • socialcalcspreadsheetcontrol.js
  • socialcalctableeditor.js
  • images/*

Artistic License 2.0 (Socialtext Inc.)

  • formatnumber2.js
  • formula1.js
  • socialcalc-3.js
  • socialcalcconstants.js
  • socialcalcpopup.js

MIT License (John Resig, The Dojo Foundation)

  • static/jquery.js

MIT License (HubSpot, Inc.)

  • static/vex-theme-flat-attack.css
  • static/vex.combined.min.js
  • static/vex.css

MIT License (Stuart Knightley, David Duponchel, Franz Buchinger, Ant'onio Afonso)

  • static/jszip.js

Apache License 2.0 (SheetJS)

  • static/shim.js
  • static/xlsx.js
  • static/xlsxworker.js

CC0 Public Domain (唐鳳)

  • src/*.ls
Something went wrong with that request. Please try again.