Air-gap fixes + in-app /docs (README/DEPLOYMENT/api.md/docs/*)
Air-gap:
- DynamicRecord.refreshAll() called getPublicIp() (api.ipify.org,
icanhazip.com, ifconfig.me) every 4h on a timer regardless of
whether any dynamic records were configured -- the one background
call in the repo not actually gated by feature use. Now skips the
lookup entirely when there's nothing to refresh.
- Removed the stray, unauthenticated GET /test page (a leftover
jq-repeat demo) that loaded jQuery + Mustache from external CDNs.
- Removed a dead IE<9-only html5shim script tag pointing at a domain
that no longer resolves.
Docs:
- New GET /docs (index) and /docs/:slug routes render this project's
own README, DEPLOYMENT, api.md, and docs/*.md server-side via
marked (new dependency) -- so the documentation is readable from
the running app with no route to GitHub Pages, where it otherwise
only lives. Public, no auth, same tier as the health endpoint.
- .dockerignore/Dockerfile updated: docs/, DEPLOYMENT.md, and
nodejs/api.md were previously excluded from the image entirely
("served via GitHub Pages, not from the image") -- now copied in
alongside README.md/tos.md-style, since they're needed at runtime.
This commit is contained in:
@@ -76,8 +76,17 @@ class DynamicRecord extends Table{
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve the public IP once, then reconcile every record to it.
|
||||
// Resolve the public IP once, then reconcile every record to it. Checked
|
||||
// BEFORE the public-IP lookup: on a stock install with zero dynamic
|
||||
// records configured, this runs on a timer regardless (services/dynamic_dns.js)
|
||||
// -- without this guard it would still reach out to the public-IP
|
||||
// resolvers (utils/public_ip.js) every cycle for nothing, which is
|
||||
// exactly the kind of always-on external call an air-gapped deployment
|
||||
// can't have.
|
||||
static async refreshAll(){
|
||||
let records = await this.listDetail();
|
||||
if(!records.length) return {count: 0};
|
||||
|
||||
let ip;
|
||||
try{
|
||||
ip = await getPublicIp();
|
||||
@@ -86,7 +95,6 @@ class DynamicRecord extends Table{
|
||||
return {error: error.message};
|
||||
}
|
||||
|
||||
let records = await this.listDetail();
|
||||
for(let record of records){
|
||||
await record.apply(ip);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user