Compare commits

..

1 Commits

Author SHA1 Message Date
c6d34f87d7 feat: initial version
All checks were successful
Test Stalwart Installation Action / Error Handling Tests (pull_request) Successful in 20s
Test Stalwart Installation Action / Full Configuration (Domains + Users) (pull_request) Successful in 37s
Test Stalwart Installation Action / Basic Installation (No Config) (pull_request) Successful in 45s
Test Stalwart Installation Action / Test Summary (pull_request) Successful in 3s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-15 09:00:48 -05:00
2 changed files with 50 additions and 3 deletions

View File

@@ -93,6 +93,7 @@ jobs:
sudo apt-get install -y jq curl
- name: Install with full configuration
id: install
uses: ./
with:
domains: |
@@ -162,6 +163,43 @@ jobs:
echo "::error::API not accessible after 60 seconds"
exit 1
- name: Debug - List created domains and users
run: |
echo "=== Reading Admin Password ==="
if [ -f /tmp/stalwart_admin_password ]; then
ADMIN_PASSWORD=$(cat /tmp/stalwart_admin_password)
echo "✓ Admin password retrieved"
else
echo "::error::Admin password file not found"
exit 1
fi
echo ""
echo "=== Listing Domains via API ==="
DOMAINS_RESPONSE=$(curl -s -u "admin:$ADMIN_PASSWORD" \
"http://localhost:8080/api/principal?types=domain&limit=100")
echo "$DOMAINS_RESPONSE" | jq '.data.items[] | {name, description, id}'
DOMAIN_COUNT=$(echo "$DOMAINS_RESPONSE" | jq '.data.total // 0')
echo "Total domains: $DOMAIN_COUNT"
echo ""
echo "=== Listing Users via API ==="
USERS_RESPONSE=$(curl -s -u "admin:$ADMIN_PASSWORD" \
"http://localhost:8080/api/principal?types=individual&limit=100")
echo "$USERS_RESPONSE" | jq '.data.items[] | {name, emails, roles, id}'
USER_COUNT=$(echo "$USERS_RESPONSE" | jq '.data.total // 0')
echo "Total users: $USER_COUNT"
# Verify expected users exist
if [ "$USER_COUNT" -ge 3 ]; then
echo "✓ Expected number of users created"
else
echo "::error::Expected at least 3 users, found $USER_COUNT"
exit 1
fi
- name: Verify unauthenticated JMAP access
run: |
echo "Testing unauthenticated JMAP endpoint..."
@@ -190,7 +228,12 @@ jobs:
echo "HTTP Status Code: $HTTP_CODE"
echo "JMAP Response:"
cat /tmp/jmap_response.json | jq '.' || cat /tmp/jmap_response.json
echo "::error::JMAP endpoint returned HTTP $HTTP_CODE"
# Check if request succeeded
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::JMAP endpoint returned HTTP $HTTP_CODE"
exit 1
fi
# Verify username field contains our test user
USERNAME=$(cat /tmp/jmap_response.json | jq -r '.username // empty')

View File

@@ -56,6 +56,10 @@ main() {
log_info "📝 Generated admin password: ${current_password}"
log_warning "⚠️ Save this password securely - it won't be shown again!"
# Save admin password to temp file for testing/debugging (remove in production)
echo "$current_password" > /tmp/stalwart_admin_password
chmod 600 /tmp/stalwart_admin_password
# Create domains if provided
if [ -n "$DOMAINS_JSON" ]; then
log_info "Creating domains..."
@@ -280,7 +284,7 @@ create_users() {
emails: [$email],
urls: [],
memberOf: [],
roles: [],
roles: ["user"],
lists: [],
members: [],
enabledPermissions: [],
@@ -297,7 +301,7 @@ create_users() {
emails: [$email],
urls: [],
memberOf: [],
roles: [],
roles: ["user"],
lists: [],
members: [],
enabledPermissions: [],