Compare commits

...
This repository has been archived on 2023-01-19. You can view files and clone it, but cannot push or open issues or pull requests.

3 commits

Author SHA1 Message Date
Alex Kotov 135ea3fa74
Reorder config options 2023-01-15 01:52:19 +04:00
Alex Kotov a59ed0b4d9
Rename config class 2023-01-15 01:50:24 +04:00
Alex Kotov e9ca874499
Rename config 2023-01-15 01:48:54 +04:00
6 changed files with 13 additions and 12 deletions

View file

@ -1,4 +1,4 @@
MATRIX_HOMESERVER_URL=https://matrix.org
MATRIX_FULL_BOT_ID=@fckidiots:matrix.org
MATRIX_BOT_PASSWORD=... MATRIX_BOT_PASSWORD=...
MATRIX_FULL_BOT_ID=@fckidiots:matrix.org
MATRIX_HOMESERVER_URL=https://matrix.org
TELEGRAM_BOT_TOKEN=5890667880:... TELEGRAM_BOT_TOKEN=5890667880:...

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
__pycache__/ __pycache__/
/.env /.env
/config.yml
/data/ /data/
!/data/.keep !/data/.keep

View file

@ -6,5 +6,5 @@ RUN apt-get install --yes python3 python3-pip
COPY requirements.txt /app/ COPY requirements.txt /app/
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
COPY mirrortea/* /app/mirrortea/ COPY mirrortea/* /app/mirrortea/
COPY config.yaml /app/ COPY config.yml /app/
ENTRYPOINT ["/usr/bin/python3", "/app/mirrortea"] ENTRYPOINT ["/usr/bin/python3", "/app/mirrortea"]

View file

@ -1,7 +1,8 @@
matrix_owner_id: "@dettlaff:inex.rocks"
db_path: "data/database.sqlite3" db_path: "data/database.sqlite3"
matrix_homeserver_url: "{{ MATRIX_HOMESERVER_URL }}"
matrix_full_bot_id: "{{ MATRIX_FULL_BOT_ID }}"
matrix_bot_password: "{{ MATRIX_BOT_PASSWORD }}" matrix_bot_password: "{{ MATRIX_BOT_PASSWORD }}"
matrix_full_bot_id: "{{ MATRIX_FULL_BOT_ID }}"
matrix_homeserver_url: "{{ MATRIX_HOMESERVER_URL }}"
matrix_owner_id: "@dettlaff:inex.rocks"
telegram_bot_token: "{{ TELEGRAM_BOT_TOKEN }}" telegram_bot_token: "{{ TELEGRAM_BOT_TOKEN }}"

View file

@ -2,9 +2,9 @@ import asyncio
from messengers import Matrix as MatrixLoop, Telegram as TelegramLoop from messengers import Matrix as MatrixLoop, Telegram as TelegramLoop
from config_dataclass import Config from config import Config
CONFIG_FILE_NAME = "config.yaml" CONFIG_FILE_NAME = 'config.yml'
def main(): def main():

View file

@ -16,14 +16,13 @@ def render_env_template(raw_config: str) -> dict:
class Config: class Config:
db_path: Path db_path: Path
matrix_homeserver_url: str
matrix_full_bot_id: str
matrix_bot_password: str matrix_bot_password: str
matrix_full_bot_id: str
matrix_homeserver_url: str
matrix_owner_id: str
telegram_bot_token: str telegram_bot_token: str
matrix_owner_id: str
@classmethod @classmethod
def from_dict(config_class, dict): def from_dict(config_class, dict):
return config_class(**dict) return config_class(**dict)