From ef72e3ea0f6fe9eeae4222fd6118f58766e2631e Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Sun, 14 Jun 2026 22:07:44 -0500 Subject: [PATCH] refactor(core): decouple applications to separate deployments and streamline core control plane This commit restructures the homeserver repository to isolate the core gateway and management tools (Control Plane) from user applications (Data Plane). This allows applications to have independent lifecycles and CI/CD pipelines, preventing git history contamination. - Relocated user applications (excalidraw, gitea, jellyfin, learning-hub, mermaid, ollama) to an external deployments directory. - Moved homepage to the root directory as a core server component and removed the empty apps directory. - Streamlined up.sh and down.sh to deploy and stop only core services and homepage, removing --infra-only parameters. - Replaced all hardcoded domain names with a configurable global DOMAIN environment variable in docker-compose files. - Used Authelia templating ({{ env "DOMAIN" }}) in configuration.yml to dynamically resolve SSO cookie domains and redirection URLs. - Updated up.sh and down.sh helpers to explicitly pass env files via --env-file flags, resolving compose interpolation warnings. - Created a declarative NixOS module (infra/nixos/dynu-ddns.nix) to orchestrate the Dynu DDNS update script. - Created Authelia .env-example template for setup reproducibility. - Refactored .gitignore to exclude obsolete app cache rules and keep it minimal to core secrets, volumes, and logs. - Updated documentation (README, architecture, roadmap, usability) to document decoupled deployments and public/SSO service templates. --- .gitignore | 42 ++-- README.md | 54 +++-- apps/excalidraw/docker-compose.yml | 44 ----- apps/gitea/docker-compose.yml | 30 --- apps/jellyfin/docker-compose.yml | 35 ---- apps/learning/app/database.py | 12 -- apps/learning/app/main.py | 185 ------------------ apps/learning/app/models.py | 12 -- apps/learning/docker-compose.yml | 32 --- apps/mermaid/docker-compose.yml | 23 --- apps/ollama/docker-compose.yml | 56 ------ docs/architecture.html | 10 +- docs/roadmap.html | 27 ++- docs/usability.html | 138 +++++++++---- down.sh | 19 +- .../config/bookmarks.yaml | 0 {apps/homepage => homepage}/config/custom.css | 0 {apps/homepage => homepage}/config/custom.js | 0 .../homepage => homepage}/config/docker.yaml | 0 .../config/kubernetes.yaml | 0 .../homepage => homepage}/config/proxmox.yaml | 0 .../config/services.yaml | 27 --- .../config/settings.yaml | 0 .../homepage => homepage}/config/widgets.yaml | 0 .../homepage => homepage}/docker-compose.yml | 6 +- infra/authelia/.env-example | 6 + infra/authelia/config/configuration.yml | 8 +- infra/authelia/docker-compose.yml | 6 +- infra/core/docker-compose.yml | 10 +- infra/nixos/dynu-ddns.nix | 78 ++++++++ up.sh | 44 ++--- 31 files changed, 289 insertions(+), 615 deletions(-) delete mode 100644 apps/excalidraw/docker-compose.yml delete mode 100644 apps/gitea/docker-compose.yml delete mode 100644 apps/jellyfin/docker-compose.yml delete mode 100644 apps/learning/app/database.py delete mode 100644 apps/learning/app/main.py delete mode 100644 apps/learning/app/models.py delete mode 100644 apps/learning/docker-compose.yml delete mode 100644 apps/mermaid/docker-compose.yml delete mode 100644 apps/ollama/docker-compose.yml rename {apps/homepage => homepage}/config/bookmarks.yaml (100%) rename {apps/homepage => homepage}/config/custom.css (100%) rename {apps/homepage => homepage}/config/custom.js (100%) rename {apps/homepage => homepage}/config/docker.yaml (100%) rename {apps/homepage => homepage}/config/kubernetes.yaml (100%) rename {apps/homepage => homepage}/config/proxmox.yaml (100%) rename {apps/homepage => homepage}/config/services.yaml (55%) rename {apps/homepage => homepage}/config/settings.yaml (100%) rename {apps/homepage => homepage}/config/widgets.yaml (100%) rename {apps/homepage => homepage}/docker-compose.yml (78%) create mode 100644 infra/authelia/.env-example create mode 100644 infra/nixos/dynu-ddns.nix diff --git a/.gitignore b/.gitignore index 874715b..a78d4c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,41 +1,27 @@ # Environments & Secrets .env .env.* -**/letsencrypt/acme.json +**/.env **/config/*.env **/config/users.yml -**/.env -# Authelia Data -**/authelia/config/db.sqlite3 -**/authelia/config/emails.txt - -# Application Data (Persistent Volumes) -**/data/ -**/ollama_data/ -**/portainer_data/ - -# Infrastructure Data -infra/diun/data/ -infra/authelia/config/db.sqlite3 - -# Certificates +# SSL / ACME Certificates & Keys +**/letsencrypt/acme.json **/*.key **/*.crt **/*.pem -# Python -__pycache__/ -*.py[cod] -*$py.class -.venv/ -venv/ +# Authelia Databases & Mail Logs +infra/authelia/config/db.sqlite3 +infra/authelia/config/emails.txt -# OS Metadata +# Infrastructure Persistent Volumes & Logs +**/portainer_data/ +infra/diun/data/ +homepage/config/logs/ + +# OS & Editor Metadata .DS_Store Thumbs.db -apps/homepage/config/logs/ - -apps/learning/learning.db -apps/jellyfin/cache -apps/jellyfin/config +.vscode/ +.idea/ diff --git a/README.md b/README.md index a1b440c..19546da 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,25 @@ # Hardened Private Cloud Hub -This repository contains a modular, secure, and self-documenting homeserver architecture based on the **Hardened Hub** model. +This repository contains the core Control Plane for a modular, secure, and self-documenting homeserver architecture based on the **Hardened Hub** model. ## πŸ—οΈ Architectural Overview -The system is split into two distinct layers to ensure stability and security: +The system is split into two distinct planes to ensure stability, security, and a clean separation of concerns: -### 1. Control Plane (`infra/`) -The "nervous system" of the server. These services handle security, routing, identity, and maintenance. +### 1. Control Plane (`infra/` & `homepage/`) +The "nervous system" of the server. These services handle security, edge routing, identity, maintenance, and portal visualization. - **Core (`infra/core`):** - - **Traefik (v3.6):** The front door. Handles HTTPS (Let's Encrypt), routing, and load balancing. - - **Socket-Proxy:** The security wall. Decouples containers from the host's `/var/run/docker.sock`. -- **Identity (`infra/authelia`):** Provides Single Sign-On (SSO) and 2FA protection for apps. + - **Traefik (v3.6):** The entry gateway. Handles HTTPS (Let's Encrypt DNS-01 challenges), routing, and load balancing. + - **Socket-Proxy:** The security boundary. Decouples core containers from the host's `/var/run/docker.sock`. +- **Identity (`infra/authelia`):** Provides Single Sign-On (SSO) and 2FA protection for administrative tools and exposed applications. - **Management (`infra/portainer`):** Visual container and stack management. -- **Monitoring (`infra/dozzle`):** Real-time log streaming for all containers (SSO Protected). -- **Maintenance (`infra/watchtower`, `infra/diun`):** Automated image updates and notifications. +- **Monitoring (`infra/dozzle`):** Real-time log streaming for core containers (SSO Protected). +- **Maintenance (`infra/watchtower`, `infra/diun`):** Automated image updates and registry monitoring. +- **Portal (`homepage/`):** Central landing dashboard at `arch-services.mywire.org` serving as the single entry point. -### 2. Data Plane (`apps/`) -The consumer-facing applications. - -- **Homepage:** Central dashboard at `arch-services.mywire.org`. -- **Gitea:** Self-hosted Git service (SSO Protected). -- **Ollama:** Local LLM runner with 3 replicas. -- **Excalidraw & Mermaid:** Visual tools for whiteboarding and diagramming. +### 2. Data Plane (Decoupled User Applications) +User applications (such as Gitea, Jellyfin, or Kanban boards) are kept fully decoupled in separate directories outside this repository. They integrate with the Control Plane dynamically via the shared external Docker network (`proxy-net`) and Traefik routing labels. --- @@ -45,21 +41,18 @@ Secrets are kept out of the configuration files and stored in `.env` files (git- ``` ### 2. Deployment -Use the `up.sh` script to launch the stack. The script handles networks, permissions, and service sequencing. +Use the `up.sh` script to launch the core stack. The script handles network creation, Let's Encrypt certificate file initialization, and starts all infrastructure services plus the Homepage portal. ```bash -# Start everything (Infrastructure + Apps) +# Start the entire Core Infrastructure + Homepage ./up.sh - -# Start ONLY the Control Plane -./up.sh --infra-only ``` ### 3. Verification Once deployed, verify your services are reachable: -- **Homepage:** `https://arch-services.mywire.org` +- **Homepage Dashboard:** `https://arch-services.mywire.org` - **Auth Portal:** `https://auth.arch-services.mywire.org` -- **Gitea:** `https://gitea.arch-services.mywire.org` (Redirects to Auth) +- **Traefik Dashboard:** `https://traefik.arch-services.mywire.org` (Redirects to Auth) - **Logs:** `https://logs.arch-services.mywire.org` (Redirects to Auth) --- @@ -71,7 +64,7 @@ The system includes built-in tools for real-time monitoring and management: - **Traefik Dashboard**: `https://traefik.arch-services.mywire.org` β€” View routing, entrypoints, and certificate status (SSO Protected). - **Dozzle**: `https://logs.arch-services.mywire.org` β€” Real-time log streaming for all containers (SSO Protected). - **Portainer**: `https://portainer.arch-services.mywire.org` β€” Advanced container, volume, and stack management (SSO Protected). -- **Homepage**: `https://arch-services.mywire.org` β€” The central "Single Pane of Glass" for all your services. +- **Homepage**: `https://arch-services.mywire.org` β€” The central portal displaying status indicators for all services. ### Maintenance Scripts For rapid diagnostics and common fixes, use the included automation scripts: @@ -93,10 +86,11 @@ This policy is currently enabled on core infrastructure and is recommended for a --- ## πŸ›‘οΈ Security Features -- **Socket Isolation:** No application container has access to the Docker socket. All management tools use the `socket-proxy`. -- **SSO Integration:** Critical apps (Gitea, Dozzle, Portainer) are behind Authelia Forward Auth. -- **Automatic TLS:** Traefik manages Let's Encrypt certificates via DNS-01 challenges with Dynu. -- **Network Segmentation:** Services are isolated on `proxy-net` and `socket-net`. +- **Socket Isolation:** No container has access to the host's raw Docker socket. All management tools communicate via the read/write-controlled `socket-proxy`. +- **SSO Integration:** Critical management tools (Portainer, Dozzle) and sensitive user applications are behind Authelia Forward Auth. +- **Automatic TLS:** Traefik automatically manages wildcard Let's Encrypt certificates via DNS-01 challenges with Dynu. +- **Network Segmentation:** System traffic is isolated on `proxy-net` and `socket-net` networks. +- **Decoupled Architecture:** Application stacks are isolated from the core repository config, preventing Git history contamination and permitting independent CI/CD pipelines. --- @@ -105,9 +99,7 @@ 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](https://kiskaadee.github.io/arch-traefik-hub/architecture.html)**: Deep dive into the layered model, networking, and security posture. -- **[Usability & Operations](https://kiskaadee.github.io/arch-traefik-hub/usability.html)**: How to use the hub, add new apps, and manage updates. +- **[Usability & Operations](https://kiskaadee.github.io/arch-traefik-hub/usability.html)**: How to use the hub, expose new decoupled apps, and manage updates. - **[Troubleshooting](https://kiskaadee.github.io/arch-traefik-hub/troubleshooting.html)**: Solutions for common connectivity, SSL, and authentication issues. - **[Project Roadmap](https://kiskaadee.github.io/arch-traefik-hub/roadmap.html)**: Current status and future planned features. - **[Dynu IP Protocol](https://kiskaadee.github.io/arch-traefik-hub/dynu-ip-update-protocol.html)**: Technical details on the DDNS synchronization mechanism. - - diff --git a/apps/excalidraw/docker-compose.yml b/apps/excalidraw/docker-compose.yml deleted file mode 100644 index edb6a99..0000000 --- a/apps/excalidraw/docker-compose.yml +++ /dev/null @@ -1,44 +0,0 @@ -services: - excalidraw: - image: excalidraw/excalidraw:latest - environment: - - REACT_APP_BACKEND_V2_GET_URL=https://excalidraw.arch-services.mywire.org/api/v2 - - REACT_APP_BACKEND_V2_POST_URL=https://excalidraw.arch-services.mywire.org/api/v2 - - REACT_APP_WS_SERVER_URL=wss://excalidraw.arch-services.mywire.org/socket.io - networks: - - proxy-net - labels: - - "traefik.enable=true" - - "traefik.http.routers.excalidraw.rule=Host(`excalidraw.arch-services.mywire.org`)" - - "traefik.http.routers.excalidraw.entrypoints=websecure" - - "traefik.http.routers.excalidraw.tls=true" - - "traefik.http.routers.excalidraw.tls.certresolver=myresolver" - - "traefik.http.routers.excalidraw.service=excalidraw-svc" - - "traefik.http.routers.excalidraw-red.rule=Host(`excalidraw.arch-services.mywire.org`)" - - "traefik.http.routers.excalidraw-red.entrypoints=web" - - "traefik.http.routers.excalidraw-red.middlewares=https-redirect@docker" - - - "traefik.http.services.excalidraw-svc.loadbalancer.server.port=80" - - excalidraw-room: - image: excalidraw/excalidraw-room:latest - restart: on-failure - networks: - - proxy-net - labels: - - "traefik.enable=true" - - "traefik.http.routers.excalidraw-room.rule=Host(`excalidraw.arch-services.mywire.org`) && PathPrefix(`/socket.io`)" - - "traefik.http.routers.excalidraw-room.entrypoints=websecure" - - "traefik.http.routers.excalidraw-room.tls=true" - - "traefik.http.routers.excalidraw-room.tls.certresolver=myresolver" - - "traefik.http.routers.excalidraw-room.service=excalidraw-room-svc" - - "traefik.http.routers.excalidraw-room-red.rule=Host(`excalidraw.arch-services.mywire.org`) && PathPrefix(`/socket.io`)" - - "traefik.http.routers.excalidraw-room-red.entrypoints=web" - - "traefik.http.routers.excalidraw-room-red.middlewares=https-redirect@docker" - - - "traefik.http.services.excalidraw-room-svc.loadbalancer.server.port=8080" - - -networks: - proxy-net: - external: true diff --git a/apps/gitea/docker-compose.yml b/apps/gitea/docker-compose.yml deleted file mode 100644 index 3a9e492..0000000 --- a/apps/gitea/docker-compose.yml +++ /dev/null @@ -1,30 +0,0 @@ -services: - server: - image: gitea/gitea:latest - container_name: gitea - environment: - - USER_UID=1000 - - USER_GID=1000 - volumes: - - ./data:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - networks: - - proxy-net - labels: - - "traefik.enable=true" - - "traefik.http.routers.gitea.rule=Host(`gitea.arch-services.mywire.org`)" - - "traefik.http.routers.gitea.entrypoints=websecure" - - "traefik.http.routers.gitea.tls=true" - - "traefik.http.routers.gitea.middlewares=authelia-auth@docker" - - "traefik.http.routers.gitea.service=gitea-svc" - - "traefik.http.routers.gitea-red.rule=Host(`gitea.arch-services.mywire.org`)" - - "traefik.http.routers.gitea-red.entrypoints=web" - - "traefik.http.routers.gitea-red.middlewares=https-redirect@docker" - - - "traefik.http.services.gitea-svc.loadbalancer.server.port=3000" - - -networks: - proxy-net: - external: true diff --git a/apps/jellyfin/docker-compose.yml b/apps/jellyfin/docker-compose.yml deleted file mode 100644 index e546f1c..0000000 --- a/apps/jellyfin/docker-compose.yml +++ /dev/null @@ -1,35 +0,0 @@ -services: - jellyfin: - image: jellyfin/jellyfin:latest - container_name: jellyfin - user: 1000:1000 # Assuming standard user, change if needed - volumes: - - ./config:/config - - ./cache:/cache - - /home/kiskaadee/media:/media # Assuming a media path in home - restart: unless-stopped - networks: - - proxy-net - labels: - - "traefik.enable=true" - # Public (HTTPS) - - "traefik.http.routers.jellyfin.rule=Host(`jellyfin.arch-services.mywire.org`)" - - "traefik.http.routers.jellyfin.entrypoints=websecure" - - "traefik.http.routers.jellyfin.tls=true" - - "traefik.http.routers.jellyfin.middlewares=jellyfin-ratelimit@docker" - - "traefik.http.routers.jellyfin.service=jellyfin-svc" - - # Middleware: Rate Limit for Jellyfin - - "traefik.http.middlewares.jellyfin-ratelimit.ratelimit.average=100" - - "traefik.http.middlewares.jellyfin-ratelimit.ratelimit.burst=50" - - # Public (Redirect) - - "traefik.http.routers.jellyfin-red.rule=Host(`jellyfin.arch-services.mywire.org`)" - - "traefik.http.routers.jellyfin-red.entrypoints=web" - - "traefik.http.routers.jellyfin-red.middlewares=https-redirect@docker" - - - "traefik.http.services.jellyfin-svc.loadbalancer.server.port=8096" - -networks: - proxy-net: - external: true diff --git a/apps/learning/app/database.py b/apps/learning/app/database.py deleted file mode 100644 index 90381c8..0000000 --- a/apps/learning/app/database.py +++ /dev/null @@ -1,12 +0,0 @@ -from sqlalchemy import create_engine -from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.orm import sessionmaker - -SQLALCHEMY_DATABASE_URL = "sqlite:///./learning.db" - -engine = create_engine( - SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} -) -SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) - -Base = declarative_base() diff --git a/apps/learning/app/main.py b/apps/learning/app/main.py deleted file mode 100644 index 764ba5d..0000000 --- a/apps/learning/app/main.py +++ /dev/null @@ -1,185 +0,0 @@ -from fastapi import FastAPI, Depends, HTTPException -from fastapi.staticfiles import StaticFiles -from fastapi.middleware.cors import CORSMiddleware -from fastapi.responses import FileResponse -from sqlalchemy.orm import Session -from typing import List, Optional -from pydantic import BaseModel -import uvicorn -import os -import psutil -import docker - -from . import models, database - -# Create tables -models.Base.metadata.create_all(bind=database.engine) - -app = FastAPI(title="Learning Hub API") - -# Initialize Docker client -try: - docker_client = docker.from_env() -except Exception: - docker_client = None - -app.add_middleware( - CORSMiddleware, - allow_origins=["*"], - allow_credentials=True, - allow_methods=["*"], - allow_headers=["*"], -) - -# Dependency -def get_db(): - db = database.SessionLocal() - try: - yield db - finally: - db.close() - -class CourseBase(BaseModel): - title: str - description: Optional[str] = None - main_link: str - last_link: Optional[str] = None - status: str = "Planning" - -class CourseCreate(CourseBase): - pass - -class Course(CourseBase): - id: int - class Config: - from_attributes = True - -@app.get("/api/system-stats") -def get_system_stats(): - cpu = psutil.cpu_percent(interval=None) # Use None for non-blocking if called frequently - ram = psutil.virtual_memory() - # Monitor /home partition - disk_path = '/home' if os.path.exists('/home') else '/' - disk = psutil.disk_usage(disk_path) - return { - "cpu": cpu, - "ram_total": round(ram.total / (1024**3), 2), - "ram_used": round(ram.used / (1024**3), 2), - "ram_percent": ram.percent, - "disk_total": round(disk.total / (1024**3), 2), - "disk_used": round(disk.used / (1024**3), 2), - "disk_percent": disk.percent - } - -@app.get("/api/services") -def get_services(): - services_config = { - "infrastructure": [ - {"name": "Traefik", "container": "traefik", "href": "https://traefik.arch-services.mywire.org"}, - {"name": "Authelia", "container": "authelia", "href": "https://auth.arch-services.mywire.org"}, - {"name": "Portainer", "container": "portainer", "href": "https://portainer.arch-services.mywire.org"}, - {"name": "Dozzle", "container": "dozzle", "href": "https://logs.arch-services.mywire.org"}, - ], - "applications": [ - {"name": "Gitea", "container": "gitea", "href": "https://gitea.arch-services.mywire.org"}, - {"name": "Ollama", "container": "ollama-ollama-1", "href": "https://ollama.arch-services.mywire.org"}, - {"name": "Excalidraw", "container": "excalidraw-excalidraw-1", "href": "https://excalidraw.arch-services.mywire.org"}, - {"name": "Mermaid", "container": "mermaid-live-editor", "href": "https://mermaid.arch-services.mywire.org"}, - {"name": "Jellyfin", "container": "jellyfin", "href": "https://jellyfin.arch-services.mywire.org"}, - ] - } - - results = {"infrastructure": [], "applications": []} - - if not docker_client: - return services_config - - for category in services_config: - for s in services_config[category]: - try: - container = docker_client.containers.get(s["container"]) - status = container.status - except Exception: - status = "unknown" - results[category].append({**s, "status": status}) - - return results - -@app.get("/api/bookmarks") -def get_bookmarks(): - return { - "Developer": [{"name": "Github", "href": "https://github.com/"}], - "Social": [{"name": "Reddit", "href": "https://reddit.com/"}], - "Entertainment": [{"name": "YouTube", "href": "https://youtube.com/"}] - } - -@app.get("/api/courses", response_model=List[Course]) -def read_courses(db: Session = Depends(get_db)): - return db.query(models.Course).all() - -@app.post("/api/courses", response_model=Course) -def create_course(course: CourseCreate, db: Session = Depends(get_db)): - db_course = models.Course(**course.dict()) - db.add(db_course) - db.commit() - db.refresh(db_course) - return db_course - -@app.put("/api/courses/{course_id}", response_model=Course) -def update_course(course_id: int, course: CourseCreate, db: Session = Depends(get_db)): - db_course = db.query(models.Course).filter(models.Course.id == course_id).first() - if not db_course: - raise HTTPException(status_code=404, detail="Course not found") - - for key, value in course.dict().items(): - setattr(db_course, key, value) - - db.commit() - db.refresh(db_course) - return db_course - -@app.delete("/api/courses/{course_id}") -def delete_course(course_id: int, db: Session = Depends(get_db)): - db_course = db.query(models.Course).filter(models.Course.id == course_id).first() - if not db_course: - raise HTTPException(status_code=404, detail="Course not found") - db.delete(db_course) - db.commit() - return {"message": "Course deleted"} - -# Seed initial data if empty -@app.on_event("startup") -def startup_event(): - db = database.SessionLocal() - if db.query(models.Course).count() == 0: - initial_courses = [ - models.Course( - title="Desarrollo Backend con Python", - description="Platzi Learning Path", - main_link="https://platzi.com/mis-rutas/16609931/", - status="WIP" - ), - models.Course( - title="Amazon Junior Software Developer", - description="Coursera Professional Certificate", - main_link="https://www.coursera.org/professional-certificates/amazon-junior-software-developer", - status="WIP" - ), - models.Course( - title="Software Design and Architecture", - description="Coursera Specialization", - main_link="https://www.coursera.org/specializations/software-design-architecture", - status="WIP" - ) - ] - db.add_all(initial_courses) - db.commit() - db.close() - -# Deprecated standalone UI - Serving only API -@app.get("/") -def read_root(): - return {"message": "Learning Hub API is running. Use the main dashboard to access the Kanban board."} - -if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=8000) diff --git a/apps/learning/app/models.py b/apps/learning/app/models.py deleted file mode 100644 index ea6af72..0000000 --- a/apps/learning/app/models.py +++ /dev/null @@ -1,12 +0,0 @@ -from sqlalchemy import Column, Integer, String -from .database import Base - -class Course(Base): - __tablename__ = "courses" - - id = Column(Integer, primary_key=True, index=True) - title = Column(String) - description = Column(String, nullable=True) - main_link = Column(String) - last_link = Column(String, nullable=True) - status = Column(String, default="Planning") # WIP, Planning, Archive diff --git a/apps/learning/docker-compose.yml b/apps/learning/docker-compose.yml deleted file mode 100644 index 04c9769..0000000 --- a/apps/learning/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -services: - learning-hub: - image: python:3.11-slim - container_name: learning-hub - working_dir: /app - volumes: - - .:/app - - /var/run/docker.sock:/var/run/docker.sock - - /home:/home:ro - command: > - sh -c "pip install fastapi uvicorn sqlalchemy psutil docker && python -m app.main" - networks: - - proxy-net - labels: - - "traefik.enable=true" - # Public (HTTPS) - - "traefik.http.routers.learning.rule=Host(`learning.arch-services.mywire.org`)" - - "traefik.http.routers.learning.entrypoints=websecure" - - "traefik.http.routers.learning.tls=true" - - "traefik.http.routers.learning.service=learning-svc" - - # Public (Redirect) - - "traefik.http.routers.learning-red.rule=Host(`learning.arch-services.mywire.org`)" - - "traefik.http.routers.learning-red.entrypoints=web" - - "traefik.http.routers.learning-red.middlewares=https-redirect@docker" - - - "traefik.http.services.learning-svc.loadbalancer.server.port=8000" - - -networks: - proxy-net: - external: true diff --git a/apps/mermaid/docker-compose.yml b/apps/mermaid/docker-compose.yml deleted file mode 100644 index 7890a1f..0000000 --- a/apps/mermaid/docker-compose.yml +++ /dev/null @@ -1,23 +0,0 @@ -services: - mermaid: - image: ghcr.io/mermaid-js/mermaid-live-editor:latest - container_name: mermaid-live-editor - restart: always - networks: - - proxy-net - labels: - - "traefik.enable=true" - - "traefik.http.routers.mermaid.rule=Host(`mermaid.arch-services.mywire.org`)" - - "traefik.http.routers.mermaid.entrypoints=websecure" - - "traefik.http.routers.mermaid.tls=true" - - "traefik.http.routers.mermaid.service=mermaid-svc" - - "traefik.http.routers.mermaid-red.rule=Host(`mermaid.arch-services.mywire.org`)" - - "traefik.http.routers.mermaid-red.entrypoints=web" - - "traefik.http.routers.mermaid-red.middlewares=https-redirect@docker" - - - "traefik.http.services.mermaid-svc.loadbalancer.server.port=8080" - - -networks: - proxy-net: - external: true diff --git a/apps/ollama/docker-compose.yml b/apps/ollama/docker-compose.yml deleted file mode 100644 index ab1e21a..0000000 --- a/apps/ollama/docker-compose.yml +++ /dev/null @@ -1,56 +0,0 @@ -services: - ollama: - image: ollama/ollama:latest - deploy: - replicas: 3 - restart_policy: - condition: on-failure - environment: - - OLLAMA_HOST=0.0.0.0 - - OLLAMA_ACCELERATE_SYSTEM=1 - devices: - - /dev/dri:/dev/dri - volumes: - - ollama_data:/root/.ollama:rw - networks: - - proxy-net - labels: - - "traefik.enable=true" - # Router 1: API/Automation (Token-based) - - "traefik.http.routers.ollama-api.rule=Host(`ollama.arch-services.mywire.org`) && Header(`X-Ollama-Key`, `sk-ollama-hardened-hub-2026`)" - - "traefik.http.routers.ollama-api.entrypoints=websecure" - - "traefik.http.routers.ollama-api.tls=true" - - "traefik.http.routers.ollama-api.priority=100" - - "traefik.http.routers.ollama-api.service=ollama-svc" - - - "traefik.http.routers.ollama-api-red.rule=Host(`ollama.arch-services.mywire.org`) && Header(`X-Ollama-Key`, `sk-ollama-hardened-hub-2026`)" - - "traefik.http.routers.ollama-api-red.entrypoints=web" - - "traefik.http.routers.ollama-api-red.middlewares=https-redirect@docker" - - "traefik.http.routers.ollama-api-red.priority=100" - - # Router 2: Browser/Standard (Authelia Protected) - - "traefik.http.routers.ollama-browser.rule=Host(`ollama.arch-services.mywire.org`)" - - "traefik.http.routers.ollama-browser.entrypoints=websecure" - - "traefik.http.routers.ollama-browser.tls=true" - - "traefik.http.routers.ollama-browser.middlewares=authelia-auth@docker" - - "traefik.http.routers.ollama-browser.priority=50" - - "traefik.http.routers.ollama-browser.service=ollama-svc" - - - "traefik.http.routers.ollama-browser-red.rule=Host(`ollama.arch-services.mywire.org`)" - - "traefik.http.routers.ollama-browser-red.entrypoints=web" - - "traefik.http.routers.ollama-browser-red.middlewares=https-redirect@docker" - - "traefik.http.routers.ollama-browser-red.priority=50" - - # Shared Service - - "traefik.http.services.ollama-svc.loadbalancer.server.port=11434" - - - "traefik.http.services.ollama-svc.loadbalancer.healthcheck.path=/api/tags" - - "traefik.http.services.ollama-svc.loadbalancer.healthcheck.interval=10s" - - -volumes: - ollama_data: - -networks: - proxy-net: - external: true diff --git a/docs/architecture.html b/docs/architecture.html index 3a70f6f..a0024e7 100644 --- a/docs/architecture.html +++ b/docs/architecture.html @@ -46,7 +46,7 @@

