diff --git a/exporter/src/app/config.cljs b/exporter/src/app/config.cljs index c219857d03..832f6f86a7 100644 --- a/exporter/src/app/config.cljs +++ b/exporter/src/app/config.cljs @@ -23,6 +23,7 @@ :host "localhost" :http-server-port 6061 :http-server-host "0.0.0.0" + :tempdir "/tmp/penpot-exporter" :redis-uri "redis://redis/0"}) (def ^:private schema:config @@ -32,6 +33,7 @@ [:tenant {:optional true} :string] [:flags {:optional true} ::sm/set-of-keywords] [:redis-uri {:optional true} :string] + [:tempdir {:optional true} :string] [:browser-pool-max {:optional true} :int] [:browser-pool-min {:optional true} :int]]) diff --git a/exporter/src/app/util/shell.cljs b/exporter/src/app/util/shell.cljs index 698efbc06b..3a7440217f 100644 --- a/exporter/src/app/util/shell.cljs +++ b/exporter/src/app/util/shell.cljs @@ -14,6 +14,7 @@ [app.common.exceptions :as ex] [app.common.logging :as l] [app.common.uuid :as uuid] + [app.config :as cf] [cuerdas.core :as str] [promesa.core :as p])) @@ -22,12 +23,12 @@ (def tempfile-minage (* 1000 60 60 1)) ;; 1h (def tmpdir - (let [path (path/join (os/tmpdir) "penpot")] + (let [path (cf/get :tempdir)] + (l/inf :hint "tmptdir setup" :path path) (when-not (fs/existsSync path) (fs/mkdirSync path #js {:recursive true})) path)) - (defn- schedule-deletion! [path] (letfn [(remote-tempfile []