diff --git a/backend/src/app/config.clj b/backend/src/app/config.clj index 6dfbfc7ae4..c0e3ea5acd 100644 --- a/backend/src/app/config.clj +++ b/backend/src/app/config.clj @@ -63,11 +63,6 @@ :storage-assets-fs-directory "assets" :assets-path "/internal/assets/" - - :rlimit-password 10 - :rlimit-image 10 - :rlimit-font 10 - :smtp-default-reply-to "Penpot " :smtp-default-from "Penpot " @@ -175,6 +170,7 @@ (s/def ::redis-uri ::us/string) (s/def ::registration-domain-whitelist ::us/set-of-str) (s/def ::rlimit-font ::us/integer) +(s/def ::rlimit-file-update ::us/integer) (s/def ::rlimit-image ::us/integer) (s/def ::rlimit-password ::us/integer) (s/def ::smtp-default-from ::us/string) @@ -281,6 +277,7 @@ ::registration-domain-whitelist ::registration-enabled ::rlimit-font + ::rlimit-file-update ::rlimit-image ::rlimit-password ::sentry-dsn diff --git a/backend/src/app/rpc/mutations/files.clj b/backend/src/app/rpc/mutations/files.clj index 23cc1b921c..176f555704 100644 --- a/backend/src/app/rpc/mutations/files.clj +++ b/backend/src/app/rpc/mutations/files.clj @@ -273,7 +273,7 @@ (contains? o :changes-with-metadata))))) (sv/defmethod ::update-file - {::rlimit/permits 20} + {::rlimit/permits (cf/get :rlimit-file-update)} [{:keys [pool] :as cfg} {:keys [id profile-id] :as params}] (db/with-atomic [conn pool] (db/xact-lock! conn id) diff --git a/backend/src/app/rpc/mutations/fonts.clj b/backend/src/app/rpc/mutations/fonts.clj index 46a6557d2a..91b8024d88 100644 --- a/backend/src/app/rpc/mutations/fonts.clj +++ b/backend/src/app/rpc/mutations/fonts.clj @@ -10,9 +10,11 @@ [app.common.exceptions :as ex] [app.common.spec :as us] [app.common.uuid :as uuid] + [app.config :as cf] [app.db :as db] [app.media :as media] [app.rpc.queries.teams :as teams] + [app.rpc.rlimit :as rlimit] [app.storage :as sto] [app.util.services :as sv] [app.util.time :as dt] @@ -39,6 +41,7 @@ ::font-id ::font-family ::font-weight ::font-style])) (sv/defmethod ::create-font-variant + {::rlimit/permits (cf/get :rlimit-font)} [{:keys [pool] :as cfg} {:keys [team-id profile-id] :as params}] (let [cfg (update cfg :storage media/configure-assets-storage)] (teams/check-edition-permissions! pool profile-id team-id)