Server

Server

The Konet Server is an Elixir/Phoenix application packaged as a Docker image. It exposes WebSocket endpoints, handles JWT authentication, tracks presence, and serves the Studio dashboard.

Architecture

┌─────────────────────────────────────┐
│           Konet Server              │
│  ┌─────────┐  ┌─────────────────┐  │
│  │ Bandit  │  │  Phoenix PubSub │  │
│  │ Endpoint│  │  Presence       │  │
│  └────┬────┘  │  RateLimiter    │  │
│       │       │  ChannelRegistry│  │
│       │       └─────────────────┘  │
│  WebSocket /socket                 │
│  HTTP      /api/*                  │
│  LiveView  /studio                 │
└─────────────────────────────────────┘

Environment Variables

VariableRequiredDefaultDescription
KONET_HOSTNolocalhostPublic hostname used in generated URLs
KONET_PORTNo4000HTTP port
KONET_JWT_SECRETYesSecret for token signing
KONET_ANON_KEYNoDefault anonymous key
KONET_SERVICE_KEYNoAdmin service key
SECRET_KEY_BASEYesPhoenix secret

See Configuration for the complete list (limits, webhooks, origins, Studio password).

Configuration File

For local development the CLI manages a konet.config.toml and maps it onto the env vars above when it starts the container:

[server]
host = "localhost"
port = 4000
mode = "docker"
 
[auth]
anon_key = "..."
service_key = "..."
jwt_secret = "..."
secret_key_base = "..."
 
[studio]
password = ""   # empty = no Studio login in local dev

Docker Compose

version: "3.9"
services:
  konet-server:
    build: ./konet-server
    ports:
      - "4000:4000"
    environment:
      KONET_JWT_SECRET: ${KONET_JWT_SECRET}
      SECRET_KEY_BASE: ${SECRET_KEY_BASE}

In this section

  • Configuration — every env var, konet.config.toml, webhooks, metrics
  • Deployment — Coolify, Dokploy, plain VPS, TLS and proxying
  • Studio — the built-in LiveView admin dashboard