overleaf-cep/server-ce/cron/delete-users.sh
Jakob Ackermann 48df8c9f38 [server-ce] reduce verbose output from cron jobs (#27240)
GitOrigin-RevId: 8a2eda551796e62af6fddf80a3ce8cf37ec309d4
2025-07-21 08:04:50 +00:00

25 lines
642 B
Bash
Executable file

#!/usr/bin/env bash
set -eu
echo "----------------------"
echo "Expiring deleted users"
echo "----------------------"
date
ENABLE_CRON_RESOURCE_DELETION=$(cat /etc/container_environment/ENABLE_CRON_RESOURCE_DELETION)
if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
echo "Skipping user expiration due to ENABLE_CRON_RESOURCE_DELETION not set to true"
exit 0
fi
WEB_URL='http://127.0.0.1:3000'
USER=$(cat /etc/container_environment/WEB_API_USER)
PASS=$(cat /etc/container_environment/WEB_API_PASSWORD)
curl -X POST -v -u "${USER}:${PASS}" \
"${WEB_URL}/internal/expire-deleted-users-after-duration"
echo "Done."