clearing bad IPs in mastodon

make sure you set up your mastodon proxy settings correctly. here are some tips to clean up your database entries if you didnt set it up correctly first.

if you dont set up your mastodon instance that is behind a proxy with correct values after youve got some users then you might get some odd things in the IPs for the users. this can cause problems with administration and setting different moderation values

the TRUSTED_PROXY_IP values should be set in the config file ahead of adding users. more details can be found here on the mastodon administration page.

if you want to clean up the IPs you'll have to access the database. i found some github issues logged about IP retention and it should only keep them for a couple days but from what ive seen they dont seem to change

clear the sign up ip

stored in users table, seems like you can edit this value to no ill effect

SELECT sign_up_ip,* FROM users

clear sessions and logins

this will delete everything, run a select if you have entries in there you want to clean manually if youve already had some activities.

delete FROM login_activities
delete FROM public.session_activations