Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d948887
docs: publish v1.0.0 project documentation
ComRobertSoftwareLabsIncon Dec 4, 2026
70ac9e3
chore: publish source file package.json
ComRobertSoftwareLabsIncon Dec 4, 2026
13febae
chore: publish source file tsconfig.json
ComRobertSoftwareLabsIncon Dec 4, 2026
f9aa854
chore: publish source file src/types.ts
ComRobertSoftwareLabsIncon Dec 4, 2026
922b2ff
chore: publish source file src/bridge.ts
ComRobertSoftwareLabsIncon Dec 4, 2026
6bdea05
chore: publish source file src/openai.ts
ComRobertSoftwareLabsIncon Dec 4, 2026
7234a39
chore: publish source file src/server.ts
ComRobertSoftwareLabsIncon Dec 4, 2026
f930041
chore: publish source file config/bridge.config.json
ComRobertSoftwareLabsIncon Dec 4, 2026
f881867
chore: publish source file config/providers.json
ComRobertSoftwareLabsIncon Dec 4, 2026
90db6d1
chore: publish source file config/privacy.policy.json
ComRobertSoftwareLabsIncon Dec 4, 2026
96c8014
chore: publish source file shortcuts/request.example.json
ComRobertSoftwareLabsIncon Dec 4, 2026
ce1fe01
chore: publish source file shortcuts/local-model-prompt.txt
ComRobertSoftwareLabsIncon Dec 4, 2026
f225cbc
chore: publish source file .gitignore
ComRobertSoftwareLabsIncon Dec 4, 2026
bb45c11
chore: publish source file .env.example
ComRobertSoftwareLabsIncon Dec 4, 2026
e24e8b9
docs: publish iOS Shortcut action manifest
ComRobertSoftwareLabsIncon Dec 4, 2026
bde7f91
fix: require explicit local routing result before cloud fallback
ComRobertSoftwareLabsIncon Dec 4, 2026
51e8c4f
Make cloud fallback injectable for routing tests
ComRobertSoftwareLabsIncon Dec 4, 2026
222989b
Add automated test script
ComRobertSoftwareLabsIncon Dec 4, 2026
472aa4a
Add automated bridge routing tests
ComRobertSoftwareLabsIncon Dec 4, 2026
7aac979
Run CIB automated tests and build in GitHub Actions
ComRobertSoftwareLabsIncon Dec 4, 2026
65621b7
Fix CI setup by removing npm cache without lockfile
ComRobertSoftwareLabsIncon Dec 4, 2026
d695f43
Add strict bridge request validation
ComRobertSoftwareLabsIncon Dec 4, 2026
f0454fb
Add bounded in-memory request rate limiter
ComRobertSoftwareLabsIncon Dec 4, 2026
ba722d6
Harden bridge HTTP endpoint
ComRobertSoftwareLabsIncon Dec 4, 2026
430dc73
Sanitize cloud provider errors
ComRobertSoftwareLabsIncon Dec 4, 2026
890c7c9
Add request validation and rate limit tests
ComRobertSoftwareLabsIncon Dec 4, 2026
86c24df
Refactor HTTP server for integration testing and throttle authenticat…
ComRobertSoftwareLabsIncon Dec 4, 2026
d921ead
Add HTTP security integration tests
ComRobertSoftwareLabsIncon Dec 4, 2026
4582c4a
Fix injected handler invocation expectation in HTTP test
ComRobertSoftwareLabsIncon Dec 4, 2026
0ffeace
Allow injectable shared rate limiter and validate JSON media type
ComRobertSoftwareLabsIncon Dec 4, 2026
dfead2f
Define async-compatible rate limiter contract
ComRobertSoftwareLabsIncon Dec 4, 2026
16af3cc
Test strict content type and shared rate limiter injection
ComRobertSoftwareLabsIncon Dec 4, 2026
c4cae9f
Document CIB security review and deployment boundaries
ComRobertSoftwareLabsIncon Dec 4, 2026
26c3cc4
Fix expected peer address in shared limiter test
ComRobertSoftwareLabsIncon Dec 4, 2026
e9f712e
Make OpenAI adapter testable through injected dependencies
ComRobertSoftwareLabsIncon Dec 4, 2026
43edcd4
Add isolated OpenAI adapter resilience tests
ComRobertSoftwareLabsIncon Dec 4, 2026
e24ec7c
Generate and commit npm lockfile, then use npm ci
ComRobertSoftwareLabsIncon Dec 4, 2026
14eb165
Fix lockfile bootstrap before npm cache setup
ComRobertSoftwareLabsIncon Dec 4, 2026
6936920
chore: add reproducible npm lockfile
github-actions[bot] Dec 4, 2026
27f5290
Enable npm cache now that lockfile is committed
ComRobertSoftwareLabsIncon Dec 4, 2026
f399e32
Reduce CI permissions and require committed lockfile
ComRobertSoftwareLabsIncon Dec 4, 2026
aa18290
Add concurrent and per-client rate-limit coverage
ComRobertSoftwareLabsIncon Dec 4, 2026
ba320d9
Document CI permission hardening and rate-limit tests
ComRobertSoftwareLabsIncon Dec 4, 2026
291b423
Fail closed on rate limiter errors and bound HTTP timeouts
ComRobertSoftwareLabsIncon Dec 4, 2026
fea7696
Test safe handling of rate limiter outages
ComRobertSoftwareLabsIncon Dec 4, 2026
b9ccf96
Complete security review notes for HTTP timeout and limiter failure h…
ComRobertSoftwareLabsIncon Dec 4, 2026
73651f3
Add dependency vulnerability audit to CI
ComRobertSoftwareLabsIncon Dec 4, 2026
3265a82
Add implementation review and remaining deployment checklist
ComRobertSoftwareLabsIncon Dec 4, 2026
b936c7c
Document reproducible npm ci installation
ComRobertSoftwareLabsIncon Dec 4, 2026
de8b972
Add provider-neutral shared rate limiter adapter
ComRobertSoftwareLabsIncon Dec 4, 2026
5e0d06b
Test shared rate limiter adapter and key hashing
ComRobertSoftwareLabsIncon Dec 4, 2026
a1bfb1e
Document shared rate limiter integration
ComRobertSoftwareLabsIncon Dec 4, 2026
e62ca86
Document shared rate limiter security contract
ComRobertSoftwareLabsIncon Dec 4, 2026
ff78f43
Update implementation review for shared rate limiter
ComRobertSoftwareLabsIncon Dec 4, 2026
8d9c80f
Add explicit trusted proxy client identity handling
ComRobertSoftwareLabsIncon Dec 4, 2026
91787c0
Add trusted proxy address resolver
ComRobertSoftwareLabsIncon Dec 4, 2026
e37cbdd
Test trusted and untrusted proxy identity handling
ComRobertSoftwareLabsIncon Dec 4, 2026
ecce89f
Add trusted proxy resolver unit tests
ComRobertSoftwareLabsIncon Dec 4, 2026
fc1b9bb
Document trusted reverse proxy configuration
ComRobertSoftwareLabsIncon Dec 4, 2026
3d55134
Document trusted proxy security boundary
ComRobertSoftwareLabsIncon Dec 4, 2026
750ea27
Record trusted proxy review and CI results
ComRobertSoftwareLabsIncon Dec 4, 2026
f96bca0
List trusted proxy resolver in project layout
ComRobertSoftwareLabsIncon Dec 4, 2026
3eefa6b
Add portable OCI container build
ComRobertSoftwareLabsIncon Dec 4, 2026
2194c7a
Exclude local and sensitive files from container context
ComRobertSoftwareLabsIncon Dec 4, 2026
1f05cf4
Document portable mobile-managed deployment contract
ComRobertSoftwareLabsIncon Dec 4, 2026
5150dfc
Document portable container deployment
ComRobertSoftwareLabsIncon Dec 4, 2026
d69931a
Validate OCI container image in CI
ComRobertSoftwareLabsIncon Dec 4, 2026
a8f8f63
docs: assess GitHub Actions as CIB runtime
ComRobertSoftwareLabsIncon Dec 5, 2026
b8a101b
docs: link GitHub Actions runtime assessment
ComRobertSoftwareLabsIncon Dec 5, 2026
b7590ad
Make the iPhone Shortcut local-first and remove mandatory server calls
ComRobertSoftwareLabsIncon Dec 5, 2026
73d46ac
Set the CIB default runtime to on-device iPhone execution
ComRobertSoftwareLabsIncon Dec 5, 2026
f4c4432
Default CIB privacy policy to local-only processing
ComRobertSoftwareLabsIncon Dec 5, 2026
c0dc929
Remove automatic cloud providers from the default CIB configuration
ComRobertSoftwareLabsIncon Dec 5, 2026
a73e9cc
Clarify that server deployment is optional and not required by the iP…
ComRobertSoftwareLabsIncon Dec 5, 2026
e3de61e
Document the zero-hosting local-only CIB workflow
ComRobertSoftwareLabsIncon Dec 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.github
node_modules
dist
coverage
.env
.env.*
!.env.example
*.log
tests
README.md
REVIEW.md
SECURITY.md
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PORT=3000
OPENAI_API_KEY=
BRIDGE_TOKEN=
OPENAI_MODEL=
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CIB CI

