diff --git a/Dockerfile b/Dockerfile index 2a562c23..5cf0a8d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ RUN corepack enable pnpm # Copy Web UI COPY src/package.json src/pnpm-lock.yaml src/pnpm-workspace.yaml ./ -COPY src/patches ./patches RUN pnpm install # Build UI diff --git a/Dockerfile.dev b/Dockerfile.dev index 6539dece..428e0368 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -33,7 +33,6 @@ ENV DISABLE_IPV6=false # Install Dependencies COPY src/package.json src/pnpm-lock.yaml src/pnpm-workspace.yaml ./ -COPY src/patches ./patches RUN pnpm install # Copy Project diff --git a/src/package.json b/src/package.json index 5b6eddb5..091627ac 100644 --- a/src/package.json +++ b/src/package.json @@ -37,13 +37,13 @@ "citty": "^0.2.2", "consola": "^3.4.2", "crc-32": "^1.2.2", - "debug": "^4.4.3", "drizzle-orm": "^0.45.2", "ip-bigint": "^9.0.4", "is-cidr": "^7.0.0", "is-ip": "^5.0.1", "js-sha256": "^0.11.1", "nuxt": "^3.21.5", + "obug": "^2.1.1", "otpauth": "^9.5.1", "pinia": "^3.0.4", "qr": "^0.6.0", @@ -58,7 +58,6 @@ "devDependencies": { "@nuxt/eslint": "^1.15.2", "@nuxt/test-utils": "^4.0.3", - "@types/debug": "^4.1.13", "@types/phc__format": "^1.0.1", "@types/semver": "^7.7.1", "@vitest/coverage-v8": "^4.1.6", diff --git a/src/patches/unenv.patch b/src/patches/unenv.patch deleted file mode 100644 index fdfc8616..00000000 --- a/src/patches/unenv.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/dist/runtime/npm/debug.mjs b/dist/runtime/npm/debug.mjs -index 62fa13e3a5e96ee835dfe7363e7451e987ef11bc..85b923f5f5597519486b5a11604af6dbfadb0a0d 100644 ---- a/dist/runtime/npm/debug.mjs -+++ b/dist/runtime/npm/debug.mjs -@@ -1,7 +1,17 @@ - function createDebug(namespace) { - return Object.assign((...args) => { - const env = globalThis.process?.env.DEBUG; -- if (!env || env !== "*" && !env.startsWith(namespace)) return; -+ if (!env) return; -+ if (env !== "*") { -+ const patterns = env.split(",").map((n) => n.trim()); -+ const isMatch = patterns.some((pattern) => { -+ if (pattern.endsWith("*")) { -+ return namespace.startsWith(pattern.slice(0, -1)); -+ } -+ return pattern === namespace; -+ }); -+ if (!isMatch) return; -+ } - console.debug(...args); - }, { - color: "#000000", diff --git a/src/pnpm-lock.yaml b/src/pnpm-lock.yaml index 09bdbfe5..26a0704a 100644 --- a/src/pnpm-lock.yaml +++ b/src/pnpm-lock.yaml @@ -4,9 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -patchedDependencies: - unenv: 0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d - importers: .: @@ -59,9 +56,6 @@ importers: crc-32: specifier: ^1.2.2 version: 1.2.2 - debug: - specifier: ^4.4.3 - version: 4.4.3 drizzle-orm: specifier: ^0.45.2 version: 0.45.2(@libsql/client@0.17.3) @@ -80,6 +74,9 @@ importers: nuxt: specifier: ^3.21.5 version: 3.21.5(@libsql/client@0.17.3)(@parcel/watcher@2.5.6)(@types/node@25.8.0)(@vue/compiler-sfc@3.5.34)(cac@6.7.14)(db0@0.3.4(@libsql/client@0.17.3)(drizzle-orm@0.45.2(@libsql/client@0.17.3)))(drizzle-orm@0.45.2(@libsql/client@0.17.3))(eslint@9.39.4(jiti@1.21.7))(ioredis@5.10.1)(magicast@0.5.3)(optionator@0.9.4)(rollup-plugin-visualizer@7.0.1(rollup@4.60.4))(rollup@4.60.4)(srvx@0.11.15)(terser@5.47.1)(tsx@4.22.1)(typescript@6.0.3)(vite@7.3.3(@types/node@25.8.0)(jiti@1.21.7)(terser@5.47.1)(tsx@4.22.1)(yaml@2.9.0))(vue-tsc@3.2.9(typescript@6.0.3))(yaml@2.9.0) + obug: + specifier: ^2.1.1 + version: 2.1.1 otpauth: specifier: ^9.5.1 version: 9.5.1 @@ -117,9 +114,6 @@ importers: '@nuxt/test-utils': specifier: ^4.0.3 version: 4.0.3(@vitest/ui@4.1.6)(crossws@0.4.5(srvx@0.11.15))(magicast@0.5.3)(typescript@6.0.3)(vite@7.3.3(@types/node@25.8.0)(jiti@1.21.7)(terser@5.47.1)(tsx@4.22.1)(yaml@2.9.0))(vitest@4.1.6) - '@types/debug': - specifier: ^4.1.13 - version: 4.1.13 '@types/phc__format': specifier: ^1.0.1 version: 1.0.1 @@ -2513,9 +2507,6 @@ packages: '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} - '@types/debug@4.1.13': - resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==} - '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} @@ -2534,9 +2525,6 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/ms@2.1.0': - resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} - '@types/node@25.8.0': resolution: {integrity: sha512-TCFSk8IZh+iLX1xtksoBVtdmgL+1IX0fC9BeU4QqFSuNdN/K+HUlhqOzEmSYYpZUVsLYcPqc9KX+60iDuninSQ==} @@ -7742,7 +7730,7 @@ snapshots: seroval: 1.5.4 std-env: 4.1.0 ufo: 1.6.4 - unenv: 2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d) + unenv: 2.0.0-rc.24 vite: 7.3.3(@types/node@25.8.0)(jiti@2.7.0)(terser@5.47.1)(tsx@4.22.1)(yaml@2.9.0) vite-node: 5.3.0(@types/node@25.8.0)(jiti@2.7.0)(terser@5.47.1)(tsx@4.22.1)(yaml@2.9.0) vite-plugin-checker: 0.13.0(eslint@9.39.4(jiti@1.21.7))(optionator@0.9.4)(typescript@6.0.3)(vite@7.3.3(@types/node@25.8.0)(jiti@1.21.7)(terser@5.47.1)(tsx@4.22.1)(yaml@2.9.0))(vue-tsc@3.2.9(typescript@6.0.3)) @@ -8480,10 +8468,6 @@ snapshots: '@types/deep-eql': 4.0.2 assertion-error: 2.0.1 - '@types/debug@4.1.13': - dependencies: - '@types/ms': 2.1.0 - '@types/deep-eql@4.0.2': {} '@types/esrecurse@4.3.1': {} @@ -8496,8 +8480,6 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/ms@2.1.0': {} - '@types/node@25.8.0': dependencies: undici-types: 7.24.6 @@ -10853,7 +10835,7 @@ snapshots: ultrahtml: 1.6.0 uncrypto: 0.1.3 unctx: 2.5.0 - unenv: 2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d) + unenv: 2.0.0-rc.24 unimport: 6.3.0(oxc-parser@0.129.0) unplugin-utils: 0.3.1 unstorage: 1.17.5(db0@0.3.4(@libsql/client@0.17.3)(drizzle-orm@0.45.2(@libsql/client@0.17.3)))(ioredis@5.10.1) @@ -12178,7 +12160,7 @@ snapshots: undici-types@7.24.6: {} - unenv@2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d): + unenv@2.0.0-rc.24: dependencies: pathe: 2.0.3 diff --git a/src/pnpm-workspace.yaml b/src/pnpm-workspace.yaml index ff78df69..955b8fc3 100644 --- a/src/pnpm-workspace.yaml +++ b/src/pnpm-workspace.yaml @@ -4,5 +4,3 @@ allowBuilds: esbuild: false unrs-resolver: false vue-demi: false -patchedDependencies: - unenv: patches/unenv.patch diff --git a/src/server/database/sqlite.ts b/src/server/database/sqlite.ts index bae94133..4b0f6723 100644 --- a/src/server/database/sqlite.ts +++ b/src/server/database/sqlite.ts @@ -1,7 +1,7 @@ import { drizzle } from 'drizzle-orm/libsql'; import { migrate as drizzleMigrate } from 'drizzle-orm/libsql/migrator'; import { createClient } from '@libsql/client'; -import debug from 'debug'; +import { createDebug } from 'obug'; import { eq } from 'drizzle-orm'; import * as schema from './schema'; @@ -13,7 +13,7 @@ import { InterfaceService } from './repositories/interface/service'; import { HooksService } from './repositories/hooks/service'; import { OneTimeLinkService } from './repositories/oneTimeLink/service'; -const DB_DEBUG = debug('Database'); +const DB_DEBUG = createDebug('Database'); const client = createClient({ url: 'file:/etc/wireguard/wg-easy.db' }); const db = drizzle({ client, schema }); diff --git a/src/server/utils/WireGuard.ts b/src/server/utils/WireGuard.ts index b5f0dd42..9ffc8ccb 100644 --- a/src/server/utils/WireGuard.ts +++ b/src/server/utils/WireGuard.ts @@ -1,8 +1,8 @@ import fs from 'node:fs/promises'; -import debug from 'debug'; +import { createDebug } from 'obug'; import type { InterfaceType } from '#db/repositories/interface/types'; -const WG_DEBUG = debug('WireGuard'); +const WG_DEBUG = createDebug('WireGuard'); const generateRandomHeaderValue = () => Math.floor(Math.random() * 2147483642) + 5; diff --git a/src/server/utils/cmd.ts b/src/server/utils/cmd.ts index 6fd4ad9b..70c979c9 100644 --- a/src/server/utils/cmd.ts +++ b/src/server/utils/cmd.ts @@ -1,7 +1,7 @@ import childProcess from 'child_process'; -import debug from 'debug'; +import { createDebug } from 'obug'; -const CMD_DEBUG = debug('CMD'); +const CMD_DEBUG = createDebug('CMD'); export function exec( cmd: string, diff --git a/src/server/utils/config.ts b/src/server/utils/config.ts index 322b7ae6..1c5b2081 100644 --- a/src/server/utils/config.ts +++ b/src/server/utils/config.ts @@ -1,9 +1,9 @@ -import debug from 'debug'; +import { createDebug } from 'obug'; import packageJson from '@@/package.json'; export const RELEASE = 'v' + packageJson.version; -export const SERVER_DEBUG = debug('Server'); +export const SERVER_DEBUG = createDebug('Server'); export const OLD_ENV = { /** @deprecated Only for migration purposes */ diff --git a/src/server/utils/firewall.ts b/src/server/utils/firewall.ts index 95f50414..76ad1c64 100644 --- a/src/server/utils/firewall.ts +++ b/src/server/utils/firewall.ts @@ -1,11 +1,11 @@ -import debug from 'debug'; +import { createDebug } from 'obug'; import { isIPv6 } from 'is-ip'; import type { ClientType } from '#db/repositories/client/types'; import type { InterfaceType } from '#db/repositories/interface/types'; import type { UserConfigType } from '#db/repositories/userConfig/types'; -const FW_DEBUG = debug('Firewall'); +const FW_DEBUG = createDebug('Firewall'); const CHAIN_NAME = 'WG_CLIENTS'; // Mutex to prevent concurrent rule rebuilds