Added patch to delete private user data
This commit is contained in:
parent
745b6f18e3
commit
9c0b5c53f4
40
patches/delete-private-data/main.go
Normal file
40
patches/delete-private-data/main.go
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
// This patch is disabled because it would be dangerous to run it accidentally.
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// color.Yellow("Deleting private user data")
|
||||||
|
|
||||||
|
// // Get a stream of all users
|
||||||
|
// allUsers, err := arn.AllUsers()
|
||||||
|
|
||||||
|
// if err != nil {
|
||||||
|
// panic(err)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// arn.DB.DeleteTable("EmailToUser")
|
||||||
|
// arn.DB.DeleteTable("GoogleToUser")
|
||||||
|
|
||||||
|
// // Iterate over the stream
|
||||||
|
// count := 0
|
||||||
|
// for user := range allUsers {
|
||||||
|
// count++
|
||||||
|
// println(count, user.Nick)
|
||||||
|
|
||||||
|
// // Delete private data
|
||||||
|
// user.Email = ""
|
||||||
|
// user.Gender = ""
|
||||||
|
// user.FirstName = ""
|
||||||
|
// user.LastName = ""
|
||||||
|
// user.IP = ""
|
||||||
|
// user.Accounts.Facebook.ID = ""
|
||||||
|
// user.Accounts.Google.ID = ""
|
||||||
|
// user.AgeRange = arn.UserAgeRange{}
|
||||||
|
// user.Location = arn.UserLocation{}
|
||||||
|
|
||||||
|
// // Save in DB
|
||||||
|
// user.Save()
|
||||||
|
// }
|
||||||
|
|
||||||
|
// color.Green("Finished.")
|
||||||
|
}
|
@ -12,7 +12,7 @@ func main() {
|
|||||||
arn.DB.DeleteTable("EmailToUser")
|
arn.DB.DeleteTable("EmailToUser")
|
||||||
arn.DB.DeleteTable("GoogleToUser")
|
arn.DB.DeleteTable("GoogleToUser")
|
||||||
|
|
||||||
// Get a stream of all anime
|
// Get a stream of all users
|
||||||
allUsers, err := arn.AllUsers()
|
allUsers, err := arn.AllUsers()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user