wiki:ethercalc

Version 3 (modified by Jamie McClelland, 7 years ago) (diff)

--

Maintaining ethercalc

We are running ethercalc (a spreadsheet/wiki web software) at https://calc.mayfirst.org/.

It depends on node.js.

It was installed by running, as the calc user on mchesney (and in the /home/calc):

npm install ethercalc

That created a directory structure in /home/calc/node_modules.

The init script is handled by runit and is located in /etc/sv/ethercalc. The run file is:

#!/bin/bash

exec 2>&1
exec chpst -e ./env -u calc:calc /usr/bin/nodejs /home/calc/node_modules/ethercalc/bin/ethercalc --keyfile /home/calc/keys/calc.mayfirst.org.key --certfile /home/calc/keys/calc.mayfirst.org.crt --basepath https://calc.mayfirst.org:8000

And in the env directory, there is a file called NODE_ENV with the contents: production

We running apache which passed through traffic to ethercalc. The apache file (in site-enabled) has the following content:

<VirtualHost 209.234.253.233:443>
        # web config for calc.mayfirst.org
        ServerName calc.mayfirst.org
        # ServerAlias www.calc.mayfirst.org

        <Proxy *>
          Order deny,allow
          Allow from all
        </Proxy>

        #SSL Stuff
        SSLEngine On
        SSLProxyEngine On
        SSLCertificateFile /home/calc/keys/calc.mayfirst.org.apache.crt
        SSLCertificateKeyFile /home/calc/keys/calc.mayfirst.org.key
        SSLCertificateChainFile /home/calc/keys/calc.mayfirst.org.apache.intermediate.crt

        ProxyPreserveHost On
        ProxyRequests off
        ProxyPass / https://calc.mayfirst.org:8000/
        ProxyPassReverse / https://calc.mayfirst.org:8000/
</VirtualHost>

To update to the latest version of ethercalc, run the following command in /home/calc as the ethercalc user:

npm update

Then, restart ethercalc (as root):

sv restart ethercalc

Note: the current version of ethercalc only works because of a patch described here. If updated, you may need to edit the specified file by hand.