♻️ validate env and add remote fossorial API as an env variable

This commit is contained in:
Fred KISSIE
2025-11-05 06:54:56 +01:00
parent 03e0e8d9c2
commit a26a441d56
7 changed files with 176 additions and 97 deletions

View File

@@ -6,6 +6,7 @@ import { eq } from "drizzle-orm";
import { configSchema, readConfigFile } from "./readConfigFile";
import { fromError } from "zod-validation-error";
import { build } from "@server/build";
import { pullEnv } from "@app/lib/pullEnv";
export class Config {
private rawConfig!: z.infer<typeof configSchema>;
@@ -149,6 +150,7 @@ export class Config {
public async checkSupporterKey() {
const [key] = await db.select().from(supporterKey).limit(1);
const env = pullEnv();
if (!key) {
return;
@@ -158,7 +160,7 @@ export class Config {
try {
const response = await fetch(
"https://api.fossorial.io/api/v1/license/validate",
`${env.app.fossorialRemoteAPIBaseUrl}/api/v1/license/validate`,
{
method: "POST",
headers: {