-
Notifications
You must be signed in to change notification settings - Fork 0
CONFIGURATION en
Version: 0.2.0
Last Updated: 2026-02-11
This document describes all configuration options for OpenCloudTouch backend.
OpenCloudTouch supports 3 configuration methods (in order of precedence):
- Environment Variables (highest priority)
-
Config File (
config.yaml) - Built-in Defaults (fallback)
Configuration is handled by Pydantic Settings with automatic validation.
All environment variables use the OCT_ prefix to avoid conflicts.
| Variable | Type | Default | Description |
|---|---|---|---|
OCT_HOST |
string | 0.0.0.0 |
API bind address (use 0.0.0.0 for Docker) |
OCT_PORT |
int | 7777 |
API port |
OCT_LOG_LEVEL |
enum | INFO |
Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
OCT_DB_PATH |
path | /data/oct.db |
SQLite database file path |
| Variable | Type | Default | Description |
|---|---|---|---|
OCT_DISCOVERY_ENABLED |
bool | true |
Enable SSDP/UPnP auto-discovery |
OCT_DISCOVERY_TIMEOUT |
int | 10 |
SSDP discovery timeout in seconds |
OCT_MANUAL_DEVICE_IPS |
list | [] |
Comma-separated device IPs (fallback) |
Example:
export OCT_MANUAL_DEVICE_IPS="192.168.178.78,192.168.178.79"| Variable | Type | Default | Description |
|---|---|---|---|
OCT_MOCK_MODE |
bool | false |
Use mock devices for testing (no real hardware needed) |
OCT_CORS_ORIGINS |
list | ["*"] |
Allowed CORS origins (comma-separated) |
OCT_MAX_DEVICE_POLL_INTERVAL |
int | 30 |
Device status polling interval (seconds) |
OpenCloudTouch can load configuration from a YAML file.
Mount config file as volume:
docker run -d \
--name opencloudtouch \
--network host \
-v /path/to/config.yaml:/app/config.yaml:ro \
-v oct-data:/data \
opencloudtouch:latestMount via Docker Compose:
# docker-compose.yml
services:
opencloudtouch:
image: opencloudtouch:latest
network_mode: host
volumes:
- ./config.yaml:/app/config.yaml:ro # Read-only
- oct-data:/data# config.yaml - OpenCloudTouch Configuration
# Environment variables take precedence over this file
# Core Settings
host: "0.0.0.0"
port: 7777
log_level: "INFO"
db_path: "/data/oct.db"
# Discovery Settings
discovery:
enabled: true
timeout: 10
manual_ips:
- "192.168.178.78"
- "192.168.178.79"
# CORS Settings
cors:
origins:
- "http://localhost:5173" # Vite dev server
- "https://myapp.example.com"
# Mock Mode (for testing without hardware)
mock_mode: false
# Device Polling
max_device_poll_interval: 30Loading Priority:
-
OCT_PORT=8080(env) overridesport: 7777(config.yaml) -
port: 7777(config.yaml) overrides built-in default7777
# .env.development
OCT_LOG_LEVEL=DEBUG
OCT_MOCK_MODE=true
OCT_DISCOVERY_ENABLED=false
OCT_MANUAL_DEVICE_IPS=192.168.1.100,192.168.1.101# docker-compose.yml
environment:
OCT_LOG_LEVEL: INFO
OCT_DISCOVERY_ENABLED: true
OCT_DB_PATH: /data/oct.db# GitHub Actions / CI
export OCT_MOCK_MODE=true
export OCT_DB_PATH=:memory:
export OCT_LOG_LEVEL=WARNINGOpenCloudTouch validates configuration on startup using Pydantic.
docker logs opencloudtouch
# [INFO] Environment validation passed
# [INFO] Data directory OK
# [INFO] Database exists
# [INFO] Starting application on 0.0.0.0:7777docker run -e OCT_PORT=invalid opencloudtouch:latest
# [ERROR] OCT_PORT must be numeric (got: invalid)
# Exit code: 1Environment Variable:
docker run -e OCT_PORT=8080 -p 8080:8080 opencloudtouch:latestConfig File:
# config.yaml
port: 8080docker run \
-e OCT_DISCOVERY_ENABLED=false \
-e OCT_MANUAL_DEVICE_IPS="192.168.1.10,192.168.1.20" \
opencloudtouch:latestdocker run -e OCT_LOG_LEVEL=DEBUG opencloudtouch:latestdocker run \
-e OCT_DB_PATH=/data/custom.db \
-v /my/data:/data \
opencloudtouch:latestdocker run -e OCT_MOCK_MODE=true opencloudtouch:latestVia Logs:
docker logs opencloudtouch | grep "Starting application"
# [INFO] Starting application on 0.0.0.0:7777
# [INFO] Database: /data/oct.db
# [INFO] Discovery: trueVia API:
curl http://localhost:7777/health
# {"status":"healthy","version":"0.2.0"}Issue: "Data directory is not writable"
# Fix permissions:
docker exec opencloudtouch ls -ld /data
# drwxr-xr-x 2 oct oct 4096 ...Issue: "OCT_LOG_LEVEL must be one of: DEBUG, INFO, ..."
# Valid values only:
export OCT_LOG_LEVEL=INFO # ✅
export OCT_LOG_LEVEL=info # ❌ (case-sensitive!)Issue: Devices not found
# Enable debug logging:
docker run -e OCT_LOG_LEVEL=DEBUG opencloudtouch:latest
# Check logs for SSDP discovery detailsConfiguration is defined in: apps/backend/src/opencloudtouch/core/config.py
from pydantic_settings import BaseSettings, SettingsConfigDict
class AppConfig(BaseSettings):
"""Application configuration with environment variable support."""
model_config = SettingsConfigDict(
env_prefix="OCT_",
case_sensitive=False,
env_file=".env",
env_file_encoding="utf-8"
)
# Core
host: str = "0.0.0.0"
port: int = 7777
log_level: str = "INFO"
db_path: str = "/data/oct.db"
# Discovery
discovery_enabled: bool = True
discovery_timeout: int = 10
manual_device_ips: list[str] = []
# Mock mode
mock_mode: bool = False- Use Environment Variables in Docker - Easier to override per deployment
- Use Config File for Development - Track in Git, share with team
-
Never commit secrets - Use
.env.local(in.gitignore) - Validate on startup - Application fails fast on invalid config
- Document defaults - Users should know what happens without config
🇩🇪 Benutzerhandbuch
🇬🇧 User Guide
Development
API & Architecture
- REST API
- ADR 001 Clean Architecture
- ADR 002 FastAPI App State
- ADR 003 SSDP Discovery
- ADR 004 React/TS/Vite
Technical Reference
Legal