jitsi-k8s/04-add-users.yml

125 lines
3.3 KiB
YAML
Raw Normal View History

2024-07-03 07:54:32 +00:00
apiVersion: v1
kind: ConfigMap
metadata:
name: jitsi-users
2024-07-03 07:54:32 +00:00
data:
users: |-
user1 asdqwe
user2 asdqwe
user3 asdqwe
clear.sh: |-
#!/bin/bash
[ ! -d /config/data/meet%2ejitsi/accounts ] && exit 0
find /config/data/meet%2ejitsi/accounts/ -type f -exec basename {} .dat \; |
while IFS="" read -r user || [ -n "$user" ]; do
prosodyctl --config /config/prosody.cfg.lua unregister "${user}" meet.jitsi
done
add.sh: |-
#!/bin/bash
while IFS="" read -r line || [ -n "$line" ]; do
username="$(echo "${line}" | cut -d ' ' -f1)"
password="$(echo "${line}" | cut -d ' ' -f2)"
prosodyctl --config /config/prosody.cfg.lua register "${username}" meet.jitsi "${password}"
done < /users
---
apiVersion: batch/v1
kind: Job
metadata:
name: add-users
2024-07-10 10:57:37 +00:00
namespace: external-app-development
2024-07-03 07:54:32 +00:00
spec:
template:
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64
- amd64
containers:
- name: add-users
image: dowerx/prosody:non-root
2024-07-03 07:54:32 +00:00
command: ["/bin/bash", "-c"]
args: ["bash /clear.sh && bash /add.sh"]
envFrom:
- configMapRef:
name: jitsi-env
2024-07-03 07:54:32 +00:00
env:
- name: JICOFO_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: jitsi-passwords
2024-07-03 07:54:32 +00:00
key: JICOFO_AUTH_PASSWORD
- name: JVB_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: jitsi-passwords
2024-07-03 07:54:32 +00:00
key: JVB_AUTH_PASSWORD
- name: JIGASI_XMPP_PASSWORD
valueFrom:
secretKeyRef:
name: jitsi-passwords
2024-07-03 07:54:32 +00:00
key: JIGASI_XMPP_PASSWORD
- name: JIBRI_RECORDER_PASSWORD
valueFrom:
secretKeyRef:
name: jitsi-passwords
2024-07-03 07:54:32 +00:00
key: JIBRI_RECORDER_PASSWORD
- name: JIBRI_XMPP_PASSWORD
valueFrom:
secretKeyRef:
name: jitsi-passwords
2024-07-03 07:54:32 +00:00
key: JIBRI_XMPP_PASSWORD
securityContext:
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
2024-07-03 07:54:32 +00:00
volumeMounts:
- mountPath: /config
name: jitsi
subPath: prosody
2024-07-03 07:54:32 +00:00
- mountPath: /users
name: jitsi-users
2024-07-03 07:54:32 +00:00
subPath: users
- mountPath: /clear.sh
name: jitsi-users
2024-07-03 07:54:32 +00:00
subPath: clear.sh
- mountPath: /add.sh
name: jitsi-users
2024-07-03 07:54:32 +00:00
subPath: add.sh
restartPolicy: OnFailure
securityContext:
fsGroup: 1000
2024-07-03 07:54:32 +00:00
volumes:
- name: jitsi
2024-07-03 07:54:32 +00:00
persistentVolumeClaim:
claimName: jitsi
- name: jitsi-users
2024-07-03 07:54:32 +00:00
configMap:
name: jitsi-users
2024-07-03 07:54:32 +00:00
items:
- key: users
path: users
- key: clear.sh
path: clear.sh
- key: add.sh
path: add.sh