From ecedf018f9a399c776e87a54ba7b0fec8dd7f37a Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Wed, 13 May 2026 23:54:23 -0500 Subject: [PATCH] docs: migrate to semantic HTML documentation v1 - Replaced all Markdown files in docs/ with structured HTML5. - Implemented a shared docs/style.css for consistent branding. - Added semantic sections, service cards, and status badges. - Updated footer with copyright and link to roadtotech.me. - Updated README to point to new HTML documentation. --- README.md | 11 +- docs/architecture.html | 104 +++++++++++++++ docs/architecture.md | 45 ------- docs/dynu-ip-update-protocol.html | 58 ++++++++ docs/dynu-ip-update-protocol.md | 213 ------------------------------ docs/roadmap.html | 77 +++++++++++ docs/roadmap.md | 55 -------- docs/style.css | 103 +++++++++++++++ docs/troubleshooting.html | 69 ++++++++++ docs/troubleshooting.md | 54 -------- docs/usability.html | 89 +++++++++++++ docs/usability.md | 67 ---------- 12 files changed, 506 insertions(+), 439 deletions(-) create mode 100644 docs/architecture.html delete mode 100644 docs/architecture.md create mode 100644 docs/dynu-ip-update-protocol.html delete mode 100644 docs/dynu-ip-update-protocol.md create mode 100644 docs/roadmap.html delete mode 100644 docs/roadmap.md create mode 100644 docs/style.css create mode 100644 docs/troubleshooting.html delete mode 100644 docs/troubleshooting.md create mode 100644 docs/usability.html delete mode 100644 docs/usability.md diff --git a/README.md b/README.md index 4cbc7b3..3751da0 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,10 @@ This policy is currently enabled on core infrastructure and is recommended for a For more in-depth information, please refer to the following guides: -- **[Server Architecture](docs/architecture.md)**: Deep dive into the layered model, networking, and security posture. -- **[Usability & Operations](docs/usability.md)**: How to use the hub, add new apps, and manage updates. -- **[Troubleshooting](docs/troubleshooting.md)**: Solutions for common connectivity, SSL, and authentication issues. -- **[Project Roadmap](docs/roadmap.md)**: Current status and future planned features. -- **[Dynu IP Protocol](docs/dynu-ip-update-protocol.md)**: Technical details on the DDNS synchronization mechanism. +- **[Server Architecture](docs/architecture.html)**: Deep dive into the layered model, networking, and security posture. +- **[Usability & Operations](docs/usability.html)**: How to use the hub, add new apps, and manage updates. +- **[Troubleshooting](docs/troubleshooting.html)**: Solutions for common connectivity, SSL, and authentication issues. +- **[Project Roadmap](docs/roadmap.html)**: Current status and future planned features. +- **[Dynu IP Protocol](docs/dynu-ip-update-protocol.html)**: Technical details on the DDNS synchronization mechanism. + diff --git a/docs/architecture.html b/docs/architecture.html new file mode 100644 index 0000000..e38e950 --- /dev/null +++ b/docs/architecture.html @@ -0,0 +1,104 @@ + + + + + + Server Architecture | Hardened Hub + + + + +
+
+

πŸ—οΈ Server Architecture

+

Model: Hardened Hub v2.0

+
+ + + +

The homeserver follows a Layered Architecture designed for security, observability, and modularity. It is split into two logical tiers: the Control Plane (Infrastructure) and the Data Plane (Applications).

+ +
+

1. Physical & Host Layer

+

The foundation of the system running directly on the host hardware or virtualized OS.

+
+
    +
  • OS: Linux (Generic).
  • +
  • IP Sync: A host-level systemd service (scripts/dynu/) monitors the public IP and updates Dynu DDNS records.
  • +
  • Docker Engine: Orchestrates all containerized services.
  • +
+
+
+ +
+

2. Infrastructure Layer (Control Plane)

+

The management tier that handles routing, identity, and system maintenance.

+ +
+
+

🌐 Edge Gateway

+

Traefik v3: Reverse Proxy & SSL (DNS-01 Challenges). Routes subdomains like gitea.*.

+
+
+

πŸ” Identity

+

Authelia: SSO & 2FA provider. Forward Auth integration with Traefik.

+
+
+

πŸ›‘οΈ Socket Proxy

+

Protects the Docker socket from container-escape vulnerabilities.

+
+
+

πŸ› οΈ Maintenance

+

