diff --git a/backend/scripts/repl b/backend/scripts/repl index ddc2fba5f..057018a11 100755 --- a/backend/scripts/repl +++ b/backend/scripts/repl @@ -29,6 +29,8 @@ export PENPOT_FLAGS="\ enable-file-validation \ enable-file-schema-validation"; +# Default deletion delay for devenv +export PENPOT_DELETION_DELAY="24h" # Setup default upload media file size to 100MiB export PENPOT_MEDIA_MAX_FILE_SIZE=104857600 diff --git a/backend/scripts/start-dev b/backend/scripts/start-dev index fe81a240a..55f5e835a 100755 --- a/backend/scripts/start-dev +++ b/backend/scripts/start-dev @@ -32,6 +32,9 @@ export OPTIONS=" -J-XX:+UnlockDiagnosticVMOptions \ -J-XX:+DebugNonSafepoints" +# Default deletion delay for devenv +export PENPOT_DELETION_DELAY="24h" + # Setup default upload media file size to 100MiB export PENPOT_MEDIA_MAX_FILE_SIZE=104857600 diff --git a/backend/src/app/config.clj b/backend/src/app/config.clj index a9e883b8f..402cbb35c 100644 --- a/backend/src/app/config.clj +++ b/backend/src/app/config.clj @@ -101,6 +101,8 @@ (s/def ::audit-log-archive-uri ::us/string) (s/def ::audit-log-http-handler-concurrency ::us/integer) +(s/def ::deletion-delay ::dt/duration) + (s/def ::admins ::us/set-of-valid-emails) (s/def ::file-change-snapshot-every ::us/integer) (s/def ::file-change-snapshot-timeout ::dt/duration) @@ -214,6 +216,7 @@ (s/keys :opt-un [::secret-key ::flags ::admins + ::deletion-delay ::allow-demo-users ::audit-log-archive-uri ::audit-log-http-handler-concurrency @@ -380,7 +383,8 @@ (defonce ^:dynamic flags (parse-flags config)) (def deletion-delay - (dt/duration {:days 7})) + (or (c/get config :deletion-delay) + (dt/duration {:days 7}))) (defn get "A configuration getter. Helps code be more testable."