🔥: better Mastodon purge

This commit is contained in:
VC
2024-10-24 11:38:52 +02:00
parent 162c62dbb5
commit febff6025e
4 changed files with 4 additions and 17 deletions

View File

@@ -63,12 +63,9 @@
- name: Put template scripts - name: Put template scripts
remote_user: mastodon remote_user: mastodon
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}.j2" src: remove_media.sh.j2
dest: "{{ mastodon_home }}/bin/{{ item }}" dest: "{{ mastodon_home }}/bin/remove_media.sh"
mode: "0o750" mode: "0o750"
loop:
- remove_media.sh
- remove_preview_cards.sh
- name: Install services - name: Install services
ansible.builtin.template: ansible.builtin.template:

View File

@@ -2,3 +2,5 @@
cd {{ mastodon_home }}/live cd {{ mastodon_home }}/live
PATH={{ mastodon_home }}/bin:{{ mastodon_home }}/.local/bin:{{ mastodon_home }}/.rbenv/plugins/ruby-build/bin:{{ mastodon_home }}/.rbenv/shims:{{ mastodon_home }}/.rbenv/bin:/usr/bin:/bin PATH={{ mastodon_home }}/bin:{{ mastodon_home }}/.local/bin:{{ mastodon_home }}/.rbenv/plugins/ruby-build/bin:{{ mastodon_home }}/.rbenv/shims:{{ mastodon_home }}/.rbenv/bin:/usr/bin:/bin
RAILS_ENV=production bin/tootctl media remove RAILS_ENV=production bin/tootctl media remove
RAILS_ENV=production bin/tootctl media remove --days=45 --prune-profiles
RAILS_ENV=production bin/tootctl preview_cards remove

View File

@@ -1,4 +0,0 @@
#!/bin/bash
cd {{ mastodon_home }}/live
PATH={{ mastodon_home }}/bin:{{ mastodon_home }}/.local/bin:{{ mastodon_home }}/.rbenv/plugins/ruby-build/bin:{{ mastodon_home }}/.rbenv/shims:{{ mastodon_home }}/.rbenv/bin:/usr/bin:/bin
RAILS_ENV=production bin/tootctl preview_cards remove

View File

@@ -7,11 +7,3 @@
minute: "0" minute: "0"
hour: "2" hour: "2"
job: "{{ mastodon_home }}/bin/remove_media.sh" job: "{{ mastodon_home }}/bin/remove_media.sh"
- name: Cron for preview_cards tootctl
ansible.builtin.cron:
user: mastodon
name: Mastodon tootctl preview
minute: "30"
hour: "2"
job: "{{ mastodon_home }}/bin/remove_preview_cards.sh"