diff --git a/app.py b/app.py
index 72abba2..bc89a37 100644
--- a/app.py
+++ b/app.py
@@ -9,6 +9,154 @@ env = jinja2.Environment(
@app.route('/')
def index():
+ subdomain = request.host.split('.', 1)[0]
+ domain = request.host.split('.', 1)[1] if '.' in request.host else request.host
+
+ base_html = """
+
+
+
+
+
+ {title}
+
+
+
+
+
{icon}
+
{service_type}
+
{title}
+
Domain: {domain}
+ {content}
+
📊 Service Status
+
+
+
+ """
+
+ if subdomain == 'autoconfig':
+ return base_html.format(
+ title="Mail Autoconfig Service",
+ service_type="Mozilla Thunderbird",
+ icon="🔧",
+ domain=domain,
+ content=f'''
+
+ '''
+ )
+ elif subdomain == 'autodiscover':
+ return base_html.format(
+ title="Mail Autodiscover Service",
+ service_type="Microsoft Outlook",
+ icon="🔍",
+ domain=domain,
+ content=f'''
+
+ '''
+ )
+ else:
+ return base_html.format(
+ title="Mail Configuration Service",
+ service_type="Error",
+ icon="❌",
+ domain="Invalid",
+ content='''
+
+ Invalid subdomain!
+ Please use autoconfig.domain.com or autodiscover.domain.com
+
+ '''
+ ), 400
+
+@app.route('/ping')
+def ping():
return "Mail Autoconfig Service is running."
@app.route('/mail/config-v1.1.xml')
diff --git a/docker-compose.yml b/docker-compose.yml
index 7c2d6e1..9592c79 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,7 +4,7 @@ services:
container_name: mifi-mail-autoconfig
restart: unless-stopped
healthcheck:
- test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:80/')"]
+ test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:80/ping')"]
interval: 30s
timeout: 10s
retries: 3