← back to Dandeana Hub
chore: lint, refactor, v1.0.1 (session close)
083458404211f87cb43c53a41065e85598609ba3 · 2026-07-22 12:48:19 -0700 · Steve Abrams
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Files touched
M package-lock.jsonM package.jsonM scripts/pull-parcels.jsM server.js
Diff
commit 083458404211f87cb43c53a41065e85598609ba3
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Jul 22 12:48:19 2026 -0700
chore: lint, refactor, v1.0.1 (session close)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---
package-lock.json | 4 ++--
package.json | 2 +-
scripts/pull-parcels.js | 2 +-
server.js | 13 ++++++++++---
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index b9d63f9..e678f6a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "dandeana-hub",
- "version": "1.0.0",
+ "version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "dandeana-hub",
- "version": "1.0.0",
+ "version": "1.0.1",
"dependencies": {
"express": "^4.19.2"
}
diff --git a/package.json b/package.json
index e0ac120..f49db62 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "dandeana-hub",
- "version": "1.0.0",
+ "version": "1.0.1",
"private": true,
"description": "Private client news hub for the Dandeana Larchmont / Poway Larchmont Street Subdivision project",
"main": "server.js",
diff --git a/scripts/pull-parcels.js b/scripts/pull-parcels.js
index 7f3e9bb..0258e7b 100644
--- a/scripts/pull-parcels.js
+++ b/scripts/pull-parcels.js
@@ -29,7 +29,7 @@ async function pullParcels(DATA) {
acreage: a.ACREAGE,
assessedLand: a.ASR_LAND,
assessedImprovements: a.ASR_IMPR,
- assessedTotal: a.ASR_TOTAL || (a.ASR_LAND + a.ASR_IMPR),
+ assessedTotal: a.ASR_TOTAL || (a.ASR_LAND != null && a.ASR_IMPR != null ? a.ASR_LAND + a.ASR_IMPR : null),
deedDoc: a.DOCNMBR ? `2024/2025 series doc #${a.DOCNMBR}` : null,
deedDocNumber: a.DOCNMBR || null,
deedDate: fmtDocDate(a.DOCDATE),
diff --git a/server.js b/server.js
index 30598d9..008c0ec 100644
--- a/server.js
+++ b/server.js
@@ -9,7 +9,11 @@ const { pullParcels } = require('./scripts/pull-parcels');
const PORT = process.env.PORT || 9917;
const DATA = path.join(__dirname, 'data');
// BASIC_AUTH="user:pass" overrides; default is the client credential pair.
-const [AUTH_USER, AUTH_PASS] = (process.env.BASIC_AUTH || 'dandeana:w3tEgaYeOPDQ').split(':');
+// Split on the FIRST colon only so passwords containing colons are preserved.
+const _rawAuth = process.env.BASIC_AUTH || 'dandeana:w3tEgaYeOPDQ';
+const _authColon = _rawAuth.indexOf(':');
+const AUTH_USER = _rawAuth.slice(0, _authColon);
+const AUTH_PASS = _rawAuth.slice(_authColon + 1);
const app = express();
app.disable('x-powered-by');
@@ -20,7 +24,9 @@ app.use((req, res, next) => {
const hdr = req.headers.authorization || '';
const [scheme, b64] = hdr.split(' ');
if (scheme === 'Basic' && b64) {
- const [u, p] = Buffer.from(b64, 'base64').toString().split(':');
+ const decoded = Buffer.from(b64, 'base64').toString();
+ const ci = decoded.indexOf(':');
+ const u = decoded.slice(0, ci), p = decoded.slice(ci + 1);
if (u === AUTH_USER && p === AUTH_PASS) return next();
}
res.set('WWW-Authenticate', 'Basic realm="Dandeana Private Hub"');
@@ -67,9 +73,10 @@ app.listen(PORT, '127.0.0.1', () => console.log(`dandeana-hub listening on 127.0
// Daily self-refresh so the hub stays current with zero external schedulers.
const DAY = 24 * 60 * 60 * 1000;
+const BOOT_DELAY = 15 * 1000; // wait for process to fully settle before first pull
function dailyPull() {
runRefresh(DATA).catch(e => console.error('scheduled refresh failed:', e.message));
pullParcels(DATA).catch(e => console.error('parcel pull failed:', e.message));
}
setInterval(dailyPull, DAY);
-setTimeout(dailyPull, 15 * 1000);
+setTimeout(dailyPull, BOOT_DELAY);
← adc8144 auto-save: 2026-07-22T12:44:11 (2 files) — data/parcels.json
·
back to Dandeana Hub
·
accept second admin basic-auth pair (admin unified pw) along 72dd3bb →