Enable TLS by default

This commit is contained in:
2025-09-23 00:40:42 -07:00
parent ce1e878fb7
commit b59fd7dcc4
7 changed files with 176 additions and 36 deletions

View File

@@ -53,4 +53,4 @@ echo
echo "Next steps:"
echo "1. Test the service: ./scripts/test.sh"
echo "2. Check logs: docker compose logs -f"
echo "3. Configure Slack webhook URL: http://your-server-ip:8080/your-topic-name"
echo "3. Configure Slack webhook URL: https://your-server-ip:8080/your-topic-name"

View File

@@ -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"