Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: plone/cookiecutter-zope-instance
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.1.0
Choose a base ref
...
head repository: plone/cookiecutter-zope-instance
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 20 commits
  • 13 files changed
  • 6 contributors

Commits on Mar 6, 2024

  1. fix rst

    jensens committed Mar 6, 2024
    Copy the full SHA
    5b02c80 View commit details

Commits on Apr 23, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    66419c8 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6cb2827 View commit details
  3. Update README.rst

    jensens authored Apr 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d5aa88a View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1bd8bb6 View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e537696 View commit details
  6. Merge pull request #22 from plone/issue_21

    Mention relevant settings in RelStorage section
    jensens authored Apr 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ccd136b View commit details

Commits on Apr 25, 2024

  1. Update cookiecutter.json

    jensens authored Apr 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    dd6c863 View commit details

Commits on Jul 1, 2024

  1. Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    f25eba2 View commit details
  2. minor doc polishing

    jensens committed Jul 1, 2024

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    9e4c1d5 View commit details
  3. Merge pull request #24 from plone/fix-blob-cache-size

    fix wrong handling of blob-cache-size
    jensens authored Jul 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e2a7fe6 View commit details
  4. bump version

    jensens committed Jul 1, 2024

    Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    018ed4e View commit details

Commits on Aug 29, 2024

  1. Fix typos in docs and deprecation: zcml_package_metas and load_zcml.

    - Fix typo in docs: it is not `zcml_package_meta` singular, but `zcml_package_metas` plural.
      I tried the singular, but it was not working, so had to dive into the code.
    
    - Fix typo in deprecation warning: there was never a `zcml` dict setting, only `load_zcml`.
      I kept seeing a deprecation warning that I should not be using a `zcml` dict, but I was not actually using it, so I never knew what or where to fix.
      And the setting is not actually removed, but it is deprecated.  Changed the warning accordingly.
    mauritsvanrees committed Aug 29, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    mauritsvanrees Maurits van Rees
    Copy the full SHA
    35a6923 View commit details

Commits on Aug 30, 2024

  1. Update hooks/pre_gen_project.py

    Co-authored-by: Steve Piercy <[email protected]>
    mauritsvanrees and stevepiercy authored Aug 30, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1c1e046 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    mauritsvanrees Maurits van Rees
    Copy the full SHA
    292f69d View commit details
  3. Merge pull request #26 from plone/maurits-fix-typos

    Fix typos in docs and deprecation: zcml_package_metas and load_zcml.
    davisagli authored Aug 30, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e093d61 View commit details

Commits on Feb 19, 2025

  1. Update CHANGES.rst

    jensens authored Feb 19, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8ef2bbc View commit details

Commits on Mar 3, 2025

  1. Copy the full SHA
    00c8e4d View commit details
  2. prep release

    jensens committed Mar 3, 2025
    Copy the full SHA
    6245920 View commit details
  3. back to dev

    jensens committed Mar 3, 2025
    Copy the full SHA
    2af0fe4 View commit details
35 changes: 34 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
Changelog
=========

2.1.4 (unreleased)
------------------

- Nothing changed yet.


2.1.3 (2025-03-03)
------------------

- Feature: configurable `wsgi_app_entrypoint`.
[@jensens, 2025-03-03]

2.1.2
-----

- Fix typo in docs: it is not ``zcml_package_meta`` singular, but ``zcml_package_metas`` plural.
[@mauritsvanrees, 2024-08-29]

