← back to Rentv
rentv-v1: gate behind Basic Auth (admin + Boomer)
a23b73f1ba6d65a84dacd76194911e7988d38121 · 2026-07-17 11:46:24 -0700 · Steve
Files touched
M data/news.jsonM server.js
Diff
commit a23b73f1ba6d65a84dacd76194911e7988d38121
Author: Steve <steve@designerwallcoverings.com>
Date: Fri Jul 17 11:46:24 2026 -0700
rentv-v1: gate behind Basic Auth (admin + Boomer)
---
data/news.json | 2 +-
server.js | 14 ++++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/data/news.json b/data/news.json
index d1e84e20..57a54f7c 100644
--- a/data/news.json
+++ b/data/news.json
@@ -1,6 +1,6 @@
{
"source": "rentv.com — live",
- "fetched_at": "2026-07-17T18:17:25.250Z",
+ "fetched_at": "2026-07-17T18:39:53.101Z",
"count": 30,
"items": [
{
diff --git a/server.js b/server.js
index 578f049f..0afa1df0 100644
--- a/server.js
+++ b/server.js
@@ -1,10 +1,20 @@
'use strict';
-// rentv-v1 — PUBLIC end-user CRE-news site (The Wire concept) on LIVE rentv.com data.
+// rentv-v1 — gated live-data CRE-news site (The Wire concept) on LIVE rentv.com data.
const fs = require('fs'); const path = require('path'); const express = require('express');
const app = express(); const PORT = process.env.PORT || 9704;
const DATA = path.join(__dirname, 'data');
const readJSON = (f, fb) => { try { return JSON.parse(fs.readFileSync(path.join(DATA, f), 'utf8')); } catch { return fb; } };
+
+// Basic Auth gate (unified + client logins). Health stays open for deploy smoke-tests.
+const CREDS = ['admin:DW2024!', 'Boomer:Rentv2024!']
+ .concat((process.env.BASIC_AUTH_EXTRA || '').split(',').map(s => s.trim()).filter(Boolean));
+const ACCEPTED = new Set(CREDS.map(c => 'Basic ' + Buffer.from(c).toString('base64')));
app.get('/api/health', (_q, r) => r.json({ ok: true, at: new Date().toISOString() }));
+app.use((req, res, next) => {
+ if (ACCEPTED.has(req.headers.authorization || '')) return next();
+ res.set('WWW-Authenticate', 'Basic realm="RENTV v1"');
+ return res.status(401).send('Authentication required');
+});
app.get('/api/news', (_q, r) => { r.set('Cache-Control', 'public, max-age=120'); r.json(readJSON('news.json', { items: [] })); });
app.use(express.static(path.join(__dirname, 'public'), { extensions: ['html'] }));
-app.listen(PORT, () => console.log('rentv-v1 (public, live data) on ' + PORT));
+app.listen(PORT, () => console.log('rentv-v1 (gated, live data) on ' + PORT));
← b143d490 rentv-v1: public live-data CRE-news site + 20-min news engin
·
back to Rentv
·
auto-save: 2026-07-17T12:16:30 (1 files) — data/news.json 374fcffe →