Project Awesome project awesome

collective.regenv

Override registry settings using environment variables.

Package 7 stars GitHub

collective.regenv

PyPI PyPI - Python Version PyPI - Wheel PyPI - License PyPI - Status PyPI - Plone Versions

CI Code Style GitHub contributors GitHub Repo stars

Override Plone registry settings with environment variables.

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.

Installation

Install collective.regenv with pip:

pip install collective.regenv

And to create the Plone site:

make create-site

Usage

Registry overrides should be in a YAML file:

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

Contribute

Prerequisites ✅

Installation 🔧

  1. Clone this repository, then change your working directory.

    git clone git@github.com:collective/collective.regenv.git
    cd collective.regenv
    
  2. Install this code base.

    make install
    

License

The project is licensed under GPLv2.

Credits and acknowledgements 🙏

Generated using Cookieplone (0.9.10) and cookieplone-templates (44f4a49) on 2026-02-20 17:38:38.334208. A special thanks to all contributors and supporters!

Back to Plone