From f9b826d2f8e308298472bf39dc1c371482be7095 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 1 Jun 2021 09:34:45 +0200 Subject: [PATCH] Add prune command --- abra.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/abra.sh b/abra.sh index 6df88a5..0e7c33a 100644 --- a/abra.sh +++ b/abra.sh @@ -1,2 +1,24 @@ export NGINX_CONFIG_VERSION=v1 export APP_ENTRYPOINT_VERSION=v1 + +sub_npm() { + export NODE_CONFIG_DIR=/app/config + export NODE_ENV=production + export PEERTUBE_DB_PASSWORD=$(cat /run/secrets/db_password) + + # shellcheck disable=SC2034 + abra__service_="app" + + sub_app_run npm run "$@" +} + +sub_prune() { + info "Pruning storage" + info "See https://docs.joinpeertube.org/maintain-tools?id=prune-storagejs for more" + silence + + sub_npm "prune-storage" + + unsilence + success "Storage pruned!" +}