From 383c0363acc5163f428d61ffdd8cc93cbd0de18e Mon Sep 17 00:00:00 2001 From: Adrien Carpentier Date: Mon, 13 May 2024 18:30:38 +0900 Subject: [PATCH] fix: fix user_allowed_domain typo in docker compose --- app/.env.example | 2 +- app/config.py | 2 +- app/matrix_bot/eventparser.py | 2 +- docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/.env.example b/app/.env.example index 04f179d..b1b79de 100644 --- a/app/.env.example +++ b/app/.env.example @@ -14,7 +14,7 @@ salt=b"\xce,\xa1\xc6lY\x80\xe3X}\x91\xa60m\xa8N" ## Albert env variables albert_api_url="https://albert-server-url.example.com" albert_api_token="INSERT_YOUR_TOKEN" -users_allowed_domains='["ministere_example.gouv.fr", "ministere_example2.gouv.fr"]' +user_allowed_domains='["ministere_example.gouv.fr", "ministere_example2.gouv.fr"]' # For docker-compose deployment MATRIX_HOME_SERVER= diff --git a/app/config.py b/app/config.py index 3225097..2d92173 100755 --- a/app/config.py +++ b/app/config.py @@ -37,7 +37,7 @@ class Config(BaseConfig): groups_used: list[str] = Field(["basic"], description="List of commands groups to use") albert_api_url: str = Field("http://localhost:8090/api/v2", description="Albert API base URL") albert_api_token: str = Field("", description="Albert API TOKEN") - users_allowed_domains: list[str] = Field( + user_allowed_domains: list[str] = Field( [], description="List of allowed Tchap users email domains allowed to use Albert Tchap bot" ) diff --git a/app/matrix_bot/eventparser.py b/app/matrix_bot/eventparser.py index c11b42a..66d70bd 100755 --- a/app/matrix_bot/eventparser.py +++ b/app/matrix_bot/eventparser.py @@ -40,7 +40,7 @@ def is_from_this_bot(self) -> bool: return self.is_from_userid(self.matrix_client.user_id) def is_sender_allowed(self) -> bool: - return self.sender_domain() in config.users_allowed_domains + return self.sender_domain() in config.user_allowed_domains def room_is_direct_message(self) -> bool: return room_is_direct_message(self.room) diff --git a/docker-compose.yml b/docker-compose.yml index 4e374e7..88eff45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - matrix_bot_password=${MATRIX_BOT_PASSWORD} - session_path=/data/session.txt - groups_used=["basic", "albert"] - - users_allowed_domains=${USER_ALLOWED_DOMAINS} + - user_allowed_domains=${USER_ALLOWED_DOMAINS} - salt=${SALT} - albert_api_url=${ALBERT_API_URL} - albert_api_token=${ALBERT_API_TOKEN}