- Fix typo in deprecation warning: there was never a ``zcml`` dict setting, only ``load_zcml`.
[@mauritsvanrees, 2024-08-29]
2.1.1
-----
- Fix broken handling of `blob-cache-size` and `blob-cache-size-check`.
[@jensens, 2024-07-01]
- Fix: Introduce consistent naming of all `db_blob_*` and deprecate all `db_blobs_*`.
[@jensens, 2024-07-01]
- Add a footer to all generated files to make clear where they come from, include version of `cookiecutter-zope-instance`.
[@jensens, 2024-07-01]
2.1.0
-----
@@ -10,7 +43,7 @@ Changelog
2.0.1
-----
- Fix: Implement a fallback to old zcml configurations Fixes #18.
- Fix: Implement a fallback to use ``load_zcml`` dict configuration, effectively making the breaking change of its removal in 2.0.0 a deprecation instead. Fixes #18.
[@ericof, 2024-03-01]

2.0
44 changes: 24 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ It bakes configuration for Zope 5
Features
========

- Creates basic file-system structure with ``zope.conf``, ``zope.ini``, ``site.zcml`` and inital user.
- Creates basic file-system structure with ``zope.conf``, ``zope.ini``, ``site.zcml`` and initial user.
- Set Zope's main configuration options.
- Configure different database backends such as local file-system storage, ``RelStorage`` or ``ZEO``.
- Enable development options.
@@ -68,7 +68,7 @@ Base Locations
The target directory name of the cookiecutter generated configuration.
This is also the so called *INSTANCEHOME*.

Attention, this is relative to current directory or to cookiecutters command line options if given (``-o PATH`` or ``--output-dir PATH``).
Attention, this is relative to current directory or to cookiecutter command line options if given (``-o PATH`` or ``--output-dir PATH``).

Default: ``instance``

@@ -94,12 +94,11 @@ Basic configuration
Default: ``localhost:8080``

``wsgi_fast_listen``
Like *wsgi_listen*, but uses [waitress_fastlisten](https://pypi.org/project/waitress-fastlisten/).
Like *wsgi_listen*, but uses `waitress_fastlisten <https://pypi.org/project/waitress-fastlisten/>`_.
Needs latter package to be installed (add it to *requirements.txt*).

Default: empty string. Switched off.


``wsgi_threads``
Specify the number of worker threads used to service requests.

@@ -179,7 +178,7 @@ Initial user
ZCML
----

``zcml_package_meta``
``zcml_package_metas``
A string with comma separated values of ``meta.zcml`` files from packages to include.

Examples: "my.fancypackage" or "myns.mypackage, collective.example"
@@ -241,7 +240,7 @@ Zope/Plone offers different ZODB storage backends for different environments and
- For development a simple local file based *direct* storage is all you need (aka filestorage).
- As soon as you want multiple application processes of Zope/Plone (horizontal scaling) you need to run a separate database server process and connect to it.

- We recommend to use a Postgresql database using the *RelStorage* implementation for ZODB with *psycopg2* driver as database server in production environments.
- We recommend to use a PostgreSQL database using the *RelStorage* implementation for ZODB with *psycopg2* driver as database server in production environments.
RelStorage supports very well MySQL (and derivatives), Oracle and SQLite 3 as database servers.
- Zope and ZODB comes with *ZEO* (Zope Enterprise Objects). This more lightweight storage server is supported here too. It is widely used in production environment.

@@ -312,7 +311,7 @@ Blobs Settings

The blob settings are valid for all storages.

``db_blobs_mode``
``db_blob_mode``
Set if blobs are stored *shared* within all clients or are they stored on the storage backend and the client only operates as temporary *cache*.
For *direct* storage only *shared* applies (operates like shared with one single client).
Attention: Do not forget to set this to *cache* if you use RelStorage!
@@ -321,23 +320,23 @@ The blob settings are valid for all storages.

Default: ``shared``

``db_blobs_location``
The name of the directory where the ZODB blob data or cache (depends on *db_blobs_mode*) will be stored.
``db_blob_location``
The name of the directory where the ZODB blob data or cache (depends on *db_blob_mode*) will be stored.

Default: ``{{ cookiecutter.location_clienthome }}/blobs``.

``db_blobs_cache_size``
``db_blob_cache_size``
Set the maximum size of the blob cache, in bytes.
With many blobs and enough disk space on the client hardware this should be increased.
If not set, then the cache size isn't checked and the blob directory will grow without bound.
Only valid for *db_blobs_mode* *cache*.
Only valid for *db_blob_mode* *cache*.

Default: ``6312427520`` (5GB).

``db_blobs_cache_size_check``
Set the ZEO check size as percent of ``blobss_cache_size`` (for example, ``10`` for 10%).
``db_blob_cache_size_check``
Set the ZEO check size as percent of ``blobs_cache_size`` (for example, ``10`` for 10%).
The ZEO cache size will be checked when this many bytes have been loaded into the cache.
Only valid for *db_blobs_mode* *cache*.
Only valid for *db_blob_mode* *cache*.

