=== Process on 8094 ===
=== Port 8094 process details ===
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python3 1062 root 17u IPv4 7990715 0t0 TCP localhost:40930->localhost:8094 (CLOSE_WAIT)
python3 3515 root 17u IPv4 59845 0t0 TCP localhost:60204->localhost:8094 (CLOSE_WAIT)
python3 2525479 root 16u IPv4 6687690 0t0 TCP localhost:54892->localhost:8094 (CLOSE_WAIT)
python3 2682681 root 17u IPv4 17383892 0t0 TCP localhost:53156->localhost:8094 (CLOSE_WAIT)
python3 2684741 root 17u IPv4 7989080 0t0 TCP localhost:40920->localhost:8094 (CLOSE_WAIT)
python3 3572508 root 17u IPv4 15633475 0t0 TCP *:8094 (LISTEN)
=== Check PMS server code ===
total 20592
drwxr-xr-x 18 root root 16384 Aug 2 15:05 .
drwxr-xr-x 152 root root 4096 Aug 2 13:50 ..
-rw-r--r-- 1 root root 13600 Jul 25 12:59 admin_feedback.html
-rw-r--r-- 1 root root 11893 Jul 25 12:59 admin_onboarding.html
-rw-r--r-- 1 root root 66072 Aug 1 11:28 agent_b64.txt
-rw-r--r-- 1 root root 14047 Jul 24 10:39 agent_system.py
-rw-r--r-- 1 root root 14047 Jul 24 11:10 agent_system.py.bak.20260724111021
-rw-r--r-- 1 root root 14047 Jul 24 10:50 agent_system.py.bak_voice
-rw-r--r-- 1 root root 20493 Jul 27 22:19 ai_assistant.html
-rw-r--r-- 1 root root 17939 Jul 27 19:28 ai_assistant.html.backup.20260727_192855
-rw-r--r-- 1 root root 30476 Jul 27 22:10 ai_assistant.html.bak_before_v2_221038
-rw-r--r-- 1 root root 6000 Aug 1 11:13 ai_booking_agent_b64.txt
-rw-r--r-- 1 root root 49553 Aug 1 11:29 ai_booking_agent.py
-rwxr-xr-x 1 root root 23198 Jul 29 12:06 ai_chat_router.py
-rwxr-xr-x 1 root root 34083 Jul 30 13:14 ai_features_api.py
-rw-r--r-- 1 root root 20192 Aug 1 06:42 ai_features.py
drwxr-xr-x 2 root root 4096 Jul 30 13:19 ai_general_manager
-rw-r--r-- 1 root root 93400 Jul 26 07:10 ai_recommendation_engine.py
-rw-r--r-- 1 root root 16552 Jul 25 10:31 api_b64.txt
---
import os as _auth_os
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.responses import JSONResponse as _auth_JSONResponse
_XIQUE_KEY = _auth_os.environ.get("XIQUE_API_KEY", "")
class _AuthMW(BaseHTTPMiddleware):
async def dispatch(self, request, call_next):
# P1 fix: allow public POST endpoints without API key
_public_post = {"/api/hotel/login", "/api/feedback/submit", "/api/onboarding/submit", "/api/help/search", "/api/sms/send-code", "/api/sms/verify-code", "/api/ai/butler", "/api/ai/smart-room-assign", "/api/check-in", "/api/check-out", "/api/check-in/execute", "/api/check-out/execute", "/api/night-audit/execute", "/api/quick-stats", "/api/room-status-board", "/api/invoice/create", "/api/invoice/issue", "/api/invoice/void", "/api/folio/add-charge", "/api/payment/charge", "/api/service-task/create", "/api/service-task/complete", "/api/group-booking/create", "/api/auth/phone-login", "/api/auth/register", "/api/auth/change-password", "/api/hotel/sms-login", "/api/hotel/reset-password"}
if request.url.path in _public_post:
return await call_next(request)
# P2 fix: if request already has valid JWT Bearer token, skip API key check
auth_header = request.headers.get("Authorization", "")
if auth_header.startswith("Bearer ") and len(auth_header) > 7:
return await call_next(request)
# Also skip if JWT middleware already validated and set user state
if hasattr(request.state, "user") and request.state.user:
return await call_next(request)
if request.method in ("POST","PUT","DELETE","PATCH"):
k = request.headers.get("X-API-Key","")
if not _XIQUE_KEY or k != _XIQUE_KEY:
return _auth_JSONResponse(status_code=401, content={"detail":"Unauthorized"})
return await call_next(request)
if request.method in ("POST","PUT","DELETE","PATCH"):
k = request.headers.get("X-API-Key","")
if not _XIQUE_KEY or k != _XIQUE_KEY:
return _auth_JSONResponse(status_code=401, content={"detail":"Unauthorized"})
return await call_next(request)
try:
import bus_integration
except:
pass
try:
from xique_event import publish_event
except:
pass
#!/usr/bin/env python3
# -*- coding: utf-8: -*-
"""
喜雀 Qwen3.7 PMS AI 集成服务
==============================
FastAPI 中间件服务,集成 Qwen3.7-Plus 作为酒店 PMS 的 AI 大脑。
端口: 8090
功能:
- 住客对话 (chat)
- 入住/退房钩子 (check_in_hook / check_out_hook)
=== What does 8094 serve at root? ===
=== What does 8094 serve at /pms? ===