Skip to content

guardian/status-app

Repository files navigation

Guardian Status App

Shows an overview of the status of autoscaling groups in an AWS account:

Status app in action

How do I run it?

There's a Cloud Formation scripts template which does much of the work, but you'll need to put the upstart config and the archive generated by running sbt dist into an S3 bucket called stack-dist in a directory /stack/stage/status-app/ where stack and stage are the corresponding names as passed to the Cloud Formation script.

If this is for a Guardian stack, open a pull request to include your stack in the riff-raff.yaml, so that you're always kept up to date with the latest version.

If you're tagging your auto-scaling groups according to the Guardian conventions, you should then have something to see.

The Status App uses OAuth with Google as the provider for authentication. You'll need to create client ID in the Google API console and then copy the details into the DynamoDB table created by the CloudFormation scripts.

Example of filling in the the config details

Ensure that you have switched on access to the Google+ API for your credentials.

For best results, you'll want to allow the security group created by the Cloud Formation script, called something like status-app-EC2SecurityGroup-XXXXXXXXXXXX, access to the management port of your apps.

Running locally

####Credentials

Credentials are retrieved from the configuration file used for the AWS CLI. For a Guardian stack, get your credentials via 'export to shell' in Janus as status-app doesn't currently handle AWS profiles.

Nginx setup

You'll need to do the dev-nginx installation, before you do anything else.

  • In this repository's root directory, run:
$ dev-nginx setup-app ./nginx/nginx-mapping.yml

You will need to provide your sudo password.

JDK setup

  • Ensure you are using Java 8, if you are using Java 9+ via Homebrew, you may want to use https://sdkman.io/ instead to be sure that Java 8 is wired up to your $JAVA_HOME. This app has been tested with AdoptOpenJDK8, installed via
sdk install java 8.0.252.hs-adpt

Start the app

If you just want to run it locally, it's a standard Play 2 app and can be run with the 'run' command from an SBT prompt.

sbt run

the app runs on port 9000 but is proxied via nginx running as root on port 80

visit:

https://status.local.dev-gutools.co.uk/

unless you've set up a different domain-root set up in your ./nginx/nginx-mapping.yml

Contributing

Pull requests are welcomed. If you hit a problem, or have an idea for improvments, open an issue, or let me know directly.

@philwills