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:
@@ -0,0 +1,32 @@
|
||||
import { resolve } from "node:path";
|
||||
|
||||
export interface AppConfig {
|
||||
databaseUrl: string;
|
||||
cloudflareApiToken: string;
|
||||
jwtSecret: string;
|
||||
jwtTtlHours: number;
|
||||
adminUsername: string;
|
||||
adminPasswordHash: string;
|
||||
serverPort: number;
|
||||
staticDir: string | null;
|
||||
certCheckCron: string;
|
||||
logLevel: string;
|
||||
}
|
||||
|
||||
export function loadConfig(): AppConfig {
|
||||
return {
|
||||
databaseUrl: process.env.DATABASE_URL ?? "sqlite:data/app.db",
|
||||
cloudflareApiToken: (process.env.CLOUDFLARE_API_TOKEN ?? "").trim(),
|
||||
jwtSecret: process.env.JWT_SECRET ?? "dev-secret-change-me",
|
||||
jwtTtlHours: Number(process.env.JWT_TTL_HOURS ?? "24") || 24,
|
||||
adminUsername: process.env.ADMIN_USERNAME ?? "admin",
|
||||
adminPasswordHash:
|
||||
process.env.ADMIN_PASSWORD_HASH?.trim() || "devplaceholder",
|
||||
serverPort: Number(process.env.SERVER_PORT ?? "8080") || 8080,
|
||||
staticDir: process.env.STATIC_DIR
|
||||
? resolve(process.env.STATIC_DIR)
|
||||
: null,
|
||||
certCheckCron: process.env.CERT_CHECK_CRON ?? "0 0 */6 * * *",
|
||||
logLevel: process.env.LOG_LEVEL ?? "info",
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user