Portainer (Management), Watchtower (Updates), and Diun (Notifications).

+
+
+
+ +
+

3. Application Layer (Data Plane)

+

Consumer-facing services isolated from the core infrastructure.

+
+
    +
  • Service Discovery: Homepage dashboard provides a unified portal.
  • +
  • SSO Integration: Critical apps (Gitea, Dozzle) utilize Authelia Forward Auth.
  • +
  • Isolation: Services have no direct host access and communicate over internal networks.
  • +
+
+
+ +
+

4. Networking Model

+

Traffic flow is segmented to minimize the blast radius of a potential breach.

+
    +
  • proxy-net: Shared internal network for Traefik and all exposed applications.
  • +
  • socket-net: Isolated network for Docker management tools.
  • +
  • External: Only ports 80 and 443 are exposed.
  • +
+
+ +
+

πŸ›‘οΈ Security Posture

+

Current hardening measures enforced across the Hub:

+
    +
  • HARDENED No Root Docker: Standardized PUID/PGID usage.
  • +
  • PRIVATE Wildcard SSL: Prevents subdomain enumeration via certificate transparency logs.
  • +
  • ISO Network Segmentation: Strict isolation of management traffic.
  • +
+
+ + +
+ + + diff --git a/docs/architecture.md b/docs/architecture.md deleted file mode 100644 index 812a3dc..0000000 --- a/docs/architecture.md +++ /dev/null @@ -1,45 +0,0 @@ -# πŸ—οΈ Server Architecture: Hardened Hub Model - -The homeserver follows a **Layered Architecture** designed for security, observability, and modularity. It is split into two logical tiers: the **Control Plane** (Infrastructure) and the **Data Plane** (Applications). - -## 1. Physical & Host Layer -- **OS**: Linux (Generic). -- **IP Sync**: A host-level systemd service (`scripts/dynu/`) monitors the public IP and updates Dynu DDNS records. This ensures that the external domain always points to the correct gateway. -- **Docker Engine**: Orchestrates all containerized services. - -## 2. Infrastructure Layer (`infra/`) -The "Control Plane" manages the lifecycle and security of the entire stack. - -### 🌐 Edge Gateway (`infra/core`) -- **Traefik v3**: Acts as the Reverse Proxy and SSL terminator. - - Handles **DNS-01 Challenges** via Dynu for wildcard SSL certificates. - - Routes traffic based on subdomains (e.g., `gitea.*`). -- **Socket-Proxy**: A secure bridge that protects the Docker socket. Services needing Docker access (Portainer, Watchtower) talk to this proxy instead of the raw socket, preventing container-escape vulnerabilities. - -### πŸ” Identity & Access (`infra/authelia`) -- **Authelia**: Provides Single Sign-On (SSO) and Two-Factor Authentication (2FA). -- **Forward Auth**: Traefik delegates authentication to Authelia before allowing traffic to sensitive applications. - -### πŸ› οΈ Management & Maintenance -- **Portainer**: Graphical UI for managing Docker stacks and containers. -- **Watchtower**: Automatically pulls new images and restarts containers when updates are available. -- **Diun**: Notifies the administrator of new image tags. - -## 3. Application Layer (`apps/`) -The "Data Plane" contains the services used by end-users. These are isolated on the `proxy-net` network and have no direct access to host resources unless explicitly defined. - -- **Service Discovery**: 'Homepage' (the dashboard) provides a unified portal. -- **SSO Integration**: Apps like Gitea and Dozzle are integrated with Authelia for secure, authenticated access. - -## 4. Networking Model -- **`proxy-net`**: Shared internal network for Traefik and all exposed applications. -- **`socket-net`**: Isolated network for communication between the Socket-Proxy and management tools. -- **External Exposure**: Only ports 80 and 443 are exposed to the internet. All other management (SSH, API) is restricted or handled via the reverse proxy. - ---- - -## πŸ›‘οΈ Security Posture -1. **No Root Docker**: Most containers are encouraged to run with specific PUID/PGID. -2. **Wildcard Certificates**: Wildcard SSL prevents domain enumeration by malicious scanners. -3. **Internal-Only Services**: Some tools (like Portainer) are reachable only via the local network or authenticated proxy. -4. **Log Rotation**: Global policy ensures container logs don't consume all disk space. diff --git a/docs/dynu-ip-update-protocol.html b/docs/dynu-ip-update-protocol.html new file mode 100644 index 0000000..294ae67 --- /dev/null +++ b/docs/dynu-ip-update-protocol.html @@ -0,0 +1,58 @@ + + + + + + Dynu IP Protocol | Hardened Hub + + + + +
+
+

