Skip to content

Commit eb73767

Browse files
author
maxim-lixakov
committed
[DOP-19992] - split settings into ServerAppSettings & WorkerAppSettings & SchedulerSettings & add corresponding configuration documentation
1 parent dfd715b commit eb73767

File tree

62 files changed

+276
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+276
-156
lines changed

.env.docker

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SYNCMASTER__LOGGING__SETUP=True
99
SYNCMASTER__LOGGING__PRESET=colored
1010

1111
# Encrypt / Decrypt credentials data
12-
SYNCMASTER__CRYPTO_KEY=UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
12+
SYNCMASTER__ENCRYPTION__CRYPTO_KEY=UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
1313

1414
# Worker settings
1515
SYNCMASTER__WORKER__LOG_URL_TEMPLATE=https://grafana.example.com?correlation_id={{ correlation_id }}&run_id={{ run.id }}
@@ -25,13 +25,13 @@ SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@db:5432/syncm
2525

2626
# TODO: add to KeycloakAuthProvider documentation about creating new realms, add users, etc.
2727
# KEYCLOAK Auth
28-
SYNCMASTER__AUTH__SERVER_URL=http://keycloak:8080
29-
SYNCMASTER__AUTH__REALM_NAME=manually_created
30-
SYNCMASTER__AUTH__CLIENT_ID=manually_created
31-
SYNCMASTER__AUTH__CLIENT_SECRET=generated_by_keycloak
32-
SYNCMASTER__AUTH__REDIRECT_URI=http://localhost:8000/v1/auth/callback
33-
SYNCMASTER__AUTH__SCOPE=email
34-
SYNCMASTER__AUTH__VERIFY_SSL=False
28+
SYNCMASTER__AUTH__KEYCLOAK__SERVER_URL=http://keycloak:8080
29+
SYNCMASTER__AUTH__KEYCLOAK__REALM_NAME=manually_created
30+
SYNCMASTER__AUTH__KEYCLOAK__CLIENT_ID=manually_created
31+
SYNCMASTER__AUTH__KEYCLOAK__CLIENT_SECRET=generated_by_keycloak
32+
SYNCMASTER__AUTH__KEYCLOAK__REDIRECT_URI=http://localhost:8000/auth/callback
33+
SYNCMASTER__AUTH__KEYCLOAK__SCOPE=email
34+
SYNCMASTER__AUTH__KEYCLOAK__VERIFY_SSL=False
3535
SYNCMASTER__AUTH__PROVIDER=syncmaster.backend.providers.auth.keycloak_provider.KeycloakAuthProvider
3636

3737
# Dummy Auth

.env.local

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ export SYNCMASTER__SCHEDULER__TRANSFER_FETCHING_TIMEOUT_SECONDS=200
1818
export SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key
1919

2020
# Encrypt / Decrypt credentials data
21-
export SYNCMASTER__CRYPTO_KEY=UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
21+
export SYNCMASTER__ENCRYPTION__CRYPTO_KEY=UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94=
2222

2323
# Postgres
2424
export SYNCMASTER__DATABASE__URL=postgresql+asyncpg://syncmaster:changeme@localhost:5432/syncmaster
2525

2626
# Keycloack Auth
27-
export SYNCMASTER__AUTH__SERVER_URL=http://keycloak:8080
28-
export SYNCMASTER__AUTH__REALM_NAME=manually_created
29-
export SYNCMASTER__AUTH__CLIENT_ID=manually_created
30-
export SYNCMASTER__AUTH__CLIENT_SECRET=generated_by_keycloak
31-
export SYNCMASTER__AUTH__REDIRECT_URI=http://localhost:8000/auth/callback
32-
export SYNCMASTER__AUTH__SCOPE=email
33-
export SYNCMASTER__AUTH__VERIFY_SSL=False
27+
export SYNCMASTER__AUTH__KEYCLOAK__SERVER_URL=http://keycloak:8080
28+
export SYNCMASTER__AUTH__KEYCLOAK__REALM_NAME=manually_created
29+
export SYNCMASTER__AUTH__KEYCLOAK__CLIENT_ID=manually_created
30+
export SYNCMASTER__AUTH__KEYCLOAK__CLIENT_SECRET=generated_by_keycloak
31+
export SYNCMASTER__AUTH__KEYCLOAK__REDIRECT_URI=http://localhost:8000/auth/callback
32+
export SYNCMASTER__AUTH__KEYCLOAK__SCOPE=email
33+
export SYNCMASTER__AUTH__KEYCLOAK__VERIFY_SSL=False
3434
export SYNCMASTER__AUTH__PROVIDER=syncmaster.backend.providers.auth.keycloak_provider.KeycloakAuthProvider
3535

