This commit is contained in:
SpudGunMan
2025-10-10 07:41:18 -07:00
parent b7a0d7cd8e
commit ee1391f6e7
4 changed files with 8 additions and 4 deletions
+2 -3
View File
@@ -89,9 +89,8 @@ def call_external_script(message, script="script/runShell.sh"):
logger.warning(f"FileMon: Error calling external script: {e}")
return None
xCmd2factor = True # Enable 2FA for x: commands
waitingXroom = {} # {message_from_id: (expected_answer, original_command, timestamp)}
xCmd2factor_timeout = 100 # seconds
def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
if not allowXcmd:
return "x: command is disabled"
@@ -102,7 +101,7 @@ def handleShellCmd(message, message_from_id, channel_number, isDM, deviceID):
return "x: command not authorized in group chat"
# 2FA logic
if xCmd2factor:
if xCmd2factorEnabled:
timeNOW = datetime.utcnow()
# If user is waiting for 2FA, treat message as answer
if message_from_id in waitingXroom:
+2
View File
@@ -373,6 +373,8 @@ try:
news_random_line_only = config['fileMon'].getboolean('news_random_line', False) # default False
enable_runShellCmd = config['fileMon'].getboolean('enable_runShellCmd', False) # default False
allowXcmd = config['fileMon'].getboolean('allowXcmd', False) # default False
xCmd2factorEnabled = config['fileMon'].getboolean('2factor_enabled', False) # default False
xCmd2factor_timeout = config['fileMon'].getint('2factor_timeout', 100) # default 100 seconds
# games
game_hop_limit = config['games'].getint('game_hop_limit', 5) # default 5 hops
-1
View File
@@ -49,7 +49,6 @@ def cleanup_memory():
if cleaned_count > 0:
logger.debug(f"System: Cleaned up {cleaned_count} stale entries from waitingXroom")
# Clean up old seenNodes entries
if 'seenNodes' in globals():
initial_count = len(seenNodes)