No description
  • HTML 42%
  • JavaScript 19%
  • Rust 14.4%
  • Shell 14.3%
  • CSS 8.9%
  • Other 1.4%
Find a file
Jan De Landtsheer b820141fd8
All checks were successful
Build Linux / build-linux (linux-amd64, false, x86_64-unknown-linux-musl) (push) Successful in 2m24s
Build Linux / build-linux (linux-arm64, true, aarch64-unknown-linux-gnu) (push) Successful in 3m40s
Add graceful shutdown on SIGTERM/SIGINT for k3s deployments
2026-02-26 13:48:20 +01:00
.forgejo/workflows Initial commit: base project setup 2026-02-24 13:19:08 +03:00
config Add simulator BIS with 10-year P&L projections, media transcoding, and layout fixes 2026-02-26 09:08:01 +03:00
content/blog init 2026-02-26 07:55:50 +03:00
scripts Initial commit: base project setup 2026-02-24 13:19:08 +03:00
specs Update web specs and add investment specifications 2026-02-24 13:26:35 +03:00
src Add graceful shutdown on SIGTERM/SIGINT for k3s deployments 2026-02-26 13:48:20 +01:00
static Remove dynamic AV1 transcoding, use pre-transcoded static videos 2026-02-26 14:25:53 +03:00
templates Hide simulator link from navbar 2026-02-26 09:12:24 +03:00
.containerignore Move hardcoded credentials to env vars, add container build 2026-02-24 12:48:23 +01:00
.gitignore Remove dynamic AV1 transcoding, use pre-transcoded static videos 2026-02-26 14:25:53 +03:00
buildenv.sh Initial commit: base project setup 2026-02-24 13:19:08 +03:00
Cargo.lock Remove dynamic AV1 transcoding, use pre-transcoded static videos 2026-02-26 14:25:53 +03:00
Cargo.toml Remove dynamic AV1 transcoding, use pre-transcoded static videos 2026-02-26 14:25:53 +03:00
Containerfile Move hardcoded credentials to env vars, add container build 2026-02-24 12:48:23 +01:00
intro_spec.md Initial commit: base project setup 2026-02-24 13:19:08 +03:00
Makefile init 2026-02-26 07:55:50 +03:00
README.md Make email optional and admin password default to 'admin' 2026-02-24 15:47:07 +01:00
test_templates.sh init 2026-02-26 07:55:50 +03:00

Coop Cloud

Marketing website and admin platform for Cooperative Clouds decentralized data centers. Single Rust binary — all templates, CSS, JS, images, and blog content are embedded at compile time via rust-embed.

Stack

  • Axum web framework with Tera templates
  • redb embedded database (~/hero/var/coop_cloud/coop_cloud.redb)
  • lettre SMTP email notifications (Brevo relay)
  • rust-embed for zero-dependency deployment
  • JSON-RPC 2.0 on Unix socket (~/hero/var/sockets/coop_cloud_web.sock)

Features

Feature Description
Door page Email + secret gate — stores credentials in localStorage
Landing page Hero video, product sections, contact form, newsletter subscribe
Blog Markdown posts from content/blog/, rendered with pulldown-cmark
ROI Calculator TOML-driven cost model comparing Tier-S vs Tier-3/4 data centers
Visitor tracking Middleware tracks pages, geo-IP lookup, session heartbeats
Admin dashboard Live visitors (SSE), history, contacts, access requests, subscriptions
Email notifications Contact form, access requests, subscriptions — HTML formatted
OpenRPC JSON-RPC 2.0 server on Unix socket for remote admin access

Quick Start

make run          # Build release + run on port 4751
make rundev       # Debug build with RUST_LOG=debug
make install      # Build + copy to ~/hero/bin/

Project Structure

src/
  main.rs         # App wiring, state, routes
  routes.rs       # Public page handlers + form submissions
  admin.rs        # Admin dashboard, login, SSE, API
  blog.rs         # Embedded markdown blog loader
  db.rs           # redb init + CRUD for all tables
  email.rs        # SMTP mailer + notification functions
  visitor.rs      # Tracking middleware, heartbeat, geo-IP, eviction
  rpc.rs          # JSON-RPC 2.0 Unix socket + HTTP proxy
  models.rs       # Data structures
  markdown.rs     # Markdown parser with frontmatter

templates/        # Tera HTML templates (embedded)
static/           # CSS, JS, images, vendor libs (embedded)
content/blog/     # Markdown blog posts (embedded)
config/
  calculator.toml # ROI calculator cost model parameters

Environment Variables

All environment variables are optional. If SMTP credentials are not set, email notifications are silently disabled.

Variable Default Purpose
ADMIN_PASSWORD admin Admin dashboard password
SMTP_USER (none — email disabled) SMTP login username
SMTP_PASSWORD (none — email disabled) SMTP login password
SMTP_RELAY smtp-relay.brevo.com SMTP relay hostname
SMTP_PORT 587 SMTP relay port
SMTP_FROM noreply@coopcloud.eu Sender address for outgoing mail
SMTP_NOTIFY_TO kristof@incubaid.com Recipient for admin notifications
APP_BASE_URL https://coopcloud.ourworld.tf Base URL used in email links
Setting Location Default
Port CLI --port 4751
Database $HOME/hero/var/coop_cloud/coop_cloud.redb auto-created
RPC socket $HOME/hero/var/sockets/coop_cloud.sock auto-created
Calculator model config/calculator.toml compiled in

Container

The app ships as a single container image. All assets are embedded at compile time — no volumes needed except for the redb database.

# Build
podman build --no-cache -t forge.ourworld.tf/mycelium/coop_cloud:latest -f Containerfile .

# Run locally
podman run --rm --env-file .env --network host forge.ourworld.tf/mycelium/coop_cloud:latest

# Push to registry
podman push forge.ourworld.tf/mycelium/coop_cloud:latest

The container image is alpine-based (~20MB), runs as non-root user app, and exposes port 7452.

K8s manifests (Deployment, Service, Ingress, Secret) are maintained in geomind-kubeserver/kube_artifacts/websites/deployment/coop-cloud.yaml.

Make Targets

make help         # Show all targets
make build        # Release build
make install      # Build + install to ~/hero/bin/
make run          # Build + run (kills existing on port)
make rundev       # Debug build + run with logging
make check        # Fast cargo check
make fmt          # Format code
make lint         # Clippy
make test         # Run tests
make release      # Bump version
make ship-binary  # Tag + push to trigger CI

CI/CD

Linux binaries (amd64 + arm64) are built automatically on push to development via Forgejo Actions (.forgejo/workflows/build-linux.yaml).

Container image: forge.ourworld.tf/mycelium/coop_cloud:latest