πŸ“‘ Dynu IP Monitor & Updater

+

Design and architecture of the DDNS synchronization mechanism.

+
+ +
+

Problem Definition

+

Maintain accurate DNS A records despite dynamic public IPs and unreliable providers.

+
+ +
+

Core Design Decisions

+
+
+

1. Probe Model

+

Runs periodically via systemd instead of a long-lived daemon.

+
+
+

2. Dual-Source

+

Uses DNS (primary) and HTTP (fallback) for IP discovery.

+
+
+

3. Validation

+

Strict pipeline ensures no RFC1918 or private IPs are ever synced.

+
+
+

4. Atomicity

+

State updates use atomic file moves to prevent corruption.

+
+
+
+ +
+

Failure Model

+
    +
  • Degraded: Fallback used, system remains functional.
  • +
  • Error: No valid IP found, abort mutation.
  • +
+
+ + +
+ + + diff --git a/docs/dynu-ip-update-protocol.md b/docs/dynu-ip-update-protocol.md deleted file mode 100644 index 3898b2f..0000000 --- a/docs/dynu-ip-update-protocol.md +++ /dev/null @@ -1,213 +0,0 @@ -# Dynu IP Monitor & Updater (Design / Architecture) - -## Problem Definition - -Maintain accurate DNS A records in Dynu despite: - -* dynamic public IPs -* unreliable external IP providers -* transient network failures - -### Success Criteria - -* Correct IP is eventually reflected in Dynu -* No invalid or private IPs are ever persisted -* No redundant updates (avoid Dynu abuse flags) -* Safe under concurrent or repeated execution - -### Non-Goals - -* IPv6 support -* complex DNS record management -* real-time updates (polling only) - ---- - -## Core Design Decisions - -### 1. Probe Model (Not a Daemon) - -The system runs periodically instead of continuously. - -**Why:** - -* simpler lifecycle (systemd handles scheduling) -* naturally idempotent -* avoids long-lived state bugs - ---- - -### 2. Dual-Source Discovery - -* Primary: DNS (`dig`) -* Fallback: HTTP providers - -**Why:** - -* DNS is faster and lightweight -* HTTP provides redundancy when DNS fails - ---- - -### 3. Explicit Degradation Model - -Failures are classified: - -* `degraded` β†’ fallback used, system still functional -* `error` β†’ no valid IP, abort - -**Why:** - -* improves observability -* avoids silent failure modes - ---- - -### 4. Strict Validation Pipeline - -Every candidate IP must pass: - -1. format validation (regex + bounds) -2. public IP validation (no RFC1918 / CGNAT) - -Validation is applied: - -* per-provider -* after discovery (final gate) - -**Why:** - -* prevents poisoning state with invalid data -* enforces invariant: *state must always be valid* - ---- - -### 5. State as a Consistency Contract - -`last_ip` represents: - -> β€œThe last IP successfully synchronized with Dynu” - -It is updated **only after**: - -* HTTP 200 -* valid Dynu semantic response (`good` / `nochg`) - -**Why:** - -* avoids divergence between local state and remote DNS - ---- - -### 6. Atomic Writes - -State updates use: - -``` -write β†’ temp file β†’ mv -``` - -**Why:** - -* guarantees consistency even on crash/interruption -* `mv` is atomic on same filesystem - ---- - -### 7. Concurrency Strategy - -Non-blocking lock via `flock`. - -If locked: - -``` -skip execution -``` - -**Why:** - -* prevents overlapping runs -* avoids queue buildup from timers -* ensures last execution β€œwins” - ---- - -### 8. Deferred Credential Processing - -Password hashing happens only when update is needed. - -**Why:** - -* avoids unnecessary computation -* keeps fast-path (no-change) minimal - ---- - -### 9. Transport vs Semantic Validation - -Two layers: - -1. Transport β†’ HTTP status must be `200` -2. Semantic β†’ response must start with `good` or `nochg` - -**Why:** - -* separates network failures from API logic failures -* improves debugging clarity - ---- - -### 10. Structured Logging - -All logs follow: - -``` -event=... reason=... cause=... -``` - -**Why:** - -* machine-filterable via journald -* consistent debugging surface - ---- - -## Trade-offs - -### Bash vs Higher-Level Language - -**Chosen:** Bash - -**Pros:** - -* zero runtime dependency -* native systemd integration -* simple deployment - -**Cons:** - -* limited abstractions -* harder error composition -* more manual validation - -Given the scope (I/O-bound, small state machine), Bash remains appropriate. - ---- - -## Failure Modes Considered - -* DNS unavailable β†’ fallback to HTTP -* HTTP provider failure β†’ rotate providers -* invalid IP returned β†’ rejected -* API failure β†’ no state mutation -* concurrent execution β†’ skipped -* partial execution β†’ no persistent side effects - ---- - -## Key Invariants - -* No invalid IP is ever persisted -* State reflects only successful external sync -* Script is safe to run repeatedly -* System is eventually consistent, not instantly consistent diff --git a/docs/roadmap.html b/docs/roadmap.html new file mode 100644 index 0000000..afe26ca --- /dev/null +++ b/docs/roadmap.html @@ -0,0 +1,77 @@ + + + + + + Project Roadmap | Hardened Hub + + + + +
+
+