on:
pull_request:
branches: [main]
push:
branches: [implementation/v1.0.1-foundation]

permissions:
contents: read

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci --no-audit --no-fund
- run: npm audit --audit-level=high
- run: npm test
- run: npm run build
- name: Build OCI container image
run: docker build --tag cib:ci .
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
.env
.env.*
!.env.example
*.log
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1

FROM node:22-bookworm-slim AS build
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund

COPY tsconfig.json ./
COPY src ./src
RUN npm run build

FROM node:22-bookworm-slim AS runtime
ENV NODE_ENV=production
WORKDIR /app

COPY --from=build --chown=node:node /app/package.json ./package.json
COPY --from=build --chown=node:node /app/dist ./dist

USER node
EXPOSE 3000

HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3000)+'/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"

CMD ["node", "dist/server.js"]
93 changes: 91 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,91 @@
# ChatGPT_Intelligence_Bridge
ChatGPT integration Apple Intelligence & Siri.
# ChatGPT Intelligence Bridge — iPhone-first

Robert Software Labs

**Default runtime:** Apple Shortcuts on iPhone
**Default strategy:** on-device first, no network requests
**Output:** Siri speaks the answer
**Server:** optional; not required for normal use

## The simple version

The default CIB is one iPhone Shortcut. Siri captures the request, the Shortcuts **Use Model** action runs the selected **On-Device** model, and **Speak Text** reads the result.

The default path does not require:
- A hosting provider, server, domain, or Docker deployment.
- An OpenAI API key, API billing, or a bridge token.
- GitHub Actions at runtime.
- A database, Redis, or conversation-history service.
- Multiple Shortcuts or separate provider-specific automations.

The JSON file in `shortcuts/` is a build manifest, not an importable Apple Shortcut file. Apple does not provide a universal JSON-to-Shortcut importer.

## Default request flow

1. Siri starts **ChatGPT Intelligence Bridge** and captures the user's request with **Dictate Text**.
2. **Use Model** is explicitly set to **On-Device**.
3. The model produces a local answer.
4. **Speak Text** reads that answer.
5. If the model returns the `NEED_CLOUD` marker, the Shortcut speaks a short notice that local processing could not complete the request. It does not call a server or silently switch to a cloud model.

**Important:** Do not replace **On-Device** with a cloud or extension model if the goal is to avoid network use and additional charges. If the On-Device option is unavailable, stop and check device language, region, and Apple Intelligence availability rather than silently selecting another provider.

## Build the single Shortcut on iPhone

Create one Shortcut named **ChatGPT Intelligence Bridge** with these actions:

1. **Dictate Text** — save the result as `UserRequest`.
2. **Use Model** — choose **On-Device**, pass `UserRequest` as input, and use the instructions in [shortcuts/local-model-prompt.txt](shortcuts/local-model-prompt.txt). Save the result as `LocalResult`.
3. **If** `LocalResult` begins with `NEED_CLOUD`:
- **Speak Text:** "Não consigo concluir essa solicitação apenas com o processamento local. Nenhum serviço externo foi chamado."
4. **Otherwise:**
- **Speak Text** using `LocalResult`.

