General Technical - Overview

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 or any of the live branches 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, Builds, PRs and Commits

- https://publichappinessmovement.com/t/topic/1902

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.

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
1 Like

@zofrex can you check if this is up to date please. I think your documentation probably updates a few things here.