Removed meissa-specifics

Moved database user and pw to secrets.yaml
This commit is contained in:
erik 2022-07-15 13:48:09 +02:00
parent 178cbc8fa3
commit 9113bc2677
4 changed files with 31 additions and 16 deletions

View file

@ -43,22 +43,26 @@
(defn-spec generate-appini-env pred/map-or-seq? (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: fix this to require the merged spec of auth and config instead of any
[config any?] [config any?]
(let [{:keys [postgres-db-user postgres-db-password fqdn]} config] (let [{:keys [fqdn mailer-from mailer-host mailer-port service-whitelist-domains]} config]
(-> (->
(yaml/load-as-edn "gitea/appini-env-configmap.yaml") (yaml/load-as-edn "gitea/appini-env-configmap.yaml")
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn) (cm/replace-all-matching-values-by-new-value "FQDN" fqdn)
(cm/replace-all-matching-values-by-new-value "URL" (str "https://" fqdn)) (cm/replace-all-matching-values-by-new-value "URL" (str "https://" fqdn))
(cm/replace-all-matching-values-by-new-value "DBUSER" postgres-db-user) (cm/replace-all-matching-values-by-new-value "FROM" mailer-from)
(cm/replace-all-matching-values-by-new-value "DBPW" postgres-db-password)))) (cm/replace-all-matching-values-by-new-value "HOST" mailer-host)
(cm/replace-all-matching-values-by-new-value "PORT" mailer-port)
(cm/replace-all-matching-values-by-new-value "WHITELISTDOMAINS" service-whitelist-domains)
)))
(defn-spec generate-secrets pred/map-or-seq? (defn-spec generate-secrets pred/map-or-seq?
[auth auth?] [auth auth?]
(let [{:keys [maileruser mailerpw]} auth] (let [{:keys [postgres-db-user postgres-db-password mailer-user mailer-pw]} auth]
(-> (->
(yaml/load-as-edn "gitea/secrets.yaml") (yaml/load-as-edn "gitea/secrets.yaml")
(cm/replace-all-matching-values-by-new-value "MAILERUSER" (b64/encode maileruser)) (cm/replace-all-matching-values-by-new-value "DBUSER" postgres-db-user)
(cm/replace-all-matching-values-by-new-value "MAILERPW" (b64/encode mailerpw)) (cm/replace-all-matching-values-by-new-value "DBPW" postgres-db-password)
))) (cm/replace-all-matching-values-by-new-value "MAILERUSER" (b64/encode mailer-user))
(cm/replace-all-matching-values-by-new-value "MAILERPW" (b64/encode mailer-pw)))))
(defn-spec generate-ingress pred/map-or-seq? (defn-spec generate-ingress pred/map-or-seq?
[config config?] [config config?]

View file

@ -7,16 +7,24 @@ data:
GITEA__database__DB_TYPE: "postgres" GITEA__database__DB_TYPE: "postgres"
GITEA__database__HOST: "postgresql-service:5432" # Service.Namespace.svc.cluster.local GITEA__database__HOST: "postgresql-service:5432" # Service.Namespace.svc.cluster.local
GITEA__database__NAME: gitea GITEA__database__NAME: gitea
GITEA__database__USER: DBUSER
GITEA__database__PASSWD: DBPW
GITEA__server__DOMAIN: FQDN GITEA__server__DOMAIN: FQDN
GITEA__server__ROOT_URL: URL GITEA__server__ROOT_URL: URL
GITEA__mailer__ENABLED: "true" GITEA__mailer__ENABLED: "true"
GITEA__mailer__FROM: gitea@meissa-gmbh.de GITEA__mailer__FROM: FROM
GITEA__mailer__MAILER_TYPE: smtp GITEA__mailer__MAILER_TYPE: smtp
GITEA__mailer__HOST: mail.routing.net:465 GITEA__mailer__HOST: HOST:PORT
GITEA__mailer__IS_TLS_ENABLED: "true" GITEA__mailer__IS_TLS_ENABLED: "true"
GITEA__service__DISABLE_REGISTRATION: "true" GITEA__service__DISABLE_REGISTRATION: "true"
GITEA__service__REQUIRE_SIGNIN_VIEW: "false"
GITEA__service__REGISTER_EMAIL_CONFIRM: "false"
GITEA__service__ENABLE_NOTIFY_MAIL: "false"
GITEA__service__EMAIL_DOMAIN_WHITELIST: WHITELISTDOMAINS
GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION: "false"
GITEA__service__ENABLE_CAPTCHA: "false"
GITEA__service__DEFAULT_KEEP_EMAIL_PRIVATE: "true"
GITEA__service__DEFAULT_ALLOW_CREATE_ORGANIZATION: "true"
GITEA__service__DEFAULT_ENABLE_TIMETRACKING: "true"
GITEA__service__NO_REPLY_ADDRESS: noreply

View file

@ -3,6 +3,9 @@ kind: Secret
metadata: metadata:
name: gitea-secrets name: gitea-secrets
data: data:
GITEA__database__USER: DBUSER
GITEA__database__PASSWD: DBPW
GITEA__mailer__USER: MAILERUSER GITEA__mailer__USER: MAILERUSER
GITEA__mailer__PASSWD: MAILERPW GITEA__mailer__PASSWD: MAILERPW

View file

@ -1,4 +1,4 @@
{:postgres-db-user "gitea" {:postgres-db-user "gitea"
:postgres-db-password "gitea-db-password" :postgres-db-password "gitea-db-password"
:maileruser "" :mailer-user ""
:mailerpw ""} :mailer-pw ""}