Skip to main content

An add-on for Plone

Project description

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

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

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.0a1 (2022-12-27)

  • Initial release. [mamico]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.regenv-1.0.0a1.tar.gz (13.5 kB view details)

Uploaded Source

File details

Details for the file collective.regenv-1.0.0a1.tar.gz.

File metadata

  • Download URL: collective.regenv-1.0.0a1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.8.3 requests/2.27.1 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.16

File hashes

Hashes for collective.regenv-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 db75bd82ed9f40b14bfdacd3e0486c613ff5233f31fc27a7e21eca72cea4e727
MD5 7f4005067f5b9477284886352582d27a
BLAKE2b-256 525c8609983c04d6dd0790f6a832f0a1f9877c8c30ea19f1bfa515c1eaf177b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page