Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f039855e6f | ||
|
|
9c0539444b | ||
|
|
568fb0a58b | ||
|
|
6ee038fcfa | ||
|
|
e82e8f2adc | ||
|
|
d7fc75ee0d | ||
|
|
1d35857ecc |
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
# 📋 Control Plane Milestone P4: Readiness Plan & Boundary Specifications
|
# 📋 Control Plane Milestone P4: Readiness Plan & Boundary Specifications
|
||||||
|
|
||||||
**Status**: ✅ **Approved & Locked (Ready for P4 Daemon Implementation)**
|
**Status**: 🛠️ **In Progress (Pre-P4 Architecture & Security Gate)**
|
||||||
**Target Milestone**: [Milestone P4: Appctl Control Plane Daemon & API](../../ROADMAP.md#milestone-p4-appctl-control-plane-daemon--command-oriented-api)
|
**Target Milestone**: [Milestone P4: Appctl Control Plane Daemon & API](../../ROADMAP.md#milestone-p4-appctl-control-plane-daemon--command-oriented-api)
|
||||||
**Governing ADR**: [`homelab-appctl-control-plane-architecture.md`](../decisions/README.md)
|
**Governing ADR**: [`homelab-appctl-control-plane-architecture.md`](../decisions/README.md)
|
||||||
|
|
||||||
@@ -25,11 +25,11 @@ This plan resolves the six architectural prerequisites necessary to implement P4
|
|||||||
| Deliverable | Phase | Focus | Status |
|
| Deliverable | Phase | Focus | Status |
|
||||||
| :--- | :--- | :--- | :--- |
|
| :--- | :--- | :--- | :--- |
|
||||||
| **1. Implementation Inventory** | P0 Verification | Baseline truth, callers, dependencies, and migration state | ✅ **Completed** |
|
| **1. Implementation Inventory** | P0 Verification | Baseline truth, callers, dependencies, and migration state | ✅ **Completed** |
|
||||||
| **2. Command & Error Contract** | P4 Prerequisite (Blocker) | Canonical domain operations, typed schemas, and error taxonomy | ✅ **Locked & Approved** |
|
| **2. Command & Error Contract** | P4 Prerequisite (Blocker) | Canonical domain operations, typed schemas, and error taxonomy | 🎯 **In Review** |
|
||||||
| **3. Authorization Design** | Security Gate (Blocker) | Token lifecycle, RBAC matrix, and fail-closed evaluation | ✅ **Locked & Approved** |
|
| **3. Authorization Design** | Security Gate (Blocker) | Token lifecycle, RBAC matrix, and fail-closed evaluation | 🎯 **In Review** |
|
||||||
| **4. Execution & Privilege Boundaries** | P4 Prerequisite | Subprocess allowlist, Docker API capabilities, and filesystem roots | ✅ **Locked & Approved** |
|
| **4. Execution & Privilege Boundaries** | P4 Prerequisite | Subprocess allowlist, Docker API capabilities, and filesystem roots | ⏳ Pending Gate |
|
||||||
| **5. Audit Telemetry Semantics** | P4 Prerequisite | RFC JSONL audit schema, persistent ownership, and lifecycle | ✅ **Locked & Approved** |
|
| **5. Audit Telemetry Semantics** | P4 Prerequisite | RFC JSONL audit schema, persistent ownership, and lifecycle | ⏳ Pending Gate |
|
||||||
| **6. P4 Acceptance Test Suite** | Verification | Concrete DoD, black-box transport parity, and security regression gates | ✅ **Locked & Approved** |
|
| **6. P4 Acceptance Test Suite** | Verification | Concrete DoD, black-box transport parity, and security regression gates | ⏳ Pending Gate |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -229,7 +229,6 @@ Following the pattern established in Milestone P2 for `homelab-gitops.service`,
|
|||||||
- `ReadWritePaths`: Explicitly allowlisted writable roots:
|
- `ReadWritePaths`: Explicitly allowlisted writable roots:
|
||||||
- `/home/kiskaadee/Sites` (workload definitions and Git checkouts)
|
- `/home/kiskaadee/Sites` (workload definitions and Git checkouts)
|
||||||
- `/home/kiskaadee/var/lib/homelab` (workload persistent state roots)
|
- `/home/kiskaadee/var/lib/homelab` (workload persistent state roots)
|
||||||
- `/home/kiskaadee/Core/config/homepage` (Homepage services.yaml destination)
|
|
||||||
- `/var/log/homelab/appctl` or `/home/kiskaadee/.local/state/homelab/appctl` (audit log directory)
|
- `/var/log/homelab/appctl` or `/home/kiskaadee/.local/state/homelab/appctl` (audit log directory)
|
||||||
- `/run/homelab` (socket runtime directory)
|
- `/run/homelab` (socket runtime directory)
|
||||||
- `PrivateTmp = true`: Isolated temporary directories.
|
- `PrivateTmp = true`: Isolated temporary directories.
|
||||||
@@ -309,4 +308,4 @@ Before marking Milestone P4 complete, the following automated regression suite m
|
|||||||
| **Truthful Error Reporting** | `test_execution_failure_audit`: Mock failing Docker compose run (exit 1). Assert daemon returns `ERR_EXECUTION_FAILED` (500) and records `phase: FAILED` in audit log. | Reject PR |
|
| **Truthful Error Reporting** | `test_execution_failure_audit`: Mock failing Docker compose run (exit 1). Assert daemon returns `ERR_EXECUTION_FAILED` (500) and records `phase: FAILED` in audit log. | Reject PR |
|
||||||
| **Audit Persistence Gate** | `test_audit_failure_blocks_mutation`: Mock read-only audit log. Assert mutating command fails closed with zero Docker invocations. | Block Release |
|
| **Audit Persistence Gate** | `test_audit_failure_blocks_mutation`: Mock read-only audit log. Assert mutating command fails closed with zero Docker invocations. | Block Release |
|
||||||
| **Daemon Crash Recovery** | `test_daemon_restart_preserves_state`: Kill and restart `homelab-appctl.service`. Assert running container stacks are undisturbed and desired Git state remains intact. | Reject PR |
|
| **Daemon Crash Recovery** | `test_daemon_restart_preserves_state`: Kill and restart `homelab-appctl.service`. Assert running container stacks are undisturbed and desired Git state remains intact. | Reject PR |
|
||||||
| **Existing Invariant Regression** | Run `./scripts/test`: All 86 existing unit, security, and nix flake tests pass with 0 regressions. | Block Merge |
|
| **Existing Invariant Regression** | Run `./scripts/test`: All 84 existing unit, security, and nix flake tests pass with 0 regressions. | Block Merge |
|
||||||
@@ -35,9 +35,6 @@ if [ -f "$ENV_FILE" ]; then
|
|||||||
set +a
|
set +a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Lock the homelab root domain before setup_app_env can mutate $DOMAIN
|
|
||||||
export HOMELAB_DOMAIN="${HOMELAB_DOMAIN:-${DOMAIN_SUFFIX:-${DOMAIN:-roadtotech.me}}}"
|
|
||||||
|
|
||||||
# Show help usage
|
# Show help usage
|
||||||
show_help() {
|
show_help() {
|
||||||
echo "🚀 appctl - Homelab Container Orchestrator"
|
echo "🚀 appctl - Homelab Container Orchestrator"
|
||||||
|
|||||||
@@ -37,11 +37,7 @@ SITES_DIR = os.environ.get(
|
|||||||
else os.path.expanduser("~/Sites"),
|
else os.path.expanduser("~/Sites"),
|
||||||
)
|
)
|
||||||
|
|
||||||
HOMELAB_DOMAIN = (
|
HOMELAB_DOMAIN = os.environ.get("HOMELAB_DOMAIN") or os.environ.get("DOMAIN", "")
|
||||||
os.environ.get("HOMELAB_DOMAIN")
|
|
||||||
or os.environ.get("DOMAIN_SUFFIX")
|
|
||||||
or os.environ.get("DOMAIN", "")
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def validate_environment() -> None:
|
def validate_environment() -> None:
|
||||||
@@ -397,7 +393,6 @@ def resolve_app(
|
|||||||
container="",
|
container="",
|
||||||
description="Homelab Core Platform Stack",
|
description="Homelab Core Platform Stack",
|
||||||
dir_path=CORE_DIR,
|
dir_path=CORE_DIR,
|
||||||
app_type="core",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|||||||
@@ -336,45 +336,3 @@ def test_homepage_sync_groups_and_sorts_correctly(
|
|||||||
content = output_file.read_text()
|
content = output_file.read_text()
|
||||||
assert content.find("- Group A") < content.find("- Group B") # Group A should appear before Group B
|
assert content.find("- Group A") < content.find("- Group B") # Group A should appear before Group B
|
||||||
assert "App2" in content # App 2 is in the file
|
assert "App2" in content # App 2 is in the file
|
||||||
|
|
||||||
|
|
||||||
def test_homepage_sync_core_services_domain_isolation(
|
|
||||||
mock_core_dir: Path,
|
|
||||||
monkeypatch,
|
|
||||||
):
|
|
||||||
"""
|
|
||||||
Ensure Core Infrastructure services use HOMELAB_DOMAIN and do not leak
|
|
||||||
an application's domain if DOMAIN is overridden by appctl.
|
|
||||||
"""
|
|
||||||
hp_config_dir = mock_core_dir / "config" / "homepage"
|
|
||||||
hp_config_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
monkeypatch.setattr(engine, "HOMELAB_DOMAIN", "roadtotech.me")
|
|
||||||
monkeypatch.setenv("DOMAIN", "mermaid.roadtotech.me")
|
|
||||||
|
|
||||||
engine.cmd_sync_homepage(["--homepage-dir=" + str(hp_config_dir)])
|
|
||||||
|
|
||||||
output_file = hp_config_dir / "services.yaml"
|
|
||||||
assert output_file.exists()
|
|
||||||
content = output_file.read_text()
|
|
||||||
|
|
||||||
assert "https://dashboard.roadtotech.me" in content
|
|
||||||
assert "https://traefik.roadtotech.me" in content
|
|
||||||
assert "https://auth.roadtotech.me" in content
|
|
||||||
assert "mermaid.roadtotech.me" not in content
|
|
||||||
|
|
||||||
|
|
||||||
def test_resolve_core_stack_type():
|
|
||||||
"""
|
|
||||||
Ensure resolving 'core' returns app_type='core' (entire stack),
|
|
||||||
while individual core services return app_type='core_service'.
|
|
||||||
"""
|
|
||||||
core = engine.resolve_app("core")
|
|
||||||
assert core is not None
|
|
||||||
assert core.to_dict()["type"] == "core"
|
|
||||||
assert core.container == ""
|
|
||||||
|
|
||||||
traefik = engine.resolve_app("traefik")
|
|
||||||
assert traefik is not None
|
|
||||||
assert traefik.to_dict()["type"] == "core_service"
|
|
||||||
assert traefik.container == "traefik"
|
|
||||||
Reference in new issue
Block a user