Files
nixos-core/docs/legacy/usability.html
T
kiskaadee e832c83882 refactor(core): consolidate control plane into a single compose stack
This massive refactor transitions the project from a custom-scripted
multi-stack deployment into a unified, standard Docker Compose
architecture. This heavily simplifies GitOps workflows and native
NixOS systemd integration.

- Merge all infrastructure and portal compose files into a root docker-compose.yml
- Consolidate all service configurations and databases into a single ./config/ directory
- Remove brittle up.sh and down.sh orchestration scripts
- Fix Authelia templating by enabling X_AUTHELIA_CONFIG_FILTERS=template
- Replace all hardcoded domain names with dynamic ${DOMAIN} variables
- Archive legacy HTML documentation and architecture notes to docs/legacy/
- Introduce setup_guide.md as the single source of truth for SOPS secrets and NixOS deployment
2026-06-28 15:55:06 -05:00

164 lines
7.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Usability & Operations | Hardened Hub</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main>
<header>
<h1>🖱️ Usability & Operational Notes</h1>
<p>A guide for interacting with the Hardened Hub and exposing external services.</p>
</header>
<nav>
<h4>Topics</h4>
<ul>
<li><a href="#auth">Authentication</a></li>
<li><a href="#nav">Navigation</a></li>
<li><a href="#mgmt">Management</a></li>
<li><a href="#add">Exposing New Services</a></li>
</ul>
</nav>
<section id="auth">
<h2>🔑 Authentication (SSO)</h2>
<p>Critical core services and protected user applications are shielded by <strong>Authelia</strong>.</p>
<ol>
<li>Access a protected URL (e.g., <code>https://portainer.arch-services.mywire.org</code>).</li>
<li>You will be redirected to the Auth Portal (<code>https://auth.arch-services.mywire.org</code>).</li>
<li>Log in with your credentials.</li>
<li>Once authenticated, you obtain global session access to all SSO-protected services.</li>
</ol>
</section>
<section id="nav">
<h2>🧭 Navigating the Hub</h2>
<p>The <strong>Homepage</strong> dashboard is your central entry point:</p>
<ul>
<li><strong>Access URL:</strong> <a href="https://arch-services.mywire.org">https://arch-services.mywire.org</a></li>
<li><strong>Widgets:</strong> View real-time Docker container statuses, system resources, and service links.</li>
</ul>
<div class="layer-box">
<h4>Local Access (Fast Lane)</h4>
<p>To bypass traversing the public internet when you are on the same local network as the server, we use a **Public Domain + Local IP** mapping strategy (see <a href="adr-001-remove-localhost-routers.md">ADR 001</a>).</p>
<p>Add the following mapping to your client machine's <code>/etc/hosts</code> file (using your server's local IP, e.g., <code>192.168.1.100</code> or <code>127.0.0.1</code> if testing locally):</p>
<pre><code>127.0.0.1 arch-services.mywire.org traefik.arch-services.mywire.org auth.arch-services.mywire.org logs.arch-services.mywire.org portainer.arch-services.mywire.org [your-app-subdomain].arch-services.mywire.org</code></pre>
<p><em>Note: This guarantees valid SSL handshakes and working SSO cookies for local LAN sessions.</em></p>
</div>
</section>
<section id="mgmt">
<h2>🛠️ Core Infrastructure Management</h2>
<p>Deploy the control plane stacks and homepage directly using the host scripts:</p>
<pre><code># Start the Control Plane + Homepage Portal
./up.sh
# Stop all Core services
./down.sh</code></pre>
</section>
<section id="add">
<h2>➕ Exposing a New Service (Decoupled Model)</h2>
<p>User applications are fully decoupled from the core repository and managed in their own directories (e.g., <code>/home/kiskaadee/deployments/my-app</code>). We use Traefik labels to expose them under the <code>*.arch-services.mywire.org</code> wildcard domain.</p>
<p>Depending on your security and access needs, you can configure your stack for one of two scenarios:</p>
<div class="grid">
<article class="card">
<h4>🔓 Scenario A: Public / Direct Access</h4>
<p>Use this for applications that have their own built-in authentication (e.g., Jellyfin, Gitea) or public-facing projects (e.g., public web demos, portfolios).</p>
</article>
<article class="card">
<h4>🔒 Scenario B: SSO-Protected</h4>
<p>Use this for administrative tools, private databases, or custom internal apps that do not have native authentication and need to be secured behind Authelia.</p>
</article>
</div>
<br>
<h3>Scenario A: Public / Direct Access (Bypassing Authelia)</h3>
<p>This configuration exposes your service directly to the internet. Authelia is bypassed, allowing anyone (or the app's own login manager) to handle access.</p>
<pre><code class="language-yaml">services:
my-public-app:
image: my-app-image:latest
container_name: my-public-app
networks:
- proxy-net
labels:
- "traefik.enable=true"
# 1. Main HTTPS Route Rule
- "traefik.http.routers.public-app.rule=Host(`demo.arch-services.mywire.org`)"
- "traefik.http.routers.public-app.entrypoints=websecure"
- "traefik.http.routers.public-app.tls=true"
- "traefik.http.routers.public-app.service=public-app-svc"
# 2. HTTP to HTTPS Redirection Route
- "traefik.http.routers.public-app-red.rule=Host(`demo.arch-services.mywire.org`)"
- "traefik.http.routers.public-app-red.entrypoints=web"
- "traefik.http.routers.public-app-red.middlewares=https-redirect@docker"
# 3. Port Mapping (Target port inside the container)
- "traefik.http.services.public-app-svc.loadbalancer.server.port=8080"
networks:
proxy-net:
external: true</code></pre>
<h3>Scenario B: SSO-Protected (Secured by Authelia)</h3>
<p>This configuration intercepts all incoming requests and redirects unauthenticated users to the Authelia portal first. Once logged in, users are returned to the service.</p>
<pre><code class="language-yaml">services:
my-secure-app:
image: my-app-image:latest
container_name: my-secure-app
networks:
- proxy-net
labels:
- "traefik.enable=true"
# 1. Main HTTPS Route Rule
- "traefik.http.routers.secure-app.rule=Host(`admin.arch-services.mywire.org`)"
- "traefik.http.routers.secure-app.entrypoints=websecure"
- "traefik.http.routers.secure-app.tls=true"
- "traefik.http.routers.secure-app.service=secure-app-svc"
# 2. SSO Authentication Middleware (Crucial Line)
- "traefik.http.routers.secure-app.middlewares=authelia-auth@docker"
# 3. HTTP to HTTPS Redirection Route
- "traefik.http.routers.secure-app-red.rule=Host(`admin.arch-services.mywire.org`)"
- "traefik.http.routers.secure-app-red.entrypoints=web"
- "traefik.http.routers.secure-app-red.middlewares=https-redirect@docker"
# 4. Port Mapping (Target port inside the container)
- "traefik.http.services.secure-app-svc.loadbalancer.server.port=3000"
networks:
proxy-net:
external: true</code></pre>
<h3>3. Register in Homepage Dashboard</h3>
<p>To list your new service on the central dashboard, update <code>homepage/config/services.yaml</code> inside the core repository:</p>
<pre><code class="language-yaml">- User Applications:
- My Application:
icon: custom-app-icon
href: https://my-app.arch-services.mywire.org
description: Custom exposed app description
server: my-docker
container: my-app # Must match container_name exactly</code></pre>
</section>
<footer>
<p>(c) 2026 | <a href="https://roadtotech.me">Kiskaadee</a></p>
</footer>
</main>
</body>
</html>