Compare commits

..

No commits in common. "improve-config" and "master" have entirely different histories.

6 changed files with 12 additions and 13 deletions

View File

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

1
.gitignore vendored
View File

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

View File

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

View File

@ -1,8 +1,7 @@
matrix_owner_id: "@dettlaff:inex.rocks"
db_path: "data/database.sqlite3"
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"
matrix_full_bot_id: "{{ MATRIX_FULL_BOT_ID }}"
matrix_bot_password: "{{ MATRIX_BOT_PASSWORD }}"
telegram_bot_token: "{{ TELEGRAM_BOT_TOKEN }}"

View File

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

View File

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