Skip to content

Commit

Permalink
add environment variable support in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Feb 15, 2021
1 parent 8b3c7c0 commit 1ff6d22
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@ The The following describes how ``maxRecords`` is handled by the configuration w

.. _alternate-configurations:

Using environment variables in configuration files
------------------------------------------------------

pycsw configuration supports using system environment variables, which can be helpful
for deploying into `12 factor <https://12factor.net/>`_ environments for example.

Below is an example of how to integrate system environment variables in pycsw:

.. code-block:: ini
[repository]
database=${PYCSW_REPOSITORY_DATABASE_URI}
table=${MY_TABLE}
Alternate Configurations
------------------------

Expand All @@ -101,6 +116,9 @@ Some deployments with alternate configurations prefer not to advertise the base
Environment Variables
~~~~~~~~~~~~~~~~~~~~~

Configuration file location
^^^^^^^^^^^^^^^^^^^^^^^^^^^

One option is using Apache's ``Alias`` and ``SetEnvIf`` directives. For example, given the base URL ``http://localhost/pycsw/csw.py?config=foo.cfg``, set the following in Apache's ``httpd.conf``:

.. code-block:: none
Expand Down

0 comments on commit 1ff6d22

Please sign in to comment.