mirror of
https://github.com/hanzoai/kms.git
synced 2026-10-17 11:18:16 +00:00
The current KMS is a pure Go binary. Per DEPRECATED.md the Node.js + PostgreSQL + Redis Infisical fork was replaced — "no Node.js / Postgres / Redis dependencies." The KMS Go runtime contains zero Redis references; the `REDIS_URL` / `REDIS_HOST` knobs in these examples were leftover from the deprecated stack and are never read. Remove the orphaned Redis declarations from the three HSM compose examples and the Zymbit k8s manifest: - zymbit-hsm/compose.yml: redis service, REDIS_URL env, depends_on, volume - zymbit-hsm/kubernetes-deployment.yaml: Redis Deployment/Service/PVC, REDIS_HOST/PORT ConfigMap keys, redis egress NetworkPolicy rule - aws-cloudhsm/compose.yml: redis service, REDIS_URL env, depends_on, volume - google-cloud-hsm/compose.yml: redis service, REDIS_URL env, depends_on, volume No consumer migration needed — nothing read Redis. Postgres left intact.
89 lines
1.9 KiB
YAML
89 lines
1.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# KMS with Zymbit HSM support
|
|
kms:
|
|
image: kms/kms-fips:latest
|
|
container_name: kms-zymbit
|
|
restart: unless-stopped
|
|
|
|
# Required for Zymbit device access
|
|
privileged: true
|
|
|
|
# Device access
|
|
devices:
|
|
- /dev/zymkey:/dev/zymkey # Zymbit device
|
|
- /dev/i2c-1:/dev/i2c-1 # I2C bus
|
|
|
|
# Volume mounts
|
|
volumes:
|
|
# Mount Zymbit PKCS#11 library (read-only)
|
|
- /usr/lib/libzk_pkcs11.so:/usr/lib/libzk_pkcs11.so:ro
|
|
|
|
# Environment configuration
|
|
environment:
|
|
# HSM Configuration
|
|
HSM_ENABLED: "true"
|
|
HSM_PROVIDER: "zymbit"
|
|
HSM_LIB_PATH: "/usr/lib/libzk_pkcs11.so"
|
|
HSM_SLOT: "0"
|
|
HSM_KEY_LABEL: "lux-kms-key"
|
|
ZYMBIT_DEVICE_PATH: "/dev/zymkey"
|
|
ZYMBIT_TAMPER_CHECK: "true"
|
|
|
|
# KMS Configuration
|
|
NODE_ENV: "production"
|
|
PORT: "8080"
|
|
|
|
# Database
|
|
DB_CONNECTION_URI: "postgresql://kms:password@postgres:5432/kms"
|
|
|
|
# Secrets (use Docker secrets in production)
|
|
env_file:
|
|
- .env.secrets # Contains HSM_PIN, ENCRYPTION_KEY, AUTH_SECRET
|
|
|
|
# Network
|
|
ports:
|
|
- "80:8080"
|
|
|
|
# Dependencies
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
# Health check
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/api/status/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: ghcr.io/hanzoai/sql:latest
|
|
container_name: kms-postgres
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
POSTGRES_DB: kms
|
|
POSTGRES_USER: kms
|
|
POSTGRES_PASSWORD: password # Change in production
|
|
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U kms"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
postgres-data:
|
|
driver: local
|
|
|
|
networks:
|
|
default:
|
|
name: kms-network
|