remodel components

This commit is contained in:
Michael Jerger 2025-02-13 16:27:30 +01:00
parent ae53a2977f
commit c5cec0bfd5
4 changed files with 41 additions and 20 deletions
.gitignore
src/main
cljc/dda/c4k_jitsi
resources/jitsi

1
.gitignore vendored
View file

@ -28,3 +28,4 @@ auth.edn
config.edn
out.yaml
.eastwood
tmp/

View file

@ -10,7 +10,8 @@
[dda.c4k-jitsi.jitsi :as jitsi]
[dda.c4k-common.namespace :as ns]))
(def config-defaults {:issuer "staging", :namespace "jitsi"})
(def config-defaults {:issuer "staging",
:namespace "jitsi"})
(s/def ::mon-cfg ::mon/mon-cfg)
(s/def ::mon-auth ::mon/mon-auth)
@ -26,25 +27,27 @@
(defn-spec config-objects cp/map-or-seq?
[config config?]
(map yaml/to-string
(filter
#(not (nil? %))
(cm/concat-vec
(ns/generate config)
[(jitsi/generate-jvb-service config)
(jitsi/generate-web-service config)
(jitsi/generate-etherpad-service config)
(jitsi/generate-excalidraw-backend-service config)
(jitsi/generate-modelector-service config)
(jitsi/generate-deployment config)
(jitsi/generate-excalidraw-deployment config)
(jitsi/generate-modelector-deployment config)]
(jitsi/generate-ingress-web config)
(jitsi/generate-ingress-etherpad config)
(jitsi/generate-ingress-excalidraw-backend config)
(jitsi/generate-ingress-modelector config)
(when (:contains? config :mon-cfg)
(mon/generate-config))))))
(let [resolved-config (merge config-defaults config)]
(map yaml/to-string
(filter
#(not (nil? %))
(cm/concat-vec
(ns/generate resolved-config)
(jitsi/prosody resolved-config)
;; [(jitsi/generate-jvb-service config)
;; (jitsi/generate-web-service config)
;; (jitsi/generate-etherpad-service config)
;; (jitsi/generate-excalidraw-backend-service config)
;; (jitsi/generate-modelector-service config)
;; (jitsi/generate-deployment config)
;; (jitsi/generate-excalidraw-deployment config)
;; (jitsi/generate-modelector-deployment config)]
;; (jitsi/generate-ingress-web config)
;; (jitsi/generate-ingress-etherpad config)
;; (jitsi/generate-ingress-excalidraw-backend config)
;; (jitsi/generate-ingress-modelector config)
(when (:contains? resolved-config :mon-cfg)
(mon/generate-config)))))))
(defn-spec auth-objects cp/map-or-seq?
[config config?

View file

@ -137,3 +137,11 @@
(->
(yaml/load-as-edn "jitsi/modelector-deployment.yaml")
(cm/replace-all-matching "NAMESPACE" namespace))))
(defn-spec prosody cp/map-or-seq?
[config config?]
(let [{:keys [fqdn namespace]} config]
[(->
(yaml/load-as-edn "jitsi/prosody-sa.yaml")
(cm/replace-all-matching "NAMESPACE" namespace))]))

View file

@ -0,0 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: prosody
namespace: NAMESPACE
labels:
helm.sh/chart: prosody-1.4.1
app.kubernetes.io/name: prosody
app.kubernetes.io/version: "stable-9646"