An add-on for Plone
Project description
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:
have different values for development and production environments (think about the MailHost settings, connection parameters to external services, etc.)
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
Issue Tracker: https://github.com/collective/collective.regenv/issues
Source Code: https://github.com/collective/collective.regenv
Documentation: https://pypi-hypernode.com/project/collective.regenv/
License
The project is licensed under the GPLv2.
Contributors
mamico, mauro.amico@gmail.com
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]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for collective.regenv-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74236bb8522b5693269993f97ef49c01521cf2e641db44cb9aff4d28d09f3204 |
|
MD5 | 8173261ca1d4f725b2b55a12d99ad93f |
|
BLAKE2b-256 | a8d9368baf98bcb88928ff88dde91dcf818f7b62f2ca7cd3ed585c2409b788c1 |