diff --git a/Dockerfile b/Dockerfile index b217477f..2a562c23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ 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 @@ -72,7 +73,7 @@ RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save # Set Environment -ENV DEBUG=Server,WireGuard,Database,CMD +ENV DEBUG=Server,WireGuard,Database,CMD,Firewall ENV PORT=51821 ENV HOST=0.0.0.0 ENV INSECURE=false diff --git a/Dockerfile.dev b/Dockerfile.dev index e6f50045..6539dece 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -24,7 +24,7 @@ RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save # Set Environment -ENV DEBUG=Server,WireGuard,Database,CMD +ENV DEBUG=Server,WireGuard,Database,CMD,Firewall ENV PORT=51821 ENV HOST=0.0.0.0 ENV INSECURE=true @@ -33,6 +33,7 @@ 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/patches/unenv.patch b/src/patches/unenv.patch new file mode 100644 index 00000000..fdfc8616 --- /dev/null +++ b/src/patches/unenv.patch @@ -0,0 +1,23 @@ +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 f8ab0dfa..09bdbfe5 100644 --- a/src/pnpm-lock.yaml +++ b/src/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + unenv: 0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d + importers: .: @@ -7739,7 +7742,7 @@ snapshots: seroval: 1.5.4 std-env: 4.1.0 ufo: 1.6.4 - unenv: 2.0.0-rc.24 + unenv: 2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d) 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)) @@ -10850,7 +10853,7 @@ snapshots: ultrahtml: 1.6.0 uncrypto: 0.1.3 unctx: 2.5.0 - unenv: 2.0.0-rc.24 + unenv: 2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d) 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) @@ -12175,7 +12178,7 @@ snapshots: undici-types@7.24.6: {} - unenv@2.0.0-rc.24: + unenv@2.0.0-rc.24(patch_hash=0caa5c5d7b4e6f60d88785861150e490da5445d2c6f3b33d505962721162b87d): dependencies: pathe: 2.0.3 diff --git a/src/pnpm-workspace.yaml b/src/pnpm-workspace.yaml index 955b8fc3..ff78df69 100644 --- a/src/pnpm-workspace.yaml +++ b/src/pnpm-workspace.yaml @@ -4,3 +4,5 @@ allowBuilds: esbuild: false unrs-resolver: false vue-demi: false +patchedDependencies: + unenv: patches/unenv.patch