-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#293] add support for configuring tokens through django-setup-config…
…uration (#297)
- Loading branch information
Showing
32 changed files
with
1,033 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# setup initial configuration using environment variables | ||
# Run this script from the root of the repository | ||
|
||
set -e | ||
|
||
if [[ "${RUN_SETUP_CONFIG,,}" =~ ^(true|1|yes)$ ]]; then | ||
# wait for required services | ||
/wait_for_db.sh | ||
|
||
src/manage.py migrate | ||
src/manage.py setup_configuration --yaml-file setup_configuration/data.yaml | ||
fi |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
openklant_tokens_config_enable: true | ||
openklant_tokens: | ||
items: | ||
- identifier: token-1 | ||
token: ba9d233e95e04c4a8a661a27daffe7c9bd019067 | ||
contact_person: Person 1 | ||
email: [email protected] | ||
organization: Organization XYZ | ||
application: Application XYZ | ||
administration: Administration XYZ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ this. | |
|
||
config | ||
migration | ||
setup_configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.. _installation_configuration_cli: | ||
|
||
============================== | ||
Open Klant configuration (CLI) | ||
============================== | ||
|
||
After deploying Open Klant, it needs to be configured to be fully functional. | ||
The django management command ``setup_configuration`` assist with this configuration. | ||
You can get the full command documentation with: | ||
|
||
.. code-block:: bash | ||
python ./src/manage.py setup_configuration --help | ||
.. warning:: This command is declarative - if configuration is manually changed after | ||
running the command and you then run the exact same command again, the manual | ||
changes will be reverted. | ||
|
||
Preparation | ||
=========== | ||
|
||
The command executes the list of pluggable configuration steps, and each step | ||
requires specific configuration information, that should be prepared. | ||
Here is the description of all available configuration steps and the configuration | ||
format, used by each step. | ||
|
||
Token configuration | ||
---------------------- | ||
|
||
Create a (single) YAML configuration file with your settings: | ||
|
||
.. code-block:: yaml | ||
openklant_tokens_config_enable: true | ||
openklant_tokens: | ||
group: | ||
- identifier: token-1 | ||
contact_person: Person 1 | ||
email: [email protected] | ||
organization: Organization XYZ # optional | ||
application: Application XYZ # optional | ||
administration: Administration XYZ # optional | ||
- identifier: token-2 | ||
contact_person: Person 2 | ||
email: [email protected] | ||
Execution | ||
========= | ||
|
||
Open Klant configuration | ||
------------------------ | ||
|
||
With the full command invocation, everything is configured at once. Each configuration step | ||
is idempotent, so any manual changes made via the admin interface will be updated if the command | ||
is run afterwards. | ||
|
||
.. code-block:: bash | ||
python ./src/manage.py setup_configuration --yaml-file /path/to/config.yaml | ||
.. note:: Due to a cache-bug in the underlying framework, you need to restart all | ||
replicas for part of this change to take effect everywhere. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
open-api-framework | ||
|
||
django-setup-configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.