feat: add remove media and preview cards to mastodon
This commit is contained in:
3
group_vars/mastodonservers.yml
Normal file
3
group_vars/mastodonservers.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
|
||||
mastodon_home: "/srv/mastodon"
|
@@ -29,6 +29,23 @@
|
||||
args:
|
||||
chdir: "{{ mastodon_home }}/live"
|
||||
|
||||
- name: create bin dir
|
||||
remote_user: mastodon
|
||||
file:
|
||||
path: "{{ mastodon_home }}/bin"
|
||||
state: directory
|
||||
mode: '0750'
|
||||
|
||||
- name: template scripts
|
||||
remote_user: mastodon
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ mastodon_home }}/bin/{{ item }}"
|
||||
mode: '0750'
|
||||
loop:
|
||||
- remove_media.sh
|
||||
- remove_preview_cards.sh
|
||||
|
||||
- name: install services
|
||||
template:
|
||||
src: "{{ item }}.j2"
|
||||
|
@@ -20,7 +20,7 @@
|
||||
remote_user: mastodon
|
||||
lineinfile:
|
||||
path: "{{ mastodon_home }}/.bashrc"
|
||||
line: "eval \"$(~/.rbenv/bin/rbenv init - bash)\""
|
||||
line: "eval \"$({{ mastodon_home }}/.rbenv/bin/rbenv init - bash)\""
|
||||
|
||||
- name: install ruby version
|
||||
remote_user: mastodon
|
||||
|
4
roles/mastodon/templates/remove_media.sh.j2
Normal file
4
roles/mastodon/templates/remove_media.sh.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/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 media remove
|
4
roles/mastodon/templates/remove_preview_cards.sh.j2
Normal file
4
roles/mastodon/templates/remove_preview_cards.sh.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/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
|
@@ -1,7 +1,5 @@
|
||||
---
|
||||
|
||||
mastodon_home: "/srv/mastodon"
|
||||
|
||||
mastodon_version: "4.0.2"
|
||||
|
||||
mastodon_nodejs_key_url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
|
||||
|
@@ -7,7 +7,7 @@
|
||||
minute: "0"
|
||||
hour: "19"
|
||||
weekday: "5"
|
||||
job: "cd live && RAILS_ENV=production bin/tootctl media remove"
|
||||
job: "{{ mastodon_home }}/bin/remove_media.sh"
|
||||
|
||||
- name: cron for preview_cards tootctl
|
||||
cron:
|
||||
@@ -16,4 +16,4 @@
|
||||
minute: "30"
|
||||
hour: "19"
|
||||
weekday: "5"
|
||||
job: "cd live && RAILS_ENV=production bin/tootctl preview_cards remove"
|
||||
job: "{{ mastodon_home }}/bin/remove_preview_cards.sh"
|
||||
|
Reference in New Issue
Block a user