From 8a057b63a81edda68907bd29b8b18e16d0620494 Mon Sep 17 00:00:00 2001 From: Thanush K Date: Sat, 16 Aug 2025 21:16:02 +0530 Subject: [PATCH 1/3] Added recipe to have an interactive shell when using docker --- docs/install/containers/recipes/index.md | 86 ++++++++++++++++++++++++ documentation | 1 + 2 files changed, 87 insertions(+) create mode 160000 documentation diff --git a/docs/install/containers/recipes/index.md b/docs/install/containers/recipes/index.md index a48afa469..5f43f30ec 100644 --- a/docs/install/containers/recipes/index.md +++ b/docs/install/containers/recipes/index.md @@ -170,3 +170,89 @@ docker compose run backend pack The above command assumes that the service that runs the Plone instance is named `backend`. Otherwise replace `backend` with your container's name. + +## Interactive shell for debugging + +When developing or troubleshooting Plone applications in Docker containers, you may need an interactive Python shell with the Plone environment loaded. +This is the Docker equivalent of the `bin/instance debug` command used in traditional Plone installations. + +### Using docker exec + +If you have a running Plone container, you can start an interactive shell using `docker exec`: + +```shell +docker exec -it /bin/bash +``` + +Once inside the container, you can start the Plone debug console: + +```shell +bin/instance debug +``` + +### Using docker run + +Alternatively, you can start a new container instance specifically for debugging: + +```shell +docker run -it --rm plone/plone-backend:{PLONE_BACKEND_MINOR_VERSION} /bin/bash +``` + +Then start the debug console: + +```shell +bin/instance debug +``` + +### Using Docker Compose + +If you're using Docker Compose, you can run an interactive shell with: + +```shell +docker compose exec backend /bin/bash +``` + +Then start the debug console: + +```shell +bin/instance debug +``` + +Or run it directly in one command: + +```shell +docker compose exec backend bin/instance debug +``` + +### Accessing the Plone site + +Once in the debug console, you can access your Plone site and perform debugging operations: + +```python +# Access the root application +app = self.app + +# Access your Plone site (replace 'Plone' with your site ID) +site = app['Plone'] + +# Access content +folder = site['my-folder'] +item = folder['my-item'] + +# Set up a fake request for testing +from Testing.makerequest import makerequest +from zope.globalrequest import setRequest + +app = makerequest(app) +setRequest(app.REQUEST) +``` + +### Exiting the debug console + +To exit the debug console, use {kbd}`ctrl-d` or type `exit()`. + +```{note} +The interactive shell provides full access to your Plone environment and database. +Use it carefully in production environments. +``` + diff --git a/documentation b/documentation new file mode 160000 index 000000000..62b8dde6f --- /dev/null +++ b/documentation @@ -0,0 +1 @@ +Subproject commit 62b8dde6fbf19efa50312486deb9fbe30cfa3d64 From a1e37806bab2801bd68a23c69c4d81d56fe1df21 Mon Sep 17 00:00:00 2001 From: Thanush K Date: Sat, 16 Aug 2025 21:47:33 +0530 Subject: [PATCH 2/3] Fix CI submodule issues and add interactive shell documentation - Remove duplicate documentation directory that was causing submodule errors - Add submodules: true to CI workflows to properly handle submodules - Add comprehensive interactive shell debugging documentation for Docker containers Fixes #1960 --- .github/workflows/build_deploy.yml | 2 ++ .github/workflows/test.yml | 2 ++ documentation | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) delete mode 160000 documentation diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml index 5d2fcd5da..207426b47 100644 --- a/.github/workflows/build_deploy.yml +++ b/.github/workflows/build_deploy.yml @@ -16,6 +16,8 @@ jobs: url: https://docs.plone.org steps: - uses: actions/checkout@v5 + with: + submodules: true - name: Setup Graphviz uses: ts-graphviz/setup-graphviz@v2 - name: Set up Python 3.12 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d51fd974..9201a924d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + with: + submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/documentation b/documentation deleted file mode 160000 index 62b8dde6f..000000000 --- a/documentation +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 62b8dde6fbf19efa50312486deb9fbe30cfa3d64 From 8e5b9eeaf2eca4975d38e59c1e55316920a0cb4e Mon Sep 17 00:00:00 2001 From: Thanush K Date: Sun, 17 Aug 2025 14:57:15 +0530 Subject: [PATCH 3/3] Fix deprecated plone.volto:default-homepage profile references - Remove references to deprecated plone.volto:default-homepage profile - Update documentation to recommend content export/import approach - Add explanatory notes about the profile removal in version 5 - Update Docker example to remove deprecated profile usage Fixes #118 --- docs/developer-guide/create-a-distribution.md | 17 ++++++++++++++--- docs/install/containers/images/frontend.md | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/developer-guide/create-a-distribution.md b/docs/developer-guide/create-a-distribution.md index 1a68df8f2..237a6c8c3 100644 --- a/docs/developer-guide/create-a-distribution.md +++ b/docs/developer-guide/create-a-distribution.md @@ -163,12 +163,16 @@ As an example, the configuration for a new Plone site with Volto as its frontend "plonetheme.barceloneta:default", "plone.volto:default" ], - "content": [ - "plone.volto:default-homepage" - ] + "content": [] } ``` +```{note} +The `plone.volto:default-homepage` profile was removed from `plone.volto` in version 5. +For creating example content, use the `content` folder with exported content instead of profiles. +See the {ref}`add-example-content-label` section below for details. +``` + ### `schema.json` @@ -319,6 +323,8 @@ Finally, add it to your {file}`profiles.json` file. ``` +(add-example-content-label)= + ## Add example content The distribution loads its content from JSON data in the `content` folder. @@ -331,6 +337,11 @@ bin/export-distribution path/to/zope.conf Plone In the example above, `Plone` is the ID of the Plone site to export. +```{note} +This is the recommended approach for creating example content in distributions. +The old approach of using profiles like `plone.volto:default-homepage` has been deprecated and removed from `plone.volto` in version 5. +``` + ## Limit available distributions diff --git a/docs/install/containers/images/frontend.md b/docs/install/containers/images/frontend.md index 3a7890e95..adba76637 100644 --- a/docs/install/containers/images/frontend.md +++ b/docs/install/containers/images/frontend.md @@ -108,7 +108,8 @@ services: environment: - SITE=Plone - 'ADDONS=plone.restapi==8.21.0 plone.volto==4.0.0a3 plone.rest==2.0.0a2 plone.app.iterate==4.0.2 plone.app.vocabularies==4.3.0' - - 'PROFILES=plone.volto:default-homepage' + # Note: plone.volto:default-homepage profile was removed in version 5 + # Use content export/import instead for example content frontend: image: 'myfrontend:latest'