Allow non-SSL postgres to support supabase
This commit is contained in:
parent
9d7c9de555
commit
0d88437034
@ -1,7 +1,9 @@
|
|||||||
|
import { POSTGRES_SSL_ENABLED } from '@/site/config';
|
||||||
import { Pool, QueryResult, QueryResultRow } from 'pg';
|
import { Pool, QueryResult, QueryResultRow } from 'pg';
|
||||||
|
|
||||||
const pool = new Pool({
|
const pool = new Pool({
|
||||||
connectionString: process.env.POSTGRES_URL,
|
connectionString: process.env.POSTGRES_URL,
|
||||||
|
...POSTGRES_SSL_ENABLED && { ssl: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
export type Primitive = string | number | boolean | undefined | null;
|
export type Primitive = string | number | boolean | undefined | null;
|
||||||
|
|||||||
@ -52,7 +52,8 @@ export const SITE_DESCRIPTION =
|
|||||||
// STORAGE: DATABASE
|
// STORAGE: DATABASE
|
||||||
export const HAS_DATABASE =
|
export const HAS_DATABASE =
|
||||||
(process.env.POSTGRES_URL ?? '').length > 0;
|
(process.env.POSTGRES_URL ?? '').length > 0;
|
||||||
|
export const POSTGRES_SSL_ENABLED =
|
||||||
|
process.env.DISABLE_POSTGRES_SSL === '1' ? false : true;
|
||||||
// STORAGE: VERCEL KV
|
// STORAGE: VERCEL KV
|
||||||
export const HAS_VERCEL_KV =
|
export const HAS_VERCEL_KV =
|
||||||
(process.env.KV_URL ?? '').length > 0;
|
(process.env.KV_URL ?? '').length > 0;
|
||||||
@ -133,6 +134,7 @@ export const HIGH_DENSITY_GRID = GRID_ASPECT_RATIO <= 1;
|
|||||||
|
|
||||||
export const CONFIG_CHECKLIST_STATUS = {
|
export const CONFIG_CHECKLIST_STATUS = {
|
||||||
hasDatabase: HAS_DATABASE,
|
hasDatabase: HAS_DATABASE,
|
||||||
|
isPostgresSSLEnabled: POSTGRES_SSL_ENABLED,
|
||||||
hasVercelKV: HAS_VERCEL_KV,
|
hasVercelKV: HAS_VERCEL_KV,
|
||||||
hasVercelBlobStorage: HAS_VERCEL_BLOB_STORAGE,
|
hasVercelBlobStorage: HAS_VERCEL_BLOB_STORAGE,
|
||||||
hasCloudflareR2Storage: HAS_CLOUDFLARE_R2_STORAGE,
|
hasCloudflareR2Storage: HAS_CLOUDFLARE_R2_STORAGE,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user