🌐 Edge Gateway

-

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

+

Traefik v3: Reverse Proxy & SSL (DNS-01 Challenges). Routes subdomains for all core and user-deployed services.

πŸ” Identity

@@ -68,10 +68,10 @@

Consumer-facing services isolated from the core infrastructure.

    -
  • Service Discovery: Homepage dashboard provides a unified portal.
  • -
  • Learning Hub: A dedicated Kanban board (FastAPI + SQLite) for tracking courses and milestones.
  • -
  • SSO Integration: Critical apps (Gitea, Dozzle, Learning) utilize Authelia Forward Auth.
  • -
  • Isolation: Services have no direct host access and communicate over internal networks.
  • +
  • Service Discovery: Homepage dashboard serves as a unified entry portal.
  • +
  • SSO Protection: Critical administration pages and external services utilize Authelia Forward Auth.
  • +
  • Decoupled Lifecycles: User applications run in separate containers outside this repository, keeping the core system clean and stable.
  • +
  • Isolation: Services have no direct host access and communicate strictly over dynamic internal networks.
diff --git a/docs/roadmap.html b/docs/roadmap.html index afe26ca..b591212 100644 --- a/docs/roadmap.html +++ b/docs/roadmap.html @@ -11,14 +11,14 @@

πŸ—ΊοΈ Project Roadmap

-

Current system maturity and future priorities.

+

Current system maturity and future priorities for the core infrastructure.