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.
develop
Jeremy Kescher 2 years ago
parent 06b9e14a03
commit 97d03110ed
No known key found for this signature in database
GPG Key ID: 48DFE4BB15BA5940

@ -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=

@ -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

@ -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:

Loading…
Cancel
Save