mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: use ! syntax instead of || ""
This commit is contained in:
@@ -10,7 +10,7 @@ import { AlertTriangle, CheckIcon, MinusIcon, PlusIcon } from "lucide-react";
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
|
|
||||||
const stripePromise = loadStripe(
|
const stripePromise = loadStripe(
|
||||||
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY || "",
|
process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const calculatePrice = (count: number, isAnnual = false) => {
|
export const calculatePrice = (count: number, isAnnual = false) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { drizzle } from "drizzle-orm/postgres-js";
|
|||||||
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
||||||
import postgres from "postgres";
|
import postgres from "postgres";
|
||||||
|
|
||||||
const connectionString = process.env.DATABASE_URL || "";
|
const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
const sql = postgres(connectionString, { max: 1 });
|
const sql = postgres(connectionString, { max: 1 });
|
||||||
const db = drizzle(sql);
|
const db = drizzle(sql);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { asc, eq } from "drizzle-orm";
|
|||||||
import type { NextApiRequest, NextApiResponse } from "next";
|
import type { NextApiRequest, NextApiResponse } from "next";
|
||||||
import Stripe from "stripe";
|
import Stripe from "stripe";
|
||||||
|
|
||||||
const endpointSecret = process.env.STRIPE_WEBHOOK_SECRET || "";
|
const endpointSecret = process.env.STRIPE_WEBHOOK_SECRET!;
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
api: {
|
api: {
|
||||||
@@ -21,7 +21,7 @@ export default async function handler(
|
|||||||
if (!endpointSecret) {
|
if (!endpointSecret) {
|
||||||
return res.status(400).send("Webhook Error: Missing Stripe Secret Key");
|
return res.status(400).send("Webhook Error: Missing Stripe Secret Key");
|
||||||
}
|
}
|
||||||
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
|
||||||
apiVersion: "2024-09-30.acacia",
|
apiVersion: "2024-09-30.acacia",
|
||||||
maxNetworkRetries: 3,
|
maxNetworkRetries: 3,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -272,12 +272,12 @@ export const authRouter = createTRPCRouter({
|
|||||||
|
|
||||||
const email = await sendEmailNotification(
|
const email = await sendEmailNotification(
|
||||||
{
|
{
|
||||||
fromAddress: process.env.SMTP_FROM_ADDRESS || "",
|
fromAddress: process.env.SMTP_FROM_ADDRESS!,
|
||||||
toAddresses: [authR.email],
|
toAddresses: [authR.email],
|
||||||
smtpServer: process.env.SMTP_SERVER || "",
|
smtpServer: process.env.SMTP_SERVER!,
|
||||||
smtpPort: Number(process.env.SMTP_PORT),
|
smtpPort: Number(process.env.SMTP_PORT),
|
||||||
username: process.env.SMTP_USERNAME || "",
|
username: process.env.SMTP_USERNAME!,
|
||||||
password: process.env.SMTP_PASSWORD || "",
|
password: process.env.SMTP_PASSWORD!,
|
||||||
},
|
},
|
||||||
"Reset Password",
|
"Reset Password",
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const stripeRouter = createTRPCRouter({
|
|||||||
const admin = await findAdminById(ctx.user.adminId);
|
const admin = await findAdminById(ctx.user.adminId);
|
||||||
const stripeCustomerId = admin.stripeCustomerId;
|
const stripeCustomerId = admin.stripeCustomerId;
|
||||||
|
|
||||||
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
|
||||||
apiVersion: "2024-09-30.acacia",
|
apiVersion: "2024-09-30.acacia",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ export const stripeRouter = createTRPCRouter({
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.mutation(async ({ ctx, input }) => {
|
.mutation(async ({ ctx, input }) => {
|
||||||
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
|
||||||
apiVersion: "2024-09-30.acacia",
|
apiVersion: "2024-09-30.acacia",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ export const stripeRouter = createTRPCRouter({
|
|||||||
}
|
}
|
||||||
const stripeCustomerId = admin.stripeCustomerId;
|
const stripeCustomerId = admin.stripeCustomerId;
|
||||||
|
|
||||||
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || "", {
|
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
|
||||||
apiVersion: "2024-09-30.acacia",
|
apiVersion: "2024-09-30.acacia",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default defineConfig({
|
|||||||
schema: "./server/db/schema/index.ts",
|
schema: "./server/db/schema/index.ts",
|
||||||
dialect: "postgresql",
|
dialect: "postgresql",
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
url: process.env.DATABASE_URL || "",
|
url: process.env.DATABASE_URL!,
|
||||||
},
|
},
|
||||||
out: "drizzle",
|
out: "drizzle",
|
||||||
migrations: {
|
migrations: {
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ declare global {
|
|||||||
|
|
||||||
export let db: PostgresJsDatabase<typeof schema>;
|
export let db: PostgresJsDatabase<typeof schema>;
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
db = drizzle(postgres(process.env.DATABASE_URL || ""), {
|
db = drizzle(postgres(process.env.DATABASE_URL!), {
|
||||||
schema,
|
schema,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!global.db)
|
if (!global.db)
|
||||||
global.db = drizzle(postgres(process.env.DATABASE_URL || ""), {
|
global.db = drizzle(postgres(process.env.DATABASE_URL!), {
|
||||||
schema,
|
schema,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { drizzle } from "drizzle-orm/postgres-js";
|
|||||||
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
||||||
import postgres from "postgres";
|
import postgres from "postgres";
|
||||||
|
|
||||||
const connectionString = process.env.DATABASE_URL || "";
|
const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
const sql = postgres(connectionString, { max: 1 });
|
const sql = postgres(connectionString, { max: 1 });
|
||||||
const db = drizzle(sql);
|
const db = drizzle(sql);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { sql } from "drizzle-orm";
|
|||||||
import { drizzle } from "drizzle-orm/postgres-js";
|
import { drizzle } from "drizzle-orm/postgres-js";
|
||||||
import postgres from "postgres";
|
import postgres from "postgres";
|
||||||
|
|
||||||
const connectionString = process.env.DATABASE_URL || "";
|
const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
const pg = postgres(connectionString, { max: 1 });
|
const pg = postgres(connectionString, { max: 1 });
|
||||||
const db = drizzle(pg);
|
const db = drizzle(pg);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { drizzle } from "drizzle-orm/postgres-js";
|
|||||||
import postgres from "postgres";
|
import postgres from "postgres";
|
||||||
import { users } from "./schema";
|
import { users } from "./schema";
|
||||||
|
|
||||||
const connectionString = process.env.DATABASE_URL || "";
|
const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
const pg = postgres(connectionString, { max: 1 });
|
const pg = postgres(connectionString, { max: 1 });
|
||||||
const db = drizzle(pg);
|
const db = drizzle(pg);
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ export const WEBSITE_URL =
|
|||||||
? "http://localhost:3000"
|
? "http://localhost:3000"
|
||||||
: process.env.SITE_URL;
|
: process.env.SITE_URL;
|
||||||
|
|
||||||
const BASE_PRICE_MONTHLY_ID = process.env.BASE_PRICE_MONTHLY_ID || ""; // $4.00
|
const BASE_PRICE_MONTHLY_ID = process.env.BASE_PRICE_MONTHLY_ID!; // $4.00
|
||||||
|
|
||||||
const BASE_ANNUAL_MONTHLY_ID = process.env.BASE_ANNUAL_MONTHLY_ID || ""; // $7.99
|
const BASE_ANNUAL_MONTHLY_ID = process.env.BASE_ANNUAL_MONTHLY_ID!; // $7.99
|
||||||
|
|
||||||
export const getStripeItems = (serverQuantity: number, isAnnual: boolean) => {
|
export const getStripeItems = (serverQuantity: number, isAnnual: boolean) => {
|
||||||
const items = [];
|
const items = [];
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import IORedis from "ioredis";
|
|||||||
import { logger } from "./logger";
|
import { logger } from "./logger";
|
||||||
import type { QueueJob } from "./schema";
|
import type { QueueJob } from "./schema";
|
||||||
|
|
||||||
export const connection = new IORedis(process.env.REDIS_URL || "", {
|
export const connection = new IORedis(process.env.REDIS_URL!, {
|
||||||
maxRetriesPerRequest: null,
|
maxRetriesPerRequest: null,
|
||||||
});
|
});
|
||||||
export const jobQueue = new Queue("backupQueue", {
|
export const jobQueue = new Queue("backupQueue", {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default defineConfig({
|
|||||||
schema: "./server/db/schema/index.ts",
|
schema: "./server/db/schema/index.ts",
|
||||||
dialect: "postgresql",
|
dialect: "postgresql",
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
url: process.env.DATABASE_URL || "",
|
url: process.env.DATABASE_URL!,
|
||||||
},
|
},
|
||||||
out: "drizzle",
|
out: "drizzle",
|
||||||
migrations: {
|
migrations: {
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ declare global {
|
|||||||
|
|
||||||
export let db: PostgresJsDatabase<typeof schema>;
|
export let db: PostgresJsDatabase<typeof schema>;
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
db = drizzle(postgres(process.env.DATABASE_URL || ""), {
|
db = drizzle(postgres(process.env.DATABASE_URL!), {
|
||||||
schema,
|
schema,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!global.db)
|
if (!global.db)
|
||||||
global.db = drizzle(postgres(process.env.DATABASE_URL || ""), {
|
global.db = drizzle(postgres(process.env.DATABASE_URL!), {
|
||||||
schema,
|
schema,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// import { migrate } from "drizzle-orm/postgres-js/migrator";
|
// import { migrate } from "drizzle-orm/postgres-js/migrator";
|
||||||
// import postgres from "postgres";
|
// import postgres from "postgres";
|
||||||
|
|
||||||
// const connectionString = process.env.DATABASE_URL || "";
|
// const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
// const sql = postgres(connectionString, { max: 1 });
|
// const sql = postgres(connectionString, { max: 1 });
|
||||||
// const db = drizzle(sql);
|
// const db = drizzle(sql);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { sql } from "drizzle-orm";
|
|||||||
import { drizzle } from "drizzle-orm/postgres-js";
|
import { drizzle } from "drizzle-orm/postgres-js";
|
||||||
import postgres from "postgres";
|
import postgres from "postgres";
|
||||||
|
|
||||||
const connectionString = process.env.DATABASE_URL || "";
|
const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
const pg = postgres(connectionString, { max: 1 });
|
const pg = postgres(connectionString, { max: 1 });
|
||||||
const db = drizzle(pg);
|
const db = drizzle(pg);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// import postgres from "postgres";
|
// import postgres from "postgres";
|
||||||
// import { users } from "./schema";
|
// import { users } from "./schema";
|
||||||
|
|
||||||
// const connectionString = process.env.DATABASE_URL || "";
|
// const connectionString = process.env.DATABASE_URL!;
|
||||||
|
|
||||||
// const pg = postgres(connectionString, { max: 1 });
|
// const pg = postgres(connectionString, { max: 1 });
|
||||||
// const db = drizzle(pg);
|
// const db = drizzle(pg);
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ interface NotionMagicLinkEmailProps {
|
|||||||
loginCode?: string;
|
loginCode?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseUrl = process.env.VERCEL_URL
|
const baseUrl = process.env.VERCEL_URL!
|
||||||
? `https://${process.env.VERCEL_URL}`
|
|
||||||
: "";
|
|
||||||
|
|
||||||
export const NotionMagicLinkEmail = ({
|
export const NotionMagicLinkEmail = ({
|
||||||
loginCode,
|
loginCode,
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ interface PlaidVerifyIdentityEmailProps {
|
|||||||
validationCode?: string;
|
validationCode?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseUrl = process.env.VERCEL_URL
|
const baseUrl = process.env.VERCEL_URL!
|
||||||
? `https://${process.env.VERCEL_URL}`
|
|
||||||
: "";
|
|
||||||
|
|
||||||
export const PlaidVerifyIdentityEmail = ({
|
export const PlaidVerifyIdentityEmail = ({
|
||||||
validationCode,
|
validationCode,
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ import {
|
|||||||
} from "@react-email/components";
|
} from "@react-email/components";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
const baseUrl = process.env.VERCEL_URL
|
const baseUrl = process.env.VERCEL_URL!
|
||||||
? `https://${process.env.VERCEL_URL}`
|
|
||||||
: "";
|
|
||||||
|
|
||||||
export const StripeWelcomeEmail = () => (
|
export const StripeWelcomeEmail = () => (
|
||||||
<Html>
|
<Html>
|
||||||
|
|||||||
@@ -29,9 +29,7 @@ interface VercelInviteUserEmailProps {
|
|||||||
inviteFromLocation?: string;
|
inviteFromLocation?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseUrl = process.env.VERCEL_URL
|
const baseUrl = process.env.VERCEL_URL!
|
||||||
? `https://${process.env.VERCEL_URL}`
|
|
||||||
: "";
|
|
||||||
|
|
||||||
export const VercelInviteUserEmail = ({
|
export const VercelInviteUserEmail = ({
|
||||||
username,
|
username,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import type { FileConfig } from "../utils/traefik/file-types";
|
|||||||
import type { MainTraefikConfig } from "../utils/traefik/types";
|
import type { MainTraefikConfig } from "../utils/traefik/types";
|
||||||
|
|
||||||
const TRAEFIK_SSL_PORT =
|
const TRAEFIK_SSL_PORT =
|
||||||
Number.parseInt(process.env.TRAEFIK_SSL_PORT ?? "", 10) || 443;
|
Number.parseInt(process.env.TRAEFIK_SSL_PORT!, 10) || 443;
|
||||||
const TRAEFIK_PORT = Number.parseInt(process.env.TRAEFIK_PORT ?? "", 10) || 80;
|
const TRAEFIK_PORT = Number.parseInt(process.env.TRAEFIK_PORT!, 10) || 80;
|
||||||
|
|
||||||
interface TraefikOptions {
|
interface TraefikOptions {
|
||||||
enableDashboard?: boolean;
|
enableDashboard?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user