diff --git a/src/main/cljc/dda/c4k_shynet/shynet.cljc b/src/main/cljc/dda/c4k_shynet/shynet.cljc index e5e708b..3975be1 100644 --- a/src/main/cljc/dda/c4k_shynet/shynet.cljc +++ b/src/main/cljc/dda/c4k_shynet/shynet.cljc @@ -6,15 +6,14 @@ [dda.c4k-common.common :as cm] [dda.c4k-common.predicate :as pred])) -(s/def ::fqdn pred/fqdn-string?) -(s/def ::issuer pred/letsencrypt-issuer?) -(s/def ::django-secret-key pred/bash-env-string?) - (defn ingress-type? [input] - (contains? #{:traefik :default} input)) + (contains? #{:traefik :nginx} input)) +(s/def ::fqdn pred/fqdn-string?) +(s/def ::issuer pred/letsencrypt-issuer?) (s/def ::ingress-type ingress-type?) +(s/def ::django-secret-key pred/bash-env-string?) #?(:cljs (defmethod yaml/load-resource :shynet [resource-name] @@ -32,7 +31,7 @@ (let [{:keys [fqdn django-secret-key postgres-db-user postgres-db-password]} config] (-> (yaml/from-string (yaml/load-resource "shynet/secret.yaml")) - ; See comment in secret.yaml + ; TODO: See comment in secret.yaml ;(assoc-in [:stringData :ALLOWED_HOSTS] fqdn) (assoc-in [:stringData :DJANGO_SECRET_KEY] django-secret-key) (assoc-in [:stringData :DB_USER] postgres-db-user) diff --git a/src/main/cljs/dda/c4k_shynet/browser.cljs b/src/main/cljs/dda/c4k_shynet/browser.cljs index 9b30e68..3de8d07 100644 --- a/src/main/cljs/dda/c4k_shynet/browser.cljs +++ b/src/main/cljs/dda/c4k_shynet/browser.cljs @@ -39,7 +39,7 @@ "provider" (concat-vec (br/generate-input-field "ingress-type" "(Optional) Your ingress type (traefik/ngingx):" "traefik") - (br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path:" "/var/postgres"))) + (br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path if Persistent Volumes are not generated by an Operator:" ""))) (generate-group "credentials" (br/generate-text-area @@ -61,19 +61,23 @@ (defn config-from-document [] (let [postgres-data-volume-path (br/get-content-from-element "postgres-data-volume-path" :optional true) - issuer (br/get-content-from-element "issuer" :optional true :deserializer keyword)] + issuer (br/get-content-from-element "issuer" :optional true :deserializer keyword) + ingress-type (br/get-content-from-element "ingress-type" :optional true :deserializer keyword)] (merge {:fqdn (br/get-content-from-element "fqdn")} (when (some? postgres-data-volume-path) {:postgres-data-volume-path postgres-data-volume-path}) (when (some? issuer) {:issuer issuer}) + (when (some? ingress-type) + {:ingress-type ingress-type}) ))) (defn validate-all! [] (br/validate! "fqdn" ::shynet/fqdn) - (br/validate! "postgres-data-volume-path" ::pgc/postgres-data-volume-path :optional true) (br/validate! "issuer" ::shynet/issuer :optional true :deserializer keyword) + (br/validate! "ingress-type" ::shynet/ingress-type :optional true) + (br/validate! "postgres-data-volume-path" ::pgc/postgres-data-volume-path :optional true) (br/validate! "auth" core/auth? :deserializer edn/read-string) (br/set-validated!))