Use the Shortcuts variable picker to insert variables. Do not type variable names as ordinary text.

The complete action sequence is recorded in [shortcuts/shortcut-manifest.json](shortcuts/shortcut-manifest.json). Siri permissions and model availability remain controlled by iOS.

## Optional remote service

The TypeScript service remains in this repository for a future, explicitly requested remote-provider integration. It is not part of the default Shortcut and should not be deployed for ordinary local use.

A remote OpenAI fallback requires a separately hosted HTTPS service and an API key. OpenAI API usage is billed separately from a ChatGPT subscription. The default configuration disables optional providers; see [config/providers.json](config/providers.json), [config/bridge.config.json](config/bridge.config.json), and [config/privacy.policy.json](config/privacy.policy.json).

Do not create hosting accounts, API keys, tokens, or paid services just to use the default CIB.

If the optional TypeScript service is developed or tested, use:

```bash
npm ci
npm test
npm run build
```

The repository's GitHub Actions workflow runs CI only. It is not the runtime for Siri requests. See [docs/GITHUB_ACTIONS_RUNTIME_ASSESSMENT.md](docs/GITHUB_ACTIONS_RUNTIME_ASSESSMENT.md).

## Project layout

- `shortcuts/shortcut-manifest.json`: single local-only Shortcut action manifest.
- `shortcuts/local-model-prompt.txt`: local model instructions.
- `config/bridge.config.json`: default local runtime configuration.
- `config/providers.json`: default and optional provider policy.
- `config/privacy.policy.json`: local-first privacy defaults.
- `src/`: optional TypeScript HTTP bridge and remote provider adapter.
- `tests/`: automated tests for the optional TypeScript service.
- `docs/DEPLOYMENT.md`: optional server deployment requirements.

## Privacy and limitations

- The default Shortcut sends no prompt to a CIB server.
- No CIB conversation history is stored.
- Model processing location is determined by the selected **On-Device** option; do not assume cloud and on-device choices are equivalent.
- Local models may not answer requests requiring live web information or remote actions.
- The `NEED_CLOUD` branch is intentionally a notice, not an automatic cloud handoff.
- Do not send passwords, authentication codes, or other secrets to an AI model.

## Project status

- The original `main` branch remains preserved.
- Implementation changes are maintained on `implementation/v1.0.1-foundation`.
- Pull request #1 remains a draft and has not been merged.
- No hosting vendor has been selected, no paid service has been enabled, and no deployment has been performed.
44 changes: 44 additions & 0 deletions REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# CIB — implementation review

**Review date:** 2026-12-04
**Reviewed branch:** `implementation/v1.0.1-foundation`
**Reviewed commit:** `3d55134fb020c46fec713865c9bfa44a899b8cc6`
**Pull request:** #1 — open, Draft, not merged

## Verified in CI

The GitHub Actions push workflow completed successfully for the reviewed commit.

- `npm ci --no-audit --no-fund`: passed.
- `npm audit --audit-level=high`: passed.
- `npm test`: 47 tests passed, 0 failed.
- `npm run build`: passed.

CI run: https://github.com/ComRobertSoftwareLabsIncon/ChatGPT_Intelligence_Bridge/actions/runs/47370949920

## Changes reviewed

- Reproducible dependency installation through the committed npm lockfile and `npm ci`.
- CI repository permission reduced to read-only.
- Integration coverage for authentication, content type, malformed and oversized bodies, routing, rate limiting, and safe provider failures.
- Shared rate limiter adapter hashes client keys before storage and requires atomic increment with first-write expiry.
- Trusted reverse-proxy handling is opt-in through `trustedProxies`; forwarded headers are ignored unless the direct TCP peer matches an explicit IP/CIDR allow-list.
- Forwarded chains are traversed right-to-left through trusted hops; malformed chains and chains longer than 20 hops fall back to the TCP peer.
- Tests cover spoofed headers, trusted/untrusted peers, IPv4, IPv6 CIDRs, mapped IPv4 addresses, malformed chains, and invalid configuration.
- HTTP server header, request, and keep-alive timeouts are bounded.
- OpenAI fallback has an injectable fetch implementation, bounded timeout, and sanitized provider errors.

