Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Add rss bot to matrix #1098

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
659c26a
begin testing enabling the rss feed reader
jessebot Jul 16, 2024
8ab1bba
switch to feature branch of matrix chart
jessebot Jul 17, 2024
afcf951
try 0.2.0-dev-1 for rss bot
jessebot Jul 16, 2024
eeb4736
try 0.2.0-dev-2 for rss bot
jessebot Jul 16, 2024
6557e89
try 0.2.0-dev-3 for rss bot
jessebot Jul 16, 2024
59b8a95
try 0.2.0-dev-4 for rss bot
jessebot Jul 16, 2024
66bc54a
try 0.2.0-dev-5 for rss bot
jessebot Jul 16, 2024
c956a04
try 0.2.0-dev-6 for rss bot
jessebot Jul 16, 2024
3751ba0
try 0.2.0-dev-7 for rss bot
jessebot Jul 16, 2024
258b141
try 0.2.0-dev-8 for rss bot
jessebot Jul 16, 2024
a8c8b3a
matrix: update to latest jessebot/matrix-rss-bot:0.2.0-dev-9
jessebot Jul 17, 2024
4f15e55
matrix: update to latest jessebot/matrix-rss-bot:0.2.0-dev-10
jessebot Jul 17, 2024
1bd193c
matrix: update to latest jessebot/matrix-rss-bot:0.2.0-dev-11
jessebot Jul 17, 2024
d1c28d7
matrix: update to latest jessebot/matrix-rss-bot:0.2.0-dev-12
jessebot Jul 17, 2024
05cf440
don't use hardcode matrix-alertmanager image
jessebot Jul 17, 2024
ccf7cec
update matrix alertmanager to 0.12.1-dev-1
jessebot Jul 17, 2024
434feef
bump alertmanager matrix bot to o.12.1-dev-2
jessebot Jul 17, 2024
48c5855
bump alertmanager matrix bot to o.12.1-dev-3
jessebot Jul 17, 2024
7eb05b8
use live 0.12.1 tag for alertmangaer
jessebot Jul 17, 2024
6d4b18d
update rss tag to 0.2.0-dev-13
jessebot Jul 17, 2024
2427b7a
update rss tag to 0.2.0-dev-14
jessebot Jul 17, 2024
66c78b0
update rss tag to 0.2.0-dev-15
jessebot Jul 17, 2024
4988c0f
add some default feeds and logging level for matrix rss bot
jessebot Jul 17, 2024
b0c5a98
update rss tag to 0.2.0-dev-16
jessebot Jul 18, 2024
5e5d26c
update rss tag to 0.2.0-dev-17
jessebot Jul 18, 2024
85aad77
update rss tag to 0.2.0-dev-18 and change interval to every 480 seconds
jessebot Jul 18, 2024
75ac69a
update rss tag to 0.2.0-dev-19
jessebot Jul 18, 2024
99e9f24
update rss tag to 0.2.0-dev-20
jessebot Jul 18, 2024
50c6d7f
update rss tag to 0.2.0-dev-21
jessebot Jul 18, 2024
bd8024b
update rss tag to 0.2.0-dev-22
jessebot Jul 18, 2024
f471e99
add rss bridge secret for matrix bridge
jessebot Jul 18, 2024
867a8bd
point matrix external secrets at rss bot feature branch for now
jessebot Jul 18, 2024
752935a
update rss tag to 0.2.0-dev-23
jessebot Jul 18, 2024
e5508e8
update rss tag to 0.2.0-dev-24
jessebot Jul 18, 2024
1f10c91
update upload size from 10M to 100M and image pixel size from 32M to 64M
jessebot Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions matrix/app_of_apps_with_bridges/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ This is an example matrix ArgoCD app of apps, which matches the other matrix app

