first commit

This commit is contained in:
2025-04-24 13:11:28 +08:00
commit ff9c54d5e4
5960 changed files with 834111 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -eux
echo "-------------------------"
echo "Deactivating old projects"
echo "-------------------------"
date
ENABLE_CRON_RESOURCE_DELETION=$(cat /etc/container_environment/ENABLE_CRON_RESOURCE_DELETION)
if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
echo "Skipping old project deactivation 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 -v -X POST \
-u "${USER}:${PASS}" \
-H "Content-Type: application/json" \
-d '{"numberOfProjectsToArchive":"720","ageOfProjects":"7"}' \
"${WEB_URL}/internal/deactivateOldProjects"
echo "Done."

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -eux
echo "-------------------------"
echo "Expiring deleted projects"
echo "-------------------------"
date
ENABLE_CRON_RESOURCE_DELETION=$(cat /etc/container_environment/ENABLE_CRON_RESOURCE_DELETION)
if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
echo "Skipping project 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-projects-after-duration"
echo "Done."

25
server-ce/cron/delete-users.sh Executable file
View 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://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."

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eux
echo "--------------------------"
echo "Flush project-history queue"
echo "--------------------------"
date
PROJECT_HISTORY_URL='http://127.0.0.1:3054'
curl -X POST "${PROJECT_HISTORY_URL}/flush/old?timeout=3600000&limit=5000&background=1"

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eux
echo "-----------------------------------"
echo "Retry project-history errors (hard)"
echo "-----------------------------------"
date
PROJECT_HISTORY_URL='http://127.0.0.1:3054'
curl -X POST "${PROJECT_HISTORY_URL}/retry/failures?failureType=hard&timeout=3600000&limit=10000"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eux
echo "-----------------------------------"
echo "Retry project-history errors (soft)"
echo "-----------------------------------"
PROJECT_HISTORY_URL='http://127.0.0.1:3054'
curl -X POST "${PROJECT_HISTORY_URL}/retry/failures?failureType=soft&timeout=3600000&limit=10000"