## Remaining deployment requirements

This review does not certify production readiness. Before public deployment:

1. Supply and test a production `AtomicRateLimitStore` implementation when running multiple instances; no concrete storage backend is bundled.
2. Configure `trustedProxies` with only the actual proxy egress IPs/CIDRs, and prevent direct application access that bypasses the proxy.
3. Terminate HTTPS at a trusted hosting platform or reverse proxy.
4. Store and rotate `BRIDGE_TOKEN` and `OPENAI_API_KEY` through a secrets manager.
5. Set platform-level connection limits and overall concurrency controls.
6. Perform deployment-specific security testing, including penetration testing where appropriate.

## Review decision

**The implementation branch CI is green for the reviewed commit and the changes are ready for human review in PR #1.** Keep the PR in Draft until deployment requirements, architecture decisions, and review feedback are addressed. No merge to `main` is performed by this review.
59 changes: 59 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# CIB security review — v1.0.1 foundation

## Scope

This review covers the HTTP bridge, request validation, authentication, rate limiting,
and the cloud fallback adapter on `implementation/v1.0.1-foundation`.

## Controls confirmed in source

- Bearer-token authentication uses a length check and `timingSafeEqual`.
- The request body is capped at 64 KiB while it is streamed.
- Request fields are allow-listed and individual text/session fields have limits.
- Provider failures are returned to clients as a generic 502 response.
- Prompt contents and credentials are not written to application logs.
- Responses use `Cache-Control: no-store` and `X-Content-Type-Options: nosniff`.
- Cloud fallback requires the explicit `NEED_CLOUD` marker.
- The OpenAI adapter uses a 25-second timeout and does not expose provider error bodies.

## Changes in this review

- The server now accepts a `RateLimiter` dependency whose `check` method may be asynchronous.
- Trusted reverse-proxy handling is opt-in through `trustedProxies`; untrusted forwarded
headers cannot override the TCP peer used for rate limiting.
- Added a provider-neutral shared limiter adapter. It hashes client keys before storage and requires a backend-provided atomic increment with first-write expiry.
This permits a host-specific shared/atomic store without making Redis or another vendor a
mandatory dependency. The in-memory implementation remains the default for a single process.
- The JSON media type is checked exactly after removing optional parameters; values such as
`application/jsonp` are rejected.
- The in-memory limiter now validates finite window sizes and integer key limits.
- The HTTP server applies 10-second header, 30-second request, and 5-second keep-alive timeouts.
- A rate-limiter backend failure now returns a generic 503 response instead of leaving the request unresolved.
- CI now uses the committed lockfile with `npm ci` and has read-only repository contents permission.
- Rate-limit tests cover concurrent checks and isolation between client keys.

## Deployment requirements and remaining risks

- The default in-memory limiter is process-local. Multiple server instances must inject the
`createSharedRateLimiter` adapter with an `AtomicRateLimitStore` implementation that performs
increment and first-write expiry atomically across instances. The repository does not bundle
or mandate Redis or another storage provider.
- Rate-limit identity uses the TCP peer address by default; `X-Forwarded-For` is ignored.
The optional `trustedProxies` allow-list accepts exact IPs/CIDRs. Forwarded chains are
considered only when the direct TCP peer is trusted, are traversed right-to-left, and
fall back to the TCP peer when malformed or longer than 20 hops. Configure only actual
proxy egress addresses and prevent direct access that bypasses the proxy.
- Terminate HTTPS at a trusted hosting platform or reverse proxy. This Node server does not
configure TLS itself.
- Store `BRIDGE_TOKEN` and `OPENAI_API_KEY` in the host's secret manager; rotate them if
exposed. Never commit live credentials or place them in Shortcut URLs.
- Apply platform-level connection limits and an overall concurrency limit before public deployment;
application-level HTTP timeouts do not replace edge/proxy connection controls.
- The health endpoint is intentionally unauthenticated and returns only service status.
- A successful source review and CI run are not a penetration test or a production security
certification.

## Model configuration

