Compare commits

..

No commits in common. "main" and "2.0.0" have entirely different histories.
main ... 2.0.0

21 changed files with 148 additions and 267 deletions

View file

@ -2,7 +2,7 @@
[![Clojars Project](https://img.shields.io/clojars/v/org.domaindrivenarchitecture/c4k-website.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-website) [![pipeline status](https://gitlab.com/domaindrivenarchitecture/c4k-website/badges/master/pipeline.svg)](https://gitlab.com/domaindrivenarchitecture/c4k-website/-/commits/main) [![Clojars Project](https://img.shields.io/clojars/v/org.domaindrivenarchitecture/c4k-website.svg)](https://clojars.org/org.domaindrivenarchitecture/c4k-website) [![pipeline status](https://gitlab.com/domaindrivenarchitecture/c4k-website/badges/master/pipeline.svg)](https://gitlab.com/domaindrivenarchitecture/c4k-website/-/commits/main)
[<img src="https://domaindrivenarchitecture.org/img/delta-chat.svg" width=20 alt="DeltaChat"> chat over e-mail](mailto:buero@meissa-gmbh.de?subject=community-chat) | [<img src="https://meissa.de/images/parts/contact/mastodon36_hue9b2464f10b18e134322af482b9c915e_5501_filter_14705073121015236177.png" width=20 alt="M"> meissa@social.meissa-gmbh.de](https://social.meissa-gmbh.de/@meissa) | [Blog](https://domaindrivenarchitecture.org) | [Website](https://meissa.de) [<img src="https://domaindrivenarchitecture.org/img/delta-chat.svg" width=20 alt="DeltaChat"> chat over e-mail](mailto:buero@meissa-gmbh.de?subject=community-chat) | [<img src="https://meissa-gmbh.de/img/community/Mastodon_Logotype.svg" width=20 alt="team@social.meissa-gmbh.de"> team@social.meissa-gmbh.de](https://social.meissa-gmbh.de/@team) | [Website & Blog](https://domaindrivenarchitecture.org)
## Purpose ## Purpose

View file

@ -28,12 +28,12 @@ websiteconfigs:
- unique-name: "test.io" - unique-name: "test.io"
fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"] fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"]
forgejo-host: "codeberg.org" forgejo-host: "codeberg.org"
repo-name: "repo" forgejo-repo: "repo"
branchname: "main" branchname: "main"
- unique-name: "example.io" - unique-name: "example.io"
fqdns: ["example.org", "www.example.com"] fqdns: ["example.org", "www.example.com"]
forgejo-host: "fineForgejoHost.net" forgejo-host: "fineForgejoHost.net"
repo-name: "repo" forgejo-repo: "repo"
branchname: "main" branchname: "main"
mon-cfg: mon-cfg:
grafana-cloud-url: "url-for-your-prom-remote-write-endpoint" grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"

View file

@ -7,7 +7,7 @@ import logging
name = 'c4k-website' name = 'c4k-website'
MODULE = 'build' MODULE = 'build'
PROJECT_ROOT_PATH = '../..' PROJECT_ROOT_PATH = '../..'
version = "2.0.4-dev" version = "2.0.0"
@init @init

View file

@ -3,12 +3,9 @@ FROM clojure:lein
# Prepare Entrypoint Script # Prepare Entrypoint Script
ADD resources /tmp ADD resources /tmp
ENV HUGO_VERSION="0.125.5"
ENV GO_VERSION="1.19.13"
ENV BUILDDIR="/etc/website" ENV BUILDDIR="/etc/website"
ENV SOURCEDIR="/etc/websitesource" ENV SOURCEDIR="/etc/websitesource"
ENV WEBSITEROOT="/var/www/html/website/" ENV WEBSITEROOT="/var/www/html/website/"
ENV HASHFILEDIR="/var/hashfile.d" ENV HASHFILEDIR="/var/hashfile.d"
ENV PATH="${PATH}:/usr/local/go/bin"
RUN /tmp/install.sh RUN /tmp/install.sh

View file

@ -20,8 +20,6 @@ if [[ $currentHash == $newHash ]]
echo "Nothing to do" echo "Nothing to do"
else else
echo $currentHash > $HASHFILEDIR/$hashfilename echo $currentHash > $HASHFILEDIR/$hashfilename
echo "Generate .netrc file"
generate-netrc-file
echo "Downloading website data" echo "Downloading website data"
get-website-data $filename get-website-data $filename
unzip-website-data $filename unzip-website-data $filename

View file

@ -1,9 +1,5 @@
#!/bin/bash #!/bin/bash
function generate-netrc-file() {
echo "machine $GITHOST password $AUTHTOKEN" > ~/.netrc
}
function get-website-data() { function get-website-data() {
curl -H "Authorization: token $AUTHTOKEN" -o $SOURCEDIR/$1 $GITREPOURL curl -H "Authorization: token $AUTHTOKEN" -o $SOURCEDIR/$1 $GITREPOURL
} }
@ -21,49 +17,9 @@ function unzip-website-data() {
} }
function build-website() { function build-website() {
(cd $BUILDDIR; dir=$(ls); cd $dir; bash generate.sh;) (cd $BUILDDIR; dir=$(ls); cd $dir; ./generate.sh;)
} }
function move-website-files-to-target() { function move-website-files-to-target() {
(cd $BUILDDIR; dir=$(ls); cd $dir; rsync -ru --exclude-from "/etc/exclude.pattern" --delete target/html/* $WEBSITEROOT;) (cd $BUILDDIR; dir=$(ls); cd $dir; rsync -ru --exclude-from "/etc/exclude.pattern" --delete target/html/* $WEBSITEROOT;)
} }
function install-hugo-from-deb() {
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" -o hugo_extended_${HUGO_VERSION}_linux-amd64.deb
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt" -o checksums.txt
EXPECTED_CHECKSUM="$(sha256sum hugo_extended_${HUGO_VERSION}_linux-amd64.deb)"
ACTUAL_CHECKSUM="$(grep hugo_extended_${HUGO_VERSION}_linux-amd64.deb checksums.txt)"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm hugo.deb
exit 1
fi
echo "Installing hugo"
echo
dpkg -i hugo_extended_${HUGO_VERSION}_linux-amd64.deb
echo "Clean up"
rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
rm checksums.txt
}
function install-go-from-tar() {
curl -L "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -o go_linux-amd64.tar.gz
EXPECTED_CHECKSUM="4643d4c29c55f53fa0349367d7f1bb5ca554ea6ef528c146825b0f8464e2e668 go_linux-amd64.tar.gz"
ACTUAL_CHECKSUM="$(sha256sum go_linux-amd64.tar.gz)"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm go_linux-amd64.tar.gz
exit 1
fi
echo "Installing go"
echo
tar -C /usr/local -xzf go_linux-amd64.tar.gz
echo "Clean up"
rm go_linux-amd64.tar.gz
}

View file

@ -6,9 +6,7 @@ function main()
{ {
{ {
upgradeSystem upgradeSystem
apt-get install -qqy unzip rsync jq imagemagick curl git apt-get install -qqy unzip rsync jq imagemagick curl
install-hugo-from-deb
install-go-from-tar
install -d /etc/lein/ install -d /etc/lein/
install -m 0700 /tmp/entrypoint.sh / install -m 0700 /tmp/entrypoint.sh /
@ -24,5 +22,4 @@ function main()
} }
source /tmp/install_functions_debian.sh source /tmp/install_functions_debian.sh
source /tmp/functions.sh
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main

View file

@ -2,7 +2,7 @@
"name": "c4k-website", "name": "c4k-website",
"description": "Generate c4k yaml for a website deployment.", "description": "Generate c4k yaml for a website deployment.",
"author": "meissa GmbH", "author": "meissa GmbH",
"version": "2.0.4-SNAPSHOT", "version": "2.0.0",
"homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-website#readme", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-website#readme",
"repository": "https://www.npmjs.com/package/c4k-website", "repository": "https://www.npmjs.com/package/c4k-website",
"license": "APACHE2", "license": "APACHE2",

View file

@ -1,11 +1,11 @@
(defproject org.domaindrivenarchitecture/c4k-website "2.0.4-SNAPSHOT" (defproject org.domaindrivenarchitecture/c4k-website "2.0.0"
:description "website c4k-installation package" :description "website c4k-installation package"
:url "https://domaindrivenarchitecture.org" :url "https://domaindrivenarchitecture.org"
:license {:name "Apache License, Version 2.0" :license {:name "Apache License, Version 2.0"
:url "https://www.apache.org/licenses/LICENSE-2.0.html"} :url "https://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.11.3"] :dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/tools.reader "1.4.2"] [org.clojure/tools.reader "1.4.0"]
[org.domaindrivenarchitecture/c4k-common-clj "6.2.3"] [org.domaindrivenarchitecture/c4k-common-clj "6.2.2"]
[hickory "0.7.1" :exclusions [viebel/codox-klipse-theme]]] [hickory "0.7.1" :exclusions [viebel/codox-klipse-theme]]]
:target-path "target/%s/" :target-path "target/%s/"
:source-paths ["src/main/cljc" :source-paths ["src/main/cljc"
@ -23,9 +23,9 @@
:main dda.c4k-website.uberjar :main dda.c4k-website.uberjar
:uberjar-name "c4k-website-standalone.jar" :uberjar-name "c4k-website-standalone.jar"
:dependencies [[org.clojure/tools.cli "1.1.230"] :dependencies [[org.clojure/tools.cli "1.1.230"]
[ch.qos.logback/logback-classic "1.5.6" [ch.qos.logback/logback-classic "1.5.1"
:exclusions [com.sun.mail/javax.mail]] :exclusions [com.sun.mail/javax.mail]]
[org.slf4j/jcl-over-slf4j "2.0.13"] [org.slf4j/jcl-over-slf4j "2.0.12"]
[com.github.clj-easy/graal-build-time "1.0.5"]]}} [com.github.clj-easy/graal-build-time "1.0.5"]]}}
:release-tasks [["test"] :release-tasks [["test"]
["vcs" "assert-committed"] ["vcs" "assert-committed"]

View file

@ -4,7 +4,7 @@
"src/test/cljc" "src/test/cljc"
"src/test/cljs" "src/test/cljs"
"src/test/resources"] "src/test/resources"]
:dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.2.3"] :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.2.2"]
[hickory "0.7.1"]] [hickory "0.7.1"]]
:builds {:frontend {:target :browser :builds {:frontend {:target :browser
:modules {:main {:init-fn dda.c4k-website.browser/init}} :modules {:main {:init-fn dda.c4k-website.browser/init}}

View file

@ -16,46 +16,36 @@
(s/def ::unique-name ::web/unique-name) (s/def ::unique-name ::web/unique-name)
(s/def ::issuer ::web/issuer) (s/def ::issuer ::web/issuer)
(s/def ::volume-size ::web/volume-size) (s/def ::volume-size ::web/volume-size)
(s/def ::average-rate ::ing/average-rate)
(s/def ::burst-rate ::ing/burst-rate)
(s/def ::authtoken ::web/authtoken) (s/def ::authtoken ::web/authtoken)
(s/def ::fqdns ::web/fqdns) (s/def ::fqdns ::web/fqdns)
(s/def ::forgejo-host ::web/forgejo-host) (s/def ::forgejo-host ::web/forgejo-host)
(s/def ::repo-owner ::web/repo-owner) (s/def ::forgejo-repo ::web/forgejo-repo)
(s/def ::repo-name ::web/repo-name)
(s/def ::branchname ::web/branchname) (s/def ::branchname ::web/branchname)
(s/def ::username ::web/username)
(s/def ::build-cpu-request ::web/build-cpu-request) (s/def ::build-cpu-request ::web/build-cpu-request)
(s/def ::build-memory-request ::web/build-memory-request) (s/def ::build-memory-request ::web/build-memory-request)
(s/def ::build-cpu-limit ::web/build-cpu-limit) (s/def ::build-cpu-limit ::web/build-cpu-limit)
(s/def ::build-memory-limit ::web/build-memory-limit) (s/def ::build-memory-limit ::web/build-memory-limit)
(s/def ::redirects ::web/redirects)
(def websiteconfig? (s/keys :req-un [::unique-name (def websiteconfig? (s/keys :req-un [::unique-name
::fqdns ::fqdns
::forgejo-host ::forgejo-host
::repo-owner ::forgejo-repo
::repo-name
::branchname] ::branchname]
:opt-un [::issuer :opt-un [::issuer
::volume-size ::volume-size
::build-cpu-request ::build-cpu-request
::build-cpu-limit ::build-cpu-limit
::build-memory-request ::build-memory-request
::build-memory-limit ::build-memory-limit]))
::redirects])) (def websiteauth? (s/keys :req-un [::unique-name ::username ::authtoken]))
(def websiteauth? web/websiteauth?)
(def websiteauths? (s/keys :req-un [::websiteauths]))
(s/def ::websiteconfigs (s/coll-of websiteconfig?)) (s/def ::websiteconfigs (s/coll-of websiteconfig?))
(s/def ::websiteauths (s/coll-of websiteauth?)) (s/def ::websiteauths (s/coll-of websiteauth?))
(def config? (s/keys :req-un [::websiteconfigs] (def config? (s/keys :req-un [::websiteconfigs]
:opt-un [::issuer :opt-un [::issuer
::volume-size ::volume-size
::mon-cfg ::mon-cfg]))
::average-rate
::burst-rate]))
(def auth? (s/keys :req-un [::websiteauths] (def auth? (s/keys :req-un [::websiteauths]
:opt-un [::mon-auth])) :opt-un [::mon-auth]))
@ -68,9 +58,7 @@
:build-memory-request "256Mi" :build-memory-request "256Mi"
:build-memory-limit "512Mi" :build-memory-limit "512Mi"
:volume-size "3" :volume-size "3"
:redirects [] :redirects []})
:average-rate 20
:burst-rate 40})
(defn-spec sort-config map? (defn-spec sort-config map?
[unsorted-config config?] [unsorted-config config?]
@ -92,11 +80,7 @@
(when (contains? config :issuer) (when (contains? config :issuer)
{:issuer (config :issuer)}) {:issuer (config :issuer)})
(when (contains? config :volume-size) (when (contains? config :volume-size)
{:volume-size (config :volume-size)}) {:volume-size (config :volume-size)}))))
(when (contains? config :average-rate)
{:average-rate (config :average-rate)})
(when (contains? config :burst-rate)
{:burst-rate (config :burst-rate)}))))
(defn-spec flatten-and-reduce-auth map? (defn-spec flatten-and-reduce-auth map?
[auth auth?] [auth auth?]
@ -115,35 +99,35 @@
(defn-spec generate seq? (defn-spec generate seq?
[config config? [config config?
auth auth?] auth auth?]
(loop [sorted-config (sort-config config) (loop [config (sort-config config)
sorted-auth (sort-auth auth) sorted-auth (sort-auth auth)
result []] result []]
(if (and (empty? (sorted-config :websiteconfigs)) (empty? (sorted-auth :websiteauths))) (if (and (empty? (config :websiteconfigs)) (empty? (sorted-auth :websiteauths)))
result result
(recur (-> (recur (->
sorted-config config
(assoc-in [:websiteconfigs] (rest (sorted-config :websiteconfigs)))) (assoc-in [:websiteconfigs] (rest (config :websiteconfigs))))
(-> (->
sorted-auth auth
(assoc-in [:websiteauths] (rest (sorted-auth :websiteauths)))) (assoc-in [:websiteauths] (rest (sorted-auth :websiteauths))))
(let [curr-flat-websiteconfig (let [final-config
(merge (merge
website-config-defaults website-config-defaults
(flatten-and-reduce-config sorted-config)) (flatten-and-reduce-config config))
name (web/replace-dots-by-minus (:unique-name curr-flat-websiteconfig))] name (web/replace-dots-by-minus (:unique-name final-config))]
(cm/concat-vec (cm/concat-vec
result result
(ns/generate (merge {:namespace name} curr-flat-websiteconfig)) (ns/generate (merge {:namespace name} final-config))
[(web/generate-nginx-deployment curr-flat-websiteconfig) [(web/generate-nginx-deployment final-config)
(web/generate-nginx-configmap curr-flat-websiteconfig) (web/generate-nginx-configmap final-config)
(web/generate-nginx-service curr-flat-websiteconfig) (web/generate-nginx-service final-config)
(web/generate-content-pvc curr-flat-websiteconfig) (web/generate-content-pvc final-config)
(web/generate-hash-state-pvc curr-flat-websiteconfig) (web/generate-hash-state-pvc final-config)
(web/generate-build-cron curr-flat-websiteconfig) (web/generate-build-cron final-config)
(web/generate-build-configmap curr-flat-websiteconfig) (web/generate-build-secret final-config
(web/generate-build-secret (flatten-and-reduce-auth sorted-auth))] (flatten-and-reduce-auth auth))]
(generate-ingress curr-flat-websiteconfig))))))) (generate-ingress final-config)))))))
(defn-spec k8s-objects cp/map-or-seq? (defn-spec k8s-objects cp/map-or-seq?
[config config? [config config?

View file

@ -20,9 +20,9 @@
(s/def ::authtoken pred/bash-env-string?) (s/def ::authtoken pred/bash-env-string?)
(s/def ::fqdns (s/coll-of pred/fqdn-string?)) (s/def ::fqdns (s/coll-of pred/fqdn-string?))
(s/def ::forgejo-host pred/fqdn-string?) (s/def ::forgejo-host pred/fqdn-string?)
(s/def ::repo-name string?) (s/def ::forgejo-repo string?)
(s/def ::branchname string?) (s/def ::branchname string?)
(s/def ::repo-owner string?) (s/def ::username string?)
(s/def ::build-cpu-request string?) (s/def ::build-cpu-request string?)
(s/def ::build-memory-request string?) (s/def ::build-memory-request string?)
(s/def ::build-cpu-limit string?) (s/def ::build-cpu-limit string?)
@ -30,21 +30,29 @@
(s/def ::redirect (s/tuple string? string?)) (s/def ::redirect (s/tuple string? string?))
(s/def ::redirects (s/coll-of ::redirect)) (s/def ::redirects (s/coll-of ::redirect))
(def websiteconfig? (s/keys :req-un [::unique-name (def websiteconfig? (s/keys :req-un [::unique-name
::fqdns ::fqdns
::forgejo-host ::forgejo-host
::repo-owner ::forgejo-repo
::repo-name
::branchname ::branchname
::issuer
::volume-size
::build-cpu-request ::build-cpu-request
::build-cpu-limit ::build-cpu-limit
::build-memory-request ::build-memory-request
::build-memory-limit ::build-memory-limit
::issuer
::volume-size
::redirects])) ::redirects]))
(def websiteauth? (s/keys :req-un [::unique-name ::authtoken])) (def websiteauth? (s/keys :req-un [::unique-name ::username ::authtoken]))
(s/def ::websiteconfigs (s/coll-of websiteconfig?))
(s/def ::websiteauths (s/coll-of websiteauth?))
(def websiteconfigs? (s/keys :req-un [::websiteconfigs]))
(def auth? (s/keys :req-un [::websiteauths]))
(defn-spec replace-dots-by-minus string? (defn-spec replace-dots-by-minus string?
[fqdn pred/fqdn-string?] [fqdn pred/fqdn-string?]
@ -53,17 +61,17 @@
; https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/<branch>.zip ; https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/<branch>.zip
(defn-spec generate-gitrepourl string? (defn-spec generate-gitrepourl string?
[host pred/fqdn-string? [host pred/fqdn-string?
owner string?
repo string? repo string?
user string?
branch string?] branch string?]
(str "https://" host "/api/v1/repos/" owner "/" repo "/archive/" branch ".zip")) (str "https://" host "/api/v1/repos/" user "/" repo "/archive/" branch ".zip"))
; https://your.gitea.host/api/v1/repos/<owner>/<repo>/git/commits/HEAD ; https://your.gitea.host/api/v1/repos/<owner>/<repo>/git/commits/HEAD
(defn-spec generate-gitcommiturl string? (defn-spec generate-gitcommiturl string?
[host pred/fqdn-string? [host pred/fqdn-string?
owner string? repo string?
repo string?] user string?]
(str "https://" host "/api/v1/repos/" owner "/" repo "/git/" "commits/" "HEAD")) (str "https://" host "/api/v1/repos/" user "/" repo "/git/" "commits/" "HEAD"))
(defn-spec replace-all-matching-prefixes map? (defn-spec replace-all-matching-prefixes map?
@ -86,6 +94,7 @@
#(str "rewrite ^" (first %1) "\\$ " (second %1) " permanent;") #(str "rewrite ^" (first %1) "\\$ " (second %1) " permanent;")
redirects)))) redirects))))
(defn-spec generate-nginx-configmap map? (defn-spec generate-nginx-configmap map?
[config websiteconfig?] [config websiteconfig?]
(let [{:keys [fqdns unique-name]} config (let [{:keys [fqdns unique-name]} config
@ -104,37 +113,32 @@
#"REDIRECTS" #"REDIRECTS"
(generate-redirects config 2))))))) (generate-redirects config 2)))))))
(defn-spec generate-build-configmap pred/map-or-seq?
[config websiteconfig?]
(let [{:keys [unique-name
forgejo-host
repo-owner
repo-name
branchname]} config
name (replace-dots-by-minus unique-name)]
(->
(yaml/load-as-edn "website/build-configmap.yaml")
(replace-all-matching-prefixes "NAME" name)
(cm/replace-all-matching-values-by-new-value "GITHOST" forgejo-host)
(cm/replace-all-matching-values-by-new-value "REPOURL" (generate-gitrepourl
forgejo-host
repo-owner
repo-name
branchname))
(cm/replace-all-matching-values-by-new-value "COMMITURL" (generate-gitcommiturl
forgejo-host
repo-owner
repo-name)))))
(defn-spec generate-build-secret pred/map-or-seq? (defn-spec generate-build-secret pred/map-or-seq?
[auth websiteauth?] [config websiteconfig?
auth websiteauth?]
(let [{:keys [unique-name (let [{:keys [unique-name
authtoken]} auth forgejo-host
forgejo-repo
branchname]} config
{:keys [authtoken
username]} auth
name (replace-dots-by-minus unique-name)] name (replace-dots-by-minus unique-name)]
(-> (->
(yaml/load-as-edn "website/build-secret.yaml") (yaml/load-as-edn "website/build-secret.yaml")
(replace-all-matching-prefixes "NAME" name) (replace-all-matching-prefixes "NAME" name)
(cm/replace-all-matching-values-by-new-value "TOKEN" (b64/encode authtoken))))) (cm/replace-all-matching-values-by-new-value "TOKEN" (b64/encode authtoken))
(cm/replace-all-matching-values-by-new-value "REPOURL" (b64/encode
(generate-gitrepourl
forgejo-host
forgejo-repo
username
branchname)))
(cm/replace-all-matching-values-by-new-value "COMMITURL" (b64/encode
(generate-gitcommiturl
forgejo-host
forgejo-repo
username))))))
(defn-spec generate-content-pvc map? (defn-spec generate-content-pvc map?

View file

@ -28,16 +28,14 @@
"{ :websiteconfigs "{ :websiteconfigs
[{:unique-name \"test.io\", [{:unique-name \"test.io\",
:fqdns [\"test.de\" \"www.test.de\"], :fqdns [\"test.de\" \"www.test.de\"],
:forgejo-host \"githost.de\", :gitea-host \"githost.de\",
:repo-owner \"someuser\", :gitea-repo \"repo\",
:repo-name \"repo\",
:branchname \"main\", :branchname \"main\",
:sha256sum-output \"123456789ab123cd345de script-file-name.sh\"} :sha256sum-output \"123456789ab123cd345de script-file-name.sh\"}
{:unique-name \"example.io \", {:unique-name \"example.io \",
:fqdns [\"example.org\" \"www.example.org\"], :fqdns [\"example.org\" \"www.example.org\"],
:forgejo-host \"githost.org\", :gitea-host \"githost.org\",
:repo-owner \"someuser\", :gitea-repo \"repo\",
:repo-name \"repo\",
:branchname \"main\", :branchname \"main\",
:build-cpu-request \"1500m\", :build-cpu-request \"1500m\",
:build-cpu-limit \"3000m\", :build-cpu-limit \"3000m\",
@ -53,8 +51,10 @@
:grafana-cloud-password \"your-cloud-password\"} :grafana-cloud-password \"your-cloud-password\"}
:websiteauths :websiteauths
[{:unique-name \"test.io\", [{:unique-name \"test.io\",
:username \"someuser\",
:authtoken \"abedjgbasdodj\"} :authtoken \"abedjgbasdodj\"}
{:unique-name \"example.io\", {:unique-name \"example.io\",
:username \"someuser\",
:authtoken \"abedjgbasdodj\"}]}" :authtoken \"abedjgbasdodj\"}]}"
"7")) "7"))
[(br/generate-br)] [(br/generate-br)]
@ -84,12 +84,12 @@
:grafana-cloud-url mon-cloud-url}})))) :grafana-cloud-url mon-cloud-url}}))))
(defn validate-all! [] (defn validate-all! []
(br/validate! "websiteconfigs" core/websiteconfigs? :deserializer edn/read-string) (br/validate! "websiteconfigs" website/websiteconfigs? :deserializer edn/read-string)
(br/validate! "issuer" ::core/issuer :optional true) (br/validate! "issuer" ::website/issuer :optional true)
(br/validate! "mon-cluster-name" ::mon/cluster-name :optional true) (br/validate! "mon-cluster-name" ::mon/cluster-name :optional true)
(br/validate! "mon-cluster-stage" ::mon/cluster-stage :optional true) (br/validate! "mon-cluster-stage" ::mon/cluster-stage :optional true)
(br/validate! "mon-cloud-url" ::mon/grafana-cloud-url :optional true) (br/validate! "mon-cloud-url" ::mon/grafana-cloud-url :optional true)
(br/validate! "auth" core/websiteauths? :deserializer edn/read-string) (br/validate! "auth" website/auth? :deserializer edn/read-string)
(br/set-form-validated!)) (br/set-form-validated!))
(defn add-validate-listener [name] (defn add-validate-listener [name]

View file

@ -1,11 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: build-configmap
namespace: NAME
labels:
app.kubernetes.part-of: NAME-website
data:
GITHOST: GITHOST
GITREPOURL: REPOURL
GITCOMMITURL: COMMITURL

View file

@ -11,7 +11,6 @@ spec:
failedJobsHistoryLimit: 1 failedJobsHistoryLimit: 1
jobTemplate: jobTemplate:
spec: spec:
activeDeadlineSeconds: 415
template: template:
metadata: metadata:
namespace: NAME namespace: NAME
@ -32,8 +31,6 @@ spec:
memory: BUILD_MEMORY_LIMIT memory: BUILD_MEMORY_LIMIT
command: ["/entrypoint.sh"] command: ["/entrypoint.sh"]
envFrom: envFrom:
- configMapRef:
name: build-configmap
- secretRef: - secretRef:
name: build-secret name: build-secret
volumeMounts: volumeMounts:

View file

@ -7,3 +7,5 @@ metadata:
app.kubernetes.part-of: NAME-website app.kubernetes.part-of: NAME-website
data: data:
AUTHTOKEN: TOKEN AUTHTOKEN: TOKEN
GITREPOURL: REPOURL
GITCOMMITURL: COMMITURL

View file

@ -46,8 +46,6 @@ spec:
memory: BUILD_MEMORY_LIMIT memory: BUILD_MEMORY_LIMIT
command: ["/entrypoint.sh"] command: ["/entrypoint.sh"]
envFrom: envFrom:
- configMapRef:
name: build-configmap
- secretRef: - secretRef:
name: build-secret name: build-secret
volumeMounts: volumeMounts:

View file

@ -30,14 +30,12 @@
[{:unique-name "example.io" [{:unique-name "example.io"
:fqdns ["example.org", "www.example.com"] :fqdns ["example.org", "www.example.com"]
:forgejo-host "finegitehost.net" :forgejo-host "finegitehost.net"
:repo-owner "someuser" :forgejo-repo "repo"
:repo-name "repo"
:branchname "main"} :branchname "main"}
{:unique-name "test.io" {:unique-name "test.io"
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"] :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"]
:forgejo-host "gitlab.de" :forgejo-host "gitlab.de"
:repo-owner "someuser" :forgejo-repo "repo"
:repo-name "repo"
:branchname "main"}]}) :branchname "main"}]})
(def websites2 (def websites2
@ -45,40 +43,42 @@
[{:unique-name "test.io" [{:unique-name "test.io"
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"] :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"]
:forgejo-host "gitlab.de" :forgejo-host "gitlab.de"
:repo-owner "someuser" :forgejo-repo "repo"
:repo-name "repo"
:branchname "main"} :branchname "main"}
{:unique-name "example.io" {:unique-name "example.io"
:fqdns ["example.org", "www.example.com"] :fqdns ["example.org", "www.example.com"]
:forgejo-host "finegitehost.net" :forgejo-host "finegitehost.net"
:repo-owner "someuser" :forgejo-repo "repo"
:repo-name "repo"
:branchname "main"}]}) :branchname "main"}]})
(def auth1 (def auth1
{:websiteauths {:websiteauths
[{:unique-name "example.io" [{:unique-name "example.io"
:username "someuser"
:authtoken "abedjgbasdodj"} :authtoken "abedjgbasdodj"}
{:unique-name "test.io" {:unique-name "test.io"
:username "someuser"
:authtoken "abedjgbasdodj"}]}) :authtoken "abedjgbasdodj"}]})
(def auth2 (def auth2
{:websiteauths {:websiteauths
[{:unique-name "test.io" [{:unique-name "test.io"
:username "someuser"
:authtoken "abedjgbasdodj"} :authtoken "abedjgbasdodj"}
{:unique-name "example.io" {:unique-name "example.io"
:username "someuser"
:authtoken "abedjgbasdodj"}]}) :authtoken "abedjgbasdodj"}]})
(def flattened-and-reduced-config (def flattened-and-reduced-config
{:unique-name "example.io", {:unique-name "example.io",
:fqdns ["example.org" "www.example.com"], :fqdns ["example.org" "www.example.com"],
:forgejo-host "finegitehost.net", :forgejo-host "finegitehost.net",
:repo-owner "someuser", :forgejo-repo "repo",
:repo-name "repo",
:branchname "main"}) :branchname "main"})
(def flattened-and-reduced-auth (def flattened-and-reduced-auth
{:unique-name "example.io", {:unique-name "example.io",
:username "someuser",
:authtoken "abedjgbasdodj"}) :authtoken "abedjgbasdodj"})
(deftest sorts-config (deftest sorts-config
@ -87,14 +87,12 @@
[{:unique-name "example.io", [{:unique-name "example.io",
:fqdns ["example.org" "www.example.com"], :fqdns ["example.org" "www.example.com"],
:forgejo-host "finegitehost.net", :forgejo-host "finegitehost.net",
:repo-owner "someuser", :forgejo-repo "repo",
:repo-name "repo",
:branchname "main"}, :branchname "main"},
{:unique-name "test.io", {:unique-name "test.io",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-owner "someuser", :forgejo-repo "repo",
:repo-name "repo",
:branchname "main", :branchname "main",
:sha256sum-output "123456789ab123cd345de script-file-name.sh"}], :sha256sum-output "123456789ab123cd345de script-file-name.sh"}],
:mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}} :mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}}
@ -104,15 +102,13 @@
[{:unique-name "test.io", [{:unique-name "test.io",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-owner "someuser", :forgejo-repo "repo",
:repo-name "repo",
:branchname "main", :branchname "main",
:sha256sum-output "123456789ab123cd345de script-file-name.sh"} :sha256sum-output "123456789ab123cd345de script-file-name.sh"}
{:unique-name "example.io", {:unique-name "example.io",
:fqdns ["example.org" "www.example.com"], :fqdns ["example.org" "www.example.com"],
:forgejo-host "finegitehost.net", :forgejo-host "finegitehost.net",
:repo-owner "someuser", :forgejo-repo "repo",
:repo-name "repo",
:branchname "main"}], :branchname "main"}],
:mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}})))) :mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint", :cluster-name "jitsi", :cluster-stage "test"}}))))
@ -131,7 +127,7 @@
(cut/flatten-and-reduce-auth (cut/sort-auth auth2))))) (cut/flatten-and-reduce-auth (cut/sort-auth auth2)))))
(deftest test-generate (deftest test-generate
(is (= 24 (is (= 22
(count (cut/generate (count (cut/generate
(yaml/load-as-edn "website-test/valid-config.yaml") (yaml/load-as-edn "website-test/valid-config.yaml")
(yaml/load-as-edn "website-test/valid-auth.yaml")))))) (yaml/load-as-edn "website-test/valid-auth.yaml"))))))
@ -162,14 +158,13 @@
:path "/", :path "/",
:backend {:service {:name "test-io", :port {:number 80}}}}]}}] :backend {:service {:name "test-io", :port {:number 80}}}}]}}]
(get-in (get-in
(cut/generate-ingress {:unique-name "test.io", (cut/generate-ingress {:forgejo-host "gitlab.de",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-repo "repo",
:repo-owner "someuser",
:repo-name "repo",
:sha256sum-output "123456789ab123cd345de script-file-name.sh", :sha256sum-output "123456789ab123cd345de script-file-name.sh",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
:unique-name "test.io"
:build-cpu-request "500m" :build-cpu-request "500m"
:build-cpu-limit "1700m" :build-cpu-limit "1700m"
:build-memory-request "256Mi" :build-memory-request "256Mi"
@ -179,14 +174,13 @@
[2 :spec :rules]))) [2 :spec :rules])))
(is (= "test-io" (is (= "test-io"
(get-in (get-in
(cut/generate-ingress {:unique-name "test.io", (cut/generate-ingress {:forgejo-host "gitlab.de",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-host "gitlab.de", :forgejo-repo "repo",
:repo-owner "someuser",
:repo-name "repo",
:sha256sum-output "123456789ab123cd345de script-file-name.sh", :sha256sum-output "123456789ab123cd345de script-file-name.sh",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
:unique-name "test.io"
:build-cpu-request "500m" :build-cpu-request "500m"
:build-cpu-limit "1700m" :build-cpu-limit "1700m"
:build-memory-request "256Mi" :build-memory-request "256Mi"

View file

@ -19,14 +19,6 @@
(st/instrument `cut/generate-nginx-service) (st/instrument `cut/generate-nginx-service)
(deftest should-generate-gitrepourl
(is (= "https://mygit.de/api/v1/repos/someuser/repo/archive/main.zip"
(cut/generate-gitrepourl "mygit.de" "someuser" "repo" "main"))))
(deftest should-generate-gitcommiturl
(is (= "https://mygit.de/api/v1/repos/someuser/repo/git/commits/HEAD"
(cut/generate-gitcommiturl "mygit.de" "someuser" "repo"))))
(deftest should-generate-redirects (deftest should-generate-redirects
(is (= "rewrite ^/products.html\\$ /offer.html permanent;\n rewrite ^/one-more\\$ /redirect permanent;" (is (= "rewrite ^/products.html\\$ /offer.html permanent;\n rewrite ^/one-more\\$ /redirect permanent;"
(cut/generate-redirects {:issuer "staging" (cut/generate-redirects {:issuer "staging"
@ -39,8 +31,7 @@
:redirects [["/products.html", "/offer.html"] :redirects [["/products.html", "/offer.html"]
["/one-more", "/redirect"]] ["/one-more", "/redirect"]]
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]} :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}
2))) 2)))
@ -54,8 +45,7 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [] :redirects []
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]} :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}
0)))) 0))))
@ -64,9 +54,8 @@
(deftest should-generate-resource-requests (deftest should-generate-resource-requests
(is (= {:requests {:cpu "1500m", :memory "512Mi"}, :limits {:cpu "3000m", :memory "1024Mi"}} (is (= {:requests {:cpu "1500m", :memory "512Mi"}, :limits {:cpu "3000m", :memory "1024Mi"}}
(-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de", (-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de",
:repo-owner "someuser",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:repo-name "repo", :forgejo-repo "repo",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
@ -79,9 +68,8 @@
:spec :template :spec :initContainers first :resources))) :spec :template :spec :initContainers first :resources)))
(is (= "test-io" (is (= "test-io"
(-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de", (-> (cut/generate-nginx-deployment {:forgejo-host "gitlab.de",
:repo-owner "someuser",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:repo-name "repo", :forgejo-repo "repo",
:issuer "staging", :issuer "staging",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
@ -104,8 +92,7 @@
:redirects [["/products.html", "/offer.html"] :redirects [["/products.html", "/offer.html"]
["/one-more", "/redirect"]] ["/one-more", "/redirect"]]
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))
" /offer.html permanent;\n")) " /offer.html permanent;\n"))
@ -120,8 +107,7 @@
:redirects [["/products.html", "/offer.html"] :redirects [["/products.html", "/offer.html"]
["/one-more", "/redirect"]] ["/one-more", "/redirect"]]
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))
" /redirect permanent;\n")) " /redirect permanent;\n"))
@ -135,8 +121,7 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))
"server_name test.de www.test.de test-it.de www.test-it.de;")) "server_name test.de www.test.de test-it.de www.test-it.de;"))
@ -154,8 +139,7 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})
:data)))) :data))))
@ -178,8 +162,7 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))
@ -196,8 +179,7 @@
:failedJobsHistoryLimit 1, :failedJobsHistoryLimit 1,
:jobTemplate :jobTemplate
{:spec {:spec
{:activeDeadlineSeconds 415, {:template
:template
{:metadata {:metadata
{:namespace "test-io", {:namespace "test-io",
:labels :labels
@ -209,8 +191,7 @@
:imagePullPolicy "IfNotPresent", :imagePullPolicy "IfNotPresent",
:resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}}, :resources {:requests {:cpu "500m", :memory "256Mi"}, :limits {:cpu "1700m", :memory "512Mi"}},
:command ["/entrypoint.sh"], :command ["/entrypoint.sh"],
:envFrom [{:configMapRef {:name "build-configmap"}} :envFrom [{:secretRef {:name "build-secret"}}],
{:secretRef {:name "build-secret"}}],
:volumeMounts [{:name "content-volume", :mountPath "/var/www/html/website"} :volumeMounts [{:name "content-volume", :mountPath "/var/www/html/website"}
{:name "hash-state-volume", :mountPath "/var/hashfile.d"}]}], {:name "hash-state-volume", :mountPath "/var/hashfile.d"}]}],
:volumes [{:name "content-volume", :persistentVolumeClaim {:claimName "content-volume"}} :volumes [{:name "content-volume", :persistentVolumeClaim {:claimName "content-volume"}}
@ -223,37 +204,12 @@
:build-memory-limit "512Mi" :build-memory-limit "512Mi"
:volume-size "3" :volume-size "3"
:forgejo-host "gitlab.de", :forgejo-host "gitlab.de",
:repo-owner "someuser",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"], :fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:repo-name "repo", :forgejo-repo "repo",
:branchname "main", :branchname "main",
:unique-name "test.io", :unique-name "test.io",
:redirects []})))) :redirects []}))))
(deftest should-generate-build-configmap
(is (= {:apiVersion "v1",
:kind "ConfigMap",
:metadata {:name "build-configmap",
:namespace "test-io",
:labels {:app.kubernetes.part-of "test-io-website"}},
:data
{:GITHOST "mygit.de"
:GITREPOURL "https://mygit.de/api/v1/repos/someuser/repo/archive/main.zip"
:GITCOMMITURL "https://mygit.de/api/v1/repos/someuser/repo/git/commits/HEAD"}}
(cut/generate-build-configmap {:issuer "staging"
:build-cpu-request "500m"
:build-cpu-limit "1700m"
:build-memory-request "256Mi"
:build-memory-limit "512Mi"
:volume-size "3"
:forgejo-host "mygit.de",
:repo-owner "someuser",
:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:repo-name "repo",
:branchname "main",
:unique-name "test.io",
:redirects []}))))
(deftest should-generate-build-secret (deftest should-generate-build-secret
(is (= {:apiVersion "v1", (is (= {:apiVersion "v1",
:kind "Secret", :kind "Secret",
@ -261,9 +217,24 @@
:namespace "test-io", :namespace "test-io",
:labels {:app.kubernetes.part-of "test-io-website"}}, :labels {:app.kubernetes.part-of "test-io-website"}},
:data :data
{:AUTHTOKEN "YWJlZGpnYmFzZG9kag=="}} {:AUTHTOKEN "YWJlZGpnYmFzZG9kag==",
(cut/generate-build-secret {:unique-name "test.io", :GITREPOURL "aHR0cHM6Ly9naXRsYWIuZGUvYXBpL3YxL3JlcG9zL3NvbWV1c2VyL3JlcG8vYXJjaGl2ZS9tYWluLnppcA==",
:authtoken "abedjgbasdodj"})))) :GITCOMMITURL "aHR0cHM6Ly9naXRsYWIuZGUvYXBpL3YxL3JlcG9zL3NvbWV1c2VyL3JlcG8vZ2l0L2NvbW1pdHMvSEVBRA=="}}
(cut/generate-build-secret {:fqdns ["test.de" "test.org" "www.test.de" "www.test.org"],
:forgejo-repo "repo",
:issuer "staging",
:branchname "main",
:unique-name "test.io",
:redirects [],
:forgejo-host "gitlab.de"
:build-cpu-request "500m"
:build-cpu-limit "1700m"
:build-memory-request "256Mi"
:build-memory-limit "512Mi"
:volume-size "3"}
{:unique-name "test.io",
:authtoken "abedjgbasdodj",
:username "someuser"}))))
(deftest should-generate-content-pvc (deftest should-generate-content-pvc
(is (= {:apiVersion "v1", (is (= {:apiVersion "v1",
@ -285,8 +256,7 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))
@ -310,7 +280,6 @@
:unique-name "test.io", :unique-name "test.io",
:redirects [], :redirects [],
:forgejo-host "gitea.evilorg", :forgejo-host "gitea.evilorg",
:repo-owner "someuser", :forgejo-repo "none",
:repo-name "none",
:branchname "mablain", :branchname "mablain",
:fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]})))) :fqdns ["test.de" "www.test.de" "test-it.de" "www.test-it.de"]}))))

View file

@ -1,7 +1,9 @@
websiteauths: websiteauths:
- unique-name: "test.io" - unique-name: "test.io"
username: "someuser"
authtoken: "abedjgbasdodj" authtoken: "abedjgbasdodj"
- unique-name: "example.io" - unique-name: "example.io"
username: "someuser"
authtoken: "abedjgbasdodj" authtoken: "abedjgbasdodj"
mon-auth: mon-auth:
grafana-cloud-user: "user" grafana-cloud-user: "user"

View file

@ -3,20 +3,14 @@ websiteconfigs:
- unique-name: "test.io" - unique-name: "test.io"
fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"] fqdns: ["test.de", "test.org", "www.test.de", "www.test.org"]
forgejo-host: "codeberg.org" forgejo-host: "codeberg.org"
repo-owner: "someuser" forgejo-repo: "repo"
repo-name: "repo"
branchname: "main" branchname: "main"
redirects:
- ["/products.html", "/offer.html"]
- ["/one-more", "/redirect"]
- unique-name: "example.io" - unique-name: "example.io"
fqdns: ["example.org", "www.example.com"] fqdns: ["example.org", "www.example.com"]
forgejo-host: "fineForgejoHost.net" forgejo-host: "fineForgejoHost.net"
repo-owner: "someotheruser" forgejo-repo: "repo"
repo-name: "repo"
branchname: "main" branchname: "main"
mon-cfg: mon-cfg:
grafana-cloud-url: "url-for-your-prom-remote-write-endpoint" grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"
cluster-name: "website" cluster-name: "website"
cluster-stage: "test" cluster-stage: "test"
average-rate: 50