Add 3x-ui user sync via panel API (login or Bearer token).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-26 00:14:27 +03:00
co-authored by Cursor
parent 865260cc9d
commit 0acd27d840
10 changed files with 551 additions and 8 deletions
+10
View File
@@ -78,5 +78,15 @@ def init_schema():
if stmt:
cur.execute(stmt)
conn.commit()
# Soft migrations for existing databases
with pool.connection() as conn:
with conn.cursor() as cur:
cur.execute(
"ALTER TABLE users ADD COLUMN IF NOT EXISTS xui_email TEXT"
)
cur.execute(
"CREATE INDEX IF NOT EXISTS idx_users_xui_email ON users(xui_email)"
)
conn.commit()
_schema_ready = True
logger.info('PostgreSQL schema ready')