Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatdeveloperguy-website / src/engines/seo/crawl/host-config.ts |
| Date | Not specified in source |
| Repository | Janady13/thatdeveloperguy-website |
| Revision | 2bea2ebdff0e34494bff597d4fa9c8422a0c3a94 |
| Branch | main |
| Path or archive member | src/engines/seo/crawl/host-config.ts |
| Original SHA-256 | 2e3014ec7e4afd9afee61336e7d1b382499af2c9d4f953656c2e8ae476fb8de5 |
| Git blob SHA | c8fb610868fd92096d78b5933ec39c42ec8657c7 |
| Reading-copy SHA-256 | 2e3014ec7e4afd9afee61336e7d1b382499af2c9d4f953656c2e8ae476fb8de5 |
Recovered source transcript
Download complete source text ↓15 lines · 1.1 KB
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { robotsHeaderFor, type ReleaseKind } from './robots-policy.ts';
/** Render deploy/nginx/site.conf for a release kind. Staging-only directives (auth gate, noindex header) exist only in the demo render. */
export function renderHostConfig(kind: ReleaseKind, host: string, template = readFileSync(resolve(import.meta.dirname, '../../../../deploy/nginx/site.conf'), 'utf8')): string {
return template
.replaceAll('__HOST__', host)
.replaceAll('__ROOT__', `/var/www/sites/${host.split('.')[0]}`)
.replaceAll('__KIND__', kind)
.replaceAll('__CERT__', kind === 'demo' ? 'thatwebhostingguy.com' : 'thatdeveloperguy.com')
.replaceAll('__ROBOTS__', robotsHeaderFor(kind))
.replaceAll('__AUTH__', kind === 'demo' && process.env.TDG_STAGING_GATE === 'on' ? 'auth_basic "ThatDeveloperGuy staging"; auth_basic_user_file /etc/nginx/tdg-demo.htpasswd;' : kind === 'demo' ? '# staging gate off (owner decision 2026-09-16: open demo for device testing; noindex + robots Disallow remain). Set TDG_STAGING_GATE=on to re-enable.' : '# production: no access gate');
}