diff --git a/README.md b/README.md index fa6c819..fae9e7c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Instead of paying recurring cloud fees for AWS S3, GitHub private repos, or Clou
### 🌌 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. +* **One Identity Across Everything:** Single login grants simultaneous access to private S3 storage and Git source control. * **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. @@ -59,14 +59,9 @@ Instead of paying recurring cloud fees for AWS S3, GitHub private repos, or Clou * **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 +### πŸ“Š 4. 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. +* **Real-Time KPI Tracking:** Total request volume, throughput bandwidth, success rates, and HTTP error distributions. * **Historical Time-Series:** Persistent hourly metric aggregations stored in ScyllaDB for telemetry auditing. --- @@ -212,7 +207,6 @@ COSMOS/ β”œβ”€β”€ 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 # Dependencies manifest └── LICENSE # MIT License diff --git a/assets/architecture.svg b/assets/architecture.svg index e4850fc..85b30d7 100644 --- a/assets/architecture.svg +++ b/assets/architecture.svg @@ -135,7 +135,7 @@ Cosmos Core (Go) ● 100% HEALTHY // PORT :8080 - Unified SSO β€’ bcrypt Auth β€’ In-Memory Caching + Unified SSO β€’ bcrypt Auth β€’ High-Speed Routing MinIO Tenant Provisioning β€’ 3D Telemetry Feed diff --git a/assets/features.svg b/assets/features.svg index 2c68b46..5f1528e 100644 --- a/assets/features.svg +++ b/assets/features.svg @@ -85,26 +85,28 @@ SYNCED - + - + + + - Edge CDN Layer - IN-MEMORY CACHE + Unified SSO + SINGLE IDENTITY - β€’ Sub-millisecond TTL - β€’ ETag Validation - β€’ Vanity CNAME Domains - β€’ Automatic Invalidation - β€’ Zero Origin Bottlenecks + β€’ Single Master Login + β€’ bcrypt Password Hashes + β€’ Auto-Provisioned S3 Keys + β€’ Gitea Account Sync + β€’ Zero Config Drift - < 1ms RT + ACTIVE @@ -122,7 +124,7 @@ β€’ Orthographic 3D Globe β€’ Live Request Ratios - β€’ Cache Hit / Miss Gauges + β€’ Success / Error Gauges β€’ Hourly Bandwidth β€’ Granular Error Logs diff --git a/assets/hero.svg b/assets/hero.svg index 7e8b678..2575b27 100644 --- a/assets/hero.svg +++ b/assets/hero.svg @@ -166,7 +166,7 @@ TURN YOUR OLD PC TO WORKSTATION - Self-hosted S3 Object Storage, Private Git Engine & Edge CDN. + Self-hosted S3 Object Storage, Private Git Engine & Unified SSO. One unified login. High-performance ScyllaDB & MinIO architecture. @@ -185,10 +185,10 @@ GIT FORGE - + - EDGE CDN + SSO AUTH diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 6678701..614bce3 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -40,7 +40,7 @@ Cosmos is an open-source, self-hosted cloud platform engineered to transform ord ### 1. Unified Identity & Application Core (`portals-go`) * **Language:** Go (Golang) 1.22+ * **Serving:** Native `net/http` server with embedded HTML/CSS templates via `embed.FS`. -* **Single Sign-On (SSO):** A centralized identity provider managing accounts across S3 Storage, Git Source Control, and CDN. +* **Single Sign-On (SSO):** A centralized identity provider managing accounts across S3 Storage and Git Source Control. * **Security Model:** * Passwords hashed with `golang.org/x/crypto/bcrypt`. * Temporary registration passwords stored in transient, self-expiring memory structures (`sync.Map`) only during automated provisioningβ€”never stored plain-text in database storage. @@ -54,7 +54,7 @@ Cosmos is an open-source, self-hosted cloud platform engineered to transform ord * `cosmos.pending`: Ephemeral registration tokens and OTP codes. * `cosmos.password_reset_tokens`: Time-expiring password reset tokens. * `cosmos.buckets`: User bucket metadata, ownership tracking, and friendly aliases. - * `cosmos.bucket_domains`: Vanity domain and CNAME mapping for edge serving. + * `cosmos.bucket_domains`: Vanity domain and CNAME mapping for public bucket serving. * `cosmos.quota_requests`: Administrative quota elevation queue. * `cosmos.s3_analytics` & `cosmos.s3_analytics_hourly`: Telemetry tracking counters. @@ -72,15 +72,10 @@ Cosmos is an open-source, self-hosted cloud platform engineered to transform ord * Cosmos manages registration and credential synchronization via CLI/API hooks (`gitea admin user create`, `gitea admin user change-password`). * Auto-healing authentication logic: if credentials fall out of sync during login, Cosmos automatically re-synchronizes the bcrypt hash with Gitea's internal database and retries transparently. -### 5. Edge Caching & CDN Simulation -* **Caching Engine:** In-memory high-concurrency cache (`sync.Map`) with TTL expiration. -* **Headers:** Standard HTTP cache control headers (`Cache-Control: public, max-age=...`), ETag generation, and conditional request handling (`If-None-Match`). -* **Cache Bypass:** Diagnostic and instant-purge queries (`?nocache=1` or `Cache-Control: no-cache`). - -### 6. Real-Time Telemetry & Observability -* **In-Memory Accumulator:** High-throughput `atomic.Int64` counters for request counts, bytes transferred, cache hits/misses, and status code categories (2xx, 4xx, 5xx). +### 5. Real-Time Telemetry & Observability +* **In-Memory Accumulator:** High-throughput `atomic.Int64` counters for request counts, bytes transferred, and status code categories (2xx, 4xx, 5xx). * **Periodic Flushing:** Background goroutine flushes aggregated metrics to ScyllaDB hourly tables (`cosmos.s3_analytics_hourly`). -* **Visual Telemetry:** Interactive 3D rotating orthographic globe rendered on HTML5 Canvas using vector latitude/longitude projections, simulating real-time global edge node activity. +* **Visual Telemetry:** Interactive 3D rotating orthographic globe rendered on HTML5 Canvas using vector latitude/longitude projections, simulating real-time global traffic node activity. --- diff --git a/main.go b/main.go index 9c98046..06487fc 100644 --- a/main.go +++ b/main.go @@ -380,7 +380,6 @@ func handleVerify(w http.ResponseWriter, r *http.Request, service string) { if rawPassword != "" { provisionGitea(username, email, rawPassword) } - // Note: "cdn" / Seafile provisioning removed β€” Seafile is not deployed } }() if r.Header.Get("Content-Type") == "application/x-www-form-urlencoded" { @@ -449,23 +448,7 @@ h1{font-size:48px;font-weight:700;margin-bottom:8px}
S3 Endpoint
%s
Open Storage Console β†’ `, name, ak, sk, bucket, getCosmosBaseURL(), sid) - case "cdn": - fmt.Fprintf(w, `CDN – Cosmos - -
-

