feat: 接入 AnyTLS 节点托管和用户流量同步

This commit is contained in:
2026-09-29 13:35:44 +08:00
parent 586c2399d1
commit ac5fed695c
24 changed files with 1413 additions and 185 deletions
+11
View File
@@ -199,6 +199,17 @@ const MIGRATIONS: (string | ((db: Database.Database) => void))[] = [
node_id INTEGER REFERENCES hy2_nodes(id) ON DELETE CASCADE
);
`,
`
ALTER TABLE node_installations ADD COLUMN protocol TEXT NOT NULL DEFAULT 'hy2';
CREATE TABLE node_agent_counters (
node_id INTEGER NOT NULL REFERENCES hy2_nodes(id) ON DELETE CASCADE,
epoch TEXT NOT NULL,
auth_id TEXT NOT NULL,
tx INTEGER NOT NULL DEFAULT 0,
rx INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY(node_id, epoch, auth_id)
);
`,
];
export function migrateDatabase(db: Database.Database) {