392 lines
12 KiB
JavaScript

export function fallbackHardware() {
return {
clusters: [
{
name: "atlas",
role: "Flux-managed Kubernetes for bstein.dev services",
nodes: [
{ name: "titan-0a", role: "control-plane (leader)", hardware: "rpi5", status: "ready" },
{ name: "titan-0b", role: "control-plane", hardware: "rpi5", status: "ready" },
{ name: "titan-0c", role: "control-plane", hardware: "rpi5", status: "ready" },
{ name: "titan-04", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-05", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-06", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-07", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-08", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-09", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-10", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-11", role: "worker", hardware: "rpi5", status: "ready" },
{ name: "titan-12", role: "worker (HDD astreae)", hardware: "rpi4", status: "ready" },
{ name: "titan-13", role: "worker (HDD astreae)", hardware: "rpi4", status: "ready" },
{ name: "titan-14", role: "worker (HDD astreae)", hardware: "rpi4", status: "ready" },
{ name: "titan-15", role: "worker (HDD astreae)", hardware: "rpi4", status: "ready" },
{ name: "titan-16", role: "worker", hardware: "rpi4", status: "offline" },
{ name: "titan-17", role: "worker (HDD asteria)", hardware: "rpi4", status: "ready" },
{ name: "titan-18", role: "worker (HDD asteria)", hardware: "rpi4", status: "ready" },
{ name: "titan-19", role: "worker (HDD asteria)", hardware: "rpi4", status: "ready" },
{ name: "titan-20", role: "jetson ai workload", hardware: "jetson xavier", status: "ready" },
{ name: "titan-21", role: "jetson ai workload", hardware: "jetson xavier", status: "ready" },
{ name: "titan-22", role: "gpu mini-pc (jellyfin)", hardware: "mini pc", status: "ready" },
],
},
],
specialty: [
{ name: "titan-db", alias: "atlas-db", role: "control-plane database (postgres)", hardware: "rpi5", status: "active" },
{ name: "titan-23", alias: "oceanus", role: "SUI validator (baremetal)", status: "active", hardware: "epyc-24c" },
{ name: "titan-24", alias: "tethys", role: "bridge node + scraper for oceanus metrics", status: "active", hardware: "ryzen-3900x" },
{ name: "titan-jh", alias: "theia", role: "bastion / KVM landing / lesavka", status: "active", hardware: "rpi5" },
],
};
}
export function fallbackServices() {
return {
services: [
{
name: "Keycloak",
icon: "🔐",
category: "identity",
summary: "Unified accounts for Single Sign-On. OIDC & LDAP",
link: "https://sso.bstein.dev",
},
{
name: "Nextcloud",
icon: "☁️",
category: "productivity",
summary: "Storage, office, and mail apps for bstein.dev users.",
link: "https://cloud.bstein.dev",
},
{
name: "Outline",
icon: "📝",
category: "productivity",
summary: "Team docs and knowledge base for Atlas users.",
link: "https://notes.bstein.dev",
},
{
name: "Planka",
icon: "🧭",
category: "productivity",
summary: "Kanban planning boards for tasks and projects.",
link: "https://tasks.bstein.dev",
},
{
name: "VaultWarden",
icon: "🔑",
category: "security",
summary: "Open Source & private password manager.",
link: "https://vault.bstein.dev",
},
{
name: "Vault",
icon: "🗝️",
category: "security",
summary: "Secrets for secure environment injection.",
link: "https://secret.bstein.dev",
},
{
name: "AI Chat",
icon: "🤖",
category: "ai",
summary: "Customized LLM for the titan home lab.",
link: "/ai/chat",
host: "chat.ai.bstein.dev",
status: "live",
},
{
name: "AI Vision",
icon: "👁️",
category: "ai",
summary: "Visualization tool - Planned",
link: "/ai/roadmap",
host: "vision.ai.bstein.dev",
status: "planned",
},
{
name: "AI Speech",
icon: "🎙️",
category: "ai",
summary: "Live Translation - Planned",
link: "/ai/roadmap",
host: "talk.ai.bstein.dev",
status: "planned",
},
{
name: "AI Translation",
icon: "🌐",
category: "ai",
summary: "Inline translation (roadmap) for comms.",
link: "/ai/roadmap",
host: "translate.ai.bstein.dev",
status: "planned",
},
{
name: "Jellyfin",
icon: "🎬",
category: "streaming",
summary: "Family movies streaming server with GPU acceleration.",
link: "https://stream.bstein.dev",
},
{
name: "Pegasus",
icon: "📤",
category: "streaming",
summary: "Upload pipeline feeding the Jellyfin library.",
link: "https://pegasus.bstein.dev",
},
{
name: "Grafana",
icon: "📈",
category: "observability",
summary: "Atlas metrics and dashboards for the lab.",
link: "https://metrics.bstein.dev",
},
{
name: "OpenSearch",
icon: "🔎",
category: "observability",
summary: "Centralized Atlas services logs. Powered by Fluent Bit.",
link: "https://logs.bstein.dev",
},
{
name: "Element",
icon: "💬",
category: "comms",
summary: "Discord style communication system for users.",
link: "https://live.bstein.dev",
host: "live.bstein.dev",
status: "live",
},
{
name: "Matrix (Synapse)",
icon: "🧩",
category: "comms",
summary: "Encrypted chat backend with bot integrations.",
link: "https://live.bstein.dev",
host: "matrix.live.bstein.dev",
status: "live",
},
{
name: "LiveKit",
icon: "🎥",
category: "comms",
summary: "Video and Voice SFU calls integrated into Element.",
link: "https://live.bstein.dev",
host: "kit.live.bstein.dev",
status: "live",
},
{
name: "Coturn",
icon: "📡",
category: "comms",
summary: "Integrated VoIP server for reliable calls.",
link: "https://live.bstein.dev",
host: "turn.live.bstein.dev",
status: "live",
},
{
name: "Mailu",
icon: "✉️",
category: "mail",
summary: "Self-hosted mailserver with accepted outgoing mail.",
link: "https://mail.bstein.dev",
host: "mail.bstein.dev",
},
{
name: "Gitea",
icon: "🍵",
category: "dev",
summary: "Source control for dev projects.",
link: "https://scm.bstein.dev",
},
{
name: "Jenkins",
icon: "🏗️",
category: "dev",
summary: "Continuous integration build pipelines.",
link: "https://ci.bstein.dev",
},
{
name: "Harbor",
icon: "⚓",
category: "dev",
summary: "Artifact Registry for build artifacts.",
link: "https://registry.bstein.dev",
},
{
name: "Flux",
icon: "🧲",
category: "dev",
summary: "GitOps UI for flux continuous deployment drift prevention.",
link: "https://cd.bstein.dev",
},
{
name: "Monero",
icon: "🪙",
category: "crypto",
summary: "Private monero node for monero wallets.",
link: "/monero",
host: "monerod.crypto.svc.cluster.local:18081",
},
{
name: "Oceanus",
icon: "🌊",
category: "crypto",
summary: "Dedicated SUI Validator - Planned.",
link: "#",
host: "oceanus",
status: "planned",
},
],
};
}
export function fallbackNetwork() {
return {
ingress: [
{
name: "dns_and_tls",
path: "DNS -> Traefik -> oauth2-proxy -> service",
notes: "TLS via cert-manager; Keycloak on the edge.",
},
{
name: "media",
path: "media.bstein.dev -> Traefik -> Pegasus -> Longhorn PVC -> Jellyfin",
notes: "Uploads and playback with storage on Longhorn.",
},
{
name: "registry",
path: "registry.bstein.dev -> Traefik -> Harbor -> FluxCD pull",
notes: "Harbor issues signed images for GitOps.",
},
],
egress: [
{
name: "ci_to_registry",
path: "Gitea webhook -> Jenkins -> Harbor push",
notes: "Builds signed before promotion.",
},
{
name: "metrics",
path: "Atlas scraping -> Prometheus -> Grafana -> metrics.bstein.dev",
notes: "titan-24 scrapes oceanus (titan-23).",
},
],
ingress_gateway: "Traefik with oauth2-proxy and Keycloak; Longhorn backs stateful ingress targets.",
};
}
export function fallbackMetrics() {
return {
dashboard: "https://metrics.bstein.dev",
description: "Atlas + Oceanus metrics.",
};
}
export function buildHardwareDiagram(data) {
return `
flowchart TB
subgraph TitanLab["Titan Lab (25 nodes)"]
subgraph Atlas["Atlas (k3s cluster)"]
subgraph CP["Control plane (rpi5)"]
titan0a["titan-0a<br/>rpi5 4c/8g"]
titan0b["titan-0b<br/>rpi5 4c/8g"]
titan0c["titan-0c<br/>rpi5 4c/8g"]
end
subgraph Pi5["Workers (rpi5)"]
titan04["titan-04"]
titan05["titan-05"]
titan06["titan-06"]
titan07["titan-07"]
titan08["titan-08"]
titan09["titan-09"]
titan10["titan-10"]
titan11["titan-11"]
end
subgraph Storage["Storage workers (rpi4 + disks)"]
titan12["titan-12<br/>8TB astreae + 12TB asteria"]
titan13["titan-13<br/>8TB astreae + 12TB asteria"]
titan14["titan-14<br/>8TB astreae + 12TB asteria"]
titan15["titan-15<br/>8TB astreae + 12TB asteria"]
titan16["titan-16<br/>offline"]:::down
titan17["titan-17"]
titan18["titan-18"]
titan19["titan-19"]
end
subgraph Accel["Accelerators + heavy nodes"]
titan20["titan-20<br/>Jetson Xavier 6c/16g"]
titan21["titan-21<br/>Jetson Xavier 6c/16g"]
titan22["titan-22<br/>10c/32g<br/>GPU streaming"]
titan24["titan-24 (tethys)<br/>12c/64g<br/>bridge + metrics"]
end
longhorn["Longhorn<br/>astreae: 4x8TB<br/>asteria: 4x12TB"]
traefik["Traefik ingress"]
keycloak["Keycloak SSO"]
services["Services<br/>cloud / stream / ci / registry / cd / secret"]
keycloak --> traefik
traefik --> services
services --> longhorn
longhorn --> Storage
end
subgraph Dedicated["Dedicated hosts (outside Atlas)"]
titanDb["titan-db<br/>Postgres for HA control plane<br/>rpi5 4c/8g"]
theia["titan-jh (theia)<br/>bastion<br/>rpi5 4c/8g"]
oceanus["titan-23 (oceanus)<br/>SUI validator<br/>24c/256g<br/>2.5GbE"]
end
titanDb -->|DB| titan0a
theia -->|ssh| titan0a
oceanus -->|metrics| titan24
end
classDef down fill:#311023,stroke:#ff4f93,color:#fff,stroke-width:2px;
`;
}
export function buildNetworkDiagram() {
return `
sequenceDiagram
participant U as User
participant DNS as DNS (*.bstein.dev)
participant T as Traefik (Atlas)
participant A as auth.bstein.dev (oauth2-proxy)
participant K as sso.bstein.dev (Keycloak)
participant S as Service (cloud/stream/ci/registry/cd/secret)
participant L as Longhorn PVC
U->>DNS: resolve host
DNS-->>U: Traefik VIP
U->>T: HTTPS request
T->>A: forwardAuth
A->>K: OIDC login/refresh
K-->>A: token
A-->>T: allow
T->>S: route to service
S-->>L: persistent storage operations
S-->>U: response / stream / artifact
`;
}
export function buildPipelineDiagram() {
return `
flowchart LR
dev[Developer] -->|push| gitea[scm.bstein.dev]
gitea -->|webhook| jenkins[ci.bstein.dev]
jenkins -->|build + push| harbor[registry.bstein.dev]
harbor -->|image update| flux[cd.bstein.dev]
flux -->|reconcile| atlas[Atlas]
atlas -->|deploy| svc[cloud / stream / secret / other apps]
keycloak[sso.bstein.dev] --> gitea
keycloak --> jenkins
keycloak --> harbor
keycloak --> flux
`;
}