Spaces:
Runtime error
Runtime error
fix: nuclear HF attempt - full node 18 image + desktop ws impersonation
Browse files- Dockerfile +12 -10
- index.js +9 -2
Dockerfile
CHANGED
|
@@ -1,32 +1,34 @@
|
|
| 1 |
-
FROM node:18
|
| 2 |
|
| 3 |
-
# Install native dependencies
|
| 4 |
USER root
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
libfontconfig1 \
|
| 7 |
libfreetype6 \
|
| 8 |
libpango1.0-0 \
|
| 9 |
libcairo2 \
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
librsvg2-
|
| 14 |
fonts-dejavu-core \
|
|
|
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
USER node
|
| 18 |
WORKDIR /home/node/app
|
| 19 |
|
| 20 |
-
# Copy only package.json to install dependencies
|
| 21 |
COPY --chown=node package.json ./
|
| 22 |
RUN npm install
|
| 23 |
|
| 24 |
COPY --chown=node . .
|
| 25 |
|
| 26 |
-
|
| 27 |
-
EXPOSE 10000
|
| 28 |
|
|
|
|
| 29 |
ENV NODE_ENV=production
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
#
|
| 32 |
CMD ["node", "index.js"]
|
|
|
|
| 1 |
+
FROM node:18
|
| 2 |
|
| 3 |
+
# Install native dependencies and CA certificates
|
| 4 |
USER root
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
libfontconfig1 \
|
| 7 |
libfreetype6 \
|
| 8 |
libpango1.0-0 \
|
| 9 |
libcairo2 \
|
| 10 |
+
libjpeg-dev \
|
| 11 |
+
libpng-dev \
|
| 12 |
+
libgif-dev \
|
| 13 |
+
librsvg2-dev \
|
| 14 |
fonts-dejavu-core \
|
| 15 |
+
ca-certificates \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
USER node
|
| 19 |
WORKDIR /home/node/app
|
| 20 |
|
|
|
|
| 21 |
COPY --chown=node package.json ./
|
| 22 |
RUN npm install
|
| 23 |
|
| 24 |
COPY --chown=node . .
|
| 25 |
|
| 26 |
+
EXPOSE 7860
|
|
|
|
| 27 |
|
| 28 |
+
ENV PORT=7860
|
| 29 |
ENV NODE_ENV=production
|
| 30 |
+
# Hard-force IPv4 and specific TLS settings
|
| 31 |
+
ENV NODE_OPTIONS="--dns-result-order=ipv4first --tls-min-v1.2 --no-warnings"
|
| 32 |
|
| 33 |
+
# Start with a direct script that forces the DNS servers
|
| 34 |
CMD ["node", "index.js"]
|
index.js
CHANGED
|
@@ -53,9 +53,16 @@ const client = new Client({
|
|
| 53 |
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
|
| 54 |
rest: {
|
| 55 |
timeout: 180_000,
|
| 56 |
-
// Use our Ghost Mode agent
|
| 57 |
agent: networkFix.getDispatcher(),
|
| 58 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
});
|
| 60 |
|
| 61 |
console.log(`[*] Discord Client Initialized. Network hijacker will handle redirections.`);
|
|
@@ -1523,7 +1530,7 @@ async function initialize() {
|
|
| 1523 |
fetch(`https://${spaceHost}/healthz`).catch(() => {});
|
| 1524 |
}
|
| 1525 |
// Also ping localhost as fallback
|
| 1526 |
-
fetch(`http://
|
| 1527 |
}, 5 * 60 * 1000); // Every 5 minutes
|
| 1528 |
}
|
| 1529 |
|
|
|
|
| 53 |
partials: [Partials.Message, Partials.Channel, Partials.Reaction],
|
| 54 |
rest: {
|
| 55 |
timeout: 180_000,
|
|
|
|
| 56 |
agent: networkFix.getDispatcher(),
|
| 57 |
},
|
| 58 |
+
// Impersonate a desktop client to bypass firewall connection killing
|
| 59 |
+
ws: {
|
| 60 |
+
properties: {
|
| 61 |
+
os: 'linux',
|
| 62 |
+
browser: 'Discord Client',
|
| 63 |
+
device: 'desktop'
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
});
|
| 67 |
|
| 68 |
console.log(`[*] Discord Client Initialized. Network hijacker will handle redirections.`);
|
|
|
|
| 1530 |
fetch(`https://${spaceHost}/healthz`).catch(() => {});
|
| 1531 |
}
|
| 1532 |
// Also ping localhost as fallback
|
| 1533 |
+
fetch(`http://0.0.0.0:${process.env.PORT || 7860}/healthz`).catch(() => {});
|
| 1534 |
}, 5 * 60 * 1000); // Every 5 minutes
|
| 1535 |
}
|
| 1536 |
|