This commit is contained in:
root
2025-12-14 10:39:18 +03:00
commit 639f4e2b4e
179 changed files with 21065 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
FROM ubuntu:24.04
RUN apt-get update && apt-get install postgresql-client -yqq \
&& rm -rf /var/lib/apt/lists/*
COPY --chmod=755 cleaner.sh /cleaner.sh
CMD ["/cleaner.sh"]

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
while true; do
psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db:5432/$POSTGRES_DB -c "DELETE FROM users WHERE timestamp <= NOW() - INTERVAL '15 minutes'";
psql postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db:5432/$POSTGRES_DB -c "DELETE FROM implants WHERE timestamp <= NOW() - INTERVAL '15 minutes'";
sleep 60;
done