Skip to content

local-prod-nginx: honor --port and accept 401 as hub readiness - #620

Merged
shikokuchuo merged 2 commits into
mainfrom
fix/local-prod-nginx-port-auth
Aug 27, 2026
Merged

local-prod-nginx: honor --port and accept 401 as hub readiness#620
shikokuchuo merged 2 commits into
mainfrom
fix/local-prod-nginx-port-auth

Conversation

@shikokuchuo

Copy link
Copy Markdown
Member

Motivation: running npm run local-prod:nginx locally with auth (OIDC_CLIENT_ID set in the shell, so the hub enables OIDC) stalled at Hub health check failed after 10 attempts. With auth on, /health requires credentials and returns 401, so the curl -f readiness check could never pass — even though the hub was up.

  • --port N now works for the nginx variant, parsed via the shared local-prod-port.mjs and substituted into the generated nginx config (NGINX_PORT placeholder, like DIST_PATH)
  • Hub readiness is now "any HTTP response", so a 401 from an auth-enabled hub counts as up; the script logs when auth is enabled via the environment
  • Regression tests in scripts/local-prod-port.test.mjs; READMEs + hub-client changelog updated

Two fixes for 'npm run local-prod:nginx':

- '--port N' now works like plain local-prod: the port is parsed via
  the shared local-prod-port.mjs and substituted into the generated
  nginx config (config/local-nginx.conf gains an NGINX_PORT
  placeholder, like DIST_PATH).
- The hub readiness check no longer uses 'curl -f': with
  OIDC_CLIENT_ID set in the environment the hub enables auth and
  /health returns 401, so the -f check could never pass even though
  the hub was up. Any HTTP response now counts as ready, and the
  script logs when auth is enabled via the environment.

Tests: scripts/local-prod-port.test.mjs covers the --port parity and
the 401-tolerant readiness check. Docs updated in hub-client/README.md
and scripts/README.md.
@posit-snyk-bot

posit-snyk-bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@shikokuchuo
shikokuchuo merged commit 00a1c17 into main Aug 27, 2026
10 checks passed
@shikokuchuo
shikokuchuo deleted the fix/local-prod-nginx-port-auth branch August 27, 2026 11:52
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