Allow modifying IP retention period

To allow IP addresses to not be stored for an entire year.
This attempts to fix https://github.com/mastodon/mastodon/issues/6474 for Catstodon.
This commit is contained in:
Jeremy Kescher 2022-06-27 00:09:17 +02:00
parent 06b9e14a03
commit 97d03110ed
No known key found for this signature in database
GPG key ID: 48DFE4BB15BA5940
3 changed files with 10 additions and 2 deletions

View file

@ -286,6 +286,14 @@ MAX_POLL_OPTION_CHARS=100
MAX_EMOJI_SIZE=51200
MAX_REMOTE_EMOJI_SIZE=204800
# IP retention period
# If undefined, the value of 31556952 (1 average year) will be used.
# Keep in mind that this is period will not be completely accurate
# and may have a delay of up to 24 hours on vanilla and glitch-soc Mastodon
# due to the scheduling of ip_cleanup_scheduler in sidekiq.yml.
# Time unit in seconds
IP_RETENTION_PERIOD=31556952
# Optional hCaptcha support
# HCAPTCHA_SECRET_KEY=
# HCAPTCHA_SITE_KEY=

View file

@ -3,7 +3,7 @@
class Scheduler::IpCleanupScheduler
include Sidekiq::Worker
IP_RETENTION_PERIOD = 1.year.freeze
IP_RETENTION_PERIOD = ENV.fetch('IP_RETENTION_PERIOD', 1.year).to_i.freeze
sidekiq_options retry: 0

View file

@ -46,7 +46,7 @@
class: Scheduler::UserCleanupScheduler
queue: scheduler
ip_cleanup_scheduler:
cron: '<%= Random.rand(0..59) %> <%= Random.rand(3..5) %> * * *'
every: '1h'
class: Scheduler::IpCleanupScheduler
queue: scheduler
email_scheduler: