Added secret.yaml
This commit is contained in:
parent
1d81949768
commit
686b20aa56
8 changed files with 53 additions and 5 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -21,6 +21,6 @@ public/js/
|
||||||
*.iml
|
*.iml
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
valid-auth.edn
|
#valid-auth.edn
|
||||||
valid-config.edn
|
#valid-config.edn
|
||||||
my-auth.edn
|
my-auth.edn
|
||||||
|
|
|
@ -12,14 +12,16 @@
|
||||||
(def config? (s/keys :req-un [::jira/fqdn]
|
(def config? (s/keys :req-un [::jira/fqdn]
|
||||||
:opt-un [::jira/issuer]))
|
:opt-un [::jira/issuer]))
|
||||||
|
|
||||||
(def auth? (s/keys :req-un []))
|
(def auth? (s/keys :req-un [::jira/db-user-name ::jira/db-user-password]))
|
||||||
|
|
||||||
(defn-spec generate any?
|
(defn-spec generate any?
|
||||||
[my-config config?
|
[my-config config?
|
||||||
my-auth auth?]
|
my-auth auth?]
|
||||||
(let [resulting-config (merge config-defaults my-config)]
|
(let [resulting-config (merge config-defaults my-config)]
|
||||||
(cs/join "\n"
|
(cs/join "\n"
|
||||||
[(yaml/to-string (jira/generate-persistent-volume))
|
[(yaml/to-string (jira/generate-secret my-auth))
|
||||||
|
"---"
|
||||||
|
(yaml/to-string (jira/generate-persistent-volume))
|
||||||
"---"
|
"---"
|
||||||
(yaml/to-string (jira/generate-pvc))
|
(yaml/to-string (jira/generate-pvc))
|
||||||
"---"
|
"---"
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
(s/def ::fqdn cm/fqdn-string?)
|
(s/def ::fqdn cm/fqdn-string?)
|
||||||
(s/def ::issuer cm/letsencrypt-issuer?)
|
(s/def ::issuer cm/letsencrypt-issuer?)
|
||||||
|
|
||||||
|
(defn generate-secret [auth]
|
||||||
|
(let [{:keys [db-user-name db-user-password]} auth]
|
||||||
|
(->
|
||||||
|
(yaml/from-string (yaml/load-resource "jira/secret.yaml"))
|
||||||
|
(assoc-in [:data :db-user-name] db-user-name)
|
||||||
|
(assoc-in [:data :db-user-password] db-user-password))))
|
||||||
|
|
||||||
(defn generate-certificate [config]
|
(defn generate-certificate [config]
|
||||||
(let [{:keys [fqdn issuer]
|
(let [{:keys [fqdn issuer]
|
||||||
:or {issuer :staging}} config
|
:or {issuer :staging}} config
|
||||||
|
@ -39,6 +46,6 @@
|
||||||
(yaml/from-string (yaml/load-resource "jira/service.yaml")))
|
(yaml/from-string (yaml/load-resource "jira/service.yaml")))
|
||||||
|
|
||||||
(defn generate-pod [config]
|
(defn generate-pod [config]
|
||||||
(let [{:keys [fqdn db-user-name db-user-password]}]
|
(let [{:keys [fqdn db-user-name db-user-password]} config]
|
||||||
(-> (yaml/from-string (yaml/load-resource "jira/pod.yaml"))
|
(-> (yaml/from-string (yaml/load-resource "jira/pod.yaml"))
|
||||||
(assoc-in [:spec :containers :args] [fqdn, db-user-name, db-user-password]))))
|
(assoc-in [:spec :containers :args] [fqdn, db-user-name, db-user-password]))))
|
||||||
|
|
8
src/main/resources/jira/secret.yaml
Normal file
8
src/main/resources/jira/secret.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: jira-secret
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
db-user-name: admin
|
||||||
|
db-user-password: admin
|
1
src/test/resources/valid-auth.edn
Normal file
1
src/test/resources/valid-auth.edn
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{:auth {}}
|
27
src/test/resources/valid-config.edn
Normal file
27
src/test/resources/valid-config.edn
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{:transform [{:source {:source-type :twitter
|
||||||
|
;; optional, defaults to false
|
||||||
|
:include-replies? false
|
||||||
|
;; optional, defaults to false
|
||||||
|
:include-rts? false
|
||||||
|
;; Replace Twitter links by Nitter
|
||||||
|
:nitter-urls? false
|
||||||
|
;; accounts you wish to mirror
|
||||||
|
:accounts ["arstechnica" "WIRED"]}
|
||||||
|
:target {:target-type :mastodon
|
||||||
|
;; optional flag specifying wether the name of the account
|
||||||
|
;; will be appended in the post, defaults to false
|
||||||
|
:append-screen-name? false
|
||||||
|
;; optional visibility flag: direct, private, unlisted, public
|
||||||
|
;; defaults to public
|
||||||
|
:visibility "unlisted"
|
||||||
|
;; optional boolean to mark content as sensitive. Defaults to true.
|
||||||
|
:sensitive? true
|
||||||
|
;; optional boolean defaults to false
|
||||||
|
;; only sources containing media will be posted when set to true
|
||||||
|
:media-only? true
|
||||||
|
;; optional limit for the post length. Defaults to 300.
|
||||||
|
:max-post-length 300
|
||||||
|
;; optional signature for posts. Defaults to "not present".
|
||||||
|
:signature "#newsbot"}
|
||||||
|
}]
|
||||||
|
:auth {}}
|
2
valid-auth.edn
Normal file
2
valid-auth.edn
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{:db-user-name "jira"
|
||||||
|
:db-user-password "jira-db-password"}
|
1
valid-config.edn
Normal file
1
valid-config.edn
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{:fqdn "keycloak.test.meissa-gmbh.de"}
|
Reference in a new issue