diff --git a/src/main/cljc/dda/c4k_website/core.cljc b/src/main/cljc/dda/c4k_website/core.cljc index da7947c..f6c32bd 100644 --- a/src/main/cljc/dda/c4k_website/core.cljc +++ b/src/main/cljc/dda/c4k_website/core.cljc @@ -13,8 +13,5 @@ (website/generate-website-content-volume config) (website/generate-ingress config) (website/generate-certificate config) - (website/generate-website-build-cron config) - (website/generate-website-build-deployment config) - (website/generate-website-build-secret config) - - ]))) + (website/generate-website-build-cron config) + (website/generate-website-build-secret config)]))) diff --git a/src/main/cljc/dda/c4k_website/website.cljc b/src/main/cljc/dda/c4k_website/website.cljc index e2b8316..67dac6b 100644 --- a/src/main/cljc/dda/c4k_website/website.cljc +++ b/src/main/cljc/dda/c4k_website/website.cljc @@ -1,7 +1,8 @@ (ns dda.c4k-website.website (:require [clojure.spec.alpha :as s] - [clojure.math.numeric-tower :as m] + #?(:clj [clojure.math.numeric-tower :as m] + :cljs [cljs.math :as m]) [clojure.string :as st] #?(:cljs [shadow.resource :as rc]) #?(:clj [orchestra.core :refer [defn-spec]] diff --git a/src/main/cljs/dda/c4k_website/browser.cljs b/src/main/cljs/dda/c4k_website/browser.cljs index 0db87dc..543770d 100644 --- a/src/main/cljs/dda/c4k_website/browser.cljs +++ b/src/main/cljs/dda/c4k_website/browser.cljs @@ -36,6 +36,14 @@ (cm/concat-vec (br/generate-input-field "volume-total-storage-size" "Your website volume-total-storage-size:" "20") (br/generate-input-field "number-of-websites" "The Number of websites running on your cluster" "5"))) + (generate-group + "credentials" + (br/generate-text-area + "auth" "Your auth.edn:" + "{:gitrepourl \"https://your.gitea.host/api/v1/repos///archive/.zip\" + :authtoken \"yourgiteaauthtoken\" + }" + "3")) [(br/generate-br)] (br/generate-button "generate-button" "Generate c4k yaml")))] (br/generate-output "c4k-website-output" "Your c4k deployment.yaml:" "25"))) @@ -61,7 +69,8 @@ (br/validate! "fqdn" ::website/fqdn) (br/validate! "issuer" ::website/issuer :optional true) (br/validate! "volume-total-storage-size" ::website/volume-total-storage-size :deserializer js/parseInt) - (br/validate! "number-of-websites" ::website/number-of-websites :deserializer js/parseInt) + (br/validate! "number-of-websites" ::website/number-of-websites :deserializer js/parseInt) + (br/validate! "auth" core/auth? :deserializer edn/read-string) (br/set-form-validated!)) (defn add-validate-listener [name] @@ -84,4 +93,5 @@ (add-validate-listener "fqdn") (add-validate-listener "volume-total-storage-size") (add-validate-listener "issuer") - (add-validate-listener "number-of-websites")) \ No newline at end of file + (add-validate-listener "number-of-websites") + (add-validate-listener "auth")) \ No newline at end of file diff --git a/valid-auth.edn b/valid-auth.edn index 5567b06..0feaed6 100644 --- a/valid-auth.edn +++ b/valid-auth.edn @@ -1 +1,2 @@ -{:none "none"} +{:authtoken "asdfasdfe" + :gitrepourl "https://some.de/path/to/repo.zip"}