Skip to content

Commit bde63c5

Browse files
authored
Merge pull request #21 from litencatt/apply-to-k8s
Apply to k8s
2 parents 3e22f7d + 7c17aa7 commit bde63c5

File tree

5 files changed

+61
-13
lines changed

5 files changed

+61
-13
lines changed

.dockerignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
.git
1+
.git/
2+
.github/
3+
.vscode/
4+
node_modules/
5+
manifests/
26
.env*
7+
.gitignore
38
.dockerignore
49
.prettierrc
5-
.vscode
6-
node_modules
710
README.md
811
docker-compose.yml
912
Dockerfile*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
manifests/secrets/

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,18 @@ build-debug:
66

77
run:
88
docker run --entrypoint=sh --env-file=.env -it notion-bot:latest-debug
9+
10+
# For minikube
11+
apply:
12+
kubectl apply -f manifests
13+
14+
install-sealed-secrets:
15+
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
16+
helm install --namespace kube-system notion-bot sealed-secrets/sealed-secrets
17+
18+
secret-init:
19+
kubectl create secret generic notion-bot --dry-run=client --from-env-file=.env -o yaml > manifests/secrets/non-encrypted-secrets.yml
20+
21+
secret-update:
22+
cat manifests/secrets/non-encrypted-secrets.yml | kubeseal --controller-name=notion-bot-sealed-secrets --controller-namespace=kube-system --format yaml > manifests/secrets/secrets.yaml
23+
kubectl replace -f manifests/secrets/secrets.yaml

README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Notion bot
22

3-
A Slack bot searches pages in Notion DB.
3+
🤖 A Slack bot searches pages in Notion DB.
44

5-
## Quick start
5+
## Features
66

7-
run on k8s
7+
- Select/change DB on modal
8+
- Add/delete filters in modal
9+
- Display page search results in modal
10+
- Display page search results in threads
811

9-
```bash
10-
kubectl apply -f manifests
11-
```
12+
## Quick start
1213

1314
run locally
1415

@@ -19,3 +20,27 @@ export SLACK_APP_TOKEN=xxx
1920
export NOTION_TOKEN=xxx
2021
docker compose up
2122
```
23+
24+
run on k8s
25+
26+
```bash
27+
cp .env.example .env
28+
# edit .env
29+
30+
make install-sealed-secrets
31+
make secret-init
32+
make secret-update
33+
make apply
34+
```
35+
36+
## Usage
37+
38+
1. Mention to bot
39+
- <img width="473" alt="image" src="https://github.com/litencatt/notion-bot/assets/17349045/a284735f-3fa4-4234-999c-144bbfaa1bc6">
40+
2. Click button in reply message received thread, then open a modal.
41+
- <img width="576" alt="image" src="https://github.com/litencatt/notion-bot/assets/17349045/6c17600e-a8aa-4127-ad01-5364ee993631">
42+
- <img width="528" alt="image" src="https://github.com/litencatt/notion-bot/assets/17349045/3f2cda27-49ea-4d6d-bb92-7bc7389928e0">
43+
3. You can search pages in selected Notion DB with filters.
44+
- <img width="523" alt="image" src="https://github.com/litencatt/notion-bot/assets/17349045/f5dc07a3-e373-4f3f-b387-20e068955e23">
45+
4. Click submit, if you want to show result in thread.
46+
- <img width="576" alt="image" src="https://github.com/litencatt/notion-bot/assets/17349045/ed239da8-4d5a-44b5-9ed0-34f796163f0c">

manifests/deployment.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ metadata:
44
name: notion-bot
55
spec:
66
replicas: 1
7+
selector:
8+
matchLabels:
9+
name: notion-bot
710
template:
811
metadata:
912
labels:
@@ -20,19 +23,19 @@ spec:
2023
valueFrom:
2124
secretKeyRef:
2225
name: notion-bot
23-
key: slack-signing-secret
26+
key: SLACK_SIGNING_SECRET
2427
- name: SLACK_BOT_TOKEN
2528
valueFrom:
2629
secretKeyRef:
2730
name: notion-bot
28-
key: slack-bot-token
31+
key: SLACK_BOT_TOKEN
2932
- name: SLACK_APP_TOKEN
3033
valueFrom:
3134
secretKeyRef:
3235
name: notion-bot
33-
key: slack-app-token
36+
key: SLACK_APP_TOKEN
3437
- name: NOTION_TOKEN
3538
valueFrom:
3639
secretKeyRef:
3740
name: notion-bot
38-
key: notion-token
41+
key: NOTION_TOKEN

0 commit comments

Comments
 (0)