mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
Merge pull request #11473 from overleaf/msm-ce-deletion-cron
[CE/SP] `cron` jobs for resource deletion GitOrigin-RevId: 7d690340f11cb4aaf38653fdcca6b7944f9a4d0b
This commit is contained in:
25
server-ce/cron/delete-users.sh
Executable file
25
server-ce/cron/delete-users.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
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://localhost: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."
|
||||
Reference in New Issue
Block a user