diff --git a/README.md b/README.md index 9621c6e..00c10ac 100644 --- a/README.md +++ b/README.md @@ -1,146 +1,222 @@
-# 🌌 COSMOS - -### *Turn your old PC into a personal cloud workstation.* - -[![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?style=flat&logo=go)](https://golang.org) -[![Storage](https://img.shields.io/badge/S3-MinIO-C72C48?style=flat&logo=minio)](https://min.io) -[![Database](https://img.shields.io/badge/Database-ScyllaDB-55449A?style=flat)](https://www.scylladb.com) -[![Git](https://img.shields.io/badge/Git-Gitea-609926?style=flat&logo=gitea)](https://gitea.com) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) + +COSMOS Cloud Workstation
-**COSMOS** is a self-hosted cloud workstation operating system that transforms any spare PC, repurposed office desktop, or home server into an enterprise-grade personal cloud. It combines S3-compatible object storage, private Git repositories, edge CDN caching, and real-time 3D observability under a unified single-sign-on (SSO) experience. + +[![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?style=for-the-badge&logo=go&logoColor=white)](https://golang.org) +[![Storage](https://img.shields.io/badge/S3_Engine-MinIO-C72C48?style=for-the-badge&logo=minio&logoColor=white)](https://min.io) +[![Database](https://img.shields.io/badge/NoSQL-ScyllaDB-55449A?style=for-the-badge&logo=apachecassandra&logoColor=white)](https://www.scylladb.com) +[![Git](https://img.shields.io/badge/Git_Engine-Gitea-609926?style=for-the-badge&logo=gitea&logoColor=white)](https://gitea.com) +[![License: MIT](https://img.shields.io/badge/License-MIT-38bdf8?style=for-the-badge)](LICENSE) -[Architecture](docs/ARCHITECTURE.md) • [Deployment Guide](docs/SETUP_GUIDE.md) • [Schema](deploy/schema.cql) • [Report Issue](https://github.com/vaishnosingh/COSMOS/issues) +
+ +**[⚡ Architecture](docs/ARCHITECTURE.md)**  •  +**[🛠️ Setup Guide](docs/SETUP_GUIDE.md)**  •  +**[📜 CQL Schema](deploy/schema.cql)**  •  +**[🐳 Docker Stack](deploy/docker-compose.yml)**  •  +**[💬 Report Issue](https://github.com/vaishnosingh/COSMOS/issues)** + +
+ +> 🌌 *"Self-hosted infrastructure that answers to you alone. Private code, infinite storage, zero compromises."*
--- -## ⚡ Highlights & Capabilities +## 🛰️ Overview -### 🌌 Unified Workstation SSO -* Single credentials grant seamless access across all workstation tools. -* Account registration with automated OTP email verification and secure self-service password recovery. -* Zero plain-text credentials stored in database storage; bcrypt-salted authentication throughout. +**COSMOS** is a space-themed, self-hosted cloud workstation operating environment engineered to transform old laptops, decommissioned office desktop towers, or home lab computers into high-performance developer workstations. -### 🗄️ Oort Cloud Storage (S3 Engine) -* **S3 Compatible:** Direct API compatibility with AWS CLI, SDKs, Cyberduck, and rclone. -* **Automated Multi-Tenancy:** Each registered user automatically gets their own isolated bucket, credentials, and custom AWS IAM access policy. -* **Full Console UI:** Browse, upload, download, generate presigned URLs, inspect versions, and manage access policies directly in the browser. -* **Custom Vanity Domains:** Map arbitrary external domains (CNAME) directly to specific buckets. - -### 🧑‍💻 Source Forge (Self-Hosted Git) -* Powered by lightweight Gitea engine. -* Instant repository creation, pull requests, issue tracking, and SSH/HTTPS Git clones. -* Automated credential synchronization with the Cosmos master identity directory. - -### ⚡ Edge CDN & In-Memory Caching -* High-speed in-memory cache layer (`sync.Map`) for frequently accessed objects. -* Standard HTTP caching semantics: conditional ETags (`If-None-Match`), `304 Not Modified` responses, and cache-purge queries. - -### 📊 Real-time 3D Telemetry Dashboard -* Live operational metrics for request volume, cache hit ratios, bandwidth consumption, and error rates. -* Interactive 3D rotating orthographic globe rendered on HTML5 Canvas visualizing global network activity. -* Granular hourly time-series stored in ScyllaDB for historical analytics. +Instead of paying recurring cloud fees for AWS S3, GitHub private repos, or Cloudflare edge caching, **COSMOS runs the entire workstation directly on your local hardware** with unified Single Sign-On (SSO), automated IAM multi-tenancy, and real-time 3D planetary observability. --- -## 🏗️ System Architecture +## ⚡ Core Capabilities -``` - ┌───────────────────────────┐ - │ Browser / Developer │ - └─────────────┬─────────────┘ - │ HTTPS (:443) - ▼ - ┌───────────────────────────┐ - │ Nginx Reverse Proxy │ - └──────┬────────────┬───────┘ - │ │ - Portals │ │ Git Forge - (:8080) │ │ (:3000) - ▼ ▼ - ┌──────────────┐ ┌──────────┐ - │ Cosmos Core │ │ Gitea │ - │ (Golang) │ │ Engine │ - └───────┬──────┘ └──────────┘ - │ - ┌─────────────┴─────────────┐ - │ │ - ▼ ▼ - ┌──────────────┐ ┌──────────────┐ - │ ScyllaDB │ │ MinIO S3 │ - │ (CQL Store) │ │(Object Store)│ - └──────────────┘ └──────────────┘ -``` +
+ Cosmos Feature Matrix +
+ +
+ +### 🌌 1. Unified Single Sign-On (SSO) +* **One Identity Across Everything:** Single login grants simultaneous access to private S3 storage, Git source control, and CDN workspaces. +* **Zero Plaintext Credentials:** Industry-standard `bcrypt` salted password hashing. Transient registration credentials exist exclusively in temporary, auto-expiring memory buffers (`sync.Map`) during provisioning. +* **Self-Service Recovery:** Integrated OTP verification and expiring password reset tokens. + +### 🗄️ 2. Oort Cloud Storage (S3 Engine) +* **S3 API Compatibility:** Native compatibility with AWS CLI, AWS SDKs, Cyberduck, rclone, and Terraform. +* **Automatic IAM Multi-Tenancy:** Each registered account is provisioned with their own MinIO bucket, custom IAM policies (`arn:aws:s3:::cosmos-/*`), and dedicated API access keys. +* **Interactive Browser Console:** Full-featured glassmorphic web console supporting chunked file uploads, object versioning, public URL generation, and vanity CNAME domain mapping. + +### 🧑‍💻 3. Source Forge (Git Engine) +* **Private Git Repositories:** Self-hosted code collaboration powered by a lightweight Gitea daemon. +* **Auto-Healing Authentication:** Smart credential synchronization between Cosmos and Gitea's internal database. If credentials ever become mismatched, Cosmos automatically re-synchronizes and authenticates transparently. +* **Full Protocol Support:** Clone, push, and pull effortlessly over HTTPS and SSH (`:2222`). + +### ⚡ 4. Sub-Millisecond Edge CDN & Caching +* **In-Memory Cache Layer:** High-concurrency caching proxy with instantaneous sub-millisecond retrieval. +* **HTTP Cache Semantics:** Conditional ETags (`If-None-Match`), `304 Not Modified` responses, and instant cache purge queries (`?nocache=1`). +* **Custom Vanity CNAMEs:** Map custom internet domains directly to specific storage buckets. + +### 📊 5. 3D Planetary Telemetry & Observability +* **Interactive Canvas Globe:** Orthographic rotating 3D globe rendered dynamically on HTML5 Canvas showing global request node routing. +* **Real-Time KPI Tracking:** Total request volume, cache hit ratios, origin loads, bandwidth meters, and HTTP error distributions. +* **Historical Time-Series:** Persistent hourly metric aggregations stored in ScyllaDB for telemetry auditing. --- -## 🚀 Quick Start (Docker Compose) +## 🏗️ System Architecture & Data Flow -Get up and running on any PC with Docker in under 5 minutes: +
+ Cosmos Architecture Diagram +
+ +
+ +Cosmos is structured as a decoupled, multi-tier micro-platform designed for minimal footprint and maximum I/O throughput: + +| Layer | Technology | Function | +|---|---|---| +| **Ingress & SSL** | Nginx Reverse Proxy | TLS 1.3 termination, rate limiting, and virtual host routing | +| **Control Plane** | Go (`net/http` daemon) | Identity orchestration, session management, S3 API gateway, and UI rendering | +| **Persistence** | ScyllaDB (CQL NoSQL) | Distributed linear-scale user directory, session indexes, and telemetry | +| **Object Store** | MinIO S3 Engine | High-throughput multi-tenant S3 file storage with automated IAM | +| **Source Engine**| Gitea Git Server | Lightweight Git version control with SSO synchronization | + +For detailed CQL schema definitions, IAM access policies, and memory models, see **[ARCHITECTURE.md](docs/ARCHITECTURE.md)**. + +--- + +## 🚀 Quickstart Terminal + +
+ Cosmos Quickstart Terminal Demo +
+ +
+ +### Option A: Launch with Docker Compose (Recommended) + +Turn your old PC into a running workstation in under 2 minutes: ```bash -# 1. Clone repository +# 1. Clone this repository git clone https://github.com/vaishnosingh/COSMOS.git -cd COSMOS +cd COSMOS/deploy -# 2. Configure environment -cp .env.example .env +# 2. Configure environment variables (optional, defaults provided) +cp ../.env.example ../.env -# 3. Launch the complete stack -cd deploy +# 3. Spin up all containers docker-compose up -d -# 4. Initialize database schema +# 4. Apply database schema docker exec -i cosmos-scylla cqlsh < schema.cql ``` -Navigate to `http://localhost:8080` in your web browser. - -For complete bare-metal setup instructions, systemd unit files, and Nginx SSL configuration, see the [Deployment Guide](docs/SETUP_GUIDE.md). +Open your browser and navigate to: +``` +http://localhost:8080 +``` --- -## 📁 Repository Structure +### Option B: Native Bare-Metal Installation + +For resource-constrained PCs (e.g. 2–4 GB RAM), running bare-metal provides maximum performance: + +```bash +# 1. Install prerequisites +sudo apt update && sudo apt install -y golang git nginx curl msmtp + +# 2. Apply ScyllaDB / Cassandra schema +cqlsh -f deploy/schema.cql + +# 3. Build Cosmos binary +go build -o cosmos . + +# 4. Start the systemd service +sudo cp deploy/cosmos.service /etc/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl enable --now cosmos +``` + +Read the step-by-step **[Setup & Deployment Guide](docs/SETUP_GUIDE.md)** for detailed bare-metal configurations, Nginx SSL certificates with Let's Encrypt, and firewall rules. + +--- + +## 💻 Hardware Compatibility + +Cosmos runs comfortably on modest or older personal computers: ``` -. -├── deploy/ -│ ├── docker-compose.yml # Full-stack container orchestration -│ ├── Dockerfile # Multi-stage lightweight application build +┌─────────────────────────┬──────────────────────────┬─────────────────────────┐ +│ Component │ Minimum Specs │ Recommended Specs │ +├─────────────────────────┼──────────────────────────┼─────────────────────────┤ +│ CPU Processor │ Dual-core 64-bit x86_64 │ Quad-core Intel / AMD │ +│ System Memory (RAM) │ 4 GB │ 8 GB or 16 GB │ +│ Boot Disk │ 30 GB SSD │ NVMe SSD (ScyllaDB) │ +│ Bulk Storage │ Any internal/USB HDD │ Multi-terabyte HDD pool │ +│ Operating System │ Debian 11/12, Ubuntu 22+ │ Debian 12 Minimal │ +└─────────────────────────┴──────────────────────────┴─────────────────────────┘ +``` + +--- + +## 📂 Repository Layout + +```ascii +COSMOS/ +├── assets/ # Motion graphics, animated SVGs & diagrams +│ ├── hero.svg # 3D planet & celestial HUD motion banner +│ ├── architecture.svg # Animated laser data flow system topology +│ ├── features.svg # Cosmic panoramic feature cards +│ └── terminal-demo.svg # Animated CLI quickstart demo +├── deploy/ # Deployment & orchestration configurations +│ ├── docker-compose.yml # Complete 4-service container stack +│ ├── Dockerfile # Lightweight multi-stage Go build │ ├── nginx.conf # Production reverse proxy & SSL config -│ ├── cosmos.service # Systemd service unit definition -│ └── schema.cql # ScyllaDB keyspace & tables DDL -├── docs/ -│ ├── ARCHITECTURE.md # In-depth technical architecture -│ └── SETUP_GUIDE.md # Step-by-step bare-metal & cloud setup -├── templates/ # Responsive HTML/CSS workstation portals -├── config.go # Dynamic environment configuration -├── main.go # HTTP server, auth, and workstation router -├── oortconsole.go # S3 console API & MinIO client bridges -├── oortanalytics.go # Telemetry engine & ScyllaDB aggregations -├── s3cache.go # In-memory edge caching middleware +│ ├── cosmos.service # Systemd daemon unit file +│ └── schema.cql # ScyllaDB keyspace & table definitions +├── docs/ # Technical documentation +│ ├── ARCHITECTURE.md # In-depth architectural specifications +│ └── SETUP_GUIDE.md # Bare-metal & cloud deployment walkthrough +├── templates/ # Responsive glassmorphic space portals +│ ├── index.html # Main workstation hub & feature showcase +│ ├── oortconsole.html # S3 storage browser, 3D globe & metrics +│ ├── login.html # Unified SSO portal +│ └── signup.html # Verification & onboarding flow +├── config.go # Environment-driven dynamic settings +├── main.go # HTTP server, auth router & MinIO broker +├── oortconsole.go # S3 API endpoints & bucket management +├── oortanalytics.go # Real-time telemetry & ScyllaDB flushers +├── s3cache.go # Sub-millisecond in-memory edge cache ├── .env.example # Sample environment configuration -├── go.mod # Go dependencies definition -└── LICENSE # MIT Open Source License +├── go.mod # Dependencies manifest +└── LICENSE # MIT License ``` --- -## 🔒 Security & Privacy +## 🛡️ Security & Privacy Guarantee -Cosmos is designed from the ground up for strict privacy and data ownership: -* **All data stays on your machine.** No telemetry, telemetry pings, or cloud reporting sent to third parties. -* **No hardcoded credentials.** Passwords, domains, secret keys, and tokens are read exclusively from environment variables or encrypted databases. -* **Per-user IAM Isolation.** Users cannot inspect or access other tenants' buckets or resources. +* **100% Data Sovereignty:** Everything lives on your hardware. No analytics, tracking pings, or telemetry phone-home calls. +* **Isolated IAM Tenants:** S3 buckets are locked down via AWS IAM JSON policies. No user can list or access files belonging to another account. +* **Decoupled Secrets:** Zero hardcoded passwords or domains in source code. All endpoints and credentials are provided dynamically via environment variables. --- ## 📜 License -Distributed under the MIT License. See [LICENSE](LICENSE) for more information. +Distributed under the **MIT License**. See **[LICENSE](LICENSE)** for details. + +
+
+ Designed & Engineered with 🌌 for sovereign developers. +
diff --git a/assets/architecture.svg b/assets/architecture.svg new file mode 100644 index 0000000..e4850fc --- /dev/null +++ b/assets/architecture.svg @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Client Ingress + Web Browser / Mobile + AWS CLI / Git Client + PORT :443 (HTTPS) + + + + + + + Nginx Edge Proxy + TLS 1.3 / HTTP/2 SSL + Rate Limiting & CNAME + REVERSE PROXY MUX + + + + + + + Cosmos Core (Go) + ● 100% HEALTHY // PORT :8080 + Unified SSO • bcrypt Auth • In-Memory Caching + MinIO Tenant Provisioning • 3D Telemetry Feed + + + + + + INTERNAL SERVICE BUS + + + + + + + + + + + OORT S3 STORAGE (MinIO) + S3 API Engine (:9000) + • Automated IAM Tenant Policies + • Per-User Bucket Isolation + • Object Versioning & Quotas + STORAGE: NVMe / HDD EXT4 + + + + + + + + + SCYLLADB CLUSTER + CQL NoSQL Protocol (:9042) + • cosmos.users (SSO & Keys) + • cosmos.buckets (Registry) + • cosmos.s3_analytics_hourly + PERSISTENCE: ULTRA-LOW LATENCY + + + + + + + + + SOURCE FORGE (Gitea) + Git Interface (:3000 / :22) + • Private Git Repositories + • SSO Password Auto-Healing + • CI/CD & Issue Tracking + ENGINE: LIGHTWEIGHT CGO/SQLITE + + + + + + + + + + diff --git a/assets/features.svg b/assets/features.svg new file mode 100644 index 0000000..2c68b46 --- /dev/null +++ b/assets/features.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Oort S3 Storage + MINIO ENGINE + + • Full S3 Compatibility + • Automated IAM Isolation + • Object Versioning + • Presigned Share URLs + • Capacity Quotas + + + ACTIVE + + + + + + + + + + + + + + Source Forge + GITEA ENGINE + + • Private Git Repos + • SSO Password Sync + • Auto-Healing Auth + • SSH & HTTPS Clones + • Code Collaboration + + + SYNCED + + + + + + + + + + + + Edge CDN Layer + IN-MEMORY CACHE + + • Sub-millisecond TTL + • ETag Validation + • Vanity CNAME Domains + • Automatic Invalidation + • Zero Origin Bottlenecks + + + < 1ms RT + + + + + + + + + + + + + 3D Telemetry + SCYLLA ANALYTICS + + • Orthographic 3D Globe + • Live Request Ratios + • Cache Hit / Miss Gauges + • Hourly Bandwidth + • Granular Error Logs + + + REALTIME + + diff --git a/assets/hero.svg b/assets/hero.svg new file mode 100644 index 0000000..7e8b678 --- /dev/null +++ b/assets/hero.svg @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SYS:ONLINE // WORKSTATION OS + + + + + COSMOS + + + + + TURN YOUR OLD PC TO WORKSTATION + + Self-hosted S3 Object Storage, Private Git Engine & Edge CDN. + + + One unified login. High-performance ScyllaDB & MinIO architecture. + + + + + + + + + S3 STORAGE + + + + + GIT FORGE + + + + + EDGE CDN + + + + + 3D TELEMETRY + + + + + + + ARCH: X86_64 // SCYLLADB: 9042 // MINIO S3: 9000 // GITEA: 3000 // STATUS: READY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + S3.NODE + + + + + + + + + GIT.FORGE + + + + + + + + + + + + + + + + + + + COORD: 45° 18' N, 9° 32' E + STATION ID: COSMOS-01 // FREQUENCY: 1420.405 MHz + SYS.VER: 2.4.0 + + diff --git a/assets/terminal-demo.svg b/assets/terminal-demo.svg new file mode 100644 index 0000000..cb17c83 --- /dev/null +++ b/assets/terminal-demo.svg @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + user@cosmos-workstation:~ (bash) + + + + + + + $ + git clone https://github.com/vaishnosingh/COSMOS.git && cd COSMOS/deploy + + + + + $ + docker-compose up -d + + + + + ✔ + Network cosmos_net + Created + + ✔ + Container cosmos-scylla + Healthy (:9042) + + ✔ + Container cosmos-minio + Healthy (:9000/:9001) + + ✔ + Container cosmos-gitea + Healthy (:3000) + + ✔ + Container cosmos-core + Running on http://localhost:8080 + + + + + $ + cosmos-cli status + --all + [WORKSTATION READY] + + + +