feat: instance admin login token + cleanup cron (GitHub Action)

Instance admin login:
- Provisioning generates adminLoginToken (crypto random, 7-day expiry)
- Sends instance-ready email with admin login URL to customer
- Token returned in provisioning response

Cleanup cron:
- .github/workflows/cleanup-cron.yml: daily at 03:00 UTC
- Calls POST /api/aos/instances/cleanup with CRON_SECRET
- Also supports manual trigger (workflow_dispatch)
- Requires GitHub secrets: AOS_URL, CRON_SECRET
This commit is contained in:
Z User committed 2026-10-28 23:37:42 +00:00
1 parent 00a3a89263
commit ec5e6b1629
2 files changed
+56

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
name: AOS Cleanup Cron
on:
schedule:
# Run daily at 03:00 UTC (05:00 Berlin time)
- cron: '0 3 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Trigger instance cleanup
run: |
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
"${{ secrets.AOS_URL || 'https://dfmpanel.eu' }}/api/aos/instances/cleanup" \
-H "Authorization: Bearer ${{ secrets.CRON_SECRET }}" \
-H "Content-Type: application/json" \
--max-time 300)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
echo "HTTP $HTTP_CODE"
echo "Response: $BODY"
if [ "$HTTP_CODE" != "200" ]; then
echo "::warning::Cleanup returned HTTP $HTTP_CODE"
exit 1
fi
echo "::notice::Cleanup completed successfully"