/
azathd
/
mutiagent
Обзор
Документация
Войти
/
azathd
/
mutiagent
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Makefile
105 строк
4 KB
Your Name
init
15 май 2026, 19:41
15 май 2026, 19:41
79a6f12
Код
Авторство
О чём код?
export COMPOSE_FILE ?= docker-compose.yml .PHONY: help bootstrap up up-dev up-prod down logs ps test lint typecheck build migrate init-db fix-log-perms help: @echo "Targets: bootstrap, up, fix-log-perms, init-db, migrate, ..." # External network/volumes for Marzban integration (safe to run repeatedly). bootstrap: @docker network inspect marzban_default >/dev/null 2>&1 || docker network create marzban_default @docker volume inspect marzban_xray_logs >/dev/null 2>&1 || docker volume create marzban_xray_logs @docker volume inspect xray_config_shared >/dev/null 2>&1 || docker volume create xray_config_shared @docker run --rm -v marzban_xray_logs:/mnt docker.io/library/alpine:3.20 \ sh -c "touch /mnt/access.log /mnt/error.log; chmod 644 /mnt/*.log; chown 10001:10001 /mnt/*.log 2>/dev/null || chmod a+r /mnt/*.log" fix-log-perms: bash scripts/fix_log_permissions.sh pipeline-check: bash scripts/pipeline_check.sh reset-pipeline: bash scripts/reset_pipeline.sh up: bootstrap @test -f .env || (echo "Missing .env — copy .env.example and set secrets" && exit 1) docker compose up -d up-dev: bootstrap @test -f .env || (echo "Missing .env" && exit 1) docker compose -f docker-compose.yml -f docker-compose.override.yml up -d up-prod: bootstrap @test -f .env || (echo "Missing .env" && exit 1) docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d down: docker compose down logs: docker compose logs -f --tail=200 ps: docker compose ps build: docker compose build test: docker build -f docker/Dockerfile --target test-runner -t xray-multiagent/test:latest . docker run --rm xray-multiagent/test:latest lint: docker build -f docker/Dockerfile --target test-runner -t xray-multiagent/test:latest . docker run --rm xray-multiagent/test:latest ruff check src tests typecheck: docker build -f docker/Dockerfile --target test-runner -t xray-multiagent/test:latest . docker run --rm xray-multiagent/test:latest mypy migrate: @test -f .env || (echo "Missing .env" && exit 1) docker compose run --rm --no-deps --entrypoint "" orchestrator python -m src.common.migrate ensure-schema: migrate init-db: bash scripts/init_db.sh test-unit: docker build -f docker/Dockerfile --target test-runner -t xray-multiagent/test:latest . docker run --rm xray-multiagent/test:latest pytest -q tests/unit seed-logs: bash scripts/seed_sample_logs.sh validate-logs: @python3 scripts/validate_log_parse.py $(FILE) --type $(TYPE) @python3 scripts/validate_log_parse.py $(FILE) --type error 2>/dev/null || true ingest-log: @test -n "$(FILE)" || (echo "Usage: make ingest-log FILE=/path/to/log [TARGET=error|access] [REPLACE=1] [FROM_START=1]" && exit 1) bash scripts/ingest_host_log.sh "$(FILE)" --target "$(TARGET)" $(if $(filter 1,$(REPLACE)),--replace,) $(if $(filter 1,$(FROM_START)),--from-start,) load-test: docker compose run --rm --entrypoint python collector /app/scripts/replay_logs.py --path /mnt/marzban/xray-logs/access.log --lines 50 seed-logs-replay: docker compose run --rm --no-deps -v marzban_xray_logs:/mnt/marzban/xray-logs \ --entrypoint python collector /app/scripts/replay_logs.py \ --path /mnt/marzban/xray-logs/access.log --lines 100 security: docker run --rm xray-multiagent/test:latest pip-audit || true docker run --rm xray-multiagent/test:latest bandit -r src -ll || true import-dashboards: @echo "Import deploy/grafana/dashboard.json into Grafana UI or API" compose-config-check: docker compose config ! grep -r docker.sock docker-compose*.yml || true clickhouse-reset: bash scripts/clickhouse_reset.sh