rate-limit #3

Merged
patdyn merged 23 commits from rate-limit into main 2024-01-23 09:02:07 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit aec67352d5 - Show all commits

View file

@ -50,7 +50,7 @@
(forgejo/generate-data-volume config)
(forgejo/generate-appini-env config)
(forgejo/generate-secrets auth)]
(when (contains? config :average)
(when (contains? config :average) ; ToDo: just leave this out and make sensible defaults
(forgejo/generate-rate-limit-ingress-and-cert config)) ; this function has a vector as output
(when (contains? config :average)
[(forgejo/generate-rate-limit-middleware config)]) ; this does not

View file

@ -137,7 +137,7 @@
; using :average and :burst seems sensible, :period may be interesting for fine tuning later on
(defn-spec generate-rate-limit-middleware pred/map-or-seq?
[config config?]
(let [{:keys [average burst]} config]
(let [{:keys [average burst]} config] ; ToDo: Set defaults, don't read config ; refactor ":average" KW to smth more speaking
(->
(yaml/load-as-edn "forgejo/middleware-ratelimit.yaml")
(cm/replace-key-value :average average)