Technical - Site Operations

mongodb
nginx
mongo

#1

Site Operations


This node aims to document the overall way the site functions and changes to the codebase update production.

Sub nodes appropriate for this article include Testing, Meteor, stats/metrics, and other infrastructure appropriate for modern webapps. Testing is currently an area identified for work.

Codebase

The codebase is hosted on github. https://github.com/focallocal/fl-maps
There are two branches, master and fl-sleeper. This is messay and needs to be cleaned up at some point. Andy has plans for how the branches diverge, that'll be a later question.

Builds

A PR to master/sleeper triggers a Travis CI build that checkouts the latest version of the codebase, decrypts the secrets to log into the server, and runs a deployment configured in mup.js.

Command to tar:
tar -czvf secrets.tar mup.js settings.json
Command to encrypt:
openssl enc -e -aes-256-cbc -a -salt -in secrets.tar -out secrets.tar.enc
Command to untar:
tar -xvf secrets.tar
Command to decrypt:
openssl enc -d -aes-256-cbc -md md5 -base64 -in secrets.tar.enc -out secrets.tar

“Bad number” error messages are due to version mismatches of openssl. Ensure your file is actually encrypted and that the decrypt command is being running base64.

Encryption/Decryption keys are with @tmcnulty.


Branches

master

GitHub link - Builds to root URL of http://focallocal.org
Configured with mup.js
Meteor Up within secrets.tar.enc.

fl-sleeper

GitHub link - Builds to root url https://brightertomorrowmap.com


Databases

Databases are hosted as very small sandbox instances on mlab.com.
These are backed up to flat file by a cron on the production app box.
We currently have no need to expand the databases, or make decisions in routing requests or ensuring high availability.

Given they’re mongo instances we’ll have to cross that bridge when we get there but the majority of the configuration and schema is done by the logic within the application.

As number of items within the schema grow we will need to figure out a way of manipulating objects, namely deleting them, as there’s no way for the application to do that currently.

This is something solved sooner rather than later, less it become impossible to remove things for some reason.


pinned #2

#3

Port mappings

We've got a variety of services running on a bunch of machines.

Public Happiness Movement

Provider: Digital Ocean

IP: 134.209.90.26
Deploy User: Yes, password.

  • local_discourse/app: 34923
  • master_withoutDCS meteor app: 8095
  • Nginx to proxy: 80/443

This product is behind Cloudflare.

Brighter Tomorrow Map

IP: 104.238.186.173
Deploy User: Yes, password.

  • mup-focallocal: 8095
  • Nginx to proxy: 80/443

Focallocal.org

IP: 104.238.186.173
Deploy User: Yes, password.

  • mup-focallocal: 8095
  • Nginx to proxy: 80/443