Privacy policy: the forum, and the export and retention it states
Both languages: rows for the forum profile, posts, last visit, private conversations, reports and the moderation log (DSA legal obligation); what is public and what moderators see; forum content never goes to AI; retention periods; the forum theme cookie; the rights (the export covers the forum, posts kept as "Törölt tag" can be deleted on request). In force from 2026-11-26. So that it holds: the account export includes the forum, and the hourly cleanup clears text removed by moderators after a year, closed reports and old ban reasons after a year, the moderation log after two years, and requests never accepted after 90 days. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -8,7 +8,7 @@ use tokio::sync::watch;
|
||||
const INTERVAL: Duration = Duration::from_secs(3600);
|
||||
|
||||
/// (what, statement) pairs; each returns the number of deleted rows.
|
||||
const STATEMENTS: [(&str, &str); 8] = [
|
||||
const STATEMENTS: [(&str, &str); 16] = [
|
||||
("sessions", "DELETE FROM sessions WHERE expires_at < now()"),
|
||||
("auth_tokens", "DELETE FROM auth_tokens WHERE expires_at < now()"),
|
||||
// Sent e-mails contain links with tokens; keep them a week for support.
|
||||
@@ -30,6 +30,36 @@ const STATEMENTS: [(&str, &str); 8] = [
|
||||
// Gifts never paid (Stripe's payment page is long closed by then), with
|
||||
// the recipient's address in them.
|
||||
("gifts", "DELETE FROM gifts WHERE paid_at IS NULL AND created_at < now() - interval '7 days'"),
|
||||
// The forum (the privacy policy's retention periods): what moderators
|
||||
// removed is kept a year for objections, then only its place and reason stay.
|
||||
(
|
||||
"forum_removed_posts",
|
||||
"UPDATE forum.posts SET body = '' WHERE deleted_at < now() - interval '1 year' AND body <> ''",
|
||||
),
|
||||
(
|
||||
"forum_removed_threads",
|
||||
"UPDATE forum.posts p SET body = '' FROM forum.threads th \
|
||||
WHERE th.id = p.thread_id AND th.deleted_at < now() - interval '1 year' AND p.body <> ''",
|
||||
),
|
||||
(
|
||||
"forum_removed_titles",
|
||||
"UPDATE forum.threads SET title = 'Eltávolított szál' \
|
||||
WHERE deleted_at < now() - interval '1 year' AND title <> 'Eltávolított szál'",
|
||||
),
|
||||
("forum_nicknames", "DELETE FROM forum.retired_nicknames WHERE until < now()"),
|
||||
("forum_reports", "DELETE FROM forum.reports WHERE status <> 'open' AND handled_at < now() - interval '1 year'"),
|
||||
("forum_mod_log", "DELETE FROM forum.mod_log WHERE created_at < now() - interval '2 years'"),
|
||||
(
|
||||
"forum_bans",
|
||||
"UPDATE forum.members SET banned_until = NULL, ban_reason = NULL WHERE banned_until < now() - interval '1 year'",
|
||||
),
|
||||
// Requests never accepted (declined or expired), with their introduction;
|
||||
// a block stays as long as the blocker keeps it.
|
||||
(
|
||||
"forum_requests",
|
||||
"DELETE FROM forum.conversations WHERE status IN ('pending', 'declined') AND last_message_at IS NULL \
|
||||
AND coalesce(responded_at, created_at) < now() - interval '90 days'",
|
||||
),
|
||||
];
|
||||
|
||||
pub async fn run_once(db: &PgPool) -> Result<Vec<(&'static str, u64)>, sqlx::Error> {
|
||||
|
||||
Reference in New Issue
Block a user