A Slack bot to post daily standup status. It launches a modal, prompting users for Yesterday, Today, Parking Lot Items, and Parking Lot Participants
Add bot to channels where you wish to use it.
Or invite the bot to the channel with @Standup
.
/standup help
/standup [parking-lot | parking_lot | parkinglot | -p] - display ephemeral parking lot items
/standup post [parking-lot | parking_lot | parkinglot | -p] - post parking lot items to chat
SLS makes it easy to deploy to AWS
Install with the command
npm install -g serverless
sls deploy --stage (prod | dev) [--aws-profile profile-name] [--region us-east-2]
To inspect the size and content of the deployment without deploying anything to AWS
sls package --stage (prod | dev) [--aws-profile profile-name]
You can also check configuration substitutions. This is useful for checking things like the target region
.
sls print --stage (prod | dev)
Create a secret in SecretsManager named SlackStandup-secret-dev
or SlackStandup-secret-prod
, depending on the target environment, with the values
SLACK_STANDUP_BOT_TOKEN
SLACK_STANDUP_SIGNING_SECRET
These can be found on the Slack website. Copy-paste the following values.
In the app's OAuth & Permissions:
In the app's Basic Settings copy the value for Signing Secret:
Testing locally requires Docker, and setting the following environment variables in a .env
file. These are the same values found in the Secrets section of this document.
SLACK_STANDUP_BOT_TOKEN
SLACK_STANDUP_SIGNING_SECRET
Deploy to Docker with the following command:
npm run serverless-localstack
This retrieves the local environment variables and creates secrets and a DynamoDB table in the Localstack instance.
Localstack runs on port 4566
.
Localstack is loaded with scripts in src/test/scripts
. These may need updated permissions to execute.
chmod 755 src/test/scripts/*
To connect Slack to this running instance, start ngrok
with either of these commands. This assumes ngrok
is installed in the user's home directory.
npm run ngrok
~/ngrok http 5000
This will create a URL to enter into Slack's Slash Command interface for this app.
The context.ts
file sets up some fake credentials, and we need these to query the DynamoDB instance using the aws cli.
AWS_ACCESS_KEY_ID=not-a-real-access-key-id AWS_SECRET_ACCESS_KEY=not-a-real-access-key aws dynamodb scan --table-name local_STANDUP_STATUS --endpoint-url http://localhost:4566
This bot uses a Slash Command and enabled Interactivity.
- Slash Commands and Interactivity use the same Request URL, which ends in
/slack/events
- For local testing, set these to the URL generated by
ngrok
- When the app is live, set these to the lambda URL
The app needs permissions to interact with the Slack workspace. Enable OAuth scopes in Slack.
chat:write
chat:write.customize
commands
groups:read
users.profile:read
users:read
👤 Steve Thompson
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator