StavenCTLStavenCTL Doc

Configuration

Configure StavenCTL services and system settings.


StavenCTL stores all runtime settings in a single configuration file.

Configuration File

/etc/stavenctl/config.conf

The installer automatically generates this file during installation.


Configuration Reference

Panel

Controls the web interface.

WEB_HOST=0.0.0.0
WEB_PORT=3000
KeyDescription
WEB_HOSTAddress the web panel listens on.
WEB_PORTPort used by the web interface.

Panel Server

Controls the backend API server.

SERVER_PORT=8080
KeyDescription
SERVER_PORTPort used by the StavenCTL backend server.

Agent

Identifies and authenticates the server with the panel.

NODE_ID=374a3f4b-15e6-4f0e-ad7c-95b67d7405b4
AGENT_TOKEN=hp_tok_xxxxxxxxxxxxxxxxx
KeyDescription
NODE_IDUnique identifier for this server.
AGENT_TOKENAuthentication token used by the agent.

Metrics

Controls how often the agent collects system statistics.

TRAFFIC_INTERVAL=2
SYSTEM_INTERVAL=2
KeyDescription
TRAFFIC_INTERVALNetwork traffic collection interval (seconds).
SYSTEM_INTERVALCPU, memory, and disk collection interval (seconds).

Database

Connection settings for PostgreSQL.

DATABASE_URL=postgres://username:password@127.0.0.1:5432/database?sslmode=disable
KeyDescription
DATABASE_URLPostgreSQL connection string used by the backend server.

Redis

Cache and message broker configuration.

REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
KeyDescription
REDIS_HOSTRedis server hostname or IP address.
REDIS_PORTRedis server port.
REDIS_PASSWORDRedis authentication password (leave empty if disabled).
REDIS_DBRedis database index.

Configuration Permissions

For security, restrict access to the configuration file.

sudo chown root:root /etc/stavenctl/config.conf
sudo chmod 600 /etc/stavenctl/config.conf

Component Overview

ComponentDescription
PanelServes the StavenCTL web dashboard.
ServerProcesses API requests and business logic.
AgentCollects system metrics and manages the server.
MetricsDefines how frequently monitoring data is collected.
PostgreSQLStores all persistent application data.
RedisProvides caching, sessions, queues, and fast messaging.

Sample Configuration

The following example shows a typical config.conf generated by the installer.

########################################
# StavenCTL Configuration
########################################

########################################
# Panel
########################################

WEB_HOST=0.0.0.0
WEB_PORT=3000

########################################
# Panel Server
########################################

SERVER_PORT=8080

########################################
# Agent
########################################

# Unique server identifier
NODE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

# Authentication token issued by the panel
AGENT_TOKEN=hp_tok_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
# Metrics
########################################

# Network traffic collection interval (seconds)
TRAFFIC_INTERVAL=2

# System metrics collection interval (seconds)
SYSTEM_INTERVAL=2

########################################
# Database
########################################

DATABASE_URL=postgres://stavenctl:password@127.0.0.1:5432/stavenctl?sslmode=disable

########################################
# Redis
########################################

REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0

Copy the Configuration

To back up or edit the configuration manually:

sudo cp /etc/stavenctl/config.conf ~/config.conf.backup
sudo nano /etc/stavenctl/config.conf

After making changes, restart the services.

sudo systemctl restart stavenctl-server
sudo systemctl restart stavenctl-agent
sudo systemctl restart stavenctl-nginx

On this page