Skip to content
Alexander Mohr edited this page Jun 3, 2019 · 14 revisions

Santa

Santa Docs

Upvote

metrics: https://app.google.stackdriver.com/?project=santaupvote

Tips

Item HowTo
View logs gcloud app logs tail -s santa-api

Backup/Restore

We're currently doing bi-weekly backups, configured via cron.yaml. In order to see, and restore a backup go to https://console.cloud.google.com/datastore/settings?organizationId=485344983296&project=santaupvote, and then click Open Datastore Admin. There you can see a list of the backups and restore any of them

Diffing against google/upvote/master

https://github.com/google/upvote/compare/627be9243fd09f3a79f2eb7ac717b33f4d6e205f...farmersbusinessnetwork:master

replace the sha1 with the last merged sha1

Setting up your local gcloud

gcloud auth login
gcloud config set account [YOUR_FBN_EMAIL]
gcloud config set project santaupvote

Deploying

Replacing default "auto" version:

fbn/deploy.py

With custom version:

fbn/deploy.py --version v2

NOTE: If you deploy with a custom version, you need to migrate/split clients to the new version: https://console.cloud.google.com/appengine/versions?organizationId=485344983296&project=santaupvote&serviceId=santa-api&versionssize=50

Cleaning build directory

bazel clean --expunge

Example API endpoints

https://santaupvote.appspot.com/api/web/votes/query https://santaupvote.appspot.com/api/web/users/query https://santaupvote.appspot.com/api/web/alerts/APPLIST/ALL https://santaupvote.appspot.com/api/web/settings/FailsafeAdministrators

Auth TODO

Security

  • Best Practices:

Bugs Logged against Google

Emergency instructions

Disable Santa Locally

sudo launchctl unload /Library/LaunchDaemons/com.google.santad.plist

Rolling back DB

Backups are done bi-weekly: https://github.com/farmersbusinessnetwork/upvote/blob/master/upvote/gae/cron.yaml#L23

To roll back go to: https://console.cloud.google.com/datastore/settings?organizationId=485344983296&project=santaupvote

Rolling back version

You can have multiple versions deployed per deploy steps above. In order roll back a version, you would just migrate all traffic to the old version here: https://console.cloud.google.com/appengine/versions?organizationId=485344983296&project=santaupvote&serviceId=default&versionssize=50