Skip to content

Commit

Permalink
core: List modules not loaded in Safe Mode check
Browse files Browse the repository at this point in the history
List the modules not loaded as a result of Safe Mode being enabled.
  • Loading branch information
prgmitchell committed Mar 14, 2024
1 parent ffa9518 commit 0aca22d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions checks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,18 @@ def checkPortableMode(lines):

def checkSafeMode(lines):
if search('Safe Mode enabled.', lines):
return [LEVEL_WARNING, "Safe Mode Enabled",
"""You are running OBS in Safe Mode. Safe Mode disables third-party plugins and prevents scripts from running."""]
modulesNotLoaded = search('not on safe list', lines)
moduleNames = []

for line in modulesNotLoaded:
found = re.search(r"'([^']+)'", line)
if found:
moduleNames.append(found.group(1))

if moduleNames:
modulesNotLoadedString = "<br><ul><li>" + "</li><li>".join(moduleNames) + "</li></ul>"
return [LEVEL_WARNING, "Safe Mode Enabled (" + str(len(moduleNames)) + ")",
"""You are running OBS in Safe Mode. Safe Mode disables third-party plugins and prevents scripts from running. The following modules were not loaded:""" + modulesNotLoadedString]
else:
return [LEVEL_WARNING, "Safe Mode Enabled",
"""You are running OBS in Safe Mode. Safe Mode disables third-party plugins and prevents scripts from running."""]

0 comments on commit 0aca22d

Please sign in to comment.