default testing mode to False, add testing mode warning for user report section

This commit is contained in:
PC-Admin 2023-08-03 20:53:16 +08:00
parent f2f529942b
commit 020289cd4d
2 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,7 @@ rdlist_bot_username = "strong-password" # The password for this user
rdlist_recommended_tags = ['hub_room_links', 'hub_room_trade', 'preban', 'degen_misc', 'beastiality', 'degen_porn', 'gore', 'snuff', 'degen_larp', 'hub_room_sussy', 'bot_spam', 'cfm', 'jailbait', 'bot_porn', 'toddlercon', 'loli', 'csam', 'tfm', 'degen_meet', 'stylized_3d_loli', '3d_loli']
# User report generator
report_folder = "./reports" # Reports folder name
testing_mode = True # Prevents the incident report feature from messaging/emailing anyone besides you, also limits the number of room states are exported when generating user reports.
testing_mode = False # Prevents the incident report feature from messaging/emailing anyone besides you, also limits the number of room states are exported when generating user reports.
# Incident report email settings
smtp_user = "abuse@matrix.example.org"
smtp_password = "strong-stmp-password"

View File

@ -59,6 +59,9 @@ remove it from your electronic mailbox.
\n**********************************************************************
"""
def testing_mode_warning():
print("\nWARNING! Testing mode is enabled, this will:\n\n- Reduce the amount of data collected in user reports.\n- Slow down rdlist blocking/purging.\n- Prevent the deactivation of accounts.\n- Send incident reports to yourself instead of other homeserver admins.\n")
def get_report_folder():
# Get report_folder from hardcoded_variables
report_folder = hardcoded_variables.report_folder
@ -85,6 +88,10 @@ def zip_report_folder(user_report_folder, username):
return zip_file_name
def generate_user_report(preset_username, report_details):
# Print warning if testing mode is enabled
if hardcoded_variables.testing_mode == True:
testing_mode_warning()
if len(preset_username) == 0:
username = input("\nPlease enter the username to automatically generate a report: ")
username = user_commands.parse_username(username)