איך למחוק את כל כתובות ה-IP?

האם יש דרך למחוק את כל כתובות ה-IP ממסד הנתונים? האם יש תוסף או סקריפטים לעשות זאת?

נא לא לשאול למה אתה רוצה לעשות את זה, זו רק דרישה ואני רוצה לסיים עם זה.

לייק 1

I went to Ask.discourse.com and got this, which seems probably true.

Deleting IP Addresses in Discourse with Rails AI

pfaffman:

Where are ip addresses stored. Can I delete them all from rails?

DiscourseHelper:

Searching

Searching for: Where are user and post IP addresses stored in the Discourse database, and is it possible to delete all stored IP addresses using Rails or through a rake task for privacy or GDPR compliance?

Reading

Read: Problematic IP address fields

Look up database schema

incoming_links,search_logs,topic_link_clicks,topic_views,user_profile_views,user_auth_tokens,user_auth_token_logs,screened_ip_addresses

Discourse stores IP addresses in several database tables, specifically:

  • incoming_links (ip_address)
  • search_logs (ip_address)
  • topic_link_clicks (ip_address)
  • topic_views (ip_address)
  • user_profile_views (ip_address)
  • user_auth_tokens (client_ip)
  • user_auth_token_logs (client_ip)
  • screened_ip_addresses (ip_address)

You can delete IP addresses using Rails commands if you have terminal access (self-hosted installations). For each table, you can set the relevant column (like ip_address or client_ip) to NULL. Example for incoming_links:

IncomingLink.update_all(ip_address: nil)

You would run similar commands for each relevant table/column.

For more details and context about privacy and potential implications, see this discussion:
Problematic IP address fields

Note: If you’re on Discourse’s hosted service, you do not have SSH or Rails console access; in such cases, contact Discourse support at team@discourse.org for guidance.

Let me know if you need specific Rails commands for each table or further advice!

לייק 1

Interestingly it doesn’t look like it’s included the main ones, ip_address and registration_ip_address from the users table.

There are a couple of others too when I do a data explorer field search.

  • screened_emails.ip_address
  • screened_urls.ip_address
  • user_histories.ip_address
  • user_ip_address_histories.ip_address

Not all of them have any records in on my test site, but probably worth a check of your own tables to make sure they’re empty for you too.

4 לייקים

Ha! It was the best I could do in my phone. It seemed like a lot so I thought it must have gotten it. :rofl:

2 לייקים