From b160ba1793012cc581f61e0a84c965e4602976d2 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 6 Nov 2024 09:14:47 +0100 Subject: [PATCH 1/8] :paperclip: Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b0b2074d8..ad4be629b 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,5 @@ node_modules /playwright-report/ /blob-report/ /playwright/.cache/ +/render-wasm/target/ +/**/.yarn/* From 946dac3c9f1327371997a1d8351a14836f4824fa Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 6 Nov 2024 09:15:06 +0100 Subject: [PATCH 2/8] :bug: Fix NPE on number schemas Mainly, without this fix, happens the following: user=> (sm/validate [::sm/int {:min 0}] nil) Execution error (NullPointerException) at app.common.schema/fn$fn (schema.cljc:692). Cannot invoke "Object.getClass()" because "x" is null And it should return `false` without an exception. --- common/src/app/common/schema.cljc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/schema.cljc b/common/src/app/common/schema.cljc index 25e802f8b..54d8e1910 100644 --- a/common/src/app/common/schema.cljc +++ b/common/src/app/common/schema.cljc @@ -681,8 +681,8 @@ (let [pred int? pred (if (some? min) (fn [v] - (and (>= v min) - (pred v))) + (and (pred v) + (>= v min))) pred) pred (if (some? max) (fn [v] @@ -719,8 +719,8 @@ (let [pred double? pred (if (some? min) (fn [v] - (and (>= v min) - (pred v))) + (and (pred v) + (>= v min))) pred) pred (if (some? max) (fn [v] @@ -749,8 +749,8 @@ (let [pred number? pred (if (some? min) (fn [v] - (and (>= v min) - (pred v))) + (and (pred v) + (>= v min))) pred) pred (if (some? max) (fn [v] From 5a3619c73711d5ef546d6d91864144cc8e47a20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Thu, 31 Oct 2024 14:08:51 +0100 Subject: [PATCH 3/8] :books: Add documentation to install with Kubernetes --- docs/technical-guide/getting-started.md | 136 ++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/docs/technical-guide/getting-started.md b/docs/technical-guide/getting-started.md index 38071cc0f..4178f41de 100644 --- a/docs/technical-guide/getting-started.md +++ b/docs/technical-guide/getting-started.md @@ -256,6 +256,142 @@ Postgres database and another one for the assets uploaded by your users (images clips). There may be more volumes if you enable other features, as explained in the file itself. + +## Install with Kubernetes + +This section details everything you need to know to get Penpot up and running in +production environments using a Kubernetes cluster of your choice. To do this, we have +created a Helm repository with everything +you need. + +Therefore, your prerequisite will be to have a Kubernetes cluster on which we can install +Helm. + + +### What is Helm + +*Helm* is the package manager for Kubernetes. A *Chart* is a Helm package. It contains +all of the resource definitions necessary to run an application, tool, or service inside +of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew +formula, an Apt dpkg, or a Yum RPM file. + +A Repository is the place where charts can be collected and shared. It's like Perl's CPAN +archive or the Fedora Package Database, but for Kubernetes packages. + +A Release is an instance of a chart running in a Kubernetes cluster. One chart can often +be installed many times into the same cluster. And each time it is installed, a new +release is created. Consider a MySQL chart. If you want two databases running in your +cluster, you can install that chart twice. Each one will have its own release, which will +in turn have its own release name. + +With these concepts in mind, we can now explain Helm like this: + +> Helm installs charts into Kubernetes clusters, creating a new release for each +> installation. And to find new charts, you can search Helm chart repositories. + + +### Install Helm + +

+Skip this section if you already have Helm installed in your system. +

+ +You can install Helm by following the
official guide. +There are different ways to install Helm, depending on your infrastructure and operating +system. + + +### Add Penpot repository + +To add the Penpot Helm repository, run the following command: + +```bash +helm repo add penpot http://helm.penpot.app +``` + +This will add the Penpot repository to your Helm configuration, so you can install all +the Penpot charts stored there. + + +### Install Penpot Chart + +To install the chart with the release name `my-release`: + +```bash +helm install my-release penpot/penpot +``` + +You can customize the installation specify each parameter using the `--set key=value[,key=value]` +argument to helm install. For example, + +```bash +helm install my-release \ + --set global.postgresqlEnabled=true \ + --set global.redisEnabled=true \ + --set persistence.assets.enabled=true \ + penpot/penpot +``` + +Alternatively, a YAML file that specifies the values for the above parameters can be +provided while installing the chart. For example, + +```bash +helm install my-release -f values.yaml penpot/penpot +``` + + +### Configure Penpot with Helm Chart + +In the previous section we have shown how to configure penpot during installation by +using parameters or by using a yaml file. + +The default values are defined in the +`values.yml` +file itself, which you can use as a basis for creating your own settings. + +You can also consult the list of parameters on the +ArtifactHub page of the project. + + +### Upgrade Penpot + +When a new version of Penpot's chart is released, or when you want to change the +configuration of your release, you can use the helm upgrade command. + +```bash +helm upgrade my-release -f values.yaml penpot/penpot +``` + +An upgrade takes an existing release and upgrades it according to the information you +provide. Because Kubernetes charts can be large and complex, Helm tries to perform the +least invasive upgrade. It will only update things that have changed since the last +release. + +After each upgrade, a new *revision* will be generated. You can check the revision +history of a release with `helm history my-release` and go back to the previous revision +if something went wrong with `helm rollback my-release 1` (`1` is the revision number of +the previous release revision). + + +### Backup Penpot + +The Penpot's Helm Chart uses different Persistent Volumes to store all persistent data. +This allows you to delete and recreate the instance whenever you want without losing +information. + +You back up data from a Persistent Volume via snapshots, so you will want to ensure that +your container storage interface (CSI) supports volume snapshots. There are a couple of +different options for the CSI driver that you choose. All of the major cloud providers +have their respective CSI drivers. + +At last, there are two Persistent Volumes used: one for the Postgres database and another +one for the assets uploaded by your users (images and svg clips). There may be more +volumes if you enable other features, as explained in the file itself. + +You have to back up your custom settings too (the yaml file or the list of parameters you +are using during you setup). + + ## Unofficial self-host options There are some other options, **NOT SUPPORTED BY PENPOT**: From 70a1a7a5ea322dbac55a26298c2f303bb8746322 Mon Sep 17 00:00:00 2001 From: Pablo Alba Date: Thu, 7 Nov 2024 16:25:36 +0100 Subject: [PATCH 4/8] :sparkles: Send event when an user opens a modal --- frontend/src/app/main/data/modal.cljs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/app/main/data/modal.cljs b/frontend/src/app/main/data/modal.cljs index 1055014c2..8b88a813f 100644 --- a/frontend/src/app/main/data/modal.cljs +++ b/frontend/src/app/main/data/modal.cljs @@ -10,6 +10,7 @@ [app.common.uuid :as uuid] [app.main.data.events :as ev] [app.main.store :as st] + [beicon.v2.core :as rx] [cljs.core :as c] [potok.v2.core :as ptk])) @@ -30,6 +31,12 @@ (dissoc :type) (assoc :name type))) + ptk/WatchEvent + (watch [_ _ _] + (rx/of (ptk/event + ::ev/event + {::ev/name "show-modal" :type type}))) + ptk/UpdateEvent (update [_ state] (assoc state ::modal {:id id From 7823eaf8900955667861422e9b74cbf64f96ad00 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 11 Nov 2024 12:08:49 +0100 Subject: [PATCH 5/8] :paperclip: Update changelog --- CHANGES.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c876a55cf..516d326b2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,16 @@ # CHANGELOG +## 2.3.2 + +### :bug: Bugs fixed + +- Fix null pointer exception on number checking functions + +### :books: Documentation + +- Add initial documentation for Kubernetes + + ## 2.3.1 ### :bug: Bugs fixed From c3970255e6142c8fd370b1dbf2c8a9205fe83336 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 11 Nov 2024 12:34:07 +0100 Subject: [PATCH 6/8] :bug: Fix problem with grid layout ordering after moving --- CHANGES.md | 1 + common/src/app/common/logic/shapes.cljc | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 516d326b2..e3c426ce5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ ### :bug: Bugs fixed - Fix null pointer exception on number checking functions +- Fix problem with grid layout ordering after moving [Taiga #9179](https://tree.taiga.io/project/penpot/issue/9179) ### :books: Documentation diff --git a/common/src/app/common/logic/shapes.cljc b/common/src/app/common/logic/shapes.cljc index 0e292847f..24b89bc1a 100644 --- a/common/src/app/common/logic/shapes.cljc +++ b/common/src/app/common/logic/shapes.cljc @@ -391,13 +391,14 @@ (-> (pcb/update-shapes [parent-id] (fn [frame objects] - (-> frame - ;; Assign the cell when pushing into a specific grid cell - (cond-> (some? cell) - (-> (ctl/free-cell-shapes ids) - (ctl/push-into-cell ids (:row cell) (:column cell)) - (ctl/assign-cells objects))) - (ctl/assign-cell-positions objects))) + (let [[row column] cell] + (-> frame + ;; Assign the cell when pushing into a specific grid cell + (cond-> (some? cell) + (-> (ctl/free-cell-shapes ids) + (ctl/push-into-cell ids row column) + (ctl/assign-cells objects))) + (ctl/assign-cell-positions objects)))) {:with-objects? true}) (pcb/reorder-grid-children [parent-id]))) From 2fa81474b904985c7e6137afcff11c4e17deb0f3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 11 Nov 2024 16:06:37 +0100 Subject: [PATCH 7/8] :bug: Fix problem creating manual overlay interactions --- CHANGES.md | 6 ++++++ .../app/main/data/workspace/interactions.cljs | 16 +++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e3c426ce5..3a7117463 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # CHANGELOG +## 2.3.3 + +### :bug: Bugs fixed + +- Fix problem creating manual overlay interactions [Taiga #9146](https://tree.taiga.io/project/penpot/issue/9146) + ## 2.3.2 ### :bug: Bugs fixed diff --git a/frontend/src/app/main/data/workspace/interactions.cljs b/frontend/src/app/main/data/workspace/interactions.cljs index e8dfd1253..ef6230692 100644 --- a/frontend/src/app/main/data/workspace/interactions.cljs +++ b/frontend/src/app/main/data/workspace/interactions.cljs @@ -206,14 +206,16 @@ (watch [_ _ _] (let [interactions (ctsi/update-interaction (:interactions shape) index update-fn) interaction (nth interactions index)] - (rx/of (dwsh/update-shapes - [(:id shape)] - (fn [shape] - (assoc shape :interactions interactions)) - options) + (rx/of + (dwsh/update-shapes + [(:id shape)] + (fn [shape] + (-> shape + (update :interactions ctsi/update-interaction index update-fn))) + options) - (when (some? (:destination interaction)) - (dwsh/update-shapes [(:destination interaction)] cls/show-in-viewer options)))))))) + (when (some? (:destination interaction)) + (dwsh/update-shapes [(:destination interaction)] cls/show-in-viewer options)))))))) (defn remove-all-interactions-nav-to "Remove all interactions that navigate to the given frame." From f1941681ab2f511dbb56d2efc329d771dee25a8c Mon Sep 17 00:00:00 2001 From: trungly1 <151967488+trungly1@users.noreply.github.com> Date: Mon, 11 Nov 2024 02:07:20 -0500 Subject: [PATCH 8/8] :books: Update getting-started.md --- docs/technical-guide/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/technical-guide/getting-started.md b/docs/technical-guide/getting-started.md index 4178f41de..d8dbedf4a 100644 --- a/docs/technical-guide/getting-started.md +++ b/docs/technical-guide/getting-started.md @@ -399,7 +399,7 @@ There are some other options, **NOT SUPPORTED BY PENPOT**: * Install with Podman instead of Docker. * Try the under development Penpot Desktop app. * Try a simple Kubernetes Deployment option penpot-kubernetes. -* Or try a fully manual installation if you have really special needs. For help, you can look at the [Architecture][2] section and the Docker configuration files. +* Or try a fully manual installation if you have a really specific use case.. For help, you can look at the [Architecture][2] section and the Docker configuration files. [1]: /technical-guide/configuration/ [2]: /technical-guide/developer/architecture