Skip to main content

Server Configuration

Complete reference for Sigilweaver Server environment variables. All settings are case-insensitive and can be set via .env file or environment variables.

Core Settings

VariableDefaultDescription
HOST0.0.0.0Server bind address
PORT25811HTTP server port
RELOADfalseEnable hot reload (development only)
LOG_LEVELinfoLogging verbosity: debug, info, warning, error
LOG_FORMATtextLog output format: text or json

Example

PORT=25811
LOG_LEVEL=info
LOG_FORMAT=json # For production log aggregation

CORS Settings

Control Cross-Origin Resource Sharing for browser-based clients.

VariableDefaultDescription
CORS_ORIGINS["http://localhost:25810"]Allowed origins (JSON array)
CORS_MODEdevelopmentdevelopment (permissive) or production (strict)

Example

CORS_ORIGINS=["https://studio.example.com"]
CORS_MODE=production

Execution Limits

Prevent runaway workflows from consuming excessive resources.

VariableDefaultDescription
MAX_EXECUTION_TIME_SECONDS300Maximum workflow execution time (5 minutes)
MAX_MEMORY_MB4096Maximum memory usage (4 GB)
MAX_PREVIEW_ROWS10000Maximum rows returned in preview responses

Authentication

Server supports four authentication modes:

ModeDescriptionUse Case
disabledNo authenticationDevelopment
ephemeralToken generated per sessionDesktop app (Electron)
staticFixed token from environmentSimple deployments
hubToken validated with HubEnterprise/Team

Configuration

VariableDefaultDescription
AUTH_MODEdisabledAuthentication mode
SESSION_TOKEN""Token for ephemeral/static modes
AUTH_PROTECT_DOCStrueRequire auth for /docs and /redoc
AUTH_PROTECT_HEALTHtrueRequire auth for /api/health

Examples

# Development (no auth)
AUTH_MODE=disabled

# Static token (simple deployment)
AUTH_MODE=static
SESSION_TOKEN=my-secret-token-here

# Hub mode (enterprise)
AUTH_MODE=hub
HUB_URL=https://hub.example.com
HUB_SERVER_TOKEN=server-token-from-hub

Hub Integration

When AUTH_MODE=hub, Server validates tokens with Hub and receives credentials just-in-time.

VariableDefaultDescription
HUB_URL""Hub server URL
HUB_SERVER_TOKEN""This server's auth token (from Hub registration)
HUB_REGISTRATION_SECRET""Shared secret for auto-registration

Auto-Registration

If HUB_REGISTRATION_SECRET is set, Server automatically registers with Hub on startup:

AUTH_MODE=hub
HUB_URL=https://hub.example.com
HUB_REGISTRATION_SECRET=shared-secret-with-hub

Hub must have the same secret configured in SERVER_REGISTRATION_SECRET.

File Security

Control which filesystem paths workflows can access.

VariableDefaultDescription
RESTRICT_FILE_ACCESStrueEnable file path restrictions
ALLOWED_FILE_PATHS[]Whitelist of allowed directories (JSON array)

Example

RESTRICT_FILE_ACCESS=true
ALLOWED_FILE_PATHS=["/data/shared", "/data/exports"]
warning

When RESTRICT_FILE_ACCESS=true with an empty ALLOWED_FILE_PATHS, file browsing is disabled. In Hub mode, file access is controlled by Hub filesystem connections.

Cache Settings

Server caches outputs of blocking operations (sort, summarize, join) to avoid re-computation.

VariableDefaultDescription
CACHE_ENABLEDtrueEnable blocking tool cache
CACHE_PATH../.working/server/cacheCache storage directory
CACHE_RETENTION_DAYS7Delete files older than this (0 = forever)
CACHE_MAX_SIZE_GB20.0Maximum total cache size (0 = unlimited)
CACHE_CLEAR_ON_CLOSEtrueClear workflow cache when Studio closes it

