diff --git a/donut-sync/nixpacks.toml b/donut-sync/nixpacks.toml new file mode 100644 index 0000000..c8f3edf --- /dev/null +++ b/donut-sync/nixpacks.toml @@ -0,0 +1,11 @@ +[phases.setup] +nixPkgs = ["nodejs_22"] + +[phases.install] +cmds = ["npm install --include=dev"] + +[phases.build] +cmds = ["npm run build", "npm prune --omit=dev"] + +[start] +cmd = "npm run start:prod" diff --git a/donut-sync/src/main.ts b/donut-sync/src/main.ts index 140b55a..3ac4c61 100644 --- a/donut-sync/src/main.ts +++ b/donut-sync/src/main.ts @@ -2,12 +2,8 @@ import { NestFactory } from "@nestjs/core"; import { AppModule } from "./app.module.js"; function validateEnv() { - const required = ["SYNC_TOKEN"]; - const missing = required.filter((key) => !process.env[key]); - if (missing.length > 0) { - console.error( - `Missing required environment variables: ${missing.join(", ")}`, - ); + if (!process.env.SYNC_TOKEN && !process.env.SYNC_JWT_PUBLIC_KEY) { + console.error("Either SYNC_TOKEN or SYNC_JWT_PUBLIC_KEY must be set"); process.exit(1); } } diff --git a/src-tauri/src/cloud_auth.rs b/src-tauri/src/cloud_auth.rs index 6174909..58f1bb7 100644 --- a/src-tauri/src/cloud_auth.rs +++ b/src-tauri/src/cloud_auth.rs @@ -26,7 +26,7 @@ pub struct CloudUser { pub email: String, pub plan: String, #[serde(rename = "planPeriod")] - pub plan_period: String, + pub plan_period: Option, #[serde(rename = "subscriptionStatus")] pub subscription_status: String, #[serde(rename = "profileLimit")] diff --git a/src/types.ts b/src/types.ts index 40a4e36..553d77d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,7 +40,7 @@ export interface CloudUser { id: string; email: string; plan: string; - planPeriod: string; + planPeriod: string | null; subscriptionStatus: string; profileLimit: number; cloudProfilesUsed: number;