Agent & Communication

एक कमांड। पूरी तरह सुरक्षित।

Castovia agent 60 सेकंड से कम समय में इंस्टॉल हो जाता है, सुरक्षा अपने-आप संभालता है, और encrypted channels के माध्यम से Castovia Cloud से संचार करता है। न manual firewall rules, न SSH keys, न VPN.

इंस्टॉलेशन कमांड की व्याख्या

जब आप अपने Linux server पर one-line installer चलाते हैं, तब ठीक क्या होता है.

कमांड क्या करता है

Castovia एडमिन डैशबोर्ड से कॉपी किया गया one-line install command आपके Linux server पर निम्न चरण करता है:

Official CDN से Castovia agent binary (~15 MB) डाउनलोड करता है
छेड़छाड़ रोकने के लिए binary signature (SHA-256 + GPG) सत्यापित करता है
एक dedicated system user बनाता है: castovia-agent (no login shell, no sudo)
Binary को /opt/castovia/agent में इंस्टॉल करता है
/etc/castovia/ में restricted permissions (0700) के साथ configuration directory बनाता है
Server token (प्रति node unique) को /etc/castovia/token.conf में लिखता है
Agent को systemd service के रूप में register करता है: castovia-agent.service
Service शुरू करता है और boot पर auto-start सक्षम करता है
Node को register करने के लिए CASTOVIA Cloud के साथ पहला handshake करता है

वास्तविक कमांड

आपके एडमिन डैशबोर्ड में दिखने वाला कमांड कुछ ऐसा दिखता है:

curl -sSL https://install.castovia.com/agent | sudo bash -s -- --token YOUR_SERVER_TOKEN

YOUR_SERVER_TOKEN एक unique, single-use token है जो प्रति node generate होता है। यदि उपयोग न हो तो यह 24 घंटे बाद expire हो जाता है.

Agent क्या नहीं करता

स्पष्ट सीमाएँ। Agent को जानबूझकर सीमित दायरे में रखा गया है.

आपके server पर कोई inbound ports नहीं खोलता
आपके firewall rules (iptables, nftables, firewalld) संशोधित नहीं करता
SSH keys इंस्टॉल या संशोधित नहीं करता
आपके server पर अन्य applications को access नहीं करता
Stream content Castovia servers के माध्यम से send नहीं करता (streams आपके network पर ही रहते हैं)
Node पर subscriber personal data store नहीं करता
VPN या special network configuration की आवश्यकता नहीं होती
Initial installation के बाद root के रूप में नहीं चलता

सुरक्षा — बिल्ट-इन, बाद में जोड़ी नहीं गई

हर security measure automatic है। किसी manual configuration की आवश्यकता नहीं.

Server Token Authentication

स्वचालित

हर node को एक unique, cryptographically random server token (256-bit) मिलता है। यह token तब generate होता है जब आप Castovia admin में node बनाते हैं। Registration के दौरान इसका एक बार उपयोग किया जाता है और फिर इसे rotating TLS client certificate से बदल दिया जाता है.

TLS 1.3 Encryption

स्वचालित

Agent और Castovia Cloud के बीच सभी communication में TLS 1.3 का उपयोग होता है। Agent pinned root CA के विरुद्ध Castovia certificate chain को validate करता है — system certificate store पर कोई भरोसा नहीं। Man-in-the-middle attacks संभव नहीं हैं.

Firewall Requirements

स्वचालित

Agent को केवल Castovia Cloud के लिए outbound HTTPS (port 443) चाहिए। कोई inbound ports खोलने की आवश्यकता नहीं है। आपके server की firewall rules अपरिवर्तित रहती हैं — agent iptables, nftables, या firewalld को संशोधित नहीं करता.

Runtime में Root Access की आवश्यकता नहीं

स्वचालित

Agent एक dedicated unprivileged user (castovia-agent) के रूप में चलता है। उसे केवल installation के दौरान root की आवश्यकता होती है (systemd service बनाने के लिए)। Runtime में यह न्यूनतम permissions के साथ चलता है — stream sources के लिए read access, अपनी cache directory के लिए write access.

Automatic Certificate Rotation

स्वचालित

Client certificates हर 7 दिनों में rotate होते हैं। Agent renewal को transparently संभालता है। यदि कोई certificate expire हो जाता है (जैसे server offline था), तो agent एक secure re-enrollment flow का उपयोग करता है जिसके लिए Castovia admin में approval आवश्यक है.

Health Monitoring & Self-Healing

स्वचालित

Agent अपनी health स्वयं monitor करता है। यदि यह crash हो जाए, तो systemd इसे 5 सेकंड के भीतर restart कर देता है। यदि यह Castovia Cloud तक नहीं पहुँच पाता, तो यह cached configuration सेवा देना जारी रखता है और metrics को बाद में भेजने के लिए queue करता है.

Communication Protocol

आपके server और Castovia Cloud के बीच data कैसे flow करता है.

CASTOVIA Cloud → Agent (Configuration Push)

Stream configurations (source URLs, transcoding profiles, recording schedules)
Media serving के लिए Nginx config fragments
Catch-up और timeshift rules
EPG data और channel logos
Package/bouquet assignments
Subscriber entitlement updates

तकनीकी: Configuration signed JSON payloads के रूप में deliver की जाती है। Agent प्रत्येक payload को लागू करने से पहले सत्यापित करता है। कोई raw SQL नहीं, कोई shell commands नहीं — केवल structured configuration.

Agent → CASTOVIA Cloud (Telemetry)

Server health: CPU, RAM, disk usage, network I/O
Stream status: active streams, bitrate, error rates
Recording status: active recordings, storage used, completion status
FFmpeg job results: transcode completion, errors, output file sizes
Viewer connection counts (anonymous aggregate — कोई personal data नहीं)
Agent version और update availability

तकनीकी: Telemetry हर 30 सेकंड में HTTPS POST के माध्यम से भेजी जाती है। Payload compressed (gzip) और encrypted होती है। औसत आकार: प्रति interval 2–5 KB.

Network Summary

पहलूविवरण
ProtocolHTTPS (TLS 1.3) with certificate pinning
Outbound Port443 (केवल HTTPS)
Inbound PortsCASTOVIA द्वारा कोई आवश्यक नहीं
Heartbeatहर 30 सेकंड (compressed 2–5 KB)
AuthenticationRotating TLS client certificates (7-day rotation)
Bandwidthmanagement traffic के लिए < 1 MB/hour
Offline Behaviorcached config serve करता है, telemetry queue करता है, auto-reconnect करता है
Stream Trafficकभी भी Castovia के माध्यम से route नहीं होती — आपके network पर ही रहती है

साफ़ अनइंस्टॉल

यदि आप किसी node को हटाते हैं, तो agent पूरी तरह cleanup करता है:

sudo castovia-agent uninstall --purge
systemd service को रोकता है और हटाता है
/opt/castovia/ से binary हटाता है
/etc/castovia/ से सभी configuration हटाता है
castovia-agent system user हटाता है
Castovia Cloud पर client certificate revoke करता है
कोई leftover files, processes, या cron jobs नहीं छोड़ता