mirror of
https://github.com/PC-Admin/matrix-moderation-tool.git
synced 2024-12-20 07:30:25 -05:00
Compare commits
No commits in common. "020289cd4d7abe72e8cc0908c2073b6802379f03" and "fcf344a921503b8e9f312c1138ed748ea66a5ab1" have entirely different histories.
020289cd4d
...
fcf344a921
@ -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']
|
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
|
# User report generator
|
||||||
report_folder = "./reports" # Reports folder name
|
report_folder = "./reports" # Reports folder name
|
||||||
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.
|
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.
|
||||||
# Incident report email settings
|
# Incident report email settings
|
||||||
smtp_user = "abuse@matrix.example.org"
|
smtp_user = "abuse@matrix.example.org"
|
||||||
smtp_password = "strong-stmp-password"
|
smtp_password = "strong-stmp-password"
|
||||||
|
@ -59,9 +59,6 @@ remove it from your electronic mailbox.
|
|||||||
\n**********************************************************************
|
\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():
|
def get_report_folder():
|
||||||
# Get report_folder from hardcoded_variables
|
# Get report_folder from hardcoded_variables
|
||||||
report_folder = hardcoded_variables.report_folder
|
report_folder = hardcoded_variables.report_folder
|
||||||
@ -88,10 +85,6 @@ def zip_report_folder(user_report_folder, username):
|
|||||||
return zip_file_name
|
return zip_file_name
|
||||||
|
|
||||||
def generate_user_report(preset_username, report_details):
|
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:
|
if len(preset_username) == 0:
|
||||||
username = input("\nPlease enter the username to automatically generate a report: ")
|
username = input("\nPlease enter the username to automatically generate a report: ")
|
||||||
username = user_commands.parse_username(username)
|
username = user_commands.parse_username(username)
|
||||||
@ -244,8 +237,8 @@ def lookup_homeserver_admin(preset_baseurl):
|
|||||||
|
|
||||||
# If baseurl is matrix.org, return 'abuse@matrix.org' as a hardcoded response
|
# If baseurl is matrix.org, return 'abuse@matrix.org' as a hardcoded response
|
||||||
if baseurl == "matrix.org":
|
if baseurl == "matrix.org":
|
||||||
#print("\nAdmin contact email(s) for " + baseurl + " are: abuse@matrix.org")
|
print("\nAdmin contact email(s) for " + baseurl + " are: abuse@matrix.org")
|
||||||
return {"admins": [{"email_address": "abuse@matrix.org"}]}, False
|
return {"admins": {"email_address": "abuse@matrix.org"}}, False
|
||||||
|
|
||||||
# Check target homserver for MSC1929 support email
|
# Check target homserver for MSC1929 support email
|
||||||
url = f"https://{baseurl}/.well-known/matrix/support"
|
url = f"https://{baseurl}/.well-known/matrix/support"
|
||||||
@ -264,7 +257,7 @@ def lookup_homeserver_admin(preset_baseurl):
|
|||||||
|
|
||||||
return data, False
|
return data, False
|
||||||
else:
|
else:
|
||||||
print(f"\nError: Unable to collect admin contact details from server {baseurl}")
|
print(f"Error: Unable to collect admin contact details from server {baseurl}")
|
||||||
print("Attempting to collect admin email from WHOIS data...")
|
print("Attempting to collect admin email from WHOIS data...")
|
||||||
|
|
||||||
# Get WHOIS data
|
# Get WHOIS data
|
||||||
@ -273,17 +266,15 @@ def lookup_homeserver_admin(preset_baseurl):
|
|||||||
if w.emails:
|
if w.emails:
|
||||||
# Check if the emails field is a list
|
# Check if the emails field is a list
|
||||||
if isinstance(w.emails, list):
|
if isinstance(w.emails, list):
|
||||||
# Create a list of dictionaries, each containing one email address
|
return {baseurl: list(w.emails)}, True
|
||||||
emails_dict_list = [{"email_address": email} for email in w.emails]
|
|
||||||
return {"admins": emails_dict_list}, True
|
|
||||||
# If it's not a list, it must be a single string. So, we wrap it in a list
|
# If it's not a list, it must be a single string. So, we wrap it in a list
|
||||||
else:
|
else:
|
||||||
return {"admins": [{"email_address": w.emails}]}, True
|
return {baseurl: [w.emails]}, True
|
||||||
else:
|
else:
|
||||||
print(f"Error: Unable to collect admin email from WHOIS data for {baseurl}")
|
print(f"\t\tError: Unable to collect admin email from WHOIS data for {baseurl}")
|
||||||
return None, False
|
return None, False
|
||||||
except:
|
except:
|
||||||
print(f"Error: Unable to collect WHOIS data for {baseurl}")
|
print(f"\t\tError: Unable to collect WHOIS data for {baseurl}")
|
||||||
return None, False
|
return None, False
|
||||||
|
|
||||||
def send_email(email_address, email_subject, email_content, email_attachments):
|
def send_email(email_address, email_subject, email_content, email_attachments):
|
||||||
|
Loading…
Reference in New Issue
Block a user