πŸ—ΊοΈ Project Roadmap

+

Current system maturity and future priorities.

+
+ + + +
+

βœ… Phase 1: Core Gateway & Infrastructure

+

COMPLETE Stable external access, identity management, and core security.

+
    +
  • [x] Dynamic DNS: Reliable IP synchronization via systemd-based Dynu updater.
  • +
  • [x] Edge Routing: Traefik v3 with Let's Encrypt (DNS-01) automation.
  • +
  • [x] Layered Architecture: Clear separation between infra/ and apps/.
  • +
  • [x] Identity & SSO: Authelia integration with 2FA/OIDC support.
  • +
  • [x] Security Hardening: Docker socket proxy and internal network segmentation.
  • +
+
+ +
+

πŸ—οΈ Phase 2: Application Ecosystem & Observability

+

IN PROGRESS Expand utility and improve monitoring.

+
    +
  • [x] Service Discovery: 'Homepage' dashboard integration.
  • +
  • [x] Visual Tools: Excalidraw and Mermaid deployment.
  • +
  • [x] Development: Self-hosted Gitea with SSO.
  • +
  • [x] AI/ML: Scalable Ollama cluster with model management.
  • +
  • [ ] Unified Health: Integrate Traefik/Docker health checks into Homepage.
  • +
  • [ ] Resource Monitoring: Add lightweight metrics (Glances/Netdata).
  • +
+
+ +
+

πŸš€ Phase 3: Automation & Resilience

+
    +
  • [x] Automated Updates: Watchtower and Diun for image lifecycle.
  • +
  • [ ] Backup Strategy: Automated, encrypted off-site backups for persistent volumes.
  • +
  • [ ] Infrastructure as Code: Further modularization of deployment scripts.
  • +
  • [ ] Alerting: Push notifications (Gotify/Ntfy) for system failures.
  • +
+
+ +
+

🌐 Phase 4: Network Optimization

+
    +
  • [ ] Local DNS: Ad-blocking DNS (Pi-hole/AdGuard Home) for LAN.
  • +
  • [ ] Hairpin NAT: Validation and optimization for internal traffic.
  • +
  • [ ] VPN Integration: WireGuard-based remote access.
  • +
