Compare commits

...

3 Commits

Author SHA1 Message Date
lilleman aa9fb8535b Refuse a malformed admin DSN before postgres 4 connects to the host it misreads
CI / full-gate (push) Successful in 4m33s
2026-11-08 23:17:54 +01:00
renovate-bot 79eca6a0c7 Update dependency postgres to v4
Release-Bump: major
2026-11-08 23:17:51 +01:00
renovate-bot 58f85baa8f Update dependency ejs to v7
CI / full-gate (push) Successful in 3m44s
Mirror / github-mirror (push) Successful in 4s
Release-Bump: major
2026-11-08 23:04:31 +01:00
3 changed files with 12 additions and 11 deletions
+9 -9
View File
@@ -7,9 +7,9 @@
"name": "plainpages", "name": "plainpages",
"dependencies": { "dependencies": {
"@larvit/log": "2.3.0", "@larvit/log": "2.3.0",
"ejs": "6.0.1", "ejs": "7.0.2",
"lucide-static": "1.70.0", "lucide-static": "1.70.0",
"postgres": "3.4.9" "postgres": "4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@mdn/browser-compat-data": "8.1.8", "@mdn/browser-compat-data": "8.1.8",
@@ -409,9 +409,9 @@
} }
}, },
"node_modules/ejs": { "node_modules/ejs": {
"version": "6.0.1", "version": "7.0.2",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-6.0.1.tgz", "resolved": "https://registry.npmjs.org/ejs/-/ejs-7.0.2.tgz",
"integrity": "sha512-UaaM14yby8U3k02ihS1Bmj5Kz2d7CCQM1scxpgs4Mhkq8F1wR2gl3+Ts4h5Ne4Mnt7M9m4Dw7jsuMr3+xO4vZA==", "integrity": "sha512-LcDSEP6Oclb9sTiSyG0MpG0RuKvLDRxCOOt+2sIk+kdk1rMkFU8SRnT0qaNt5zvU0LOV1YXXOvIoZL/sKwabvw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
"ejs": "bin/cli.js" "ejs": "bin/cli.js"
@@ -427,12 +427,12 @@
"license": "ISC" "license": "ISC"
}, },
"node_modules/postgres": { "node_modules/postgres": {
"version": "3.4.9", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.9.tgz", "resolved": "https://registry.npmjs.org/postgres/-/postgres-4.1.0.tgz",
"integrity": "sha512-GD3qdB0x1z9xgFI6cdRD6xu2Sp2WCOEoe3mtnyB5Ee0XrrL5Pe+e4CCnJrRMnL1zYtRDZmQQVbvOttLnKDLnaw==", "integrity": "sha512-s+0WH67YAyLdBQUb6XczbziBhY+C9uiQsg9S8R5RHdZhk6sdyK6202E+T2tXpiInSEEjDLRSJ3OpYBe3PN6MsQ==",
"license": "Unlicense", "license": "Unlicense",
"engines": { "engines": {
"node": ">=12" "node": ">=18"
}, },
"funding": { "funding": {
"type": "individual", "type": "individual",
+2 -2
View File
@@ -17,9 +17,9 @@
}, },
"dependencies": { "dependencies": {
"@larvit/log": "2.3.0", "@larvit/log": "2.3.0",
"ejs": "6.0.1", "ejs": "7.0.2",
"lucide-static": "1.70.0", "lucide-static": "1.70.0",
"postgres": "3.4.9" "postgres": "4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@mdn/browser-compat-data": "8.1.8", "@mdn/browser-compat-data": "8.1.8",
+1
View File
@@ -20,6 +20,7 @@ export interface ProvisionResult {
// so it is swallowed here. The driver, not `new URL`, decides what parses: it takes a multi-host DSN. // so it is swallowed here. The driver, not `new URL`, decides what parses: it takes a multi-host DSN.
function connect(adminUrl: string): ReturnType<typeof postgres> { function connect(adminUrl: string): ReturnType<typeof postgres> {
try { try {
new URL(adminUrl); // postgres 4 connects to whatever a malformed DSN parses to, and its error names that host
return postgres(adminUrl, { connect_timeout: 10, max: 1 }); return postgres(adminUrl, { connect_timeout: 10, max: 1 });
} catch { } catch {
throw new Error("PLUGIN_DB_ADMIN_URL must be a Postgres URL (its value is not shown; percent-encode special characters in a password)"); throw new Error("PLUGIN_DB_ADMIN_URL must be a Postgres URL (its value is not shown; percent-encode special characters in a password)");