Buy Me A Coffee

Some notes on deploying Coauthor

Created: October 25, 2024   Last Modified: November 03, 2024   Category: research, linux   Print this pageBack to Home

Summary

Coauthor is a tool for group collaboration, discussion, keeping track of notes/results of meetings, and so on. To me, this looks like a nice tool to manage my research and collaboration. So I decided to purchase a domain from Namecheap (hoanganhduc.org) and a DigitalOcean Droplet (with NodeJS app installed on Ubuntu 20.04) for testing it. In particular, what I like most about this tool is the ability to write in LaTeX, which is quite convenient for math discussions.

And the result is here at https://coauthor.hoanganhduc.org/.

Note that MIT has deployed all tools in Cosuite: MIT coauthor, MIT comingle, MIT cocreate.

Point domain from Namecheap to DigitalOcean

  • I will use the subdomain coauthor.hoanganhduc.org.
  • To do so, I need to add the following records in Namecheap:
Type Host Value TTL
A Record coauthor <my_droplet_public_ipv4> Automatic
NS Record coauthor ns1.digitalocean.com Automatic
NS Record coauthor ns2.digitalocean.com Automatic
NS Record coauthor ns3.digitalocean.com Automatic
  • Wait about 30 minutes for the setting to take effect.

Configuration in the Droplet

  • I use a Droplet with 1 vCPU (Regular Intel), 1GB memory, and 25GB SSD, which costs me about $6/month ($0.009/hour). Before that, I used only 512MB memory and the deployment was interrupted by the server.
  • Access to the Droplet with ssh root@my_droplet_public_ipv4. Run as the nodejs user and delete the current running process hello by using pm2 delete hello and pm2 save.
  • Create a TLS certificate for the domain coauthor.hoanganhduc.org at Let’s Encrypt, following the instruction here. (Apparently, if you are using a network protected by FortiGuard, you may be blocked.)
  • Stop nginx with systemctl stop nginx and systemctl disable nginx.

Deploying coauthor from my PC

  • Follow this instruction for public server.
  • Some notes and issues:
    • I was unable to deploy coauthor to a subdirectory. I am able to set meteor.env.ROOT_URL in the file .deploy/mup.js to something like http://<my_droplet_public_ipv4>/coauthor and then set up the “reverse proxy” in the ngnix server by editing /etc/nginx/sites-available/default like
      server {
          listen 80 default_server;
          listen [::]:80 default_server;
      
          # SSL configuration
          #
          # listen 443 ssl default_server;
          # listen [::]:443 ssl default_server;
          #
          # Note: You should disable gzip for SSL traffic.
          # See: https://bugs.debian.org/773332
          #
          # Read up on ssl_ciphers to ensure a secure configuration.
          # See: https://bugs.debian.org/765782
          #
          # Self signed certs generated by the ssl-cert package
          # Don't use them in a production server!
          #
          # include snippets/snakeoil.conf;
      
          root /var/www/html;
      
          # Add index.php to the list if you are using PHP
          index index.html index.htm index.nginx-debian.html;
      
          server_name hellonode;
      
          location ^~ /assets/ {
                  gzip_static on;
                  expires 12h;
                  add_header Cache-Control public;
          }
      
          location /coauthor {
                  proxy_http_version 1.1;
                  proxy_cache_bypass $http_upgrade;
      
                  proxy_set_header Upgrade $http_upgrade;
                  proxy_set_header Connection 'upgrade';
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  proxy_set_header X-Forwarded-Proto $scheme;
      
                  proxy_pass http://localhost:3000;
          }
      }
      

      But one issue is that a group in coauthor still has its URL as http://<my_droplet_public_ipv4>/groupname and I expected something like http://<my_droplet_public_ipv4>/coauthor/groupname. I decided to change to using a subdomain pointing directly to <my_droplet_public_ipv4>.

    • In the current version of coauthor, the function “Download and Zip everything in a group” does not work well. Basically when I click the Download ZIP button, what I received in the downloaded ZIP file are only css and fonts files. For now, as I am the admin, I can back up and restore the MongoDB database by the tools mongodump and mongorestore.
    • I don’t want to install a custom postfix server to send emails, so I simply send emails using my GMAIL account. You can set this by modifying the value of meteor.env.MAIL_URL in .deploy/mup.js with something like smtps://<my_gmail_username>%40gmail.com:<my_gmail_password>@smtp.gmail.com:465.

Send emails with Free x10hosting

I realized that I had a free x10hosting account which I have not yet used for a long time. With the resources provided in this account, I can send emails from some address like coauthor@hoanganhduc.org. The essential steps I did are as follows:

  • x10hosting free account provides three email accounts. I created one account coauthor@hoanganhduc.org in the x10hosting Control Panel for sending emails.
  • You can also add the domain hoanganhduc.org in the x10hosting Control Panel. Note that their settings in the DNS Management section will not work but can be used as a guide to set up with Namecheap (because my domain is managed by Namecheap).
  • Point domain hoanganhduc.org to x10hosting in Namecheap by creating the following records:
    • NS records (set up both if possible): ns1.x10hosting.com, ns2.x10hosting.com
    • CNAME record: x13.x10hosting.com
    • A record: 198.91.81.13
    • Copy x10hosting DNS settings.
  • Use a Ubuntu 22.04 Droplet instead of the Nodejs Droplet above.
  • When deploying coauthor as instructed, change the value of meteor.env.MAIL_URL in .deploy/mup.js to something like smtp://coauthor%40hoanganhduc.org:<x10_hosting_email_password>@x13.x10hosting.com:587.

More Configurations with Ubuntu server