+
+ + +
+ + + diff --git a/docs/roadmap.md b/docs/roadmap.md deleted file mode 100644 index 9fb6fe8..0000000 --- a/docs/roadmap.md +++ /dev/null @@ -1,55 +0,0 @@ -# πŸ—ΊοΈ Project Roadmap: Hardened Private Cloud Hub - -This roadmap reflects the current system maturity and future priorities. - ---- - -## βœ… Phase 1: Core Gateway & Infrastructure (Complete) -*Objective: Stable external access, identity management, and core security.* - -- [x] **Dynamic DNS:** Reliable IP synchronization via systemd-based Dynu updater. -- [x] **Edge Routing:** Traefik v3 with Let's Encrypt (DNS-01) automation. -- [x] **Layered Architecture:** Clear separation between `infra/` (control plane) and `apps/` (data plane). -- [x] **Identity & SSO:** Authelia integration with 2FA/OIDC support. -- [x] **Security Hardening:** Docker socket proxy, internal network segmentation, and non-root users where possible. -- [x] **Centralized Logging:** Real-time log streaming via Dozzle. - ---- - -## πŸ—οΈ Phase 2: Application Ecosystem & Observability (In Progress) -*Objective: Expand utility and improve "Single Pane of Glass" monitoring.* - -- [x] **Service Discovery:** 'Homepage' dashboard integration. -- [x] **Visual Tools:** Excalidraw and Mermaid deployment. -- [x] **Development:** Self-hosted Gitea with SSO. -- [x] **AI/ML:** Scalable Ollama cluster with model management. -- [ ] **Unified Health:** Integrate Traefik/Docker health checks into the Homepage dashboard. -- [ ] **Resource Monitoring:** Add lightweight metrics (e.g., Glances or Netdata) with dashboard widgets. - ---- - -## πŸš€ Phase 3: Automation & Resilience -*Objective: Move from "manual maintenance" to "autonomous operations".* - -- [x] **Automated Updates:** Watchtower and Diun for image lifecycle management. -- [ ] **Backup Strategy:** Automated, encrypted off-site backups for persistent volumes (Gitea, DBs). -- [ ] **Infrastructure as Code:** Further modularization of the `up.sh` script into a more robust CLI or Ansible-based setup. -- [ ] **Alerting:** Push notifications (via Gotify/Ntfy) for system failures, auth breaches, or IP update issues. - ---- - -## 🌐 Phase 4: Network Optimization -*Objective: Reduce latency and external dependencies.* - -- [ ] **Local DNS:** Ad-blocking DNS (Pi-hole/AdGuard Home) for LAN clients. -- [ ] **Hairpin NAT:** Validation and optimization for internal traffic routing. -- [ ] **VPN Integration:** WireGuard-based remote access for private management without public exposure. - ---- - -## πŸ“œ Engineering Principles - -1. **Idempotency:** All deployment scripts (`up.sh`, `down.sh`) must be safe to run repeatedly. -2. **Layered Security:** No single point of failure. If the gateway is breached, apps are still behind SSO. -3. **Auditability:** Every change is reflected in documentation and Git history. -4. **Resilience:** Infrastructure must survive reboots and network outages automatically. diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 0000000..70f1a77 --- /dev/null +++ b/docs/style.css @@ -0,0 +1,103 @@ +:root { + --primary: #2563eb; + --secondary: #475569; + --bg: #f8fafc; + --text: #1e293b; + --border: #e2e8f0; + --accent: #f1f5f9; + --success: #166534; + --success-bg: #dcfce7; + --warning: #9a3412; + --warning-bg: #ffedd5; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + line-height: 1.6; + color: var(--text); + background: var(--bg); + margin: 0; + padding: 2rem; +} + +main { + max-width: 900px; + margin: 0 auto; + background: white; + padding: 3rem; + border-radius: 8px; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); +} + +header { + border-bottom: 2px solid var(--border); + margin-bottom: 2rem; + padding-bottom: 1rem; +} + +h1 { font-size: 2.5rem; color: var(--primary); margin: 0; } +h2 { font-size: 1.75rem; color: var(--secondary); margin-top: 2.5rem; border-left: 4px solid var(--primary); padding-left: 1rem; } +h3 { font-size: 1.25rem; color: var(--text); margin-top: 1.5rem; } + +code { + background: var(--accent); + padding: 0.2rem 0.4rem; + border-radius: 4px; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 0.9em; +} + +pre { + background: #1e293b; + color: #f8fafc; + padding: 1.5rem; + border-radius: 6px; + overflow-x: auto; +} + +pre code { + background: transparent; + padding: 0; + color: inherit; +} + +.layer-box { + background: var(--accent); + padding: 1.5rem; + border-radius: 6px; + margin: 1rem 0; + border: 1px solid var(--border); +} + +nav { + background: var(--accent); + padding: 1rem; + border-radius: 6px; + margin-bottom: 2rem; +} + +nav h4 { margin: 0 0 0.5rem 0; font-size: 0.9rem; text-transform: uppercase; color: var(--secondary); } +nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.9rem; } +nav a { color: var(--primary); text-decoration: none; } +nav a:hover { text-decoration: underline; } + +.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } +.card { border: 1px solid var(--border); padding: 1rem; border-radius: 4px; background: white; } +.card h4 { margin: 0 0 0.5rem 0; color: var(--primary); } + +.badge { + padding: 0.2rem 0.6rem; + border-radius: 9999px; + font-size: 0.8rem; + font-weight: bold; + display: inline-block; +} + +.badge-success { background: var(--success-bg); color: var(--success); } +.badge-warning { background: var(--warning-bg); color: var(--warning); } + +.status-list { list-style: none; padding: 0; } +.status-item { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; } + +footer { margin-top: 4rem; font-size: 0.8rem; color: var(--secondary); text-align: center; border-top: 1px solid var(--border); padding-top: 2rem; } +footer a { color: var(--primary); text-decoration: none; } diff --git a/docs/troubleshooting.html b/docs/troubleshooting.html new file mode 100644 index 0000000..d6d40f1 --- /dev/null +++ b/docs/troubleshooting.html @@ -0,0 +1,69 @@ + + + + + + Troubleshooting | Hardened Hub + + + + +
+
+

