mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
...
This commit is contained in:
1 parent
b068e3e95c
commit
5b4d1b0aa3
7 files changed
+22
-10
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ COPY --from=builder --chown=10001:10001 /app ./
|
||||
RUN cp /app/docker/openssl.cnf /etc/ssl/openssl.cnf
|
||||
|
||||
ENV OPENSSL_CONF=/etc/ssl/openssl.cnf
|
||||
ENV NODE_OPTIONS="--tls-max-v1.2 --openssl-shared-config"
|
||||
ENV NODE_OPTIONS="--dns-result-order=ipv4first --tls-max-v1.2 --openssl-shared-config"
|
||||
|
||||
RUN chmod +x docker/docker-entrypoint.sh && \
|
||||
mkdir -p /app/storage && chown -R 10001:10001 /app
|
||||
|
||||
@@ -19,7 +19,7 @@ services:
|
||||
environment:
|
||||
- TZ=${TZ:-UTC}
|
||||
- OPENSSL_CONF=/etc/ssl/openssl.cnf
|
||||
- NODE_OPTIONS=--tls-max-v1.2 --openssl-shared-config
|
||||
- NODE_OPTIONS=--dns-result-order=ipv4first --tls-max-v1.2 --openssl-shared-config
|
||||
ports:
|
||||
- "${WEB_PORT:-8080}:80"
|
||||
networks:
|
||||
|
||||
@@ -3,9 +3,9 @@ set -e
|
||||
|
||||
export OPENSSL_CONF="${OPENSSL_CONF:-/etc/ssl/openssl.cnf}"
|
||||
if [ -z "$NODE_OPTIONS" ]; then
|
||||
export NODE_OPTIONS="--tls-max-v1.2 --openssl-shared-config"
|
||||
elif ! echo "$NODE_OPTIONS" | grep -q -- "--tls-max-v1.2"; then
|
||||
export NODE_OPTIONS="--tls-max-v1.2 $NODE_OPTIONS"
|
||||
export NODE_OPTIONS="--dns-result-order=ipv4first --tls-max-v1.2 --openssl-shared-config"
|
||||
elif ! echo "$NODE_OPTIONS" | grep -q -- "--dns-result-order=ipv4first"; then
|
||||
export NODE_OPTIONS="--dns-result-order=ipv4first $NODE_OPTIONS"
|
||||
fi
|
||||
|
||||
CONFIG_FILE="/app/config.json"
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
* graceful shutdown. All boot logic lives in src/core/Bot.mjs.
|
||||
*/
|
||||
|
||||
import dns from "node:dns";
|
||||
dns.setDefaultResultOrder("ipv4first");
|
||||
|
||||
import { logger } from "./src/core/Logger.mjs";
|
||||
import Remix from "./src/core/Bot.mjs";
|
||||
import { initErrorChannel, reportCrash } from "./src/core/ErrorChannel.mjs";
|
||||
|
||||
+3
-3
@@ -17,9 +17,9 @@
|
||||
"redis": "^6.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "node --inspect --tls-max-v1.2 index.mjs --trace-warnings",
|
||||
"start": "node --tls-max-v1.2 index.mjs",
|
||||
"shard": "node --tls-max-v1.2 shard.mjs",
|
||||
"dev": "node --inspect --dns-result-order=ipv4first --tls-max-v1.2 index.mjs --trace-warnings",
|
||||
"start": "node --dns-result-order=ipv4first --tls-max-v1.2 index.mjs",
|
||||
"shard": "node --dns-result-order=ipv4first --tls-max-v1.2 shard.mjs",
|
||||
"migrate": "node settings/migrate.mjs"
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@
|
||||
* its children — never export them manually.
|
||||
*/
|
||||
|
||||
import dns from "node:dns";
|
||||
dns.setDefaultResultOrder("ipv4first");
|
||||
|
||||
import * as fs from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { ShardingManager } from "@fluxerjs/sharding";
|
||||
@@ -108,7 +111,7 @@ const manager = new ShardingManager(entryFile, {
|
||||
respawn,
|
||||
spawnTimeout,
|
||||
spawnDelay,
|
||||
execArgv: ["--tls-max-v1.2"],
|
||||
execArgv: ["--dns-result-order=ipv4first", "--tls-max-v1.2"],
|
||||
});
|
||||
|
||||
manager.on("shardCreate", (shard) => {
|
||||
|
||||
@@ -82,7 +82,13 @@ export function initErrorChannel({ config, client } = {}) {
|
||||
const forwardInfo = cfg.forwardInfo === true;
|
||||
if (!_originals.error) _tapLogger(forwardWarn, forwardInfo);
|
||||
console.info(`[ErrorChannel] Active — forwarding errors${forwardWarn ? " + warnings" : ""}${forwardInfo ? " + info" : ""} to channel ${_channelId}.`);
|
||||
if (cfg.startupMessage !== false) _announceOnce();
|
||||
if (cfg.startupMessage !== false) {
|
||||
if (_client && typeof _client.once === "function") {
|
||||
_client.once("ready", () => _announceOnce());
|
||||
} else {
|
||||
_announceOnce();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user