Skip to content

Commit 19e7317

Browse files
Merge pull request #14 from cloudnative-id/multiple-dispatcher
refactor telegram & twitter dispatcher to support multiple account/group
2 parents ead06d2 + 612826b commit 19e7317

18 files changed

Lines changed: 190 additions & 127 deletions

.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
telegram:
2+
enabled: true
3+
group:
4+
- chatId: "group_one_chatid"
5+
token: "bot_token"
6+
- chatId: "group_two_chatid"
7+
token: "bot_token"
8+
twitter:
9+
enabled: false
10+
account:
11+
- apiKey: "account_api_key"
12+
apiSecretKey: "account_api_secret_key"
13+
accessToken: "account_access_token"
14+
accessTokenSecret: "account_access_token_secret"

.env-example

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Fork and clone **[community-operator](https://github.com/cloudnative-id/communit
1414

1515
- Setup your environment
1616
```
17-
cp .env-example .env
18-
set -o allexport; source .env; set +o allexport
17+
sudo mkdir /etc/community-operator/
18+
sudo cp .env /etc/community-operator/community-operator-config.yaml
1919
```
2020

2121
- deploy CRDs
@@ -37,6 +37,10 @@ kubectl apply -f examples/meetup/example.yaml
3737
kubectl apply -f examples/announcement/example.yaml
3838
```
3939

40+
- Build community-operator image
41+
```
42+
operator-sdk build account/repository:tag
43+
```
4044

4145
### Submit a pull request
4246
As you are ready with your code contribution, push your branch to your `community-operator` fork and open a pull request against the **master** branch.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,3 @@ tags
7575
.vscode/*
7676
.history
7777
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
78-
.env

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22
All notable changes to this project should be documented in this file.
33

4+
### v0.0.5
5+
- support for multiple telegram group
6+
- support for multiple twitter account
7+
- refactor configuration to file based configuration
8+
49
### v0.0.4
510
- Telegram dispatcher supported
611
- Twitter dispatcher supported

FEATURE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
#### Dispatcher
88
- [x] telegram dispatcher
9-
- [ ] support for multiple telegram dispatcher
9+
- [x] support for multiple telegram dispatcher
1010
- [x] twitter dispatcher
11-
- [ ] support for multiple twitter dispatcher
11+
- [x] support for multiple twitter dispatcher
1212
- [ ] facebook dispatcher
1313
- [ ] support for multiple facebook dispatcher
1414

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# community-operator
22

3+
![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.5](https://img.shields.io/badge/AppVersion-0.0.5-informational?style=flat-square)
4+
35
The Community Operator provides Kubernetes native deployment and management of your community. The purpose of this project is to simplify and automate community management in top of Kubernetes clusters.
46

57
Community-operator currently watch CRDs on the same namespace as the community-operator deployed.

charts/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
apiVersion: v1
33
name: community-operator
44
type: application
5-
version: 0.0.4
6-
appVersion: 0.0.4
5+
version: 0.0.5
6+
appVersion: 0.0.5
77
description: community-operator for managing community lifecycle
88
home: https://github.com/cloudnative-id/community-operator
99
keywords:

charts/README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@ helm install ./charts --name community-operator
99

1010
### Configuration
1111

12-
| Parameter | Description | Default |
13-
|-|-| -|
14-
| operator.image | Image for community-operator | cloudnativeid/community-operator |
15-
| operator.tag | Tag for image community-operator | 0.0.4 |
16-
| operator.pullPolicy | pullPolicy | Always |
17-
| operator.replica | number of replica | 3 |
18-
| telegram.enabled | Telegram enabled | "true" |
19-
| telegram.chatid | Telegram chatid | |
20-
| telegram.token | Telegram bot token | |
21-
| twitter.enabled | Telegram enabled | "true" |
22-
| twitter.api_key | Twitter API key | |
23-
| twitter.api_secret_key | Twitter API secret key | |
24-
| twitter.access_token | Twitter access token | |
25-
| twitter.access_token_secret | TTwitter access token secrets | |
12+
| Key | Type | Default | Description |
13+
|-----|------|---------|-------------|
14+
| config.telegram.enabled | bool | `true` | |
15+
| config.telegram.group[0].chatId | string | `"group_one_chatid"` | |
16+
| config.telegram.group[0].token | string | `"bot_token"` | |
17+
| config.telegram.group[1].chatId | string | `"group_two_chatid"` | |
18+
| config.telegram.group[1].token | string | `"bot_token"` | |
19+
| config.twitter.account[0].accessToken | string | `"account_0_access_token"` | |
20+
| config.twitter.account[0].accessTokenSecret | string | `"account_0_access_token_secret"` | |
21+
| config.twitter.account[0].apiKey | string | `"account_0_api_key"` | |
22+
| config.twitter.account[0].apiSecretKey | string | `"account_0_api_secret_key"` | |
23+
| config.twitter.account[1].accessToken | string | `"account_1_access_token"` | |
24+
| config.twitter.account[1].accessTokenSecret | string | `"account_1_access_token_secret"` | |
25+
| config.twitter.account[1].apiKey | string | `"account_1_api_key"` | |
26+
| config.twitter.account[1].apiSecretKey | string | `"account_1_api_secret_key"` | |
27+
| config.twitter.enabled | bool | `false` | |
28+
| operator.image | string | `"cloudnativeid/community-operator"` | |
29+
| operator.pullPolicy | string | `"Always"` | |
30+
| operator.replica | int | `1` | |
31+
| operator.tag | string | `"0.0.5"` | |
2632

2733
Specify each parameter using the `--set key=value[,key=value]` argument to helm install. For example:
2834
```

charts/templates/deployment.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@ spec:
1919
image: {{ .Values.operator.image }}:{{ .Values.operator.tag }}
2020
imagePullPolicy: {{ .Values.operator.pullPolicy }}
2121
env:
22-
- name: WATCH_NAMESPACE
23-
valueFrom:
24-
fieldRef:
25-
fieldPath: metadata.namespace
26-
- name: POD_NAME
27-
valueFrom:
28-
fieldRef:
29-
fieldPath: metadata.name
3022
- name: OPERATOR_NAME
3123
value: {{ .Chart.Name }}
32-
envFrom:
33-
- secretRef:
34-
name: {{ .Chart.Name }}-secret
35-
24+
volumeMounts:
25+
- name: {{ .Chart.Name }}-secret
26+
mountPath: "/etc/community-operator/"
27+
volumes:
28+
- name: {{ .Chart.Name }}-secret
29+
secret:
30+
secretName: {{ .Chart.Name }}-secret
31+
defaultMode: 0400

0 commit comments

Comments
 (0)