3636
# Dummy Auth

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ build:
1717
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry install --no-root --all-extras --with docs --without dev,test
1818
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry show -v
1919
- python -m pip list -v
20-
- SYNCMASTER__DATABASE__URL=postgresql+psycopg://fake:[email protected]:5432/fake SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key SYNCMASTER__BROKER__URL=amqp://fake:faket@fake:5672/ SYNCMASTER__CRYPTO_KEY=crypto_key SYNCMASTER__AUTH__ACCESS_TOKEN__SECRET_KEY=fakepython python -m syncmaster.backend.scripts.export_openapi_schema docs/_static/openapi.json
20+
- SYNCMASTER__DATABASE__URL=postgresql+psycopg://fake:[email protected]:5432/fake SYNCMASTER__SERVER__SESSION__SECRET_KEY=session_secret_key SYNCMASTER__BROKER__URL=amqp://fake:faket@fake:5672/ SYNCMASTER__ENCRYPTION__CRYPTO_KEY=crypto_key SYNCMASTER__AUTH__ACCESS_TOKEN__SECRET_KEY=fakepython python -m syncmaster.backend.scripts.export_openapi_schema docs/_static/openapi.json
2121

2222
sphinx:
2323
configuration: docs/conf.py

docs/backend/configuration/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Configuration
1818
static_files
1919
openapi
2020

21-
.. autopydantic_settings:: syncmaster.settings.Settings
22-
.. autopydantic_settings:: syncmaster.settings.server.ServerSettings
21+
.. autopydantic_settings:: syncmaster.backend.settings.ServerAppSettings
22+
.. autopydantic_settings:: syncmaster.backend.settings.server.ServerSettings

docs/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@
2020
backend/openapi
2121
backend/configuration/index
2222

23+
24+
.. toctree::
25+
:maxdepth: 2
26+
:caption: Worker
27+
:hidden:
28+
29+
worker/configuration/index
30+
31+
32+
.. toctree::
33+
:maxdepth: 2
34+
:caption: Scheduler
35+
:hidden:
36+
37+
scheduler/configuration/index
38+
2339
.. toctree::
2440
:maxdepth: 2
2541
:caption: Development
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _backend-configuration-broker:
2+
3+
Broker settings
4+
=================
5+
6+
.. autopydantic_model:: syncmaster.settings.broker.RabbitMQSettings
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _backend-configuration-database:
2+
3+
Database settings
4+
=================
5+
6+
.. autopydantic_model:: syncmaster.settings.database.DatabaseSettings
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. _scheduler-configuration:
2+
3+
Configuration
4+
=============
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
:caption: Configuration
9+
:hidden:
10+
11+
database
12+
broker
13+
logging
14+
15+
.. autopydantic_settings:: syncmaster.scheduler.settings.SchedulerAppSettings
16+
.. autopydantic_settings:: syncmaster.scheduler.settings.SchedulerSettings
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. _backend-configuration-logging:
2+
3+
Logging settings
4+
================
5+
6+
7+
.. autopydantic_model:: syncmaster.settings.log.LoggingSettings
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _backend-configuration-broker:
2+
3+
Broker settings
4+
=================
5+
6+
.. autopydantic_model:: syncmaster.settings.broker.RabbitMQSettings

0 commit comments

Comments
 (0)