-
Notifications
You must be signed in to change notification settings - Fork 0
mod_node
Category: Infrastructure | Version: v0.4.0 | Source: modules/mod_node/mod_node.c
Node federation over TCP/TLS. Connects Portal instances into a distributed network. Remote paths transparently accessible as /node_name/path. Worker thread pool per peer. PORTAL02 wire protocol. Hub routing for NAT traversal.
| Path | Method | Description |
|---|---|---|
/node/peers |
GET | List all known peers and connection status |
/node/connect |
ACTION | Connect to a peer |
/node/disconnect |
ACTION | Disconnect from a peer |
/node/status |
GET | Federation status overview |
/node/<peer>/<path> |
* | Route message to remote peer |
┌────────┬────────┬──────────┬��──────────┬──────────────┐
│ MAGIC │ VERSION│ MSG_TYPE │ BODY_LEN │ BODY │
│ 4 bytes│ 2 bytes│ 1 byte ��� 4 bytes │ variable │
│"PRT\0" │ 0x0002 │ │ uint32 BE │ serialized │
└────────┴────────┴──────────┴───────────┴──────���───────┘
SHA-256 challenge-response:
- Server sends 32-byte random nonce
- Client computes
SHA-256(nonce + federation_key) - Server verifies the hash
- Both sides authenticated (mutual)
[mod_node]
name = portal-central
federation_key = shared_secret_here
listen_port = 9090
tls = true
tls_cert = /etc/portal/cert.pem
tls_key = /etc/portal/key.pem
[peer:office]
host = 192.168.1.100
port = 9090
auto_connect = true
[peer:cloud]
host = cloud.example.com
port = 9090
auto_connect = true
hub = true # route through this peer for NAT traversal-
Transparent routing:
/node/office/health→ health on office peer - Auto-reconnect: Exponential backoff on disconnection
- Worker pools: Dedicated thread pool per peer connection
- Hub routing: NAT traversal via designated hub nodes
- TLS encryption: Optional TLS on federation links
Top Level System — GPL-2.0 | Website | Repository
mod_cli · mod_web · mod_node · mod_ssh · mod_config_sqlite · mod_config_psql
mod_cache · mod_kv · mod_shm · mod_queue · mod_websocket · mod_mqtt · mod_email · mod_file
mod_logic · mod_logic_lua · mod_logic_python · mod_logic_c · mod_logic_pascal
mod_metrics · mod_health · mod_sysinfo · mod_process · mod_log · mod_audit · mod_cron · mod_scheduler · mod_worker · mod_backup
mod_proxy · mod_dns · mod_http_client · mod_webhook · mod_api_gateway · mod_tunnel · mod_acme
mod_firewall · mod_crypto · mod_ldap · mod_validator
mod_iot · mod_gpio · mod_serial
mod_xz · mod_gzip · mod_template · mod_admin