Skip to content

Latest commit

 

History

History
124 lines (77 loc) · 3.57 KB

README.md

File metadata and controls

124 lines (77 loc) · 3.57 KB

Cloudy - our community helpbot

Cloudy can query across workspaces. Only install into workspaces you trust. Controlled with SLACK_AUTHORIZED_TEAMS

Cloudy is deployed to prod automatically on push to main at https://cloudy-server.onrender.com

You can develop Cloudy locally by following these steps:

Getting started

# Clone the Lightdash cloud announcer repo
git clone https://github.com/lightdash/lightdash-cloud-announcer.git

Make sure you create and set an .env file correctly.

ℹ️ app id for "dev Cloudy" is A03NM81NBFD

SLACK_SIGNING_SECRET=Get variable from slack app settings

SLACK_CLIENT_ID=Get variable from slack app settings

SLACK_CLIENT_SECRET=Get variable from slack app settings

SLACK_STATE_SECRET=this can be anything

SLACK_AUTHORIZED_TEAMS=T0163M87MB9,T03942PB7E3

PG_CONNECTION_STRING=postgres://user:pass@host:port/database

SITE_ENV=https://cloudy-dev-crazy-cayote.loca.lt

GITHUB_WEBHOOKS_SECRET=Create a new webhook with a secret

GITHUB_ACCESS_TOKEN=Create a new access token

RUDDERSTACK_WRITE_KEY=Get your Rudderstack write key here

RUDDERSTACK_DATA_PLANE_URL=Get your data plane URL here

Setup dev

1. Install all dependencies

# Install all the project's dependencies
yarn

# Run the app locally
yarn start

2. Run localtunnel and update URLs

yarn expose

Now you need to update the following URLs with the last Forwarding url that localtunnel returns:

  • Update the SITE_ENV environment variable
  • Update all domains in the /slack-app-manifest.yaml

3. Configure slack to use our app

  • Create or update a slack app at https://api.slack.com
  • Copy in the slack-app-manifest.yaml (change command names and bot name if in dev)
  • Get all the secrets from the "basic information" and update:
    • SLACK_SIGNING_SECRET
    • SLACK_CLIENT_ID
    • SLACK_CLIENT_SECRET

4. Setup GitHub webhooks

Go to webhooks and create a new webhook

  • Payload URL https://[ngrok domain]/api/github/webhooks
  • Content type: application/json
  • Add a secret variable (it can be anything)
  • Enable SSL
  • "Let me select individual events" -> Issues only
  • Active ✔️

In the app add the following variables:

GITHUB_WEBHOOKS_SECRET=the secret you chose above (it can be anything but must match the one you provided to github)
GITHUB_ACCESS_TOKEN=a personal access token for GitHub

6. Run the app locally

yarn dev

7. Verify webhooks

Once the app is running, in your webhook settings in GitHub verify that you can receive the ping event:

CleanShot 2023-11-29 at 19 00 12@2x

In Slack under "event subscriptions" check you can receive the ping event:

CleanShot 2023-11-29 at 19 01 51@2x

8. Install into your workspace

Visit https://[ngrok domain]/slack/oauth_redirect to install the app correctly. This won't work through the api. slack.com web UI.

Production

  • Update all URLs for prod deployment
  • Under "manage distribution" set to "publicly available"

Dev notes

Add migration

yarn knex migrate:make <migration_name> --env production