Refactor project to transition from Rust backend to Node.js with Fastify; update Dockerfile and Docker configurations for new build process; enhance local development instructions in CONTRIBUTING.md; implement health checks in Docker Compose; update pnpm-lock.yaml with new dependencies for API and shared packages; revise README.md to reflect new stack and development setup.
Build, Test, and Push CFDM Docker Image / test (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / create-release (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / test (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / build-and-push (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / create-release (push) Has been cancelled
Build, Test, and Push CFDM Docker Image / update-wiki (push) Has been cancelled
This commit is contained in:
1 parent
0a0a1a92f1
commit
d11414666f
2065 files changed
+15782
-16699
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import { readFileSync, existsSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { buildApp } from "./app.js";
|
||||
import { loadConfig } from "./config.js";
|
||||
|
||||
for (const path of [
|
||||
resolve(import.meta.dirname, "../../../.env"),
|
||||
".env",
|
||||
"../.env",
|
||||
]) {
|
||||
if (!existsSync(path)) continue;
|
||||
const content = readFileSync(path, "utf-8");
|
||||
for (const line of content.split("\n")) {
|
||||
const trimmed = line.trim();
|
||||
if (!trimmed || trimmed.startsWith("#")) continue;
|
||||
const eq = trimmed.indexOf("=");
|
||||
if (eq === -1) continue;
|
||||
const key = trimmed.slice(0, eq).trim();
|
||||
let value = trimmed.slice(eq + 1).trim();
|
||||
if (
|
||||
(value.startsWith('"') && value.endsWith('"')) ||
|
||||
(value.startsWith("'") && value.endsWith("'"))
|
||||
) {
|
||||
value = value.slice(1, -1);
|
||||
}
|
||||
if (!(key in process.env)) process.env[key] = value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
const config = loadConfig();
|
||||
|
||||
if (!config.cloudflareApiToken) {
|
||||
console.warn(
|
||||
"CLOUDFLARE_API_TOKEN не задан — импорт доменов из Cloudflare недоступен",
|
||||
);
|
||||
}
|
||||
|
||||
const app = await buildApp({ config });
|
||||
|
||||
try {
|
||||
await app.listen({ port: config.serverPort, host: "0.0.0.0" });
|
||||
app.log.info(`listening on ${config.serverPort}`);
|
||||
} catch (err) {
|
||||
app.log.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in new issue
Block a user