RED Engine is a stateless, high‑performance Go runtime that serves Markdown files as a sovereign knowledge network. It decouples the Independent Data Layer from the Social Curation Layer — removing centralized chokepoints, cryptographic integrity verification, and instant decentralized mirroring.
git clone https://github.com/RED-Collective/RED-Engine.git
cd RED-Engine
./setup.sh install
./red
# Open http://localhost:8080Full installation guide →
INSTALL.md(Windows, Docker/Podman, manual setup, federation)
RED Engine rejects centralized database monopolies and overly complex consensus protocols. The philosophy is simple: the runtime handles state, not moderation; trust is cryptographic, not platform-enforced.
Single‑container deployment behind a Caddy reverse proxy:
graph TD
Inet((Global Internet))
Inet --> Caddy[Caddy Proxy<br/>Port 80/443]
Caddy --> RED[RED Engine Container<br/>Go + Goldmark]
RED --> Volume[(Host Volume /data)]
Volume --> Markdown[Markdown Files<br/>+ manifest.json<br/>+ contributors.json]
All components run as standard Podman or Docker containers. The engine listens on port 8080 internally; Caddy provides automatic HTTPS.
| Layer | Technology |
|---|---|
| Language | Go 1.21+ — single memory‑safe static binary |
| Markdown | goldmark — fully CommonMark compliant |
| Frontend | React 18 + Vite + Tailwind CSS |
| Sanitizer | bluemonday — strict XSS prevention |
| Container | Multi‑stage Alpine Docker/Podman pipeline |
| Integrity | Ed25519 signatures + SHA‑256 hashing |
- Cryptographic Integrity — Every article carries an Ed25519 signature verified against a trusted
contributors.json. Tampered content is flagged immediately with no database required. - Minimal Attack Surface — Stateless content layer with no user database, no session store, no CMS schema. A lightweight SQLite DB holds only operational metadata.
- Instant Mirroring — Built‑in
/importendpoint fetches any Markdown URL, GitHub repo, or archive and serves it without restart. - Admin Panel — Protected by configurable token. Import sources, manage sync, browse index, edit settings.
- Federation — Peers announce themselves, gossip peer lists, and challenge‑response URL re-registration handles dynamic tunnels.
- Dark Mode & i18n — Built into the React SPA (7 languages).
| Command | What it does |
|---|---|
./setup.sh install |
Install deps + build binary + frontend |
./setup.sh dev |
Dev server with live reload (Vite + air) |
./setup.sh test |
Run the full Go test suite |
./setup.sh build |
Build Go binary + frontend |
./setup.sh token |
Show the admin token |
make build-frontend |
Build only the React SPA |
make build-backend |
Build only the Go binary |
See INSTALL.md for Windows, Docker/Podman deployment, manual setup, federation testing, and troubleshooting.
RED Engine is part of Project R.E.D Network and is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) — see LICENSE.
Per AGPL-3.0 Section 7(b), an additional attribution term applies: any copy, modified version, or derivative — including a modified version operated as a network service — must preserve the credit
Powered by RED Collective.
in the notices the software displays to its users (the web UI footer, the server startup banner / --version, and this README). The exact, binding terms are in ADDITIONAL_TERMS.md.
© 2026 RED Collective · https://github.com/RED-Collective
Federation & Peer Identity
- Peer identity is now anchored to the Ed25519 public key. The registered URL is treated as a mutable secondary property — rotating a tunnel no longer orphans a peer record.
- Added challenge-response URL re-registration for nodes behind dynamic cloudflared tunnels: a peer requests a single-use nonce (5-minute TTL), signs
nonce|new_urlwith its private key, and submits the signature. Constant-time comparison prevents timing attacks; the nonce is deleted on first use to prevent replay. - Added gossip import: pulling a peer's public peer list and registering unknown nodes as upstream-only consumers with zero manual configuration.
- Added peer health history tracking with per-peer last-seen timestamps and sequential failure counts stored in the registry.
Database Schema (v2)
- Migrated
exported_pathsfrom a serialized column to a normalizedpeer_exported_pathsjunction table, enabling clean per-path queries without string parsing. - Added
UNIQUEconstraint onpeers.public_keyandCHECKconstraints onpeer_type(upstream,downstream,mirror) andtunnel_type(cloudflared,direct). - Added
startup_synchealth columns:last_synced_at,last_error,consecutive_failures.
API Layer
- Added
/api/contentJSON endpoint: resolves articles (withRED_KNOWLEDGEdirectory-default fallback), rewrites.assets/image paths to/-/assets/for client rendering, and returns breadcrumbs, prev/next sibling links, and verification state. - Added
/api/recent-filesendpoint: walks all sections, sorts by filesystem mtime, returns top N articles with correct display paths forRED_KNOWLEDGEdefaults. - Added
/api/search-indexendpoint: returns full title + path index for client-side search, with no-cache headers. - Added
/-/admin/verifyno-op endpoint for admin token validation without performing side effects.
Frontend
- Introduced a React SPA (Vite) served from
static/dist/. All browser-navigation routes (/,/-/admin,/-/nodes, article paths) servestatic/dist/index.html. Go templates are retained as a fallback when the SPA is not built. - Vite assets served from
/assets/(dist output) alongside the existing/-/assets/content-file handler.
Content Pipeline
- Image src rewriting: bare filenames in Markdown AST (
imageTransformer) are rewritten to/-/assets/{dir}/{filename}at render time. A second pass in/api/contentrewrites any remaining.assets/-relative srcs to absolute paths for the SPA. - File watcher (
radovskyb/watcher) triggers hot-reload of individual articles on change. Remote sync sets aremoteSyncActiveatomic flag with a 4-second cooldown to suppress redundant local events during pulls.
Attribution & License
- AGPL-3.0 §7(b) attribution ("Powered by RED Collective.") enforced in all UI surfaces: React SPA footer, all five Go templates, and the server startup banner. Tagged
Attribution required by NOTICE (AGPL-3.0 §7(b)) — do not removeat every insertion point.