Defaults: ``10`` (10% of the blob cache size).

@@ -391,6 +390,9 @@ RelStorage

`RelStorage <https://pypi.org/project/RelStorage/>`_ is a storage implementation for ZODB that stores pickles in a relational database (RDBMS).

Note: Please see `Database`_ and `Blobs Settings`_ , as you will have to set ``db_blob_mode`` to ``cache``.
Usually you will also have to set up the correct DSN for your database.

General settings
""""""""""""""""

@@ -524,14 +526,16 @@ The configuration for the scripts is generated as separate file:
The file ``relstorage-pack.conf`` for the command line utility ``zobdpack`` is always generated for all RelStorage configurations.
For usage information read `Packing Or Reference Checking A ZODB Storage: zodbpack <https://relstorage.readthedocs.io/en/latest/zodbpack.html>`_.

The file ``relstorage-export.conf`` is generated if the two ``db_relstorage_export_*`` settings are given.
The file ``relstorage-import.conf`` is generated if the two ``db_relstorage_import_*`` settings are given.
The files
- ``relstorage-export.conf`` is generated if the two ``db_relstorage_export_*`` settings are given, and
- ``relstorage-import.conf`` is generated if the two ``db_relstorage_import_*`` settings are given.

Both are for the command line utility ``zobdconvert``.
For usage information read `Copying Data Between ZODB Storages: zodbconvert <https://relstorage.readthedocs.io/en/latest/zodbconvert.html>`_

At the moment only the filestorage with blobs is supported.
In future there may be more options, like converting from/to a ZEO-server or another RelStorage/Database.
Latter would be useful to upgrade a database or convert MyQL to Postgresql or vice versa.
Latter would be useful to upgrade a database or convert MySQL to PostgreSQL or vice versa.

``db_relstorage_import_filestorage_location``
The filename of the filestorage to import from.
@@ -761,7 +765,7 @@ If in doubt better do not touch them.
Cross-Origin Resource Sharing (CORS)
------------------------------------

Plone offers [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) handling with the [plone.rest](https://pypi.org/project/plone.rest/) package.
Plone offers `CORS <https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS`_ handling with the `plone.rest <https://pypi.org/project/plone.rest/>`_ package.
CORS configuration is needed, if you want to access the Plone REST API from a different domain than the one Plone is running on.

``cors_enabled``
@@ -912,7 +916,7 @@ Then we set a bunch of environment variables for production:
export INSTANCE_debug_mode=false
export INSTANCE_verbose_security=false
export INSTANCE_db_storage=relstorage
export INSTANCE_db_blobs_mode=cache
export INSTANCE_db_blob_mode=cache
export INSTANCE_db_relstorage_keep_history=false
export INSTANCE_db_relstorage=postgresql
export INSTANCE_db_relstorage_postgresql_dsn="host='db' dbname='plone' user='plone' password='verysecret'"
@@ -925,7 +929,7 @@ all prefixed environment variables are transformed into a new configuration file
.. code-block:: YAML
default_context:
db_blobs_mode: cache
db_blob_mode: cache
db_cache_size: '50000'
db_cache_size_bytes: 1500MB
db_relstorage: postgresql
15 changes: 10 additions & 5 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_version": "2.0.0",
"_version": "2.1.2.dev0",
"_extensions": ["local_extensions.ZopeExtensions"],
"target": "instance",
"location_clienthome": "{{ cookiecutter.target }}/var",
@@ -10,6 +10,7 @@
"wsgi_threads": "4",
"wsgi_max_request_body_size": "1073741824",
"wsgi_clear_untrusted_proxy_headers": false,
"wsgi_app_entrypoint": "egg:Zope#main",

"environment": {
"zope_i18n_compile_mo_files": "true",
@@ -48,8 +49,12 @@
"db_large_record_size": "",
"db_pool_size": "",

"db_blobs_mode": ["shared", "cache"],
"db_blobs_location": "{{ cookiecutter.location_clienthome }}/blobs",
"db_blob_mode": ["shared", "cache"],
"db_blobs_mode": ["","shared", "cache"],
"db_blob_location": "{{ cookiecutter.location_clienthome }}/blobs",
"db_blobs_location": "",
"db_blob_cache_size": "6312427520",
"db_blob_cache_size_check": "",

"db_filestorage_location": "{{ cookiecutter.location_clienthome }}/filestorage/Data.fs",
"db_filestorage_pack_keep_old": true,
@@ -63,7 +68,7 @@
"db_relstorage_create_schema": true,
"db_relstorage_commit_lock_timeout": "",
"db_relstorage_commit_lock_id": "",
"db_relstorage_blob_cache_size_check_external": "",
"db_relstorage_blob_cache_size_check_external": false,
"db_relstorage_blob_chunk_size": "",
"db_relstorage_cache_local_mb": "",
"db_relstorage_cache_local_object_max": "",
@@ -137,4 +142,4 @@
"profile_repoze_path": "/__profile__",
"profile_repoze_flush_at_shutdown": "true",
"profile_repoze_unwind": "false"
}
}
2 changes: 1 addition & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
with work_in(basedir):
Path("{{ cookiecutter.location_clienthome }}").mkdir(parents=True, exist_ok=True)
Path("{{ cookiecutter.location_log }}").mkdir(parents=True, exist_ok=True)
Path("{{ cookiecutter.db_blobs_location }}").mkdir(parents=True, exist_ok=True)
Path("{{ cookiecutter.db_blob_location }}").mkdir(parents=True, exist_ok=True)
Path("{{ cookiecutter.environment['CHAMELEON_CACHE'] }}").mkdir(
parents=True, exist_ok=True
)
29 changes: 21 additions & 8 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
@@ -4,17 +4,19 @@
# check database mode direct and blobs not cache
if (
"{{ cookiecutter.db_storage }}" == "direct"
and "{{ cookiecutter.db_blobs_mode }}" == "cache"
and "{{ cookiecutter.db_blobs_mode or cookiecutter.db_blob_mode }}" == "cache"
):
print("Error: A 'direct' database must be configured with 'shared' blobs_mode!")
print("Error: A 'direct' database must be configured with 'shared' db_blob_mode!")
exit(1)

# check database mode not direct and blobs not shared
db_blob_mode = "{{ cookiecutter.db_blobs_mode }}"
if db_blob_mode == "":
db_blob_mode = "{{ cookiecutter.db_blob_mode }}"
if (
"{{ cookiecutter.db_storage }}" == "relstorage"
and "{{ cookiecutter.db_blobs_mode }}" == "shared"
"{{ cookiecutter.db_storage }}" == "relstorage" and db_blob_mode == "shared"
):
print("Warning: A 'relstorage' database is better used with 'cache' blobs_mode!\n")
print("Warning: A 'relstorage' database is better used with 'cache' db_blob_mode!\n")

# minimal sanity check for password
password = "{{ cookiecutter.initial_user_password }}"
@@ -30,7 +32,7 @@
has_old_zcml = bool([value for value in load_zcml.values() if value])
if has_old_zcml:
upgrade_warnings.append(
"The 'zcml' dict setting is removed in 2.0, use 'zcml_' prefix variables instead!"
"The 'load_zcml' dict setting was deprecated in version 2.0. Instead use the name of its keys prefixed with 'zcml_' as the new variable names."
)

if "{{ cookiecutter.debug_mode in [True, False] }}" != "True":
@@ -40,7 +42,17 @@

if "{{ cookiecutter.verbose_security in [True, False] }}" != "True":
upgrade_errors.append(
"The'verbose_security' setting must be boolean in 2.0, please fix your configuration!\n"
"The 'verbose_security' setting must be boolean in 2.0, please fix your configuration!\n"
)

if "{{ cookiecutter.db_blobs_mode }}" != "":
upgrade_warnings.append(
"The 'db_blobs_mode' setting was renamed to 'db_blob_mode', please fix your configuration!"
)

if "{{ cookiecutter.db_blobs_location }}" != "":
upgrade_warnings.append(
"The 'db_blobs_location' setting was renamed to 'db_blob_location', please fix your configuration!"
)

if upgrade_errors:
@@ -52,4 +64,5 @@
elif upgrade_warnings:
print("Please review the following warning messages and fix them at your earliest convenience:")
for warning_msg in upgrade_warnings:
print(f" - Warning: {warning_msg}")
print(f" - Warning: {warning_msg}")
print()
Loading