diff --git a/packages/dsw-config/CHANGELOG.md b/packages/dsw-config/CHANGELOG.md
index 3faf8369..381effef 100644
--- a/packages/dsw-config/CHANGELOG.md
+++ b/packages/dsw-config/CHANGELOG.md
@@ -16,6 +16,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- `sentry.environment` (`SENTRY_ENVIRONMENT`) defaults to `development` instead of `production`, as in the backend, so a deployment that does not set it no longer reports as production
- `SentryReporter.initialize` takes `component` (the `component` tag) instead of `prog_name`
+- Multi-tenant mode is read from `multiTenancy.enabled` (`MULTI_TENANCY_ENABLED`), the backend's new name for the section; `cloud.enabled` (`CLOUD_ENABLED`) is still read when `multiTenancy.enabled` is not set
## [4.34.0]
diff --git a/packages/dsw-config/dsw/config/keys.py b/packages/dsw-config/dsw/config/keys.py
index d0ad71fe..10208b68 100644
--- a/packages/dsw-config/dsw/config/keys.py
+++ b/packages/dsw-config/dsw/config/keys.py
@@ -174,6 +174,15 @@ class _CloudKeys(ConfigKeysContainer):
)
+class _MultiTenancyKeys(ConfigKeysContainer):
+ enabled = ConfigKey(
+ yaml_path=['multiTenancy', 'enabled'],
+ var_names=['MULTI_TENANCY_ENABLED'],
+ default=False,
+ cast=cast_bool,
+ )
+
+
class _SentryKeys(ConfigKeysContainer):
enabled = ConfigKey(
yaml_path=['sentry', 'enabled'],
@@ -286,5 +295,6 @@ class ConfigKeys(ConfigKeysContainer):
database = _DatabaseKeys
general = _GeneralKeys
logging = _LoggingKeys
+ multi_tenancy = _MultiTenancyKeys
s3 = _S3Keys
sentry = _SentryKeys
diff --git a/packages/dsw-config/dsw/config/parser.py b/packages/dsw-config/dsw/config/parser.py
index f90711e1..b3b98a00 100644
--- a/packages/dsw-config/dsw/config/parser.py
+++ b/packages/dsw-config/dsw/config/parser.py
@@ -130,8 +130,12 @@ def logging(self) -> model.LoggingConfig:
@property
def cloud(self) -> model.CloudConfig:
+ key = self.keys.multi_tenancy.enabled
+ if not self.has_value_for_key(key):
+ # the section's name before the backend renamed it
+ key = self.keys.cloud.enabled
return model.CloudConfig(
- multi_tenant=self.get(self.keys.cloud.enabled),
+ multi_tenant=self.get(key),
)
@property
diff --git a/packages/dsw-config/tests/test_parser.py b/packages/dsw-config/tests/test_parser.py
index 8a517980..c3e10233 100644
--- a/packages/dsw-config/tests/test_parser.py
+++ b/packages/dsw-config/tests/test_parser.py
@@ -70,6 +70,17 @@ def test_yaml_boolean():
assert make_parser().cloud.multi_tenant is False
+def test_multi_tenancy():
+ assert make_parser('multiTenancy:\n enabled: true\n').cloud.multi_tenant is True
+ parser = make_parser('multiTenancy:\n enabled: false\ncloud:\n enabled: true\n')
+ assert parser.cloud.multi_tenant is False
+
+
+def test_multi_tenancy_env_var_wins_over_cloud(monkeypatch):
+ monkeypatch.setenv('DSW_MULTI_TENANCY_ENABLED', 'true')
+ assert make_parser('cloud:\n enabled: false\n').cloud.multi_tenant is True
+
+
def test_sentry_numeric_options():
parser = make_parser('sentry:\n maxBreadcrumbs: 100\n tracesSampleRate: 0.5\n')
sentry = parser.sentry
diff --git a/packages/dsw-data-seeder/config.example.yml b/packages/dsw-data-seeder/config.example.yml
index 99a3c4b6..e0fca111 100644
--- a/packages/dsw-data-seeder/config.example.yml
+++ b/packages/dsw-data-seeder/config.example.yml
@@ -13,7 +13,7 @@ logging:
level: INFO
globalLevel: WARNING
-cloud:
+multiTenancy:
enabled: True
extraDatabases:
diff --git a/packages/dsw-mailer/CHANGELOG.md b/packages/dsw-mailer/CHANGELOG.md
index 697686db..6223c86e 100644
--- a/packages/dsw-mailer/CHANGELOG.md
+++ b/packages/dsw-mailer/CHANGELOG.md
@@ -17,7 +17,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Sentry events carry the same tags as the backend's: `component` is the persistent command component (`mailer`), and a command sets `function`, `tenantUuid`, `traceUuid` (the command UUID, the `traceId` of the logs), the user who created it, and its trace; `command_uuid` / `tenant_uuid` are gone
- Mails are translated with the tenant's mail template locales (Wizard 5.0): one mail is sent per recipient, in the mail template locale whose code matches the recipient's UI locale (exact code, then the base language), otherwise the tenant's default one, otherwise `en`, otherwise built-in English; disabled locales are skipped and a recipient who is not a user gets the default
-- A command with `sendAsOne` sends a single mail to all its recipients in English (the analytics mails); a command without the field, queued before the upgrade, is sent per recipient
+- A command with `sendAsOne` sends a single mail to all its recipients in English; a command without the field, queued before the upgrade, is sent per recipient
- The compiled `mail.mo` of a mail template locale is stored back to S3 next to its `mail.po` and cached locally until the locale's `updated_at` changes, instead of compiling the PO for every mail
- A mail template locale that cannot be loaded is reported and the mail is sent in English
- The `registry` mode is unchanged: English, without locales
@@ -26,6 +26,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Removed
+- The `registrationCreatedAnalytics` templates of the Wizard and the registry, which the backend no longer sends
- The three POT files (`default`, `wizard` and `registry`, built with `pybabel` and `make-header.sh`): `make pot` builds the one `mail.pot`
- The illustrations color (`style.illustrations_color` in templates, `illustrationsColor` and `styleIllustrationsColor` in the input, the `DEFAULT_ILLUSTRATIONS_COLOR` variable): Wizard 5.0 removed it
diff --git a/packages/dsw-mailer/examples/msg.registry.registrationCreatedAnalytics.json b/packages/dsw-mailer/examples/msg.registry.registrationCreatedAnalytics.json
deleted file mode 100644
index a60a8793..00000000
--- a/packages/dsw-mailer/examples/msg.registry.registrationCreatedAnalytics.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "id": "2ff6a64c-b781-4aea-8873-2ccb3e9ee3d7",
- "type": "registry:registrationCreatedAnalytics",
- "trigger": "file:msg.registry.registrationCreatedAnalytics.json",
- "ctx": {
- "email": "john.doe@example.com",
- "organization": {
- "name": "ACME",
- "id": "acme",
- "email": "acme@example.com"
- },
- "clientUrl": "https://dsw.example.com"
- },
- "recipients": [
- "test@example.com"
- ]
-}
\ No newline at end of file
diff --git a/packages/dsw-mailer/examples/msg.wizard.registrationCreatedAnalytics.json b/packages/dsw-mailer/examples/msg.wizard.registrationCreatedAnalytics.json
deleted file mode 100644
index 7e9698d9..00000000
--- a/packages/dsw-mailer/examples/msg.wizard.registrationCreatedAnalytics.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "id": "2ff6a64c-b781-4aea-8873-2ccb3e9ee3d7",
- "type": "wizard:registrationCreatedAnalytics",
- "trigger": "file:msg.wizard.registrationCreatedAnalytics.json",
- "ctx": {
- "email": "john.doe@example.com",
- "user": {
- "uuid": "4b4db197-db13-4bd4-aab8-71c92da0832f",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john.doe@example.com"
- },
- "clientUrl": "https://dsw.example.com",
- "supportEmail": "help@example.com",
- "appTitle": "My DSW"
- },
- "recipients": [
- "test@example.com"
- ]
-}
\ No newline at end of file
diff --git a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/data.json b/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/data.json
deleted file mode 100644
index 06a72132..00000000
--- a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/data.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "mode": "registry",
- "parameters": {
- "clientUrl": "https://registry-staging.ds-wizard.org",
- "organizationEmail": "marek.suchanek+test.mails@gmail.com",
- "organizationId": "ms.test.mail",
- "organizationName": "MS test mail"
- },
- "recipients": [
- {
- "email": "admin@ds-wizard.org",
- "uuid": null
- }
- ],
- "template": "registrationCreatedAnalytics"
-}
\ No newline at end of file
diff --git a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.html.j2 b/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.html.j2
deleted file mode 100644
index 9cb4e427..00000000
--- a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.html.j2
+++ /dev/null
@@ -1,50 +0,0 @@
-{% extends '_common/layout.html.j2' %}
-{% block body %}
-
-
-
-
-
-
-
-
-
- |
-
- {% trans %}Hello!{% endtrans %}
- {% trans %}Good news — we have a new organization in{% endtrans %} Registry "{{ ctx.appTitle }}": {{ ctx.clientUrl }}
-
-
- - {% trans %}ID{% endtrans %}
-
-
- {{ ctx.organizationId }}
- - {% trans %}Name{% endtrans %}
-
-
- {{ ctx.organizationName }}
- - {% trans %}Email{% endtrans %}
-
-
- {{ ctx.organizationEmail }}
-
-
-
- {% trans %}Have a nice day!{% endtrans %}
- {% if ctx.appTitle %}{{ ctx.appTitle }} {% trans %}team{% endtrans %}{% endif %}
-
- |
-
-
-
-
-
- |
-
-
-
-{% endblock %}
diff --git a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.json b/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.json
deleted file mode 100644
index d3f435b8..00000000
--- a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "id": "registry:registrationCreatedAnalytics",
- "subject": "New Organization Registered",
- "subjectPrefix": true,
- "defaultSenderName": "DSW Registry",
- "parts": [
- {
- "type": "html",
- "file": "message.html.j2"
- },
- {
- "type": "plain",
- "file": "message.txt.j2"
- }
- ]
-}
diff --git a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.txt.j2 b/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.txt.j2
deleted file mode 100644
index 0e6e5c52..00000000
--- a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/message.txt.j2
+++ /dev/null
@@ -1,9 +0,0 @@
-{% trans %}Hello!{% endtrans %}
-
-{% trans %}Good news — we have a new organization in{% endtrans %} Registry "{{ ctx.appTitle }}": {{ ctx.clientUrl }}
-
-- {% trans %}ID{% endtrans %}: {{ ctx.organizationId }}
-- {% trans %}Name{% endtrans %}: {{ ctx.organizationName }}
-- {% trans %}Email{% endtrans %}: {{ ctx.organizationEmail }}
-
-{% include '_common/footer.txt.j2' %}
diff --git a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/subject.txt.j2 b/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/subject.txt.j2
deleted file mode 100644
index 52dbc495..00000000
--- a/packages/dsw-mailer/templates/registry/registrationCreatedAnalytics/subject.txt.j2
+++ /dev/null
@@ -1 +0,0 @@
-{% trans %}New Organization Registered{% endtrans %}
diff --git a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.html.j2 b/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.html.j2
deleted file mode 100644
index 5c5a4916..00000000
--- a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.html.j2
+++ /dev/null
@@ -1,47 +0,0 @@
-{% extends '_common/layout.html.j2' %}
-{% block body %}
-
-
-
-
-
-
-
-
-
- |
-
- {% trans %}Hello!{% endtrans %}
- {% trans %}Good news — we have a new user in{% endtrans %} {% if ctx.appTitle %}{{ ctx.appTitle }} {% endif %}({{ ctx.clientUrl }}):
-
-
- - {% trans %}Name{% endtrans %}
-
-
- {{ ctx.userFirstName }} {{ ctx.userLastName }}
- - {% trans %}Email{% endtrans %}
-
-
- {{ ctx.userEmail }}
-
-
-
- {% trans %}Have a nice day!{% endtrans %}
{{ ctx.appTitle }}
-
- |
-
-
-
-
-
- |
-
-
-
-{% endblock %}
diff --git a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.json b/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.json
deleted file mode 100644
index 632aa5aa..00000000
--- a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "id": "wizard:registrationCreatedAnalytics",
- "subject": "New User Registered",
- "subjectPrefix": true,
- "defaultSenderName": "DSW",
- "parts": [
- {
- "type": "html",
- "file": "message.html.j2"
- },
- {
- "type": "plain",
- "file": "message.txt.j2"
- }
- ]
-}
diff --git a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.txt.j2 b/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.txt.j2
deleted file mode 100644
index 4afa0c12..00000000
--- a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/message.txt.j2
+++ /dev/null
@@ -1,8 +0,0 @@
-{% trans %}Hello!{% endtrans %}
-
-{% trans %}Good news — we have a new user in{% endtrans %} ({% if ctx.appTitle %}{{ ctx.appTitle }}, {% endif %}{{ ctx.clientUrl }}):
-
-- {% trans %}Name{% endtrans %}: {{ ctx.userFirstName }} {{ ctx.userLastName }}
-- {% trans %}Email{% endtrans %}: {{ ctx.userEmail }}
-
-{% include '_common/footer.txt.j2' %}
diff --git a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/subject.txt.j2 b/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/subject.txt.j2
deleted file mode 100644
index aae2befa..00000000
--- a/packages/dsw-mailer/templates/wizard/registrationCreatedAnalytics/subject.txt.j2
+++ /dev/null
@@ -1 +0,0 @@
-{% trans %}New User Registered{% endtrans %}