From 0117a4767df7004063fdacddd5dd2fdfd1331af6 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 2 Sep 2024 11:52:19 +0200 Subject: [PATCH 1/2] :paperclip: Rename `file-snapshot` to `auto-file-snapshot` --- backend/src/app/config.clj | 12 ++++++------ backend/src/app/rpc/commands/files_update.clj | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/src/app/config.clj b/backend/src/app/config.clj index 578f1db9a..a06f52950 100644 --- a/backend/src/app/config.clj +++ b/backend/src/app/config.clj @@ -42,9 +42,9 @@ :rpc-rlimit-config "resources/rlimit.edn" :rpc-climit-config "resources/climit.edn" - :file-snapshot-total 10 - :file-snapshot-every 5 - :file-snapshot-timeout "3h" + :auto-file-snapshot-total 10 + :auto-file-snapshot-every 5 + :auto-file-snapshot-timeout "3h" :public-uri "http://localhost:3449" :host "localhost" @@ -101,9 +101,9 @@ [:telemetry-uri {:optional true} :string] [:telemetry-with-taiga {:optional true} ::sm/boolean] ;; DELETE - [:file-snapshot-total {:optional true} ::sm/int] - [:file-snapshot-every {:optional true} ::sm/int] - [:file-snapshot-timeout {:optional true} ::dt/duration] + [:auto-file-snapshot-total {:optional true} ::sm/int] + [:auto-file-snapshot-every {:optional true} ::sm/int] + [:auto-file-snapshot-timeout {:optional true} ::dt/duration] [:media-max-file-size {:optional true} ::sm/int] [:deletion-delay {:optional true} ::dt/duration] ;; REVIEW diff --git a/backend/src/app/rpc/commands/files_update.clj b/backend/src/app/rpc/commands/files_update.clj index e4114a2be..007b3b68a 100644 --- a/backend/src/app/rpc/commands/files_update.clj +++ b/backend/src/app/rpc/commands/files_update.clj @@ -388,9 +388,9 @@ (defn- take-snapshot? "Defines the rule when file `data` snapshot should be saved." [{:keys [revn modified-at] :as file}] - (when (contains? cf/flags :file-snapshot) - (let [freq (or (cf/get :file-snapshot-every) 20) - timeout (or (cf/get :file-snapshot-timeout) + (when (contains? cf/flags :auto-file-snapshot) + (let [freq (or (cf/get :auto-file-snapshot-every) 20) + timeout (or (cf/get :auto-file-snapshot-timeout) (dt/duration {:hours 1}))] (or (= 1 freq) @@ -420,7 +420,7 @@ (defn- delete-old-snapshots! [{:keys [::db/conn] :as cfg} {:keys [id] :as file}] (when-let [snapshots (not-empty (db/exec! conn [sql:get-latest-snapshots id - (cf/get :file-snapshot-total 10)]))] + (cf/get :auto-file-snapshot-total 10)]))] (let [last-date (-> snapshots peek :created-at) result (db/exec-one! conn [sql:delete-snapshots id last-date])] (l/trc :hint "delete old snapshots" :file-id (str id) :total (db/get-update-count result))))) From a28117b30106fd4ab60178bdd65c6d80965dea42 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 2 Sep 2024 11:52:48 +0200 Subject: [PATCH 2/2] :books: Add missing backend enhancements on the changelog --- CHANGES.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f4c1e99d6..f0f5a05ec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,52 @@ ### :sparkles: New features +- **Tiered File Data Storage** [Taiga #8376](https://tree.taiga.io/project/penpot/us/8376) + + This feature allows offloading file data that is not actively used + from the database to object storage (e.g., filesystem, S3), thereby + freeing up space in the database. It can be enabled with the + `enable-enable-tiered-file-data-storage` flag. + + *(On-Premise feature, EXPERIMENTAL).* + +- **JSON Interoperability for HTTP API** [Taiga #8372](https://tree.taiga.io/project/penpot/us/8372) + + Enables full JSON interoperability for our HTTP API. Previously, + JSON was only barely supported for output when the + `application/json` media type was specified in the `Accept` header, + or when `_fmt=json` was passed as a query parameter. With this + update, we now offer proper bi-directional support for using our API + with plain JSON, instead of Transit. + +- **Automatic File Snapshotting** + + Adds the ability to automatically take and maintain a limited set of + snapshots of active files without explicit user intervention. This + feature allows on-premise administrators to recover the state of a + file from a past point in time in a limited manner. + + It can be enabled with the `enable-auto-file-snapshot` flag and + configured with the following settings: + + ```bash + # Take snapshots every 10 update operations + PENPOT_AUTO_FILE_SNAPSHOT_EVERY=10 + + # Take a snapshot if it has been more than 3 hours since the file was last modified + PENPOT_AUTO_FILE_SNAPSHOT_TIMEOUT=3h + + # The total number of snapshots to keep + PENPOT_AUTO_FILE_SNAPSHOT_TOTAL=10 + ``` + + Snapshots are only taken during update operations; there is NO + active background process for this. + +- Add separated flag `enable-oidc-registration` for enable the + registration only for OIDC authentication backend [Github + #4882](https://github.com/penpot/penpot/issues/4882) + ### :bug: Bugs fixed - Fix wrong props on padding input [Taiga #8254](https://tree.taiga.io/project/penpot/issue/8254) @@ -17,6 +63,11 @@ - Fix scroll on color picker modal [Taiga #8353](https://tree.taiga.io/project/penpot/issue/8353) - Fix components are not dragged from the group to the assets tab [Taiga #8273](https://tree.taiga.io/project/penpot/issue/8273) + +## 2.1.3 + +- Don't allow registration when registration is disabled and invitation token is used [Github #4975](https://github.com/penpot/penpot/issues/4975) + ## 2.1.2 ### :bug: Bugs fixed