Compare commits

..

1 Commits

Author SHA1 Message Date
103485b4d9 feat: initial version
Some checks failed
Test Stalwart Installation Action / Basic Installation (No Config) (pull_request) Failing after 1m48s
Test Stalwart Installation Action / Error Handling Tests (pull_request) Successful in 2m15s
Test Stalwart Installation Action / Full Configuration (Domains + Users) (pull_request) Failing after 2m19s
Test Stalwart Installation Action / Installation with Admin Password (pull_request) Failing after 2m24s
Test Stalwart Installation Action / Test on Ubuntu ubuntu-20.04 (pull_request) Has been cancelled
Test Stalwart Installation Action / Test on Ubuntu ubuntu-22.04 (pull_request) Has been cancelled
Test Stalwart Installation Action / Test on Ubuntu ubuntu-24.04 (pull_request) Has been cancelled
Test Stalwart Installation Action / Test Summary (pull_request) Has been cancelled
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-15 00:35:07 -05:00

View File

@@ -129,16 +129,13 @@ jobs:
sleep 2 sleep 2
done done
# Try to authenticate with new password # Test authentication with Basic Auth (the actual method Stalwart uses)
RESPONSE=$(curl -sf -X POST http://localhost:8080/api/authenticate \ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Content-Type: application/json" \ -u "admin:TestPassword123!@#" \
-d '{"login":"admin","password":"TestPassword123!@#"}') http://localhost:8080/api/principal?types=domain&limit=1)
TOKEN=$(echo "$RESPONSE" | jq -r '.token // empty') if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Authentication failed with HTTP $HTTP_CODE"
if [ -z "$TOKEN" ]; then
echo "::error::Failed to authenticate with new password"
echo "Response: $RESPONSE"
exit 1 exit 1
fi fi
@@ -227,49 +224,50 @@ jobs:
sleep 2 sleep 2
done done
RESPONSE=$(curl -sf -X POST http://localhost:8080/api/authenticate \ # Test authentication with Basic Auth
-H "Content-Type: application/json" \ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-d '{"login":"admin","password":"AdminPass123!@#"}') -u "admin:AdminPass123!@#" \
http://localhost:8080/api/principal?types=domain&limit=1)
TOKEN=$(echo "$RESPONSE" | jq -r '.token // empty') if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Authentication failed with HTTP $HTTP_CODE"
if [ -z "$TOKEN" ]; then
echo "::error::Failed to authenticate with admin password"
echo "Response: $RESPONSE"
exit 1 exit 1
fi fi
echo "✓ Admin authentication successful" echo "✓ Admin authentication successful"
echo "TOKEN=$TOKEN" >> $GITHUB_ENV
- name: Verify domains were created - name: Verify domains were created
run: | run: |
# List domains via API # List domains via API (using discovered endpoint structure)
DOMAINS=$(curl -sf -X GET http://localhost:8080/api/domain \ DOMAINS=$(curl -sf \
-H "Authorization: Bearer $TOKEN") -u "admin:AdminPass123!@#" \
"http://localhost:8080/api/principal?types=domain&limit=100")
echo "Domains response: $DOMAINS" echo "Domains response: $DOMAINS"
# Check if our test domains exist # Check if our test domains exist in data.items array
if echo "$DOMAINS" | jq -e '.[] | select(.name == "test1.local")' >/dev/null; then if echo "$DOMAINS" | jq -e '.data.items[] | select(.name == "test1.local")' >/dev/null; then
echo "✓ Domain test1.local found" echo "✓ Domain test1.local found"
else else
echo "::warning::Domain test1.local not found (API might use different structure)" echo "::warning::Domain test1.local not found"
echo "$DOMAINS" | jq '.data.items[].name' || true
fi fi
- name: Verify users were created - name: Verify users were created
run: | run: |
# List accounts via API # List accounts via API (using discovered endpoint structure)
ACCOUNTS=$(curl -sf -X GET http://localhost:8080/api/account \ ACCOUNTS=$(curl -sf \
-H "Authorization: Bearer $TOKEN") -u "admin:AdminPass123!@#" \
"http://localhost:8080/api/principal?types=individual&limit=100")
echo "Accounts response: $ACCOUNTS" echo "Accounts response: $ACCOUNTS"
# Check if users exist # Check if users exist in data.items array
if echo "$ACCOUNTS" | jq -e '.[] | select(.name == "user1@test1.local")' >/dev/null; then if echo "$ACCOUNTS" | jq -e '.data.items[] | select(.emails[] == "user1@test1.local")' >/dev/null; then
echo "✓ User user1@test1.local found" echo "✓ User user1@test1.local found"
else else
echo "::warning::User user1@test1.local not found (API might use different structure)" echo "::warning::User user1@test1.local not found"
echo "$ACCOUNTS" | jq '.data.items[].emails[]' || true
fi fi
- name: Show logs on failure - name: Show logs on failure