🩺 Troubleshooting Guide

+

Common issues and resolutions for the Hardened Hub.

+
+ + + +
+

🌐 Connectivity Issues

+
+

Site is unreachable

+
    +
  • Check External IP: Verify your public IP matches Dynu.
  • +
  • Check Traefik: docker compose -f infra/core/docker-compose.yml ps
  • +
+
+
+

Bad Gateway (502/503)

+

The application is down or not on proxy-net.

+
+
+ +
+

πŸ”’ SSL & Certificate Issues

+

If you see "Connection not private":

+
# Check Traefik ACME logs
+docker compose -f infra/core/docker-compose.yml logs -f traefik
+
+ +
+

πŸ” Authentication (Authelia)

+
+

Stuck in Login Loop?

+

Sync server time: sudo ntpdate pool.ntp.org and clear cookies.

+
+
+ +
+

🐳 Docker & Performance

+

If disk is full, run cleanup:

+
docker system prune -a --volumes
+
+ + +
+ + + diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md deleted file mode 100644 index 8773f1d..0000000 --- a/docs/troubleshooting.md +++ /dev/null @@ -1,54 +0,0 @@ -# 🩺 Troubleshooting Guide - -Common issues and their resolutions for the Hardened Hub. - -## 🌐 Connectivity Issues -### 1. Site is unreachable (General) -- **Check External IP**: Verify if your public IP matches the DNS record at Dynu. - - Run `scripts/dynu/run-once.sh` to force an update. -- **Check Traefik Status**: - - `docker compose -f infra/core/docker-compose.yml ps` - - Ensure Traefik is running and port 80/443 are mapped. - -### 2. "Bad Gateway" (502) or "Service Unavailable" (503) -- This usually means the application container is down or not connected to the `proxy-net`. -- **Action**: Verify the app container is running: - ```bash - docker ps | grep - ``` -- **Action**: Check container logs via Dozzle or `docker logs`. - -## πŸ”’ SSL & Certificate Issues -### 1. "Your connection is not private" -- Traefik might be struggling with the Let's Encrypt challenge. -- **Action**: Check Traefik logs for "ACME" or "LE" errors: - ```bash - docker compose -f infra/core/docker-compose.yml logs -f traefik - ``` -- **Common Cause**: Dynu API key is incorrect or API rate limits were hit. - -### 2. Certificate is not valid for the subdomain -- Ensure the Traefik `Host` rule in your `docker-compose.yml` labels is correct. - -## πŸ” Authentication (Authelia) Issues -### 1. Stuck in a Login Loop -- This often happens if the browser clock or server clock is out of sync. -- **Action**: Sync the server time (`sudo ntpdate pool.ntp.org`). -- **Action**: Clear browser cookies for your domain. - -### 2. Forbidden (403) after login -- Your user may not have the required permissions in `infra/authelia/config/configuration.yml`. -- **Action**: Check the `access_control` section in the Authelia config. - -## 🐳 Docker & Performance -### 1. Disk is full -- **Cause**: Usually excessive logs or orphaned volumes. -- **Action**: Run the cleanup command: - ```bash - docker system prune -a --volumes - ``` -- **Action**: Check `apps/homepage/config/logs/` and other app-specific log paths. - -### 2. High CPU/RAM Usage -- Check the Homepage dashboard or run `docker stats` to identify the culprit. -- **Common Culprit**: Ollama during model inference or Gitea indexing large repos. diff --git a/docs/usability.html b/docs/usability.html new file mode 100644 index 0000000..d79057a --- /dev/null +++ b/docs/usability.html @@ -0,0 +1,89 @@ + + + + + + Usability & Operations | Hardened Hub + + + + +
+
+

