Skip to content

Hosting with Active Directory login

The documentation site is static HTML (Astro build). Active Directory login is handled by a small Node.js server in server/ that serves dist/ only after a successful AD bind — the same approach as HomeOwnerPortal-Node-2026/server/src/utils/ldap.js.

CommandAuthUse when
npm run devNoneWriting or editing docs (Astro hot reload)
npm run startAD (or dev bypass)How you run the site for staff — build + protected server

npm run start runs npm run build, then node server/src/index.js.

Terminal window
cd /path/to/sdc-docs
npm install
npm run server:install
cp server/.env.example server/.env
# Edit server/.env — set LDAP_SERVER and SESSION_SECRET
npm run start

Open http://127.0.0.1:4321/ — you will be redirected to Sign in unless already authenticated.

Copy server/.env.example to server/.env:

VariableRequiredDescription
LDAP_SERVERYes (prod)AD domain controller hostname, e.g. dc01.thesmartbuilder.local
LDAP_PORTNoDefault 389 (use 636 with LDAP_USE_TLS=true)
LDAP_URLNoFull URL override, e.g. ldaps://dc01.example:636
SESSION_SECRETYes (prod)Random string — openssl rand -hex 64
PORTNoDefault 4321
NODE_ENVNoSet production when deployed
AUTH_DISABLEDNotrue only for local dev without AD — never in production

Use the same LDAP_SERVER values as the Home Owner Portal Node server (HomeOwnerPortal-Node-2026/server/.env).

  • Accounts with a @smithdouglas.com UPN (or username without @ — the server appends @smithdouglas.com).
  • Password is validated with an LDAP bind using that UPN (same as Workplace / SMART).

Homeowner WebUser table login is not used for this site.

Use Sign out in the top bar (visible only when the auth server is in use), or POST /api/auth/logout.

package-local.ps1 still packages Caddy + static files with no login — useful for quick offline copies on a laptop.

For AD-protected hosting on a shared server:

  1. npm run build
  2. Run node server/src/index.js (or a process manager) on the host that can reach your domain controllers.
  3. Put HTTPS in front (IIS ARR, reverse proxy, etc.) and set TRUST_PROXY=1 if needed.
SymptomCheck
Active Directory is not configuredLDAP_SERVER in server/.env
Invalid credentialsUPN format, password, VPN, firewall to DC
Redirect loopSESSION_SECRET set; cookies allowed; HTTPS secure cookie in prod
dist/ not foundRun npm run build first

Health check (no auth): GET /api/health