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