From b8c9df8a3189cc163d88cd63b0b6358be51a8634 Mon Sep 17 00:00:00 2001 From: Ville Ranki Date: Tue, 10 Dec 2019 22:09:21 +0200 Subject: [PATCH] Don't crash if no data saved, mount gcal stuff in docker --- Dockerfile | 1 + bot.py | 2 ++ docker-compose.yml | 3 +++ 3 files changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 6149762..fa8ac5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,6 @@ COPY Pipfile . RUN pipenv install --skip-lock --system COPY bot.py . +COPY modules . CMD [ "python", "-u", "./bot.py" ] diff --git a/bot.py b/bot.py index 9847953..e869846 100755 --- a/bot.py +++ b/bot.py @@ -61,6 +61,8 @@ class Bot: self.set_account_data(data) def load_settings(self, data): + if not data: + return if not data.get('module_settings'): return for modulename, moduleobject in self.modules.items(): diff --git a/docker-compose.yml b/docker-compose.yml index f65a14d..97e0d5e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,3 +12,6 @@ services: - MATRIX_PASSWORD - MATRIX_SERVER - JOIN_ON_INVITE + volumes: + - ${PWD}/credentials.json:/bot/credentials.json + - ${PWD}/token.pickle:/bot/token.pickle