Barza commited on
Commit
ab51dfd
·
1 Parent(s): 57d6d61

fix: nuclear HF attempt - full node 18 image + desktop ws impersonation

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -10
  2. index.js +9 -2
Dockerfile CHANGED
@@ -1,32 +1,34 @@
1
- FROM node:18-slim
2
 
3
- # Install native dependencies required by @napi-rs/canvas
4
  USER root
5
  RUN apt-get update && apt-get install -y \
6
  libfontconfig1 \
7
  libfreetype6 \
8
  libpango1.0-0 \
9
  libcairo2 \
10
- libjpeg62-turbo \
11
- libpng16-16 \
12
- libgif7 \
13
- librsvg2-2 \
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
- # Render handles the PORT environment variable automatically
27
- EXPOSE 10000
28
 
 
29
  ENV NODE_ENV=production
 
 
30
 
31
- # Standard start command
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://localhost:${process.env.PORT || 7860}/healthz`).catch(() => {});
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