From c286faf084e081a8970472af6e2d4f098a1caca1 Mon Sep 17 00:00:00 2001 From: jerger Date: Tue, 26 Jul 2022 19:35:35 +0200 Subject: [PATCH] added review comments --- src/main/cljc/dda/c4k_gitea/gitea.cljc | 5 ++++- .../resources/gitea/appini-env-configmap.yaml | 22 +++++-------------- src/main/resources/gitea/deployment.yaml | 1 + src/main/resources/gitea/secrets.yaml | 1 + .../resources/gitea/traefik-middleware.yaml | 1 + src/main/resources/gitea/volumes.yaml | 1 + 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/main/cljc/dda/c4k_gitea/gitea.cljc b/src/main/cljc/dda/c4k_gitea/gitea.cljc index 945977f..b1827b1 100644 --- a/src/main/cljc/dda/c4k_gitea/gitea.cljc +++ b/src/main/cljc/dda/c4k_gitea/gitea.cljc @@ -18,15 +18,18 @@ (s/def ::fqdn pred/fqdn-string?) (s/def ::mailer-from pred/bash-env-string?) ; TODO: Move to pred/host-port? +; TODO: Review jem - 2022/07/26 - move to common & add unittest (s/def ::mailer-host-port #(let [split-string (str/split % #":")] (and (= (count split-string) 2) (pred/fqdn-string? (first split-string)) ; TODO: Move this to pred/port-number? + ; TODO: Review jem - 2022/07/26 - move to common & add unittest (let [snd (edn/read-string (second split-string))] (and (integer? snd) (> snd 0) (<= snd 65535)))))) ;TODO: Maybe move to pred/comma-separated-fqdn-list? +; TODO: Review jem - 2022/07/26 - move to common & add unittest (s/def ::service-domain-whitelist #(every? true? (map pred/fqdn-string? (str/split % #",")))) (s/def ::service-noreply-address string?) (s/def ::mailer-user pred/bash-env-string?) @@ -58,7 +61,7 @@ (yaml/from-string (yaml/load-resource resource-name)))) (defn-spec generate-appini-env pred/map-or-seq? - ; TODO: fix this to require the merged spec of auth and config instead of any + ; TODO: Review jem - 2022/07/26 - as we do not need auth here just hand over config & spec it. [config any?] (let [{:keys [default-app-name fqdn diff --git a/src/main/resources/gitea/appini-env-configmap.yaml b/src/main/resources/gitea/appini-env-configmap.yaml index d17c2de..38d5e58 100644 --- a/src/main/resources/gitea/appini-env-configmap.yaml +++ b/src/main/resources/gitea/appini-env-configmap.yaml @@ -61,14 +61,18 @@ data: #[server] GITEA__server__DOMAIN: FQDN GITEA__server__SSH_DOMAIN: FQDN - GITEA__server__ROOT_URL: URL + GITEA__server__ROOT_URL: URL + # TODO: Review jem - 2022/07/26 - what does http port mean? The outgoning port should be 80 for http // 443 for https! GITEA__server__HTTP_PORT: "3000" GITEA__server__SSH_PORT: "2222" #[service] + # TODO: Review jem - 2022/07/26 - why? Does not match to whitelisting GITEA__service__DISABLE_REGISTRATION: "true" GITEA__service__REQUIRE_SIGNIN_VIEW: "false" + # TODO: Review jem - 2022/07/26 - why? Does not match to whitelisting GITEA__service__REGISTER_EMAIL_CONFIRM: "false" + # TODO: Review jem - 2022/07/26 - why? Does not match to whitelisting GITEA__service__ENABLE_NOTIFY_MAIL: "false" GITEA__service__EMAIL_DOMAIN_WHITELIST: WHITELISTDOMAINS GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION: "false" @@ -81,19 +85,3 @@ data: #[session] GITEA__session__PROVIDER_CONFIG: /data/gitea/sessions GITEA__session__PROVIDER: file - - - - - - - - - - - - - - - - diff --git a/src/main/resources/gitea/deployment.yaml b/src/main/resources/gitea/deployment.yaml index b1abf8a..cc2149b 100644 --- a/src/main/resources/gitea/deployment.yaml +++ b/src/main/resources/gitea/deployment.yaml @@ -18,6 +18,7 @@ spec: spec: containers: - name: gitea + # TODO: Review jem - 2022/07/26 - latest release? image: gitea/gitea:1.16.9 imagePullPolicy: IfNotPresent # config settings diff --git a/src/main/resources/gitea/secrets.yaml b/src/main/resources/gitea/secrets.yaml index 80feb13..4f0e447 100644 --- a/src/main/resources/gitea/secrets.yaml +++ b/src/main/resources/gitea/secrets.yaml @@ -3,6 +3,7 @@ kind: Secret metadata: name: gitea-secrets data: + # TODO: Review jem - 2022/07/26 - mixed upper & lowercase?? GITEA__database__USER: DBUSER GITEA__database__PASSWD: DBPW diff --git a/src/main/resources/gitea/traefik-middleware.yaml b/src/main/resources/gitea/traefik-middleware.yaml index a327dba..f36d807 100644 --- a/src/main/resources/gitea/traefik-middleware.yaml +++ b/src/main/resources/gitea/traefik-middleware.yaml @@ -1,3 +1,4 @@ +# TODO: Review jem - 2022/07/26 - move this to provs? apiVersion: traefik.containo.us/v1alpha1 kind: Middleware metadata: diff --git a/src/main/resources/gitea/volumes.yaml b/src/main/resources/gitea/volumes.yaml index ee2a43b..2b76c20 100644 --- a/src/main/resources/gitea/volumes.yaml +++ b/src/main/resources/gitea/volumes.yaml @@ -26,4 +26,5 @@ spec: - ReadWriteOnce resources: requests: + # TODO: Review jem - 2022/07/26 - should be configurable & as large as posible ... storage: 15Gi