aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-06-13 08:48:44 -0400
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-06-13 08:48:44 -0400
commite1c8fbfd6c62d63f638317bc05aa66cec060ec4c (patch)
treed95c27ecf5d5d47995b717d6d736f51983541101 /roles
parent3a04278e4750ae0a5ec6703829d0bc151ddbf4e5 (diff)
downloadselfhosted-e1c8fbfd6c62d63f638317bc05aa66cec060ec4c.tar.gz
selfhosted-e1c8fbfd6c62d63f638317bc05aa66cec060ec4c.zip
mastodon: add archive job
Diffstat (limited to 'roles')
-rw-r--r--roles/mastodon/README.md1
-rw-r--r--roles/mastodon/vars/main.yml6
2 files changed, 7 insertions, 0 deletions
diff --git a/roles/mastodon/README.md b/roles/mastodon/README.md
index 3effd2f..d75d2d6 100644
--- a/roles/mastodon/README.md
+++ b/roles/mastodon/README.md
@@ -60,6 +60,7 @@ Variable | Description
-------------------------|------------
`mastodon_webroot` | Path to Mastodon public web directory
`mastodon_apache_config` | Apache config block for reverse proxy
+`mastodon_archive_shell` | Shell command for generating tarball of Mastodon media files
Usage
diff --git a/roles/mastodon/vars/main.yml b/roles/mastodon/vars/main.yml
index cede4a0..082d234 100644
--- a/roles/mastodon/vars/main.yml
+++ b/roles/mastodon/vars/main.yml
@@ -19,6 +19,7 @@ mastodon_home: /opt/mastodon
mastodon_user: mastodon
mastodon_install_dir: '{{ mastodon_home }}/mastodon'
mastodon_webroot: '{{ mastodon_install_dir }}/public'
+mastodon_media_dir: '{{ mastodon_install_dir }}/public/system'
mastodon_git_repo: https://github.com/mastodon/mastodon
mastodon_apache_config: |
@@ -56,3 +57,8 @@ mastodon_apache_config: |
ErrorDocument 502 /500.html
ErrorDocument 503 /500.html
ErrorDocument 504 /500.html
+
+mastodon_archive_shell: >-
+ TIMESTAMP=$(date +%Y%m%d%H%M%S);
+ tar czf "mastodon-${TIMESTAMP}.tar.gz"
+ --transform "s|^\.|mastodon-${TIMESTAMP}|" -C {{ mastodon_media_dir }} .