Metadata-Version: 2.1
Name: collective.zopeconsul
Version: 0.3
Summary: Asynchronous updating of consul with zope configration
Home-page: https://github.com/collective/collective.zopeconsul/
Author: Dylan Jay, Jon Pentland
Author-email: software@pretaweb.com
License: GPL
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 4.3
Classifier: Framework :: Plone :: 5.0
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: setuptools
Requires-Dist: Zope2
Requires-Dist: python-consul
Requires-Dist: collective.monkeypatcher
Requires-Dist: zope.app.publication
Provides-Extra: test
Requires-Dist: plone.app.testing; extra == "test"
Requires-Dist: plone.app.robotframework>=0.7.0rc4; extra == "test"

=====================
collective.zopeconsul
=====================

*collective.zopeconsul* enables asynchronous sending of zope configuration
to consul. It sends the VHM domain information to consul along
with port and ip address of this instance. It can also be used to set key/value
pairs from buildout config options or environment variables.

Configuration
--------------

zopeconsul can be configured by adding the following to your buildout:

.. code:: ini

  [instance]
  eggs = collective.zopeconsul

  zope-conf-additional =
    <product-config zopeconsul>
      consul_url http://localhost:8500
      consul_prefix zope
      consul_key_somename somevalue
    </product-config>

Any configuration option can be overridden by an environment variable:

.. code:: ini

  $ export CONSUL_URL=http://localhost:8500
  $ export CONSUL_KEY_SOMENAME=somevalue

Configuration options
---------------------

consul_url
    Url of the consul server to connect to. *Default: http\://localhost:8500*

consul_prefix
    When setting key/values, this is the base key from which all values are
    set. *Default: zope*

consul_instancename
    Gives a name to the instance. Instead of values being placed in ``<consul_prefix>``, they are placed in ``<consul_prefix>/instances/<instance_name>`` on the consul server. Useful when there are multiple instances being orchestrated from consul. *Default: unset*

consul_key_[name]
    Allows to set arbitrary key values with any name. *Example: ``consul_key_somekey = somevalue``*

consul_ignore
    Skips setting consul key values. Useful if you have multiple instances that
    share the same code. You can set this value on specific instances and no
    key/values will be set in consul.

consul_ignorevhm
    Skips individual VHM hosts from being set. This should match the first part of the vhm string (i.e. before `/VirtualHostBase`)
    e.g. `CONSUL_IGNOREVHM="test.localhost,test2.localhost"` which will prevent either of the corresponding vhm values being set in consul.

Changelog
=========

0.3 (2024-09-23)
----------------

- Create new CONSUL_IGNOREVHM option [instification]
- Only update VHM values if they differ from consul [instification]


0.2 (2021-09-16)
----------------

- Add Python3 compatibility [instification]


0.1 (2018-02-01)
----------------

- Initial setup and vhm monkeypatching [djay]
- Addition of zope-additional-configuration option [instification]
- Addition of key/value pairs to consul [instification]
