test
This commit is contained in:
1
lp/matrix/-d
Normal file
1
lp/matrix/-d
Normal file
@@ -0,0 +1 @@
|
||||
{"errcode":"M_FORBIDDEN","error":"You are not a server admin"}
|
||||
@@ -70,3 +70,59 @@ nc -zv coturn-lp.allarddcs.nl 5349
|
||||
|
||||
#checken certificaat:
|
||||
kubectl describe secret coturn-cert -n matrix
|
||||
|
||||
#HOOKSHOT
|
||||
|
||||
|
||||
#passkey genereren en in secret zetten. Passkey wordt gebruikt om andere sleutels versleuteld op te slaan.
|
||||
|
||||
openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:4096
|
||||
kubectl -n matrix create secret generic hookshot-passkey --from-file=passkey.pem
|
||||
|
||||
#opvragen access token:
|
||||
|
||||
curl -X POST "https://matrix-lp.allarddcs.nl/_matrix/client/v3/login" -H "Content-Type: application/json" -d '{
|
||||
"type": "m.login.password",
|
||||
"user": "admin",
|
||||
"password": "Matrix01@"
|
||||
}'
|
||||
|
||||
syt_YWRtaW4_laSGClQJFMQNKKjqyfVj_1XLp4x
|
||||
|
||||
#room aanmaken:
|
||||
|
||||
curl -k -X POST \
|
||||
-H "Authorization: Bearer syt_YWRtaW4_bUqQKyFkonSgjkghnuxY_4IsleV" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"harbor","preset":"private_chat"}' \
|
||||
"https://matrix-lp.allarddcs.nl/_matrix/client/v3/createRoom"
|
||||
|
||||
{"room_id":"!AmeLKsUWrKBIkosFbY:matrix-lp.allarddcs.nl"}
|
||||
|
||||
#toevoegen hookshot bot aan room:
|
||||
|
||||
curl -X POST \
|
||||
-H "Authorization: Bearer syt_YWRtaW4_bUqQKyFkonSgjkghnuxY_4IsleV" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://matrix-lp.allarddcs.nl/_synapse/admin/v1/join/AmeLKsUWrKBIkosFbY:matrix-lp.allarddcs.nl" \
|
||||
-d '{
|
||||
"user_id": "@hookshot:matrix-lp.allarddcs.nl"
|
||||
}'
|
||||
|
||||
Opmerking: doordat de bot is toegevoegd wordt de status van de room veranderd in: gemanaged door de appservice.
|
||||
Daardoor kun je de room niet publiceren en ook geen leden uitnodigen.
|
||||
|
||||
#toevoegen allardhook aan room:
|
||||
|
||||
curl -k -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://matrix-lp.allarddcs.nl/_synapse/admin/v1/join/!BPcyrRUfYdBJrFVdlV:matrix-lp.allarddcs.nl" \
|
||||
-d '{
|
||||
"user_id": "@allard:matrix-lp.allarddcs.nl"
|
||||
}'
|
||||
|
||||
#herstarten hookshot
|
||||
|
||||
#transformationFunction in state-event schrijven:
|
||||
|
||||
curl -k -X PUT -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" "https://matrix-lp.allarddcs.nl/_matrix/client/r0/rooms/!BPcyrRUfYdBJrFVdlV:matrix-lp.allarddcs.nl/state/uk.half-shot.matrix-hookshot.generic.hook/generic-1" -d @harbor-webhook.json
|
||||
|
||||
1
lp/matrix/as-token.txt
Normal file
1
lp/matrix/as-token.txt
Normal file
@@ -0,0 +1 @@
|
||||
d3c8fccbe082aa2a59da362b3805abe4c4cebcd7e822cdbd700d84e7c55c485f
|
||||
1
lp/matrix/create-passkey-secret.sh
Normal file
1
lp/matrix/create-passkey-secret.sh
Normal file
@@ -0,0 +1 @@
|
||||
microk8s kubectl -n matrix create secret generic hookshot-passkey --from-file=passkey.pem
|
||||
5
lp/matrix/harbor-webhook.bak
Normal file
5
lp/matrix/harbor-webhook.bak
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Harbor Webhook",
|
||||
"webhookId": "harbor",
|
||||
"transformationFunction": "try { const repo=data.repository||{}; const resources=(data.event_data && data.event_data.resources)||[]; let msg=`📦 Repository: ${repo.namespace||''}/${repo.name||''}\n📝 Type: ${data.type||''}\n👤 Operator: ${data.operator||''}\n`; if(resources.length>0){ msg+=`\n💠 Resources:\n`; resources.forEach((r,idx)=>{ msg+=`\n🔹 Resource ${idx+1}:\n`; msg+=` 🏷 Tag: ${r.tag||''}\n`; msg+=` 🆔 Digest: ${r.digest||''}\n`; msg+=` 🌐 URL: ${r.resource_url||''}\n`; }); } result={plain:msg, version:'v2'}; } catch(e){ result={plain:`Error processing webhook: ${e.message}`, version:'v2'}; }"
|
||||
}
|
||||
5
lp/matrix/harbor-webhook.json
Normal file
5
lp/matrix/harbor-webhook.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Harbor Webhook",
|
||||
"webhookId": "harbor",
|
||||
"transformationFunction": "const repo = data.repository || {}; const resources = (data.event_data && data.event_data.resources) || []; let msg = ''; msg += '📦 Repository: ' + (repo.namespace || '') + '/' + (repo.name || '') + '\\n'; msg += '📝 Type: ' + (data.type || '') + '\\n'; msg += '👤 Operator: ' + (data.operator || '') + '\\n'; msg += '\\n'; msg += '💠 Resources:\\n'; resources.forEach((r, i) => { msg += '\\n'; msg += '🔹 Resource ' + (i + 1) + '\\n'; msg += '🏷 Tag: ' + (r.tag || '') + '\\n'; msg += '🆔 Digest: ' + (r.digest || '') + '\\n'; msg += '🌐 URL: ' + (r.resource_url || '') + '\\n'; }); result = { plain: msg, version: 'v2' };"
|
||||
}
|
||||
133
lp/matrix/hookshot.yaml
Normal file
133
lp/matrix/hookshot.yaml
Normal file
@@ -0,0 +1,133 @@
|
||||
# ===========================
|
||||
# Hookshot Deployment
|
||||
# ===========================
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: matrix-hookshot
|
||||
namespace: matrix
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: matrix-hookshot
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: matrix-hookshot
|
||||
spec:
|
||||
containers:
|
||||
- name: hookshot
|
||||
image: halfshot/matrix-hookshot:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 9000 # webhooks
|
||||
- containerPort: 9001 # metrics
|
||||
- containerPort: 9002 # widgets
|
||||
- containerPort: 9003 # appservice
|
||||
env:
|
||||
# tell hookshot where to find files
|
||||
- name: CONFIG_PATH
|
||||
value: /data/config.yml
|
||||
- name: REGISTRATION_PATH
|
||||
value: /data/registration.yml
|
||||
- name: TRANSFORM_PATH
|
||||
value: /data/transformationFunction.js
|
||||
volumeMounts:
|
||||
- name: hookshot-data
|
||||
mountPath: /data
|
||||
- name: hookshot-registration
|
||||
mountPath: /data/registration.yml
|
||||
subPath: registration.yml
|
||||
volumes:
|
||||
- name: hookshot-data
|
||||
persistentVolumeClaim:
|
||||
claimName: hookshot-pvc
|
||||
- name: hookshot-registration
|
||||
secret:
|
||||
secretName: matrix-hookshot-registration
|
||||
|
||||
---
|
||||
|
||||
# ===========================
|
||||
# Hookshot Service
|
||||
# ===========================
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: matrix-hookshot
|
||||
namespace: matrix
|
||||
spec:
|
||||
selector:
|
||||
app: matrix-hookshot
|
||||
ports:
|
||||
- name: webhooks
|
||||
port: 9000
|
||||
targetPort: 9000
|
||||
- name: metrics
|
||||
port: 9001
|
||||
targetPort: 9000
|
||||
- name: widgets
|
||||
port: 9002
|
||||
targetPort: 9000
|
||||
- name: appservice
|
||||
port: 9003
|
||||
targetPort: 9003
|
||||
- name: matrix
|
||||
port: 9993
|
||||
targetPort: 9993
|
||||
|
||||
---
|
||||
# ===========================
|
||||
# Hookshot IngressRoute
|
||||
# ===========================
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: matrix-hookshot
|
||||
namespace: matrix
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`hookshot-lp.allarddcs.nl`) && PathPrefix(`/webhook`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: matrix-hookshot
|
||||
port: 9000
|
||||
tls:
|
||||
certResolver: default
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: hookshot-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.110
|
||||
path: /mnt/nfs_share/hookshot
|
||||
readOnly: false
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: hookshot-pvc
|
||||
namespace: matrix
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: hookshot-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
1
lp/matrix/hs-token.txt
Normal file
1
lp/matrix/hs-token.txt
Normal file
@@ -0,0 +1 @@
|
||||
c31f7a18d3d2d79bd7a03e2794d966317155c409699cb6fd0922023cf45f9c3b
|
||||
@@ -28,10 +28,16 @@ spec:
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: matrix
|
||||
- name: hookshot-registration
|
||||
mountPath: /appservices/hookshot-registration.yml
|
||||
subPath: registration.yml
|
||||
volumes:
|
||||
- name: matrix
|
||||
persistentVolumeClaim:
|
||||
claimName: matrix-pvc
|
||||
- name: hookshot-registration
|
||||
secret:
|
||||
secretName: matrix-hookshot-registration
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
@@ -45,7 +51,7 @@ spec:
|
||||
port: 8008
|
||||
selector:
|
||||
app: matrix
|
||||
type: NodePort
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
|
||||
52
lp/matrix/passkey.pem
Normal file
52
lp/matrix/passkey.pem
Normal file
@@ -0,0 +1,52 @@
|
||||
-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ks9sL+9bBMo9f1tVipfDiJ7NmmwYSdzew1ANxnH
|
||||
Sh2zfQcQVQsE3Y79bKY/5quJpUMxVJ+fgdSm4js+4ubQvDDGkpy24rpSgghD3IAd
|
||||
TJVY7t34aXLrp7L0i57OkxCa0gDCpVIkW2KrG4O2N7Aumk3XFmPttRBuAnZZV+22
|
||||
SiovNua1o1B9RYWx2Q/F1oJJMfZV1qDyHe4UxO+6GKO9Z2ETBjIimFc/s/zqLDSx
|
||||
BixkpeaGIwGU11xCAxH+NzqpvaqqAZ0P
|
||||
-----END PRIVATE KEY-----
|
||||
42
lp/matrix/redis.yaml
Executable file
42
lp/matrix/redis.yaml
Executable file
@@ -0,0 +1,42 @@
|
||||
# ===========================
|
||||
# Redis Deployment
|
||||
# ===========================
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: matrix
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
|
||||
---
|
||||
|
||||
# ===========================
|
||||
# Redis Service
|
||||
# ===========================
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: matrix
|
||||
spec:
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
|
||||
|
||||
22
lp/matrix/registration-secret.yaml
Normal file
22
lp/matrix/registration-secret.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
# ===========================
|
||||
# Hookshot Registration Secret
|
||||
# ===========================
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: matrix-hookshot-registration
|
||||
namespace: matrix
|
||||
type: Opaque
|
||||
stringData:
|
||||
registration.yml: |
|
||||
id: hookshot
|
||||
url: http://matrix-hookshot.matrix.svc.cluster.local:9993
|
||||
as_token: d3c8fccbe082aa2a59da362b3805abe4c4cebcd7e822cdbd700d84e7c55c485f
|
||||
hs_token: c31f7a18d3d2d79bd7a03e2794d966317155c409699cb6fd0922023cf45f9c3b
|
||||
sender_localpart: hookshot
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: false
|
||||
regex: "^@(hookshot|_webhooks_.*):matrix-lp.allarddcs.nl$"
|
||||
rooms: []
|
||||
aliases: []
|
||||
68
lp/matrix/synapse-admin.yaml
Normal file
68
lp/matrix/synapse-admin.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: synapse-admin
|
||||
namespace: matrix
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: synapse-admin
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: synapse-admin
|
||||
spec:
|
||||
containers:
|
||||
- name: synapse-admin
|
||||
image: awesometechnologies/synapse-admin:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 3
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 3
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: synapse-admin
|
||||
namespace: matrix
|
||||
spec:
|
||||
selector:
|
||||
app: synapse-admin
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: synapse-admin
|
||||
namespace: matrix
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- synapse-admin.matrix-lp.allarddcs.nl
|
||||
rules:
|
||||
- host: synapse-admin.matrix-lp.allarddcs.nl
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: synapse-admin
|
||||
port:
|
||||
number: 80
|
||||
221
lp/matrix/werkt/hookshot.yaml
Normal file
221
lp/matrix/werkt/hookshot.yaml
Normal file
@@ -0,0 +1,221 @@
|
||||
# ===========================
|
||||
# Hookshot ConfigMap
|
||||
# ===========================
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: matrix-hookshot-config
|
||||
namespace: matrix
|
||||
data:
|
||||
config.yml: |
|
||||
bridge:
|
||||
domain: matrix-lp.allarddcs.nl
|
||||
url: http://matrix.matrix.svc.cluster.local:8008
|
||||
port: 9993
|
||||
bindAddress: 0.0.0.0
|
||||
|
||||
homeserver:
|
||||
url: http://matrix.matrix.svc.cluster.local:8008
|
||||
domain: matrix-lp.allarddcs.nl
|
||||
|
||||
appservice:
|
||||
id: hookshot
|
||||
as_token: d3c8fccbe082aa2a59da362b3805abe4c4cebcd7e822cdbd700d84e7c55c485f
|
||||
hs_token: c31f7a18d3d2d79bd7a03e2794d966317155c409699cb6fd0922023cf45f9c3b
|
||||
bot:
|
||||
username: hookshot
|
||||
displayname: Hookshot
|
||||
|
||||
logging:
|
||||
level: debug
|
||||
|
||||
listeners:
|
||||
- port: 9000
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- webhooks
|
||||
- port: 9001
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- metrics
|
||||
- port: 9002
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- widgets
|
||||
- port: 9003
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- appservice
|
||||
|
||||
# Redis for persistent token storage
|
||||
cache:
|
||||
redisUri: redis://redis:6379
|
||||
|
||||
generic:
|
||||
enabled: true
|
||||
urlPrefix: https://hookshot-lp.allarddcs.nl/webhook/
|
||||
userIdPrefix: _webhooks_
|
||||
includeHookBody: true
|
||||
allowJsTransformationFunctions: true
|
||||
|
||||
passFile: /data/passkey.pem
|
||||
|
||||
connections:
|
||||
- connectionType: uk.half-shot.matrix-hookshot.generic.hook
|
||||
stateKey: generic-1
|
||||
roomId: "!BPcyrRUfYdBJrFVdlV:matrix-lp.allarddcs.nl"
|
||||
state:
|
||||
name: "Harbor Webhook"
|
||||
webhookId: harbor
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
# ===========================
|
||||
# Hookshot Deployment
|
||||
# ===========================
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: matrix-hookshot
|
||||
namespace: matrix
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: matrix-hookshot
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: matrix-hookshot
|
||||
spec:
|
||||
containers:
|
||||
- name: hookshot
|
||||
image: halfshot/matrix-hookshot:latest
|
||||
ports:
|
||||
- name: webhooks
|
||||
containerPort: 9000
|
||||
- name: metrics
|
||||
containerPort: 9001
|
||||
- name: widgets
|
||||
containerPort: 9002
|
||||
- name: appservice
|
||||
containerPort: 9003
|
||||
- name: matrix
|
||||
containerPort: 9993
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /data/config.yml
|
||||
subPath: config.yml
|
||||
- name: registration
|
||||
mountPath: /data/registration.yml
|
||||
subPath: registration.yml
|
||||
- name: hookshot-passkey
|
||||
mountPath: /data/passkey.pem
|
||||
subPath: passkey.pem
|
||||
env:
|
||||
- name: CONFIG_FILE
|
||||
value: /data/config.yml
|
||||
- name: REGISTRATION_FILE
|
||||
value: /data/registration.yml
|
||||
- name: NODE_TLS_REJECT_UNAUTHORIZED
|
||||
value: "0"
|
||||
- name: NODE_OPTIONS
|
||||
value: "--dns-result-order=ipv4first"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: matrix-hookshot-config
|
||||
- name: registration
|
||||
secret:
|
||||
secretName: matrix-hookshot-registration
|
||||
- name: hookshot-passkey
|
||||
secret:
|
||||
secretName: hookshot-passkey
|
||||
|
||||
---
|
||||
|
||||
# ===========================
|
||||
# Hookshot Service
|
||||
# ===========================
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: matrix-hookshot
|
||||
namespace: matrix
|
||||
spec:
|
||||
selector:
|
||||
app: matrix-hookshot
|
||||
ports:
|
||||
- name: webhooks
|
||||
port: 9000
|
||||
targetPort: 9000
|
||||
- name: metrics
|
||||
port: 9001
|
||||
targetPort: 9000
|
||||
- name: widgets
|
||||
port: 9002
|
||||
targetPort: 9000
|
||||
- name: appservice
|
||||
port: 9003
|
||||
targetPort: 9003
|
||||
- name: matrix
|
||||
port: 9993
|
||||
targetPort: 9993
|
||||
|
||||
---
|
||||
# ===========================
|
||||
# Hookshot IngressRoute
|
||||
# ===========================
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: matrix-hookshot
|
||||
namespace: matrix
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`hookshot-lp.allarddcs.nl`) && PathPrefix(`/webhook`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: matrix-hookshot
|
||||
port: 9000
|
||||
tls:
|
||||
certResolver: default
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: hookshot-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.110
|
||||
path: /mnt/nfs_share/hookshot/lp
|
||||
readOnly: false
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: hookshot-pvc
|
||||
namespace: matrix
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: hookshot-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
122
lp/matrix/werkt/matrix.yaml
Executable file
122
lp/matrix/werkt/matrix.yaml
Executable file
@@ -0,0 +1,122 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: matrix
|
||||
namespace: matrix
|
||||
labels:
|
||||
app: matrix
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: matrix
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: matrix
|
||||
spec:
|
||||
containers:
|
||||
- name: matrix
|
||||
image: matrixdotorg/synapse:latest
|
||||
# args:
|
||||
# - generate
|
||||
env:
|
||||
- name: SYNAPSE_SERVER_NAME
|
||||
value: "matrix-lp.allarddcs.nl"
|
||||
# - name: SYNAPSE_REPORT_STATS
|
||||
# value: "yes"
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: matrix
|
||||
- name: hookshot-registration
|
||||
mountPath: /appservices/hookshot-registration.yml
|
||||
subPath: registration.yml
|
||||
volumes:
|
||||
- name: matrix
|
||||
persistentVolumeClaim:
|
||||
claimName: matrix-pvc
|
||||
- name: hookshot-registration
|
||||
secret:
|
||||
secretName: matrix-hookshot-registration
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: matrix
|
||||
namespace: matrix
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
targetPort: 8008
|
||||
port: 8008
|
||||
selector:
|
||||
app: matrix
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: matrix-http
|
||||
namespace: matrix
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`matrix-lp.allarddcs.nl`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: matrix
|
||||
port: 8008
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: matrix-tls
|
||||
namespace: matrix
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- match: Host(`matrix-lp.allarddcs.nl`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: matrix
|
||||
port: 8008
|
||||
tls:
|
||||
secretName: matrix-lp.allarddcs.nl-tls
|
||||
# certResolver: letsencrypt
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: matrix-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.110
|
||||
path: /mnt/nfs_share/matrix/lp
|
||||
readOnly: false
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: matrix-pvc
|
||||
namespace: matrix
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: matrix-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
22
lp/matrix/werkt/registration-secret.yaml
Normal file
22
lp/matrix/werkt/registration-secret.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
# ===========================
|
||||
# Hookshot Registration Secret
|
||||
# ===========================
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: matrix-hookshot-registration
|
||||
namespace: matrix
|
||||
type: Opaque
|
||||
stringData:
|
||||
registration.yml: |
|
||||
id: hookshot
|
||||
url: http://matrix-hookshot.matrix.svc.cluster.local:9993
|
||||
as_token: d3c8fccbe082aa2a59da362b3805abe4c4cebcd7e822cdbd700d84e7c55c485f
|
||||
hs_token: c31f7a18d3d2d79bd7a03e2794d966317155c409699cb6fd0922023cf45f9c3b
|
||||
sender_localpart: hookshot
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: "^@(hookshot|_webhooks_.*):matrix-lp.allarddcs.nl$"
|
||||
rooms: []
|
||||
aliases: []
|
||||
Reference in New Issue
Block a user