diff --git a/CloudronManifest.json b/CloudronManifest.json index 38fb4fa..fc4fa1a 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -14,7 +14,13 @@ "postgresql": {}, "redis": {}, "sendmail": {}, - "ldap": {} + "ldap": {}, + "scheduler": { + "cleanup": { + "schedule": "11 11 * * *", + "command": "/app/pkg/cleanup.sh" + } + } }, "minBoxVersion": "4.1.4", "manifestVersion": 2, diff --git a/Dockerfile b/Dockerfile index 1346ed3..641c78b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ RUN ln -fs /run/mastodon/bullet.log /app/code/log/bullet.log RUN ln -fs /app/data/system /app/code/public/system RUN rm -rf /app/code/tmp && ln -fs /tmp/mastodon /app/code/tmp -COPY start.sh env.template /app/pkg/ +COPY start.sh cleanup.sh env.template /app/pkg/ CMD [ "/app/pkg/start.sh" ] diff --git a/cleanup.sh b/cleanup.sh new file mode 100755 index 0000000..0c6ce4f --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -eu + +echo "=> Cleanup cached media" + +cd /app/code +./bin/tootctl media remove