Cache Behavior

  • TTL cleanup: Files older than CACHE_RETENTION_DAYS are deleted on startup
  • LRU eviction: If cache exceeds CACHE_MAX_SIZE_GB, oldest files are evicted
  • Workflow close: If CACHE_CLEAR_ON_CLOSE=true, cache is cleared when workflow closes

Example

CACHE_ENABLED=true
CACHE_PATH=/var/lib/sigilweaver/cache
CACHE_RETENTION_DAYS=7
CACHE_MAX_SIZE_GB=50.0

Archive Settings

Server archives workflow executions for audit and debugging.

VariableDefaultDescription
ARCHIVE_ENABLEDtrueEnable workflow execution archiving
ARCHIVE_PATH../.working/server/archivesArchive storage directory
ARCHIVE_RETENTION_DAYS30Auto-cleanup after this many days (0 = forever)

What's Archived

  • Original workflow JSON
  • Execution timing and status
  • Tool execution sequence
  • Error details (if failed)
  • Result summaries

Audit Settings

Audit logging tracks API requests for compliance and debugging.

VariableDefaultDescription
AUDIT_ENABLEDtrueEnable audit logging
AUDIT_PATH../.working/server/auditAudit log directory
AUDIT_RETENTION_DAYS30Cleanup logs older than this (0 = forever)

Parallel Execution

Execute independent tools concurrently for improved performance.

VariableDefaultDescription
EXECUTION_MODEsequentialsequential (safe) or parallel
MAX_PARALLEL_TOOLS4Maximum concurrent tool executions (0 = unlimited)
note

Parallel execution can significantly speed up workflows with independent branches, but uses more memory. Start with sequential and enable parallel after testing.

Safety Limits

Prevent tools from creating outputs that could crash the application or consume excessive resources.

VariableDefaultDescription
SAFETY_MAX_PIVOT_COLUMNS1000Max unique values in pivot "on" column
SAFETY_MAX_CROSS_JOIN_ROWS10000000Max rows from cross join (left × right)
SAFETY_MAX_UNPIVOT_ROWS100000000Max rows after unpivot (rows × columns)

Set to 0 to disable individual limits (not recommended).

Example Error

If a pivot would create 5000 columns but limit is 1000:

Safety limit exceeded: Pivot would create 5000 columns, but maximum is 1000.
Reduce unique values in the "on" column or increase SAFETY_MAX_PIVOT_COLUMNS.

Connection Store

Server can store database connections with encrypted credentials.

VariableDefaultDescription
CONNECTION_ENCRYPTION_KEY""Fernet key for credential encryption
CONNECTION_STORE_PATH../.working/server/connections.jsonConnection storage file

Generating an Encryption Key

python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

Example

CONNECTION_ENCRYPTION_KEY=your-fernet-key-here
CONNECTION_STORE_PATH=/var/lib/sigilweaver/connections.json
warning

Without CONNECTION_ENCRYPTION_KEY, server connections are disabled. Client-owned connections (stored in Studio) still work.

Complete Example

Production-ready configuration:

# Core
PORT=25811
LOG_LEVEL=info
LOG_FORMAT=json

# CORS
CORS_ORIGINS=["https://studio.example.com"]
CORS_MODE=production

# Authentication (Hub mode)
AUTH_MODE=hub
HUB_URL=https://hub.example.com
HUB_SERVER_TOKEN=your-server-token

# Limits
MAX_EXECUTION_TIME_SECONDS=600
MAX_MEMORY_MB=8192
MAX_PREVIEW_ROWS=10000

# Cache
CACHE_ENABLED=true
CACHE_PATH=/var/lib/sigilweaver/cache
CACHE_MAX_SIZE_GB=100.0

# Safety
SAFETY_MAX_PIVOT_COLUMNS=2000
SAFETY_MAX_CROSS_JOIN_ROWS=50000000

# Connections
CONNECTION_ENCRYPTION_KEY=your-fernet-key-here