Refactor error handling and localDb structure, and fix usage tracking bug.

This commit is contained in:
decolua
2026-04-16 10:58:35 +07:00
parent 3badf1cbb6
commit 75ad0bef8e
13 changed files with 162 additions and 109 deletions

View File

@@ -1,8 +1,8 @@
import fs from "fs";
import path from "path";
import os from "os";
import { DATA_DIR } from "@/lib/dataDir.js";
const TUNNEL_DIR = path.join(os.homedir(), ".9router", "tunnel");
const TUNNEL_DIR = path.join(DATA_DIR, "tunnel");
const STATE_FILE = path.join(TUNNEL_DIR, "state.json");
const CLOUDFLARED_PID_FILE = path.join(TUNNEL_DIR, "cloudflared.pid");
const TAILSCALE_PID_FILE = path.join(TUNNEL_DIR, "tailscale.pid");