The code keeps `gpt-6-luna` as its default. Confirmed against the current OpenAI API model
catalog/pricing documentation on 2026-12-04. Deployments may override it with `OPENAI_MODEL`.
20 changes: 20 additions & 0 deletions config/bridge.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "ChatGPT Intelligence Bridge",
"version": "1.0.1",
"owner": "Robert Software Labs",
"runtime": "apple-shortcuts-on-device",
"strategy": "local_first",
"execution_order": [
"iphone_on_device_model",
"siri_speak_text"
],
"cloud_fallback": {
"enabled_by_default": false,
"requires_explicit_future_opt_in": true
},
"response_channel": "siri_speak_text",
"session_storage": "none",
"network_requests_by_default": 0,
"max_input_characters": 12000,
"max_local_result_characters": 16000
}
32 changes: 32 additions & 0 deletions config/privacy.policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "1.1",
"default_mode": "on_device_only",
"principles": [
"local_first",
"data_minimisation",
"no_prompt_logging",
"no_network_by_default",
"no_secrets_on_device"
],
"cloud_transfer": {
"enabled_by_default": false,
"requires_explicit_future_opt_in": true,
"default_payload_fields": [],
"excluded_fields": [
"device_identifiers",
"contacts",
"location",
"files",
"credentials"
]
},
"retention": {
"request_body": "not_persisted_by_cib",
"application_logs": "not_applicable_to_local_shortcut"
},
"user_controls": {
"cloud_fallback": "not_configured_in_default_shortcut",
"model_selection": "controlled_by_user_in_apple_shortcuts",
"siri_prompts_and_permissions": "controlled_by_ios"
}
}
23 changes: 23 additions & 0 deletions config/providers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"default_provider": {
"id": "apple-on-device",
"type": "shortcuts-use-model",
"priority": 1,
"execution_location": "iphone",
"enabled": true,
"role": "default_local_inference",
"network_required": false,
"notes": "Select the On-Device option in the iOS Shortcuts Use Model action."
},
"optional_providers": [
{
"id": "openai-responses",
"type": "https",
"execution_location": "optional_external_service",
"enabled": false,
"requires_explicit_opt_in": true,
"secret_env": "OPENAI_API_KEY",
"notes": "Not used by the default iPhone Shortcut. Enabling this provider may incur separate API charges and requires a hosted service."
}
]
}
37 changes: 37 additions & 0 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Optional CIB server deployment

**The default CIB does not require a server deployment.** The iPhone Shortcut runs the selected on-device model and speaks its result directly through Siri. Do not create a hosting account, configure a domain, or add API credentials for the default workflow.

This document applies only if a future version explicitly enables a remote provider.

## Optional runtime

- OCI-compatible container built from the repository's `Dockerfile`.
- Node.js 22 runtime.
- Container listens on `PORT` (defaults to `3000`).
- Start command: `node dist/server.js`.
- Health check: `GET /health`.
- Bridge endpoint: `POST /v1/bridge`.
- Public traffic requires HTTPS termination.

## Optional environment

| Variable | Required | Purpose |
| --- | --- | --- |
| `BRIDGE_TOKEN` | Yes, for a deployed endpoint | Bearer token for an explicitly configured remote client |
| `OPENAI_API_KEY` | Only if OpenAI fallback is explicitly enabled | Server-side OpenAI API credential |
| `PORT` | No | Port supplied by the host; defaults to `3000` |
| `OPENAI_MODEL` | No | Overrides the code's default model identifier |

Never put secrets in the repository, container image, build arguments, client-side configuration, Shortcut URL, or logs. API usage is billed separately from a ChatGPT subscription.

## Security requirements before any deployment

1. Keep the service private until HTTPS, secrets, and proxy identity are configured.
2. Confirm `GET /health` over the platform's HTTPS URL.
3. Keep the default in-memory rate limiter to one service process, or inject a shared atomic store before scaling.
4. Configure exact trusted proxy IP/CIDR ranges; do not trust arbitrary forwarded headers.
5. Verify provider request limits, concurrency limits, secret handling, and log retention.
6. Test with non-sensitive data before enabling any cloud provider.

No hosting vendor is selected. No live service is deployed. Deployment is not part of the default CIB setup and should not be undertaken unless a concrete feature requires it.
Loading
Loading