[split-upload 4/6] f2fd4fa backup via proxy

This commit is contained in:
Simon
2026-08-11 14:17:15 +08:00
parent 8ef4be0fa0
commit 90ff78563a
74 changed files with 247663 additions and 65 deletions
+1
View File
@@ -0,0 +1 @@
SELECT column_name FROM information_schema.columns WHERE table_name = 'messages' AND column_name LIKE '%source%';
+1
View File
@@ -0,0 +1 @@
UPDATE alembic_version SET version_num = '041_message_server_timestamp';
+3
View File
@@ -0,0 +1,3 @@
SELECT id, created_at, sender_type, content, extra_data
FROM messages
WHERE id = 'd212b1eb-6fdb-49b9-986e-3023680b4137';
+8
View File
@@ -0,0 +1,8 @@
$b = [System.IO.File]::ReadAllText('fix-prod.b64').Trim()
$n = $b.Length
$half = [int]($n / 2)
$s1 = $b.Substring(0, $half)
$s2 = $b.Substring($half)
[System.IO.File]::WriteAllText('fix-prod.s1', $s1)
[System.IO.File]::WriteAllText('fix-prod.s2', $s2)
Write-Host "Total=$n seg1=$($s1.Length) seg2=$($s2.Length)"
+3
View File
@@ -0,0 +1,3 @@
import requests
r = requests.get('http://127.0.0.1:8000/h5/agents/online-status')
print(r.text)
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""测试 Dify API 连接"""
import httpx
import asyncio
import sys
async def test_dify():
url = "http://yw-dify.dc.servyou-it.com/v1/chat-messages"
headers = {"Authorization": "Bearer app-7jkRkAzvX4QM9v9SM3P8mMEO"}
payload = {
"query": "test",
"user": "test_user",
"response_mode": "blocking"
}
try:
async with httpx.AsyncClient(timeout=15) as client:
print(f"Testing Dify API: {url}")
response = await client.post(url, json=payload, headers=headers)
print(f"Status: {response.status_code}")
print(f"Response: {response.text[:500]}")
except Exception as e:
print(f"Error: {e}")
sys.exit(1)
if __name__ == "__main__":
asyncio.run(test_dify())
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""测试内部网络 Dify 服务"""
import httpx
import asyncio
async def test_internal():
async with httpx.AsyncClient(timeout=10) as client:
# 测试 RAGFlow (有 Dify API)
print("=== RAGFlow 8080 (Dify API) ===")
try:
r = await client.post(
"http://10.80.0.85:8080/v1/chat-messages",
json={"query": "hello", "user": "test"},
headers={"Content-Type": "application/json"}
)
print(f"Status: {r.status_code}")
print(f"Response: {r.text[:200]}")
except Exception as e:
print(f"Error: {e}")
print()
# 测试内部 Dify 服务 (尝试常见内网地址)
print("=== Try Internal Dify Services ===")
candidates = [
"http://10.80.0.85:8081",
"http://10.80.0.86:8080",
"http://dify:8080",
"http://dify:80",
]
for url in candidates:
try:
r = await client.get(url)
print(f"{url}: {r.status_code}")
except Exception as e:
print(f"{url}: FAIL - {type(e).__name__}")
if __name__ == "__main__":
asyncio.run(test_internal())
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
"""测试 Dify dify2openai 代理"""
import httpx
import asyncio
import sys
async def test_dify_proxy():
# Test the dify2openai proxy path
async with httpx.AsyncClient(timeout=15) as client:
print("=== Test dify2openai proxy ===")
url = "http://yw-dify.dc.servyou-it.com/dify2openai/v1/chat/completions"
headers = {
"Authorization": "Bearer http://yw-dify.dc.servyou-it.com/v1|app-7jkRkAzvX4QM9v9SM3P8mMEO|Chat",
"Content-Type": "application/json"
}
payload = {
"model": "Chat",
"messages": [{"role": "user", "content": "hello"}],
"stream": False
}
r = await client.post(url, json=payload, headers=headers)
print(f"Status: {r.status_code}")
print(f"Response: {r.text[:500]}")
if __name__ == "__main__":
asyncio.run(test_dify_proxy())
+16
View File
@@ -0,0 +1,16 @@
import asyncio
import sys
sys.path.insert(0, '/app')
from app.services.neo4j_client import get_neo4j_client
async def test():
client = await get_neo4j_client()
print(f'Neo4j client: {client}')
if client:
healthy = await client.health_check()
print(f'Health check: {healthy}')
else:
print('Neo4j client is None')
asyncio.run(test())