Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jobs:
run: |
make format
make lint
make smoke
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This repository holds itsUP, a Docker-based GitOps deployment platform, together

### Rules

- **Runtime-mutating commands run only on the container host** — the machine whose own LAN IP equals `SSH_HOST` in `.env`. The `itsup` CLI enforces this fail-closed: `run`, `apply`, `down`, `dns`, `proxy`, `svc`, `monitor`, and `logs` refuse on any machine whose detected LAN IP does not match `SSH_HOST`, and `make install-runtime` refuses off-host before it touches systemd/launchd. `make uninstall-runtime` is the recovery exception: it may run off-host to remove stale local systemd/launchd integration and local remnants from the current checkout, but it does not invoke the host-only `itsup down` path there. The GitOps, config, secrets, and read commands (`pull`, `commit`, `status`, `create`, `init`, `validate`, `migrate`, `encrypt`, `decrypt`, `diff-secrets`, `edit-secret`, `sops-key`) run anywhere. Off-host a runtime-mutating command would spin up the entire stack locally; the gate is not self-grantable. The command-level contract is in `project/itsup/spec/cli`; operational detail in `project/itsup/spec/runtime-operations`.
- **Runtime-mutating commands run only on the container host** — the machine whose own LAN IP equals `SSH_HOST` in `.env`. The `itsup` CLI enforces this fail-closed: `run`, `apply`, `down`, `dns`, `proxy`, `svc`, and `monitor` refuse on any machine whose detected LAN IP does not match `SSH_HOST`, and `make install-runtime` refuses off-host before it touches systemd/launchd. `make uninstall-runtime` is the recovery exception: it may run off-host to remove stale local systemd/launchd integration and local remnants from the current checkout, but it does not invoke the host-only `itsup down` path there. The GitOps, config, secrets, and read commands (`pull`, `commit`, `status`, `create`, `init`, `validate`, `migrate`, `encrypt`, `decrypt`, `diff-secrets`, `edit-secret`, `sops-key`) run anywhere. Off-host a runtime-mutating command would spin up the entire stack locally; the gate is not self-grantable. The command-level contract is in `project/itsup/spec/cli`; operational detail in `project/itsup/spec/runtime-operations`.
- **Operate from the repository root.** Never stay `cd`'d into a subdirectory. For directory-scoped work use `(cd <dir> && <command>)` with relative paths.
- **Operate from the repository root.** Never stay `cd`'d into a subdirectory. For directory-scoped work use `(cd <dir> && <command>)` with relative paths.
- **itsUP's own code is not containerized.** The Python CLI (`itsup`), API server, monitoring, DNS honeypot-management, and proxy-config code all run on the host. Only upstream project services are containerized. Never containerize itsUP code.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help install install-runtime uninstall-runtime restart status lint format clean
.PHONY: help install install-runtime uninstall-runtime restart status lint format smoke clean

help: ## Show this help message
@echo 'Usage: make [target]'
Expand Down Expand Up @@ -31,6 +31,9 @@ format: ## Format code
lint: ## Run linter
@FILES_FROM="$(FILES_FROM)" ./bin/lint.sh

smoke: ## Start the CLI from the installed environment
@.venv/bin/itsup --help

clean: ## Remove generated artifacts and caches
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name '*.pyc' -delete
Expand Down
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ itsup svc <project> exec web sh # Execute commands in containers
# Container Security Monitor
itsup monitor start [--flags] # Start security monitor
itsup monitor stop # Stop monitor
instrukt-ai-logs itsup --include monitor # Tail monitor diagnostics
journalctl -u itsup-monitor -f # Follow monitor diagnostics (container host)
itsup monitor cleanup # Review blacklist
itsup monitor report # Generate threat report

Expand Down Expand Up @@ -379,8 +379,8 @@ itsup monitor start --report-only --use-opensnitch
# Stop monitor
itsup monitor stop

# View diagnostics
instrukt-ai-logs itsup --include monitor
# View diagnostics (container host)
journalctl -u itsup-monitor

# Generate threat intelligence report
itsup monitor report
Expand Down Expand Up @@ -509,25 +509,30 @@ On Linux hosts, `make install-runtime` (via `bin/install-bringup.sh`) configures

##### Runtime logs

`itsup logs` is the front door for API, monitor, and supervised runtime logs:
itsUP has no log command of its own; each log is read with the tool that owns it.

**Application logs** — what itsUP's own code writes through the shared InstruktAI logger (the `itsup` CLI and the one-shot jobs) — are read with the InstruktAI logs tool, the same instruction as for every other InstruktAI project:

```bash
itsup logs api -f
instrukt-ai-logs itsup --since 1h # Everything from the last hour, merged by time
instrukt-ai-logs itsup --follow # Print the recent window, then follow
```

Application logs can also be queried with the InstruktAI logs CLI:
`instrukt-ai-logs` is the logger project's standalone tool ([InstruktAI/logging](https://github.com/InstruktAI/logging)). The Python package itsUP depends on only writes logs, so `make install` does not provide the tool. Install it once on each machine that reads these logs:

```bash
instrukt-ai-logs -f itsup
curl -LsSf https://github.com/InstruktAI/logging/releases/latest/download/instrukt-ai-logs-installer.sh | sh
```

Systemd-managed units (bringup, healthcheck, backup) log to stdout/stderr, captured by the journal: `journalctl -u <service>`. On macOS, launchd captures agent output to `~/Library/Logs/itsup.<name>.log`.
**Supervised units** — the API server, the security monitor, bringup, apply, backup, and the healthcheck — write to stdout/stderr, captured by the journal: `journalctl -u <unit>` (for example `journalctl -u itsup-api -f`). On macOS, launchd captures agent output to `~/Library/Logs/itsup.<name>.log`.

**The Traefik access log** is Traefik's own JSON file, `logs/access.log`, read with ordinary tools.

#### 6. Monitor

```bash
# Follow raw Traefik access records
itsup logs access -f
tail -f logs/access.log
```

### Configure services
Expand Down
275 changes: 0 additions & 275 deletions commands/logs.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/domain/itsup/policy/host-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Which itsUP CLI commands may run on which machine — runtime-mutat

- **Runtime-mutating commands run only on the container host** — the machine whose own LAN IP
equals `SSH_HOST` in `.env`. These deploy or stop containers: `apply`, `run`, `down`, and the
stack-management commands (`dns`, `proxy`, `svc`, `monitor`, `logs`), plus host provisioning
stack-management commands (`dns`, `proxy`, `svc`, `monitor`), plus host provisioning
(`make install-runtime`). On the host, the full command set is available.
- **GitOps, config, secret, and read commands run anywhere.** `pull`, `commit`, `status`,
`create`, `init`, `validate`, `migrate`, `edit-secret`, `encrypt`, `decrypt`, `diff-secrets`,
Expand Down
4 changes: 2 additions & 2 deletions docs/domain/itsup/spec/cli-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Container host only — runtime-mutating (see itsUP Host Boundary):
- `itsup down` — stop all containers.
- `itsup dns` / `itsup proxy` — DNS and proxy stack management.
- `itsup svc <project> <command>` — service operations for a project.
- `itsup monitor` — container security monitor management. Diagnostics are viewed via
`instrukt-ai-logs itsup --include monitor`, not a subcommand.
- `itsup monitor` — container security monitor management. Its diagnostics are in the host
supervisor's journal (`journalctl -u itsup-monitor`), not behind a subcommand.

## Known caveats

Expand Down
Loading