- HTML 42%
- JavaScript 19%
- Rust 14.4%
- Shell 14.3%
- CSS 8.9%
- Other 1.4%
| .forgejo/workflows | ||
| config | ||
| content/blog | ||
| scripts | ||
| specs | ||
| src | ||
| static | ||
| templates | ||
| .containerignore | ||
| .gitignore | ||
| buildenv.sh | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Containerfile | ||
| intro_spec.md | ||
| Makefile | ||
| README.md | ||
| test_templates.sh | ||
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