Fix SSL cert on phpMyadmin

main
Anthony 2025-10-21 01:54:41 +08:00
parent 7b7ec7e2fb
commit 36d5be15c8
2 changed files with 22 additions and 4 deletions

View File

@ -1029,7 +1029,7 @@ actions:
user: root user: root
commands: commands:
- bash /home/litespeed/mbmanager/scripts/dbreset.sh >/dev/null - bash /home/litespeed/mbmanager/scripts/dbreset.sh >/dev/null
- bash /home/litespeed/mbmanager/pma-gateway/create_pma_gateway.sh --validity="${settings.validity}" --slug="${settings.slug}" | tail -n1 - bash /home/litespeed/mbmanager/pma-gateway/create_pma_gateway.sh --validity="${settings.validity}" --slug="${settings.slug}"
- return: - return:
type: info type: info
message: "Gateway URL: ${response.out}" message: "Gateway URL: ${response.out}"

View File

@ -314,10 +314,28 @@ fi
# Generate URL using public hostname (port 443) with valid SSL certificate # Generate URL using public hostname (port 443) with valid SSL certificate
# This bypasses CDN protections and uses the trusted certificate # This bypasses CDN protections and uses the trusted certificate
URL="https://$PUBLIC_HOST/access-db-$SLUG.php?token=$token" URL="https://$PUBLIC_HOST/access-db-$SLUG.php?token=$token"
echo "$URL"
# Display security information # Output JSON response for Cloud Scripting compatibility
echo "" # Cloud Scripting expects structured JSON output from custom actions
cat <<EOF
{
"status": "success",
"url": "$URL",
"slug": "$SLUG",
"validity_minutes": $VALIDITY,
"expires_at": $expires,
"message": "phpMyAdmin gateway created successfully",
"security_info": {
"ssl_certificate": "$CERT_FILE_PATH",
"uses_valid_cert": "$([[ "$CERT_FILE_PATH" != '$SERVER_ROOT/ssl/litespeed.crt' ]] && echo 'true' || echo 'false')",
"port_443_only": "true",
"cdn_protected": "true",
"auto_expires": "true"
}
}
EOF
# Display security information to stderr (not part of JSON response)
echo "🔐 SECURITY NOTICE:" >&2 echo "🔐 SECURITY NOTICE:" >&2
echo " • Gateway URL uses valid Let's Encrypt certificate" >&2 echo " • Gateway URL uses valid Let's Encrypt certificate" >&2
echo " • Served through main domain (port 443) with CDN protection" >&2 echo " • Served through main domain (port 443) with CDN protection" >&2