Welcome, %s.

Your personal cdn drive is ready.

-Open CDN Drive β†’ -
`, name) + case "git": fmt.Fprintf(w, `Git – Cosmos - - - - - - - - - - -
-
-
ATMOSPHERIC LAYER Β· KP 6.3SYNC ORBIT Β· 412 KM
-
00:00:00 UTCΒ·ALL SYSTEMS NOMINAL
-
-
MODULE 03 Β· CLOUD WORKSPACE
-

Cloud Workspace.

-

Secure document collaboration and zero-latency file synchronization.

- -
-
SCROLL
-
- - - -
-
-

CAPABILITIES

-

Everything shared. Nothing exposed.

-
    -
  • Live document collaboration with presence
  • -
  • Zero-latency file sync across every device
  • -
  • Full version history & one-click restore
  • -
  • Granular permissions & private link sharing
  • -
- Create your account -
-
- -
- - 51.4778Β° N Β· 0.0015Β° W β€” SELF-HOSTED & PRIVATE - All systems nominal -
- - - - diff --git a/templates/index.html b/templates/index.html index 14ac993..7f76563 100644 --- a/templates/index.html +++ b/templates/index.html @@ -443,11 +443,11 @@ footer{position:relative;z-index:10;border-top:1px solid var(--line);

MODULE 02 Β· OBJECT STORAGE

Oort

-

S3-compatible object storage at warp speed. Buckets, versioning, real-time analytics, custom CDN domains β€” all under your sky.

+

S3-compatible object storage at warp speed. Buckets, versioning, real-time analytics, custom domains β€” all under your sky.

  • S3-compatible API β€” AWS SDK drop-in
  • Bucket versioning & object lifecycle
  • -
  • 32,000+ req/s RAM cache layer
  • +
  • High-throughput MinIO S3 storage engine
  • Custom domains with real-time analytics
diff --git a/templates/oort.html b/templates/oort.html index d732622..2a05e7f 100644 --- a/templates/oort.html +++ b/templates/oort.html @@ -4,7 +4,7 @@ Oort β€” Object Storage Β· Cosmos - + @@ -120,7 +120,7 @@ body:not(.has-cur).grabbing #rings{cursor:grabbing} -
+
Total Requests
@@ -948,16 +948,6 @@ input:checked + .slider:before { transform: translateX(16px); }
β€”
All time
-
-
-
Cache Hit Rate
-
- -
-
-
β€”
-
Served from edge
-
Bandwidth
@@ -978,16 +968,6 @@ input:checked + .slider:before { transform: translateX(16px); }
β€”
2xx responses
-
-
-
Origin Requests
-
- -
-
-
β€”
-
Cache misses
-
Errors
@@ -1048,7 +1028,7 @@ input:checked + .slider:before { transform: translateX(16px); } Bucket Requests - Cache Hit + Status Errors Bandwidth Last Hit @@ -1559,7 +1539,7 @@ async function addBucketDomain() { const d = inp.value.trim(); if(!d) { toast('Enter a domain name', 'error'); return; } // basic validation - if(!d.includes('.')) { toast('Please enter a valid domain like cdn.example.com', 'error'); return; } + if(!d.includes('.')) { toast('Please enter a valid domain like static.example.com', 'error'); return; } try { const res = await api('/oort/api/bucket/domain/add', { method: 'POST', @@ -2044,8 +2024,6 @@ async function loadAnalytics() { const r = await api(`/oort/api/analytics?bucket=${b}&start=${dStart}&end=${dEnd}®ion=${r_reg}&op=${op}`); const totalReq = r ? r.total_requests || 0 : 0; - const cacheHits = r ? r.total_cache_hits || 0 : 0; - const originHits = r ? r.total_origin_hits || 0 : 0; const totalSucc = r ? r.total_success || 0 : 0; const total4xx = r ? r.total_4xx || 0 : 0; const total5xx = r ? r.total_5xx || 0 : 0; @@ -2054,19 +2032,15 @@ async function loadAnalytics() { const totalReqEl = document.getElementById('an-total-req'); if(totalReqEl) totalReqEl.textContent = totalReq.toLocaleString(); - const cacheEl = document.getElementById('an-cache-rate'); - if(cacheEl) cacheEl.textContent = totalReq > 0 ? ((cacheHits / totalReq) * 100).toFixed(1) + '%' : '0%'; const bwEl = document.getElementById('an-bandwidth'); if(bwEl) bwEl.textContent = fmtBytes(totalBytes); const succEl = document.getElementById('an-success-rate'); - if(succEl) succEl.textContent = totalReq > 0 ? ((totalSucc / totalReq) * 100).toFixed(1) + '%' : '0%'; - const origEl = document.getElementById('an-origin'); - if(origEl) origEl.textContent = originHits.toLocaleString(); + if(succEl) succEl.textContent = totalReq > 0 ? ((totalSucc / totalReq) * 100).toFixed(1) + '%' : '100%'; const errEl = document.getElementById('an-errors'); if(errEl) errEl.textContent = totalErrors.toLocaleString(); if(subtitle) subtitle.textContent = 'Real-time storage performance metrics'; - const ts = r && r.timeseries ? r.timeseries : {labels:[], reqs:[], cache:[], origin:[]}; + const ts = r && r.timeseries ? r.timeseries : {labels:[], reqs:[]}; const canv = document.getElementById('analyticsChart'); if(canv) { if (analyticsChart) { analyticsChart.destroy(); } @@ -2075,9 +2049,7 @@ async function loadAnalytics() { data: { labels: ts.labels, datasets: [ - { label: 'Total', data: ts.reqs, borderColor: '#8b5cf6', backgroundColor: 'rgba(139,92,246,0.08)', borderWidth: 2, fill: true, tension: 0.4, pointRadius: 2 }, - { label: 'Cache', data: ts.cache, borderColor: '#10b981', backgroundColor: 'rgba(16,185,129,0.05)', borderWidth: 1.5, fill: false, tension: 0.4, pointRadius: 0 }, - { label: 'Origin', data: ts.origin, borderColor: '#f59e0b', backgroundColor: 'rgba(245,158,11,0.05)', borderWidth: 1.5, fill: false, tension: 0.4, pointRadius: 0 }, + { label: 'S3 Requests', data: ts.reqs, borderColor: '#8b5cf6', backgroundColor: 'rgba(139,92,246,0.08)', borderWidth: 2, fill: true, tension: 0.4, pointRadius: 2 } ] }, options: { @@ -2104,12 +2076,11 @@ async function loadAnalytics() { tbody.innerHTML = 'No data found.'; } else { tbody.innerHTML = buckets.map(bk => { - const bCache = bk.requests > 0 ? ((bk.cache_hits / bk.requests) * 100).toFixed(1) : '0'; const lastHit = bk.last_hit ? new Date(bk.last_hit * 1000).toLocaleString() : 'Never'; return ` ${bk.display || bk.name} ${(bk.requests||0).toLocaleString()} - ${bCache}% + Active ${(bk.errors||0).toLocaleString()} ${fmtBytes(bk.bytes||0)} ${lastHit} @@ -3650,7 +3621,7 @@ async function restoreVersion(key, versionId) {
- +
Loading domains...