Skip to content
Merged

V2 #35

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e4427c0
v2 phase 0: node API contract, env template, gitleaks, CI
Shachindra Jun 12, 2026
bf5900e
v2 phase 1: node core + stealth carriers + installer
Shachindra Jun 13, 2026
cc5e535
v2: lean repo, clear docs, fixed CI
Shachindra Jun 13, 2026
1eb3d27
node: security hardening, local dashboard, stats API, audit report
Shachindra Jun 14, 2026
84c26f3
feat(gateway): restore node↔gateway WebSocket control plane (PR0)
Shachindra Jun 15, 2026
40850d0
feat(config): runtime modes and network profiles (PR1)
Shachindra Jun 15, 2026
2f56a41
feat(transport): transport ladder interfaces and port 443 config (PR2)
Shachindra Jun 15, 2026
c44e6e9
feat(carriers): credential rotation and bundle v2 (PR3)
Shachindra Jun 15, 2026
7c4c579
feat(services): service registry and CLI (PR4)
Shachindra Jun 15, 2026
22d1516
feat(dns): private DNS resolver backed by service registry (PR5)
Shachindra Jun 15, 2026
ecd5d14
feat(services): service ACL evaluation (PR6)
Shachindra Jun 15, 2026
c46caa0
feat(edge): gateway public edge proxy and Caddy config (PR7)
Shachindra Jun 15, 2026
21a15ac
feat(edge): custom CNAME domain routing (PR8)
Shachindra Jun 15, 2026
5c1d189
feat(templates): built-in service templates (PR9)
Shachindra Jun 15, 2026
07aa7db
docs(config): restructure env template and align installer with compose
Shachindra Jun 15, 2026
7f72583
node: fix rotate CLI standalone use + warn on off-host API bind
Shachindra Jun 15, 2026
8295ead
feat(node): access modes, readiness status, init and doctor CLI
Shachindra Jun 21, 2026
eede950
feat(node): split deploy mode (container|host) from access (private|s…
Shachindra Jun 21, 2026
1932cd9
feat(node): dashboard identity — libp2p peer ID, Solana wallet, erebr…
Shachindra Jun 21, 2026
75c78b1
feat(node): expose WireGuard server public key and endpoint on status UI
Shachindra Jun 21, 2026
dcca466
fix(node): clearer dashboard labels — access modes, region, node name
Shachindra Jun 21, 2026
ed1c784
fix(node): remove identity footnote from dashboard
Shachindra Jun 21, 2026
c2d864f
fix(node): drop NODE_NAME hint; show region as Norway (NO)
Shachindra Jun 21, 2026
09d8daf
feat: org enrollment auth and default public node access
Shachindra Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 148 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Erebrus Node v2 — environment template
#
# Where to put this file:
# Host install → /etc/erebrus/erebrus.env (systemd EnvironmentFile)
# Docker install → /opt/erebrus/.env (docker compose --env-file)
# Local dev → copy to .env in repo root
#
# Never commit real secrets (MNEMONIC, NODE_KEY, EREBRUS_ORG_ENROLLMENT_SECRET).

# =============================================================================
# REQUIRED — all runs (Validate() hard-fails if missing)
# =============================================================================
MNEMONIC= # BIP39 12-word phrase: wallet, PeerID, DID
WG_ENDPOINT_HOST= # Public IP or DNS name clients dial

# =============================================================================
# REQUIRED — release mode only (not enforced at boot; peer API fails without it)
# =============================================================================
# RUNTYPE=release
# NODE_KEY= # Per-node bearer for /api/v2/peers/* (gateway mints if unset)

# =============================================================================
# DEBUG profile — local smoke / gateway dev (copy these values)
# =============================================================================
# RUNTYPE=debug
# SERVER=127.0.0.1
# HTTP_PORT=9080
# MNEMONIC=abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about
# WG_ENDPOINT_HOST=127.0.0.1
# GATEWAY_URL=http://127.0.0.1:8080
# ENABLE_STEALTH=false
# STATE_DIR=./var/lib/erebrus
# NODE_API_TOKEN= # leave unset — peer API is open in debug only

# =============================================================================
# RELEASE profile — production node (installer container path; public by default)
# =============================================================================
RUNTYPE=release
EREBRUS_ACCESS=public
EREBRUS_MODE=container
EREBRUS_NETWORK_PROFILE=bridge
SERVER=0.0.0.0
HTTP_PORT=9080
NODE_NAME=erebrus-node
REGION=unknown
GATEWAY_URL=https://gateway.erebrus.io
EREBRUS_ORG_ENROLLMENT_SECRET=
NODE_KEY=
ENABLE_STEALTH=true
STEALTH_TCP_PORT=8443
STEALTH_UDP_PORT=4443
STATE_DIR=/var/lib/erebrus

# =============================================================================
# RELEASE profile — public access node (any deploy; host for app-hosting DNS)
# =============================================================================
# EREBRUS_ACCESS=public
# EREBRUS_MODE=container # or host for bare metal + wildcard DNS
# EREBRUS_NETWORK_PROFILE=bridge # host-network when EREBRUS_MODE=host
# STEALTH_TCP_PORT=443
# STEALTH_UDP_PORT=443
# ENABLE_APP_HOSTING=true
# APP_WILDCARD_DOMAIN=apps.example.com
# PUBLIC_DOMAIN=apps.example.com
# WILDCARD_DOMAIN=*.apps.example.com
# PUBLIC_GATEWAY_ENABLED=true

# =============================================================================
# Deploy + access (independent knobs)
# =============================================================================
# EREBRUS_MODE=container|host how the node runs (Docker vs bare metal)
# EREBRUS_ACCESS=private|public gateway directory visibility (org controls private access)
# EREBRUS_NETWORK_PROFILE=bridge|host-network|native

# =============================================================================
# API bind
# =============================================================================
# API_BIND_ADDR= # overrides SERVER when set
# UNSAFE_PUBLIC_API=false # acknowledge risk when binding 0.0.0.0 publicly

# =============================================================================
# Gateway integration (optional; empty GATEWAY_URL disables control plane)
# =============================================================================
# GATEWAY_URL=https://gateway.erebrus.io
# GATEWAY_AUTO_REGISTER=true
# EREBRUS_ORG_ENROLLMENT_SECRET= # from org create/GET (owner/admin); required for auto-register
# WALLET_CHAIN=sol # sol | evm — signs machine enrollment challenge
# API_PUBLIC_URL= # gateway peer provision URL (default: http://WG_ENDPOINT_HOST:HTTP_PORT)
# NODE_KEY= # optional pre-register bearer; gateway mints if empty (persisted)
# GATEWAY_PUBLIC_KEY= # optional override; normally saved at registration
# NODE_ID= # persisted after registration; skip auto-register if set with NODE_TOKEN
# NODE_TOKEN=
# GATEWAY_PEER_MULTIADDR= # libp2p bootstrap (DHT advertise only)

# =============================================================================
# WireGuard
# =============================================================================
WG_CONF_DIR=/etc/wireguard
WG_INTERFACE_NAME=wg0
WG_ENDPOINT_PORT=51820 # alias: WG_PORT
WG_IPv4_SUBNET=10.0.0.1/16
WG_DNS=1.1.1.1
WG_POST_UP=iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
WG_POST_DOWN=iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

# =============================================================================
# Stealth carriers (sing-box) — DPI-resistant fallbacks when WG UDP is blocked
# Canonical ports: STEALTH_TCP_PORT / STEALTH_UDP_PORT
# Legacy aliases: VLESS_PORT / HYSTERIA2_PORT (same values if you prefer old names)
# =============================================================================
# ENABLE_STEALTH=true
# STEALTH_TCP_PORT=8443 # VLESS+REALITY (tcp); gateway production: 443
# STEALTH_UDP_PORT=4443 # Hysteria2 (udp); gateway production: 443
REALITY_SERVER_NAMES=www.microsoft.com
REALITY_HANDSHAKE_SERVER=
HYSTERIA2_OBFS_PASSWORD=
ENABLE_TUIC=false

# =============================================================================
# Public edge / app hosting (gateway mode, opt-in)
# =============================================================================
# ENABLE_APP_HOSTING=false
# APP_WILDCARD_DOMAIN=
# PUBLIC_DOMAIN=
# WILDCARD_DOMAIN=
# PUBLIC_GATEWAY_ENABLED=false
# PUBLIC_HTTP_PORT=80
# PUBLIC_HTTPS_PORT=443
# AUTO_TLS=true

# =============================================================================
# Private DNS (opt-in; backed by service registry)
# =============================================================================
PRIVATE_DNS_ENABLED=false
PRIVATE_DNS_DOMAIN=ere
PRIVATE_DNS_ADDR=10.0.0.1
UPSTREAM_DNS=1.1.1.1
DNS_QUERY_LOGS=false

# =============================================================================
# Registrar (on-chain; noop in v2.0)
# =============================================================================
CHAIN_REGISTRATION=off # off | solana (future)

# =============================================================================
# Docker only — set by docker-compose.yml; do not set on host/systemd installs
# =============================================================================
# LOAD_CONFIG_FILE=TRUE
52 changes: 0 additions & 52 deletions .github/workflows/build-file.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

on:
push:
branches: [main, v2]
pull_request:

jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
# with_reality_server enables the sing-box REALITY server (stealth carrier);
# required or the stealth start-test fails. Keep in sync with Makefile/Dockerfile.
- run: go vet -tags with_reality_server ./...
- run: go build -tags with_reality_server ./...
- run: go test -tags with_reality_server ./...
- uses: golangci/golangci-lint-action@v6
continue-on-error: true
with:
version: latest
args: --build-tags with_reality_server

gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115 changes: 0 additions & 115 deletions .github/workflows/docker-publish.yml

This file was deleted.

Loading
Loading