Skip to main content
Latest Version Supported - Python Versions Number of PyPI downloads License Tests Coverage

collective.regenv

This product allows to override the values stored in the portal registry and property manager object (i.e. a PAS plugin) with values defined on a local file defined in an environment variable called PLONE_REGISTRY_YAML.

When it comes to PropertyManager, this product actually only works if you use the accessor getProperty to read properties.

Features

Using this product you can:

  1. have different values for development and production environments (think about the MailHost settings, connection parameters to external services, etc.)

  2. have different values for different instances in the same buildout, allowing for example to toggle features on and off for A/B testing.

Documentation

Registry overrides should be in a YAML file:

% cat sample.yaml

defaults: &defaults
    plone.cachepurging.interfaces.ICachePurgingSettings.cachingProxies:
        - http://localhost:8000
        - http://localhost:8001
    plone.app.theming.interfaces.IThemeSettings.hostnameBlacklist:
        - 127.0.0.1
        - localhost

/Plone/portal_registry:
    <<: *defaults

/Plone2/portal_registry:
    <<: *defaults
    plone.cachepurging.interfaces.ICachePurgingSettings.cachingProxies:
        - http://localhost:9000

/Plone/acl_users/oidc:
    issuer:
        http://localhost:1234/realms/plone/
    client_id:
        plone

Run zope instance with environment pointing to the YAML file, for example:

PLONE_REGISTRY_YAML=$(pwd)/sample.yaml bin/instance fg

Or using the docker image, for example:

docker run -p 8080:8080 \
    -e ADDONS=collective.regenv \
    -e PLONE_REGISTRY_YAML=/app/registry.yaml \
    -v$(pwd)/sample.yaml:/app/registry.yaml \
    plone/plone-backend:latest

Alternatively you can add the contents of the YAML file in an environment variable called PLONE_REGISTRY_YAML_CONTENT and pass the values directly. This way you do not need to mount a volume with the configuration file. For example:

export PLONE_REGISTRY_YAML_CONTENT=$(cat sample.yaml)
docker run -p 8080:8080 \
    -e ADDONS=collective.regenv \
    -e PLONE_REGISTRY_YAML_CONTENT
    plone/plone-backend:latest

Installation

Install collective.regenv by adding it to your buildout:

[buildout]

...

eggs =
    collective.regenv

and then running bin/buildout

Contribute

License

The project is licensed under the GPLv2.

Contributors

Changelog

1.0.0 (2023-11-15)

  • Add another environment variable to get the YAML file content from [erral]

1.0.0rc1 (2023-03-21)

  • Get overridden keys more efficiently. [maurits]

  • Fix python_requires metadata. [maurits]

1.0.0a2 (2022-12-27)

  • Fix monkeys init [mamico]

1.0.0a1 (2022-12-27)

  • Initial release. [mamico]

Release files for collective.regenv 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.regenv 1.0.0
File Size Uploaded
collective.regenv-1.0.0.tar.gz 19.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.regenv 1.0.0
File Interpreter ABI Platform
collective.regenv-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.1 kB

Release files / collective.regenv-1.0.0.tar.gz

Download URL collective.regenv-1.0.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bf377c9ea873ff3d3d722dd60b9b003040267f91390006a06e2b06eb2a241981
BLAKE2b-256 checksum
How to use checksums
fbeab94ba30e2d12b489f7371c9c4f24d5e3a148940d794162092766a5f093a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / collective.regenv-1.0.0-py3-none-any.whl

Download URL collective.regenv-1.0.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74236bb8522b5693269993f97ef49c01521cf2e641db44cb9aff4d28d09f3204
BLAKE2b-256 checksum
How to use checksums
a8d9368baf98bcb88928ff88dde91dcf818f7b62f2ca7cd3ed585c2409b788c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page