confluence_web/Makefile
Artur Mukhamadiev c853fff995 deploy: optional Uvicorn TLS with a name-constrained private CA for IP-only networks
scripts/make-tls.sh creates a CA whose critical nameConstraints permit only the
listed IPv4 addresses (and the .invalid DNS subtree), plus an end-entity server
certificate; run-backend.sh passes CONFLUENCE_WEB_TLS_CERT/KEY to uvicorn.
2026-09-15 00:01:24 +03:00

68 lines
2.5 KiB
Makefile

# Confluence Research Web UI: integration entry points.
# Subsystem guides: agent/README.md, backend/README.md, frontend/README.md.
PYTHON ?= .venv/bin/python
IMAGE ?= confluence-pi-agent:rev1
FAKE_IMAGE ?= confluence-fake-agent:test
ENV_FILE ?= deploy/confluence-web.env
.PHONY: install check check-python check-agent check-frontend check-docker check-browser build-image build-fake-image image-checks run run-dev tls clean-containers
install:
$(PYTHON) -m pip install -r requirements.txt
npm --prefix agent ci --ignore-scripts
npm --prefix frontend ci
## Deterministic checks (no Docker, no network, no browser).
check: check-python check-agent check-frontend
check-python:
CONFLUENCE_PAT=synthetic-token-no-network CONFLUENCE_URL=https://approved.example.com \
$(PYTHON) -m pytest --ignore=tests/backend/test_docker_live.py --ignore=tests/integration/test_real_image.py \
--ignore=tests/integration/test_real_provider_adapter.py --ignore=tests/integration/test_browser_backend.py
check-agent:
npm --prefix agent run build
npm --prefix agent test
check-frontend:
npm --prefix frontend test
## Real rootless Docker checks: backend fake image, runtime image checks, backend+runtime integration.
check-docker: build-fake-image
$(PYTHON) -m pytest tests/backend/test_docker_live.py tests/integration/test_real_image.py tests/integration/test_real_provider_adapter.py -p no:cacheprovider
npm --prefix agent run test:image
## Real Chrome (DevTools on 127.0.0.1:9444) against the real backend and the frontend's own e2e suite.
check-browser:
$(PYTHON) -m pytest tests/integration/test_browser_backend.py -p no:cacheprovider
npm --prefix frontend run test:e2e
build-image:
docker build -t $(IMAGE) agent
@docker image inspect --format 'Image ID: {{.Id}}' $(IMAGE)
build-fake-image:
docker build -t $(FAKE_IMAGE) -f backend/dev/Dockerfile.fake .
image-checks:
npm --prefix agent run build
node agent/dist/dev/image-checks.js
node agent/dist/dev/boundary-checks.js
run:
scripts/run-backend.sh $(ENV_FILE)
## Name-constrained private CA + server certificate for IP-only TLS: make tls IP=172.26.10.20
tls:
@test -n "$(IP)" || { echo "usage: make tls IP=<lan-ip> [IP='<ip> <ip>']"; exit 2; }
scripts/make-tls.sh $(IP)
## Network-free UI development against explicit fakes (no Docker).
run-dev:
CONFLUENCE_WEB_DEV_MODE=true CONFLUENCE_WEB_FRONTEND_DIST_DIR=$(CURDIR)/frontend \
$(PYTHON) -m uvicorn backend.app:create_app --factory --workers 1 --host 127.0.0.1 --port 8000
clean-containers:
docker ps -aq --filter label=com.confluence_web.app | xargs -r docker rm -f