From 016b1e10d7cb5d4372550352d689fcaaa98640c7 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Mar 2026 03:11:54 -0700 Subject: [PATCH] feat: register Mattermost and Matrix env vars in OPTIONAL_ENV_VARS Adds both platforms to the config system so hermes setup, hermes doctor, and hermes config properly discover and manage their env vars. - MATTERMOST_URL, MATTERMOST_TOKEN, MATTERMOST_ALLOWED_USERS - MATRIX_HOMESERVER, MATRIX_ACCESS_TOKEN, MATRIX_USER_ID, MATRIX_ALLOWED_USERS - Extra env keys for .env sanitizer: MATTERMOST_HOME_CHANNEL, MATTERMOST_REPLY_MODE, MATRIX_PASSWORD, MATRIX_ENCRYPTION, MATRIX_HOME_ROOM --- hermes_cli/config.py | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index a72c0ff63..3f8ac78c1 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -37,6 +37,8 @@ _EXTRA_ENV_KEYS = frozenset({ "DINGTALK_CLIENT_ID", "DINGTALK_CLIENT_SECRET", "TERMINAL_ENV", "TERMINAL_SSH_KEY", "TERMINAL_SSH_PORT", "WHATSAPP_MODE", "WHATSAPP_ENABLED", + "MATTERMOST_HOME_CHANNEL", "MATTERMOST_REPLY_MODE", + "MATRIX_PASSWORD", "MATRIX_ENCRYPTION", "MATRIX_HOME_ROOM", }) import yaml @@ -692,6 +694,55 @@ OPTIONAL_ENV_VARS = { "password": True, "category": "messaging", }, + "MATTERMOST_URL": { + "description": "Mattermost server URL (e.g. https://mm.example.com)", + "prompt": "Mattermost server URL", + "url": "https://mattermost.com/deploy/", + "password": False, + "category": "messaging", + }, + "MATTERMOST_TOKEN": { + "description": "Mattermost bot token or personal access token", + "prompt": "Mattermost bot token", + "url": None, + "password": True, + "category": "messaging", + }, + "MATTERMOST_ALLOWED_USERS": { + "description": "Comma-separated Mattermost user IDs allowed to use the bot", + "prompt": "Allowed Mattermost user IDs (comma-separated)", + "url": None, + "password": False, + "category": "messaging", + }, + "MATRIX_HOMESERVER": { + "description": "Matrix homeserver URL (e.g. https://matrix.example.org)", + "prompt": "Matrix homeserver URL", + "url": "https://matrix.org/ecosystem/servers/", + "password": False, + "category": "messaging", + }, + "MATRIX_ACCESS_TOKEN": { + "description": "Matrix access token (preferred over password login)", + "prompt": "Matrix access token", + "url": None, + "password": True, + "category": "messaging", + }, + "MATRIX_USER_ID": { + "description": "Matrix user ID (e.g. @hermes:example.org)", + "prompt": "Matrix user ID (@user:server)", + "url": None, + "password": False, + "category": "messaging", + }, + "MATRIX_ALLOWED_USERS": { + "description": "Comma-separated Matrix user IDs allowed to use the bot (@user:server format)", + "prompt": "Allowed Matrix user IDs (comma-separated)", + "url": None, + "password": False, + "category": "messaging", + }, "GATEWAY_ALLOW_ALL_USERS": { "description": "Allow all users to interact with messaging bots (true/false). Default: false.", "prompt": "Allow all users (true/false)",