Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnpertoft/text-to-image-slack-bot
https://github.com/johnpertoft/text-to-image-slack-bot
generative-art slack-bot stable-diffusion
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnpertoft/text-to-image-slack-bot
- Owner: johnPertoft
- Created: 2022-08-20T09:32:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T13:54:53.000Z (about 1 year ago)
- Last Synced: 2024-01-01T14:57:12.383Z (about 1 year ago)
- Topics: generative-art, slack-bot, stable-diffusion
- Language: Python
- Homepage:
- Size: 9.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Text to Image Slack Bot (Stable-diffusion)
![Lint status](https://github.com/johnPertoft/text-to-image-slack-bot/actions/workflows/lint.yaml/badge.svg?branch=main)
![Test status](https://github.com/johnPertoft/text-to-image-slack-bot//actions/workflows/test.yaml/badge.svg?branch=main)**Slack application home**: https://api.slack.com/apps/A03U9439A5U/
## Setup
Click to expand
### Local environment secrets
Put secrets in `.envrc`, they will be automatically loaded by `direnv`.### Create secrets
```bash
gcloud secrets create john-test-slack-bot-token
gcloud secrets create john-test-slack-signing-secret
```### Update secret versions
```bash
echo -n $SLACK_BOT_TOKEN | gcloud secrets versions add john-test-slack-bot-token --data-file=-
echo -n $SLACK_SIGNING_SECRET | gcloud secrets versions add john-test-slack-signing-secret --data-file=-
```### Allow default service account to access secrets
```bash
gcloud secrets add-iam-policy-binding john-test-slack-bot-token \
--role roles/secretmanager.secretAccessor \
--member serviceAccount:[email protected]gcloud secrets add-iam-policy-binding john-test-slack-signing-secret \
--role roles/secretmanager.secretAccessor \
--member serviceAccount:[email protected]
```## How to run locally
Click to expand
1. ```bash
python -m src.app
```
2. ```bash
# ngrok config add-authtokenngrok http 3000
```
3. Update request url for event subscription: https://api.slack.com/apps/A03U9439A5U/event-subscriptions?## Deploying
Currently the app is deployed by
- Building and pushing the new image to gcr, just run `./deploy.sh` in the project root
- Manually deleting the pod to have it automatically restart and use the new image