From bf999979d237822c48932639de3a7991f436e2e1 Mon Sep 17 00:00:00 2001 From: virgile-dev Date: Tue, 20 May 2025 21:10:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D(doc)=20update=20xl=20packages=20wa?= =?UTF-8?q?rning=20(#985)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So that people know how to use the PUBLISH_AS_MIT variable Signed-off-by: virgile-dev --- README.md | 4 +--- docs/env.md | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1c6d7398..63919089 100644 --- a/README.md +++ b/README.md @@ -57,9 +57,7 @@ Available methods: Helm chart, Nix package In the works: Docker Compose, YunoHost -⚠️ For the PDF and Docx export Docs relies on XL packages from BlockNote licenced in AGPL-3.0 which are not MIT compatible. -You can perfectly use Docs without these packages by setting the environment variable `PUBLISH_AS_MIT` to true, and that way you'll build an image of the application without the features that are not MIT compatible. -If you run Docs `PUBLISH_AS_MIT` set to false make sure you fulfill your [BlockNote licensing](https://github.com/TypeCellOS/BlockNote/blob/main/packages/xl-pdf-exporter/LICENSE) or [sponsorship](https://www.blocknotejs.org/about#partner-with-us) obligations. +⚠️ For some advanced features (ex: Export as PDF) Docs relies on XL packages from BlockNote. These are licenced under AGPL-3.0 and are not MIT compatible. You can perfectly use Docs without these packages by setting the environment variable `PUBLISH_AS_MIT` to true. That way you'll build an image of the application without the features that are not MIT compatible. Read the [environment variables documentation](/docs/docs/env.md) for more information. ## Getting started 🔧 diff --git a/docs/env.md b/docs/env.md index 12294f5c..67d52b2b 100644 --- a/docs/env.md +++ b/docs/env.md @@ -107,8 +107,36 @@ These are the environment variables you can set for the `impress-backend` contai These are the environment variables you can set to build the `impress-frontend` image. +Depending on how you are building the front-end application, this variable is used in different ways. + +If you want to build the Docker image, this variable is used as an argument in the build command. + +Example: + +``` +docker build -f src/frontend/Dockerfile --target frontend-production --build-arg PUBLISH_AS_MIT=false docs-frontend:latest +``` + +If you want to build the front-end application using the yarn build command, you can edit the file `src/frontend/apps/impress/.env` with the `NODE_ENV=production` environment variable and modify it. Alternatively, you can use the listed environment variables with the prefix `NEXT_PUBLIC_` (for example, `NEXT_PUBLIC_PUBLISH_AS_MIT=false`). + +Example: + +``` +cd src/frontend/apps/impress +NODE_ENV=production NEXT_PUBLIC_PUBLISH_AS_MIT=false yarn build +``` + | Option | Description | default | | ----------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------- | | API_ORIGIN | backend domain - it uses the current domain if not initialized | | | SW_DEACTIVATED | To not install the service worker | | -| PUBLISH_AS_MIT | MIT licence does not include the export feature | true | \ No newline at end of file +| PUBLISH_AS_MIT | Removes packages whose licences are incompatible with the MIT licence (see below) | true | + +Packages with licences incompatible with the MIT licence: +* `xl-docx-exporter`: [AGPL-3.0](https://github.com/TypeCellOS/BlockNote/blob/main/packages/xl-docx-exporter/LICENSE), +* `xl-pdf-exporter`: [AGPL-3.0](https://github.com/TypeCellOS/BlockNote/blob/main/packages/xl-pdf-exporter/LICENSE) + +In `.env.development`, `PUBLISH_AS_MIT` is set to `false`, allowing developers to test Docs with all its features. + +⚠️ If you run Docs in production with `PUBLISH_AS_MIT` set to `false` make sure you fulfill your [BlockNote licensing](https://github.com/TypeCellOS/BlockNote/blob/main/packages/xl-pdf-exporter/LICENSE) or [subscription](https://www.blocknotejs.org/about#partner-with-us) obligations. +