#11 - fix password handling
build container aoc / build (push) Successful in 1m0s

This commit is contained in:
2026-10-28 19:03:55 +01:00
parent a0fb7a6a5f
commit 787cea3e7f
2 changed files with 16 additions and 2 deletions
+12
View File
@@ -8,3 +8,15 @@ Dies ist eine neuentwicklung für Matrix, des bisher unter Discord laufenden Bot
## limits
- this bot only supports handling with unencryptet channels!
## usage
1. fill the conf file
2. run the bot
hint: the password can be set as env var
## env vars
var | description | value options
--- | --- | ---
MATRIX_BOT_PASSWORD | password for the bot, overrides config! | string
+3 -1
View File
@@ -46,7 +46,8 @@ class MatrixBot:
self.domain = self._config['general']['domain']
self.homeserver = f"https://{self.domain}"
self.username = f"@{self._config['general']['user']}:{self._config['general']['domain']}"
self.__password = self._config['general']['pass']
# get password from env or fallback from config file
self.__password = os.environ.get('MATRIX_BOT_PASSWORD') or self._config['general']['pass']
del self._config['general']['pass']
return True
@@ -154,6 +155,7 @@ class MatrixBot:
async def run(self):
if await self._login():
del self.__password
await self.send_status(f"{self.botname} Online!")
await self._activate_skills()
await self.client.sync_forever(timeout=30000, set_presence='online')