diff --git a/src/main/clj/dda/c4k_jitsi/uberjar.clj b/src/main/clj/dda/c4k_jitsi/uberjar.clj index a2a27dc..d018411 100644 --- a/src/main/clj/dda/c4k_jitsi/uberjar.clj +++ b/src/main/clj/dda/c4k_jitsi/uberjar.clj @@ -11,5 +11,5 @@ jitsi/config? jitsi/auth? core/config-defaults - core/generate + core/k8s-objects cmd-args)) diff --git a/src/main/cljc/dda/c4k_jitsi/core.cljc b/src/main/cljc/dda/c4k_jitsi/core.cljc index 4b4e7d5..d57adf1 100644 --- a/src/main/cljc/dda/c4k_jitsi/core.cljc +++ b/src/main/cljc/dda/c4k_jitsi/core.cljc @@ -4,27 +4,21 @@ [clojure.spec.alpha :as s] #?(:clj [orchestra.core :refer [defn-spec]] :cljs [orchestra.core :refer-macros [defn-spec]]) + [dda.c4k-common.common :as cm] [dda.c4k-common.yaml :as yaml] [dda.c4k-jitsi.jitsi :as jitsi])) -(def config-defaults {:issuer :staging}) +(def config-defaults {:issuer "staging"}) -(defn k8s-objects [config] +(defn k8s-objects [config auth] (map yaml/to-string - [(jitsi/generate-secret-jitsi config) - (jitsi/generate-certificate-jitsi config) - (jitsi/generate-certificate-etherpad config) - (jitsi/generate-jvb-service) - (jitsi/generate-web-service) - (jitsi/generate-etherpad-service) - (jitsi/generate-ingress-jitsi config) - (jitsi/generate-ingress-etherpad config) - (jitsi/generate-deployment config)])) - -(defn-spec generate any? - [my-config jitsi/config? - my-auth jitsi/auth?] - (cm/concat-vec - (map yaml/to-string - (filter #(not (nil? %)) - (merge config-defaults my-config my-auth))))) + (filter + #(not (nil? %)) + (cm/concat-vec + [(jitsi/generate-secret-jitsi auth) + (jitsi/generate-jvb-service) + (jitsi/generate-web-service) + (jitsi/generate-etherpad-service) + (jitsi/generate-deployment config)] + (jitsi/generate-ingress-web config) + (jitsi/generate-ingress-etherpad config))))) diff --git a/src/main/cljs/dda/c4k_jitsi/browser.cljs b/src/main/cljs/dda/c4k_jitsi/browser.cljs index fd166a5..15fd9bf 100644 --- a/src/main/cljs/dda/c4k_jitsi/browser.cljs +++ b/src/main/cljs/dda/c4k_jitsi/browser.cljs @@ -57,9 +57,11 @@ (.getElementById "generate-button") (.addEventListener "click" #(do (validate-all!) - (-> (core/generate + (-> (cm/generate-common (config-from-document) - (br/get-content-from-element "auth" :deserializer edn/read-string)) + (br/get-content-from-element "auth" :deserializer edn/read-string) + {} + core/k8s-objects) (br/set-output!))))) (add-validate-listener "fqdn") (add-validate-listener "issuer")