Skip to content

Feature/nginx js - #64

Merged
unilynx merged 10 commits into
mainfrom
feature/nginx-js
Oct 16, 2026
Merged

unilynx merged 10 commits into
mainfrom
feature/nginx-js

Conversation

@unilynx

@unilynx unilynx commented Oct 14, 2026

Copy link
Copy Markdown
Member

a series of nginxjs features. does not activate yet, that requires starting WebHare as specified in the docs

@unilynx
unilynx requested a review from a team October 14, 2026 14:42
webharebot[bot]
webharebot Bot previously approved these changes Oct 14, 2026

@webharebot webharebot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.

@unilynx
unilynx marked this pull request as draft October 15, 2026 10:01
@unilynx

unilynx commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

Should target post 6.1

@blexrob

blexrob commented Oct 15, 2026

Copy link
Copy Markdown
Member

DeepSeek 4.1 review:

 Key high-severity:
 - A. Static files served by nginx bypass WebHare's rule/access system (auth, IP allow/deny, forcehttps, redirects, HSTS/addheaders, force_content_type, fixcase). Security + functional.
 - B. wh apply config / CI: TESTFW_WEBHARE_WEBSERVER doesn't reach the container build → nginx module not built → runtime nginxjs fails. (probable, medium confidence)
 - C. dataroot: null for unknown hosts + no default domain → empty root/cert. Potential info leak / broken SSL.

 Medium:
 - Cert model divergence (keystore-by-host vs port keypair) + staleness (60m cache, no invalidation on cert change/renew; wh apply nginx not triggered by webserver config changes).
 - getFileRoute reads the entire file for every .shtml/index.html request (nocache) — perf; also JSON.parse of the whole remainder is fragile.
 - index index.shtml index.html; order reversed vs WebHare's ["index.html","index.shtml"]; custom defaultpages ignored.
 - A/B test pages return 500 (FIXME).
 - Port selection: skips non-virtualhost ports (rescue) but includes internal trusted ports (-2/-3/-7/-8) — verify intent.
 - Connection: close set for all proxied requests (upstream keepalive disabled).
 - Build fragility: module tied to installed nginx version, not rebuilt on nginx upgrade; builds njs in-tree.

 Low/nits:
 - Makefile duplicate $(SRCDIR)/vendor/setup-nginx.sh dependency.
 - Brewfile brew "PCRE" casing (likely should be pcre); git redundant; pcre+pcre2 both.
 - setup-nginx.sh no trailing newline; NJS_QUICKJS=YES redundant.
 - Router comment about readFileSync/utf8 misleading.
 - console.log(e) in error path (should be console.error).
 - getFileRoute nocache unnecessary; js_var $file_redirect empty-string edge cases.
 - getLogTimestamp NaN edge case.
 - webserver.ts .ts extension import inconsistent with nginx.ts.
 - doc/nginx.md minimal.
 - sanitizeHost rejects underscores.

# Conflicts:
#	whtree/package-lock.json
#	whtree/package.json
…ebserver (if js=false, we return 403 if js=true because we still want to attach a direct JS webserver for those)
we don't seem to need an explicit .whsock extension expectation anymore
@unilynx

unilynx commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Most missing functionality is intentional at this stage. It's not production ready yet. I've move these remarks to https://gitlab.webhare.com/webharebv/codekloppers/-/work_items/1374 as it's a nice checklist

At this point the question is - is there anything in the PR that affects WebHare if you didn't optin using WEBHARE_WEBSERVER=nginxjs

webharebot[bot]
webharebot Bot previously approved these changes Oct 16, 2026

@webharebot webharebot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.

@unilynx
unilynx marked this pull request as ready for review October 16, 2026 10:48
@unilynx
unilynx requested a review from blexrob October 16, 2026 10:48
Comment thread doc/nginx.md Outdated

@webharebot webharebot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.

@unilynx
unilynx merged commit 6c559af into main Oct 16, 2026
31 checks passed
@unilynx
unilynx deleted the feature/nginx-js branch October 16, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants