Please DM any security disclosures to @llllvvuu
brew install postgresql
brew services start postgresql
createdb $USER
createdb campaigns
psql -c "grant all privileges on database campaigns to $USER"
brew install dbmate
Add the following to .env, replacing "username" with your username:
DATABASE_URL="postgres://[email protected]:5432/campaigns?sslmode=disable"
dbmate --help
For prod:
- ssh into EC2 instance
- cd into
campaigns-worker
- run
dbmate up
Prerequisite:
yarn global add @cloudflare/wrangler
wrangler login
yarn
AWS_REGION
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DB_NAME
AWS_AURORA_RESOURCE_ARN
AWS_AURORA_SECRET_ARN
wrangler dev
wrangler publish
We use AWS Lambda for the cron job to keep impact stats updated. Copy cron.js
into the in-browser Lambda code editor.