Collaboration Support Bot supporting my team.
Find a file
Joseph McQueen e8500b4324 Package dect-relay-agent as a Docker deploy bundle
Adds a one-command packager (`npm run package:relay`) that produces a
self-contained zip ready to transfer into the data center and start
with `docker compose up -d --build`. Three commands on the DC host:
unzip, edit .env, docker compose up.

Why a packager instead of `docker build` in the repo:
The agent's index.js imports the shared cisco-dect + httpDigestAuth
modules via `../integrations/...` paths, so a naive
`docker build dect-relay-agent/` would fail because those files live
outside the build context. The packager copies them into a
`workspace/` tree inside the bundle so the Dockerfile sees them as
local paths without any source rewriting.

Docker artifacts (in dect-relay-agent/):
- Dockerfile: multi-stage node:20-alpine build (~55MB final image),
  non-root `dect` user (UID/GID 1500), tini as PID 1 for clean
  SIGTERM propagation to node's graceful-shutdown path,
  `npm install --omit=dev --ignore-scripts` in the deps stage.
- docker-compose.yml: restart:unless-stopped, JSON log rotation
  (10MB × 5 files), pgrep-based health check. No `ports:` block
  because the agent is outbound-only (dials the bot).
- .dockerignore: defensive — the bundle already excludes cruft, but
  this hardens against a stray manual build.

Packager (scripts/packageDectRelayAgent.js):
- Assembles agent code + shared modules + deploy artifacts into a
  timestamped staging dir (.package-relay-tmp/, git-ignored).
- Generates a bundle README with three-command deploy instructions,
  ongoing-ops table, no-internet-DC fallback (docker save/load), and
  troubleshooting for the most common failure modes.
- Generates BUNDLE_INFO.txt with build metadata (git sha + dirty
  flag + timestamp + size) so the DC operator can trace deployed
  bundles back to source.
- Emits `dist/dect-relay-agent-bundle-<YYYYMMDD-HHMMSS>.zip` (30KB).
- Cleans staging in a finally block so failed runs don't leak.

Bundle layout (matches Dockerfile expectations):
  dect-relay-agent-bundle-<version>/
    Dockerfile, docker-compose.yml, .dockerignore
    .env.example, README.md, BUNDLE_INFO.txt
    workspace/dect-relay-agent/{package.json, index.js}
    workspace/integrations/cisco-dect/{client,probes,statusXml}.js
    workspace/utils/httpDigestAuth.js

Wiring:
- package.json: new `package:relay` and `test` npm scripts.
- .gitignore: `scripts/` changed to `scripts/*` so `!scripts/
  packageDectRelayAgent.js` can re-include just the packager
  (git forbids re-including files under a fully-excluded directory,
  hence the glob form).
- dect-relay-agent/README.md: rewrites deployment section to show
  the Docker path as the recommended production route, with the
  node-directly path kept for local dev.

Verified end-to-end: `npm run package:relay` produces a valid zip
that unpacks to the expected layout in <2s. All 113 existing tests
still pass.
2026-07-03 09:32:26 -04:00
commands DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
config Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
dect-relay-agent Package dect-relay-agent as a Docker deploy bundle 2026-07-03 09:32:26 -04:00
integrations Add DBS-210 status.xml parser + health verdict 2026-07-02 15:35:34 -04:00
public Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
scripts Package dect-relay-agent as a Docker deploy bundle 2026-07-03 09:32:26 -04:00
services DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
tests DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
utils Add Cisco DBS-210 DECT base spike (HTTP Digest client + safe probes) 2026-07-02 15:30:42 -04:00
.dockerignore Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
.env.example DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
.gitignore Package dect-relay-agent as a Docker deploy bundle 2026-07-03 09:32:26 -04:00
docker-compose.yml Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
Dockerfile Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
index.js DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
nodemon.json Initial commit: CollabFinder Webex bot 2026-07-01 16:55:03 -04:00
package-lock.json DECT relay Phase 1: WSS hub + agent + /phonestatus follow-up 2026-07-02 17:03:32 -04:00
package.json Package dect-relay-agent as a Docker deploy bundle 2026-07-03 09:32:26 -04:00