πŸ–±οΈ Usability & Operational Notes

+

A guide for interacting with the Hardened Hub once deployed.

+
+ + + +
+

πŸ”‘ Authentication (SSO)

+

Most services are protected by Authelia.

+
    +
  1. Access a protected service (e.g., gitea.*).
  2. +
  3. You will be redirected to the Auth Portal (auth.*).
  4. +
  5. Log in with your credentials.
  6. +
  7. Once authenticated, you have global access to all SSO-enabled services.
  8. +
+
+ + + +
+

πŸ› οΈ Service Management

+

Deployment Scripts

+
# Start everything
+./up.sh
+
+# Start ONLY the Control Plane
+./up.sh --infra-only
+
+# Stop all services
+./down.sh
+
+ +
+

βž• Adding a New Application

+
    +
  1. Create apps/your-app/docker-compose.yml.
  2. +
  3. Connect to proxy-net.
  4. +
  5. Add Traefik labels for routing and Authelia protection.
  6. +
  7. Update apps/homepage/config/services.yaml.
  8. +
+
+ +
+

πŸ€– Ollama API & Automation

+

Uses a hybrid security model for browser and CLI access.

+
+

API Key / Trusted Payload

+

Header: X-Ollama-Key: sk-ollama-hardened-hub-2026

+
curl https://ollama.arch-services.mywire.org/api/generate \
+  -H "X-Ollama-Key: sk-ollama-hardened-hub-2026" \
+  -d '{"model": "llama3", "prompt": "hi"}'
+
+
+ + +
+ + + diff --git a/docs/usability.md b/docs/usability.md deleted file mode 100644 index e887fd5..0000000 --- a/docs/usability.md +++ /dev/null @@ -1,67 +0,0 @@ -# πŸ–±οΈ Usability & Operational Notes - -This guide explains how to interact with the Hardened Hub once it is deployed. - -## πŸ”‘ Authentication (SSO) -Most services are protected by **Authelia**. -1. When you access a protected service (e.g., `gitea.*`), you will be redirected to the Auth Portal (`auth.*`). -2. Log in with your credentials. -3. Once authenticated, you will have access to all SSO-enabled services for the duration of your session. - -## 🧭 Navigating the Hub -The **Homepage** dashboard is your central entry point: -- **URL**: `https://arch-services.mywire.org` -- **Widgets**: View the health of Docker containers, system resources, and quick links to all deployed applications. - -## πŸ› οΈ Service Management -### Deployment Commands -Use the provided scripts for lifecycle management: -- `./up.sh`: Starts everything. -- `./up.sh --infra-only`: Starts only the control plane (routing, auth, monitoring). -- `./down.sh`: Stops and removes all containers gracefully. - -### Managing a Specific Service -To restart or view logs for a single service (e.g., Gitea): -```bash -cd apps/gitea -docker compose restart -docker compose logs -f -``` - -## βž• Adding a New Application -To add a new service to the Hub: -1. Create a directory in `apps/your-app`. -2. Add a `docker-compose.yml`. -3. Ensure it connects to the `proxy-net` network: - ```yaml - networks: - proxy-net: - external: true - ``` -4. Add Traefik labels for routing and (optional) Authelia labels for SSO. -5. Add the service to `apps/homepage/config/services.yaml` to see it on the dashboard. - -## πŸ“¦ Container Updates -- **Automated**: Watchtower checks for updates every few hours. -- **Manual**: Use Portainer (`portainer.*`) to manually pull new images and recreate containers with a single click. - -## πŸ“ Logging -Real-time logs can be viewed via **Dozzle** at `https://logs.arch-services.mywire.org`. This is preferred over `docker logs` for quick debugging across multiple containers. - -## πŸ€– Ollama API & Automation (Trusted Payload) -Ollama uses a hybrid security model to allow both browser use and automated tools: - -### Browser Use -Accessing `https://ollama.arch-services.mywire.org` directly will prompt for **Authelia SSO** login. - -### API & CLI Bypass -For scripts, cron jobs, or terminal use, you can bypass SSO by including the `X-Ollama-Key` header. -- **Header**: `X-Ollama-Key: sk-ollama-hardened-hub-2026` - -**Example (curl):** -```bash -curl https://ollama.arch-services.mywire.org/api/generate \ - -H "X-Ollama-Key: sk-ollama-hardened-hub-2026" \ - -d '{"model": "llama3", "prompt": "hi"}' -``` -