Here is how to get a local test server running:
- Install Meteor:
curl https://install.meteor.com/ | sh
on UNIX,choco install meteor
on Windows (in administrator command prompt after installing Chocolatey) - Download Coauthor:
git clone https://github.com/edemaine/coauthor.git
- Run meteor:
cd coauthor
meteor npm install
meteor
- Make a superuser account:
-
Open the website http://localhost:3000/
-
Create an account
-
meteor mongo
-
Give your account permissions as follows:
meteor:PRIMARY> db.users.update({username: 'edemaine'}, {$set: {'roles.*': ['read', 'post', 'edit', 'super', 'admin']}}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
*
means all groups, so this user gets all permissions globally.
-
To deploy to a public server, we recommend deploying from a development machine via meteor-up. Installation instructions:
- Install Meteor and download Coauthor as above.
- Install
mup
vianpm install -g mup
(after installing Node and thus NPM). - Edit
.deploy/mup.js
to point to your SSH key (for accessing the server), your SSL certificate (for an https server), and your SMTP server in theMAIL_URL
environment variable (for sending email notifications — to run a local SMTP server, see below, and use e.g.smtp://yourhostname.org:25/
). [smtp://localhost:25/
may not work because of mup's use of docker.] If you want the "From" address in email notifications to be something other than coauthor@deployed-host-name, set theMAIL_FROM
variable. - Edit
settings.json
to set the server's timezone (used as the default email notification timezone for all users). cd .deploy
mup setup
to install all necessary software on the servermup deploy
each time you want to deploy code to server (initially and after eachgit pull
)- If you proxy the resulting server from another web server,
you'll probably want to
meteor remove force-ssl
to remove the automatic redirection fromhttp
tohttps
.
You'll also need an SMTP server to send email notifications. Make sure that your server has both DNS (hostname to IP mapping) and reverse DNS (PTR) (IP to hostname mapping), and that these point to each other. Otherwise, many mail servers (such as MIT's) will not accept email sent by the server.
If you're using Postfix, modify the /etc/postfix/main.cf
configuration as
follows (substituting your own hostname):
-
Set
myhostname = yourhostname.com
-
Add
, $myhostname
tomydestination
-
Add
172.17.0.0/16
tomynetworks
:mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.17.0.0/16
Set the MAIL_FROM
environment variable (in .deploy/mup.js
) to the
return email address (typically [email protected]
) you'd like
notifications sent from.
If you want [email protected]
to receive email,
add an alias like coauthor: [email protected]
to /etc/aliases
and then run sudo newaliases
.
To monitor server performance, you can install an
open-source Kadira server,
and set the KADIRA_OPTIONS_ENDPOINT
environment variable in .deploy/mup.js
.
To get open-source Kadira running (on a different server), I recommend kadira-compose.
All of Coauthor's data (including messages, history, and file uploads)
is stored in the Mongo database (which is part of Meteor).
You probably want to do regular (e.g. daily) dump backups.
There's a script in .backup
that I use to dump the database,
copy to the development machine, and upload to Dropbox or other cloud storage
via rclone.
mup
's MongoDB stores data in /var/lib/mongodb
. MongoDB prefers an XFS
filesystem, so you might want to
create an XFS filesystem
and mount or link it there.
(For example, I have mounted an XFS volume at /data
and linked via
ln -s /data/mongodb /var/lib/mongodb
).
mup
also, by default, makes the MongoDB accessible to any user on the
deployed machine. This is a security hole: make sure that there aren't any
user accounts on the deployed machine.
But it is also useful for manual database inspection and/or manipulation.
Install MongoDB client
tools,
run mongo coauthor
(or mongo
then use coauthor
) and you can directly
query or update the collections. (Start with show collections
, then
e.g. db.messages.find()
.)
On a test server, you can run meteor mongo
to get the same interface.
Instructions for building the Coauthor Android app (not yet functional):
- Install Android Studio;
add
gradle/gradle-N.N/bin
,jre/bin
,AppData/local/android/sdk/build-tools/26.0.2
to PATH keytool -genkey -alias coauthor -keyalg RSA -keysize 2048 -validity 10000
(if you don't already have a key for the app)meteor build ../build --server=https://coauthor.csail.mit.edu
cd ../build/android
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 release-unsigned.apk coauthor
zipalign -f 4 release-unsigned.apk coauthor.apk
To install bcrypt
on Windows (to avoid warnings about it missing), install
windows-build-tools
via npm install --global --production windows-build-tools
, and
then run meteor npm install bcrypt
.