- [discord bridge](https://docs.mau.fi/bridges/general/docker-setup.html?bridge=discord) for bridging discord with matrix
- [alertmanager](https://github.com/small-hack/matrix-alertmanager) for bridging prometheus with matrix
- [rss](https://github.com/small-hack/matrix-rss-bot) for bridging rss feeds into various rooms


## Tips
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
# - matrix_trusted_key_servers_bitwarden_id
- matrix_alertmanager_bitwarden_id
- matrix_discord_bitwarden_id
- matrix_rss_bitwarden_id
- global_external_secrets
- matrix_oidc_credentials_bitwarden_id
- matrix_postgres_credentials_bitwarden_id
Expand Down Expand Up @@ -46,7 +47,7 @@ spec:
source:
repoURL: 'https://github.com/small-hack/argocd-apps.git'
path: matrix/external_secrets/
targetRevision: main
targetRevision: add-rss-bot
helm:
valuesObject:
# use openbao or bitwarden
Expand Down Expand Up @@ -76,4 +77,5 @@ spec:

bridges:
alertmanager_bitwarden_ID: '{{ .matrix_alertmanager_bitwarden_id }}'
rss_bitwarden_ID: '{{ .matrix_rss_bitwarden_id }}'
discord_bitwarden_ID: '{{ .matrix_discord_bitwarden_id }}'
96 changes: 85 additions & 11 deletions matrix/app_of_apps_with_bridges/matrix_argocd_appset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ spec:
prune: true
selfHeal: true
source:
repoURL: 'https://small-hack.github.io/matrix-chart'
targetRevision: 13.2.0
chart: matrix
# repoURL: 'https://github.com/small-hack/matrix-chart'
# targetRevision: main
# path: charts/matrix/
# repoURL: 'https://small-hack.github.io/matrix-chart'
# targetRevision: 13.1.0
# chart: matrix
repoURL: 'https://github.com/small-hack/matrix-chart'
targetRevision: add-rss-bot
path: charts/matrix/
helm:
valuesObject:
fullnameOverride: matrix-stack
Expand Down Expand Up @@ -92,10 +92,10 @@ spec:
# -- Settings related to image and multimedia uploads
uploads:
# -- Max upload size in bytes
maxSize: 10M
maxSize: 100M

# -- Max image size in pixels
maxPixels: 32M
maxPixels: 64M

serve_server_wellknown: true

Expand Down Expand Up @@ -622,13 +622,87 @@ spec:
storageClass: local-path
accessMode: ReadWriteOnce

alertmanager:
rss:
enabled: true
image:
# -- rss bridge docker image
repository: "jessebot/matrix-rss-bot"
# -- rss bridge docker image tag
tag: "0.2.0-dev-24"
# -- rss bridge docker image pull policy.
# If tag is "main", set pullPolicy to "Always"
pullPolicy: IfNotPresent

# -- set the revisionHistoryLimit to decide how many replicaSets are
# kept when you change a deployment. Explicitly setting this field to 0,
# will result in cleaning up all the history of your Deployment thus that
# Deployment will not be able to roll back.
revisionHistoryLimit: 1

image:
tag: 0.12.0-dev-6
existingSecret:
# -- use an existing Kubernetes secret for your entire appservice registration file.
# must have a secret key called registration.yaml. If provided, ignores bridges.rss.registration
registration: ""
# -- use an existing Kubernetes secret for your entire feeds.yml file.
# must have a secret key called feeds.yml. If provided, ignores bridges.rss.feeds
feeds: ""

# -- optionally provide an existing Kubernetes ConfigMap with a key of feeds.yml
# if set, bridges.rss.feeds will be ignored.
existingFeedsConfigMap: ""

# this section is for registering the application service with matrix
# read more about application services here:
# https://spec.matrix.org/v1.11/application-service-api/
registration:
id: "rss-bot"
sender_localpart: "rss"
# like http://matrix-rss-service:3000
url: ""
# -- should this bot be rate limited?
rate_limited: false
# -- Use an existing Kubernetes Secret to store your own generated appservice
# and homeserver tokens. If this is not set, we'll generate them for you.
# Setting this won't override the ENTIRE registration.yaml we generate for
# the synapse pod to authenticate mautrix/discord. It will only replaces the tokens.
# To replaces the ENTIRE registration.yaml, use
# bridges.rss.existingSecret.registration
existingSecret: "matrix-bridge-rss"
existingSecretKeys:
# -- key in existingSecret for as_token (application service token). If
# provided and existingSecret is set, ignores bridges.rss.registration.as_token
as_token: "as_token"
# -- key in existingSecret for hs_token (home server token)
hs_token: "hs_token"

encryption: false

config:
bot:
# -- the username of the bot (we will automatically template the homeserver)
user: "rss"
# -- optionally provide a display name for this bot
display_name: "RSS Bot"
# -- optionally provide an mxc:// file to use as an avatar for this bot
avatar: ""
# -- the default room to post things in and interact in
default_room: "!RTkTbtPFXALdjmxAWn:{{ .matrix_hostname }}"
# -- interval to update all feeds, in seconds
interval: 480
log:
level: debug

# -- optionally provide a list of RSS feeds to add to the rss bot on startup
feeds:
- name: "matrix.org blog"
url: "https://matrix.org/blog/feed"
room_id: "!AUweUQXCxcVfFOaOIU:matrix.org"
- name: "GitHub Status"
url: "https://www.githubstatus.com/feed"

alertmanager:
enabled: true
revisionHistoryLimit: 1
registration:
id: "alertmanager"
rate_limited: false
Expand Down
45 changes: 45 additions & 0 deletions matrix/external_secrets/templates/bitwarden/bridge_rss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if and (eq .Values.external_secrets_provider "bitwarden") .Values.bridges.rss_bitwarden_ID }}
{{- if not (eq .Values.bridges.rss_bitwarden_ID "Not Applicable") }}
---
# secret matrix email stuff
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: matrix-bridge-rss
spec:
target:
# Name of the kubernetes secret to create
name: matrix-bridge-rss
deletionPolicy: Delete
template:
type: Opaque
data:
as_token: |-
{{ `{{ .astoken }}` }}
hs_token: |-
{{ `{{ .hstoken }}` }}

data:
- secretKey: astoken
sourceRef:
storeRef:
name: bitwarden-fields
kind: ClusterSecretStore
remoteRef:
# name of the bitwarden secret
key: {{ .Values.bridges.rss_bitwarden_ID }}
# property within the bitwarden secret we want
property: as_token

- secretKey: hstoken
sourceRef:
storeRef:
name: bitwarden-fields
kind: ClusterSecretStore
remoteRef:
# name of the bitwarden secret
key: {{ .Values.bridges.rss_bitwarden_ID }}
# property within the bitwarden secret we want
property: hs_token
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions matrix/external_secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ bridges:
alertmanager_bitwarden_ID: ""
# -- bitwarden id containing secrets for discord bridge
discord_bitwarden_ID: ""
# -- bitwarden id containing secrets for RSS feeds bridge
rss_bitwarden_ID: ""