Skip to main content

Deployment: hbf-knowledge-manager

Infrastructure config for this service. Full platform deployment: docs/architecture/deployment.md

Runtime

  • Port: 3000 (default; overridden by PORT env var)
  • Framework: NestJS (Node.js 22)
  • Base image (build): node:22-slim
  • Base image (runtime): node:22-slim
  • Start command: npm run start:prodnode dist/main
  • Local dev: npm run start:dev (NestJS watch mode; sets ELASTIC_APM_ACTIVE=false)
  • Health check: none configured (relies on K8s liveness/readiness probes in production)

Required Environment Variables

VariableExampleDescription
PORT3000HTTP listen port (default: 3000)
CORE_BASE_URLhttp://hbf-core:8080hbf-core base URL
CORE_TOKEN<token>Static service auth token for hbf-core
PINO_LOGGER_USEtrueEnable Pino structured logging
PINO_LOGGER_LEVELinfoLog level (trace/debug/info/warn/error)
PINO_LOGGER_AUTO_LOGGINGfalseAuto-log HTTP requests
ELASTIC_APM_ACTIVEfalseEnable Elastic APM agent
ELASTIC_APM_SERVER_URLAPM server endpoint (required if APM active)
ELASTIC_APM_SECRET_TOKENAPM auth token (required if APM active)
ELASTIC_APM_SERVICE_NAMEService identifier in APM
ELASTIC_APM_ENVIRONMENTEnvironment name in APM
SHAREPOINT_CLIENT_IDSharePoint OAuth app client ID
SHAREPOINT_CLIENT_SECRETSharePoint OAuth app client secret
SHAREPOINT_WEBHOOK_BASE_URLBase URL for SharePoint webhook callbacks
SHAREPOINT_WEBHOOK_SECRETShared secret for webhook validation

Azure Blob Storage credentials (accountName, containerName, sasToken) are not service-level env vars. They are stored per-org in hbf-core and retrieved at runtime via the hbf-core-api.

Docker

# Build (requires GitHub PAT for @helvia npm scope)
docker build --build-arg GITHUB_TOKEN=<PAT> -t hbf-knowledge-manager .

# Run
docker run -p 3000:3000 --env-file .env hbf-knowledge-manager

CI/CD

No CI/CD configured yet (no .github/workflows/ directory).

External Dependencies

  • Azure Blob Storage — source of knowledge base documents; accessed via per-org SAS tokens stored in hbf-core. Cloud-only; not in local infra.
  • Azure Event Grid — delivers BlobCreated/BlobDeleted webhook events to POST /webhooks/azure-blob. Cloud-only; not in local infra.
  • hbf-core — all KB read/write operations, integration config, and auth token validation go through hbf-core API.

Notes

  • No database. No Kafka. No Redis. Stateless; all persistent state lives in hbf-core.
  • No docker-compose.yml. Run standalone with npm run start:dev for local development.
  • Azure credentials are per-org config, not service env vars. Adding a new Azure Blob integration is done via hbf-core, not by redeploying this service.