Skip to content

Commit e14aed9

Browse files
committed
📝 [#210] Update documentation for setup-configuration
with general info on how to use the command, as well as YAML examples per configuration step
1 parent b78c3f2 commit e14aed9

File tree

3 files changed

+12
-113
lines changed

3 files changed

+12
-113
lines changed

docs/conf.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
import os
99
import sys
1010

11-
# import django
11+
import django
1212

1313
sys.path.insert(0, os.path.abspath("../src"))
1414

1515
import nrc # noqa isort:skip
1616

17+
from nrc.setup import setup_env # noqa isort:skip
18+
19+
setup_env()
20+
django.setup()
21+
1722
# from nrc.setup import setup_env # noqa isort:skip
1823

1924
# TODO: This needs to be enabled when we want to use autodoc to grab
@@ -43,6 +48,9 @@
4348
"sphinx.ext.todo",
4449
"recommonmark",
4550
"sphinx_tabs.tabs",
51+
"sphinx.ext.autodoc",
52+
"django_setup_configuration.documentation.setup_config_example",
53+
"django_setup_configuration.documentation.setup_config_usage",
4654
]
4755

4856
# Add any paths that contain templates here, relative to this directory.

docs/delivery_guarantees.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ the formula to calculate the time to wait until the next retry is as follows:
7979
8080
where `t` is time in seconds and `c` is the number of retries that have been performed already.
8181

82-
This behaviour can be configured using :ref:`setup_configuration <installation_configuration_cli_retry>`
82+
This behaviour can be configured using `setup_configuration <installation/configuration/opennotifs_config_cli.html#configuration-for-notificaties-api>`_
8383
and also via the admin interface at **Configuratie > Notificatiescomponentconfiguratie**:
8484

8585
* **Notification delivery max retries**: the maximum number of retries the task queue
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,7 @@
11
.. _installation_configuration_cli:
22

33
=====================================
4-
Open Notificaties configuration (CLI)
4+
Open Notificaties Configuration (CLI)
55
=====================================
66

7-
After deploying Open Notificaties, it needs to be configured to be fully functional. The
8-
command line tool ``setup_configuration`` assist with this configuration by loading a
9-
YAML file in which the configuration information is specified.
10-
11-
.. code-block:: bash
12-
13-
src/manage.py setup_configuration --yaml-file /path/to/your/yaml
14-
15-
You can get the full command documentation with:
16-
17-
.. code-block:: bash
18-
19-
src/manage.py setup_configuration --help
20-
21-
.. warning:: This command is declarative - if configuration is manually changed after
22-
running the command and you then run the exact same command again, the manual
23-
changes will be reverted.
24-
25-
Preparation
26-
===========
27-
28-
The command executes the list of pluggable configuration steps, and each step
29-
requires specific configuration information, that should be prepared.
30-
Here is the description of all available configuration steps and the shape of the data,
31-
used by each step.
32-
33-
34-
Services configuration
35-
----------------------
36-
37-
In order for Open Notificaties to make requests to external services (such as the Autorisaties API),
38-
``Services`` must be configured. To enable this step, set ``zgw_consumers_config_enable`` to ``true`` in your
39-
configuration file and specify a list of ``Services``, for example:
40-
41-
.. code-block:: yaml
42-
43-
zgw_consumers_config_enable: true
44-
zgw_consumers:
45-
services:
46-
# all possible configurable fields
47-
- identifier: objecten-test
48-
label: Objecten API test
49-
api_root: http://objecten.local/api/v1/
50-
api_connection_check_path: objects
51-
api_type: orc
52-
auth_type: api_key
53-
header_key: Authorization
54-
header_value: Token foo
55-
client_id: client
56-
secret: super-secret
57-
nlx: http://some-outway-adress.local:8080/
58-
user_id: open-formulieren
59-
user_representation: Open Formulieren
60-
timeout: 5
61-
# minimum required fields
62-
- identifier: objecttypen-test
63-
label: Objecttypen API test
64-
api_root: http://objecttypen.local/api/v1/
65-
api_type: orc
66-
auth_type: api_key
67-
68-
Client credentials
69-
------------------
70-
71-
TODO: add generated documentation for ``JWTSecretsConfigurationStep``
72-
73-
74-
Autorisaties API configuration
75-
------------------------------
76-
77-
Open Notificaties uses Autorisaties API to check permissions of the clients that
78-
make requests to Open Notificaties.
79-
80-
This step configures Open Notificaties to use the specified Autorisaties API (see also :ref:`installation_configuration`). It is
81-
dependent on the `Services configuration`_ step to load a ``Service`` for this Autorisaties API,
82-
which is referred to in this step by ``authorizations_api_service_identifier``.
83-
To enable this step, set ``autorisaties_api_config_enable`` to ``true`` in your
84-
configuration file and specify which ``Service`` to use as the Autorisaties API, for example:
85-
86-
.. code-block:: yaml
87-
88-
autorisaties_api_config_enable: True
89-
autorisaties_api:
90-
authorizations_api_service_identifier: autorisaties-api
91-
92-
.. _installation_configuration_cli_retry:
93-
94-
Notificaties configuration
95-
--------------------------
96-
97-
TODO: add generated documentation
98-
99-
100-
Sites configuration
101-
-------------------
102-
103-
TODO: add generated documentation
104-
105-
Execution
106-
=========
107-
108-
Open Notificaties configuration
109-
-------------------------------
110-
111-
With the full command invocation, all defined configuration steps are applied. Each step is idempotent,
112-
so it's safe to run the command multiple times. The steps will overwrite any manual changes made in
113-
the admin if you run the command after making these changes.
114-
115-
.. note:: Due to a cache-bug in the underlying framework, you need to restart all
116-
replicas for part of this change to take effect everywhere.
7+
.. setup-config-usage::

0 commit comments

Comments
 (0)