diff --git a/src/main/cljc/dda/c4k_nextcloud/nextcloud.cljc b/src/main/cljc/dda/c4k_nextcloud/nextcloud.cljc index 1c0b49f..ac3db50 100644 --- a/src/main/cljc/dda/c4k_nextcloud/nextcloud.cljc +++ b/src/main/cljc/dda/c4k_nextcloud/nextcloud.cljc @@ -10,7 +10,7 @@ [dda.c4k-common.common :as cm] [dda.c4k-common.postgres :as postgres])) -(s/def ::fqdn any?) ; TODO: Fix fqdn-string? to include localhost +(s/def ::fqdn cp/fqdn-string?) (s/def ::issuer cp/letsencrypt-issuer?) (s/def ::restic-repository string?) (s/def ::nextcloud-data-volume-path string?) @@ -38,7 +38,7 @@ (defn generate-certificate [config] (let [{:keys [fqdn issuer]} config - letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")] + letsencrypt-issuer (name issuer)] (-> (yaml/from-string (yaml/load-resource "nextcloud/certificate.yaml")) (assoc-in [:spec :commonName] fqdn) @@ -53,7 +53,7 @@ (defn generate-ingress [config] (let [{:keys [fqdn issuer] :or {issuer :staging}} config - letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")] + letsencrypt-issuer (name issuer)] (-> (yaml/from-string (yaml/load-resource "nextcloud/ingress.yaml")) (assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer) diff --git a/src/main/resources/nextcloud/certificate.yaml b/src/main/resources/nextcloud/certificate.yaml index 6912f95..0890ac5 100644 --- a/src/main/resources/nextcloud/certificate.yaml +++ b/src/main/resources/nextcloud/certificate.yaml @@ -9,5 +9,5 @@ spec: dnsNames: - fqdn issuerRef: - name: letsencrypt-staging-issuer + name: staging kind: ClusterIssuer \ No newline at end of file diff --git a/src/test/cljc/dda/c4k_nextcloud/nextcloud_test.cljc b/src/test/cljc/dda/c4k_nextcloud/nextcloud_test.cljc index bf8c867..024a0c6 100644 --- a/src/test/cljc/dda/c4k_nextcloud/nextcloud_test.cljc +++ b/src/test/cljc/dda/c4k_nextcloud/nextcloud_test.cljc @@ -24,7 +24,7 @@ :commonName "xx" :dnsNames ["xx"] :issuerRef - {:name "letsencrypt-prod-issuer", :kind "ClusterIssuer"}}} + {:name "prod", :kind "ClusterIssuer"}}} (cut/generate-certificate {:fqdn "xx" :issuer :prod})))) (deftest should-generate-ingress @@ -33,7 +33,7 @@ :metadata {:name "ingress-cloud" :annotations - {:cert-manager.io/cluster-issuer "letsencrypt-staging-issuer" + {:cert-manager.io/cluster-issuer "staging" :ingress.kubernetes.io/proxy-body-size "256m" :ingress.kubernetes.io/ssl-redirect "true" :ingress.kubernetes.io/rewrite-target "/"