Enable TLS by default
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
MIDDLEWARE_URL="http://localhost:8080"
|
||||
MIDDLEWARE_URL="https://localhost:8080"
|
||||
TEST_TOPIC="test-topic"
|
||||
|
||||
echo "🧪 Testing Slack to ntfy middleware..."
|
||||
|
||||
# Check if service is running
|
||||
echo "Checking if middleware is running..."
|
||||
if ! curl -s "$MIDDLEWARE_URL/health" > /dev/null; then
|
||||
if ! curl -k -s "$MIDDLEWARE_URL/health" > /dev/null; then
|
||||
echo "❌ Middleware is not running on $MIDDLEWARE_URL"
|
||||
echo "Please start it with: docker compose up -d"
|
||||
exit 1
|
||||
@@ -18,19 +18,19 @@ echo "✅ Middleware is running"
|
||||
|
||||
# Test health endpoint
|
||||
echo "Testing health endpoint..."
|
||||
HEALTH_RESPONSE=$(curl -s "$MIDDLEWARE_URL/health")
|
||||
HEALTH_RESPONSE=$(curl -k -s "$MIDDLEWARE_URL/health")
|
||||
echo "Health response: $HEALTH_RESPONSE"
|
||||
|
||||
# Test Slack webhook format
|
||||
echo "Testing Slack webhook format..."
|
||||
curl -X POST "$MIDDLEWARE_URL/$TEST_TOPIC" \
|
||||
curl -k -X POST "$MIDDLEWARE_URL/$TEST_TOPIC" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"text": "🧪 Test alert from Slack to ntfy middleware test script"}' \
|
||||
-w "\nHTTP Status: %{http_code}\n"
|
||||
|
||||
# Test plain text format
|
||||
echo "Testing plain text format..."
|
||||
curl -X POST "$MIDDLEWARE_URL/$TEST_TOPIC" \
|
||||
curl -k -X POST "$MIDDLEWARE_URL/$TEST_TOPIC" \
|
||||
-H 'Content-Type: text/plain' \
|
||||
-d 'Plain text test alert' \
|
||||
-w "\nHTTP Status: %{http_code}\n"
|
||||
|
||||
Reference in New Issue
Block a user