MessageWeave/hoststack.yaml

50 lines
2.3 KiB
YAML

# HostStack native Rust deployment for MessageWeave.
#
# Set REDIS_URL and CONFIG_ENCRYPTION_KEY as encrypted HostStack dashboard
# secrets; never put their values in this repository.
#
# Business config (JMAP URL + credentials, Telegram bot token, worker token,
# chat allowlist, LLM settings) is NOT read from environment variables at all.
# It is written to Redis via /api/bootstrap or admin PUT on /api/config.
#
# Precedence (verified in the HostStack agent source, deploy-executor.ts):
# a value declared here wins; a field omitted here falls back to the
# per-runtime framework default. For runtime: rust those defaults are
# `cargo fetch` / `cargo build --release` / `./target/release/app`.
#
# That last default is why start.command MUST be declared below: `app` is not
# this package's binary name. Cargo.toml declares [[bin]] name = "message-weave"
# with path = "src/main.rs"; there is no `app` target and no src/app.rs.
# Deleting this file reverts the service to a start command that exits with
# `./target/release/app: not found` before it can bind the port.
#
# Do NOT add --debug here for production. See the note above start.command.
services:
web:
type: web_service
runtime: rust
install:
command: cargo fetch --locked
build:
# --locked on both steps: fail rather than rewriting Cargo.lock mid-deploy.
command: cargo build --release --locked
start:
# Binary is named after the Cargo package: `message-weave`, not `app`.
# Do NOT add --debug here for production.
command: ./target/release/message-weave
# Temporary diagnosis only: change the line above to
# command: ./target/release/message-weave --debug
# and set the DEBUG_TOKEN secret. The debug surface is gated by BOTH
# factors — the argv flag AND a non-empty DEBUG_TOKEN — read once at
# process start. Then probe it from inside the container, never through
# the public domain:
# curl -s -i -H "Authorization: Bearer <token>" http://127.0.0.1:8080/debug/config
# See docs/deployment.md §2.1 for the double-factor gate.
healthCheck:
# /healthz only, never /ready. /ready also probes redis, the JMAP session
# and Telegram getMe, so a transient upstream blip would restart the
# container. See docs/deployment.md §2.1.
path: /healthz
interval: 30
timeout: 5