Skip to content

Cesivi Configuration Tool

Overview

cesivi-config is an interactive CLI tool for configuring Cesivi Server and WebUI. It provides a menu-driven interface for managing configuration, validation, and sample generation.

Installation

The tool is included in the Cesivi solution:

# Build the tool
dotnet build Cesivi.ConfigTool/Cesivi.ConfigTool.csproj

# Run directly
dotnet run --project Cesivi.ConfigTool

# Or use the built executable
./Cesivi.ConfigTool/bin/Debug/net10.0/cesivi-config

Commands

Interactive Mode (Default)

Run without arguments for the main menu:

cesivi-config
╭───────────────────────────────────╮
│  SPM Config                       │
╰───────────────────────────────────╯
Cesivi Configuration Tool

What would you like to do?
> Configure SPM Server
  Configure WebUI
  Show Current Configuration
  Validate Configuration
  Generate Sample Configuration
  Exit

Configure Command

Interactive configuration wizard:

# Full interactive mode
cesivi-config configure

# Configure SPM Server only
cesivi-config configure --spm

# Configure WebUI only
cesivi-config configure --webui

# Specify custom project paths
cesivi-config configure --spm-path /path/to/server --webui-path /path/to/webui

SPM Server Configuration Options: - Storage Provider (FileSystem, SQLite, LiteDB, InMemory) - Network Settings (HTTP/HTTPS ports, hostname) - Identity Providers (AcceptAll, NTLM, OAuth2, TrustedCaller) - Logging (path) - Trusted Callers (WebUI trust configuration)

WebUI Configuration Options: - SPM Connection (URL, timeout, retries) - Trust Settings (certificate, caller ID) - UI Settings (theme, page size, file preview)

Show Command

Display current configuration:

# Show both SPM and WebUI config
cesivi-config show

# Show SPM config only
cesivi-config show --spm

# Show WebUI config only
cesivi-config show --webui

Example Output:

SPM Server Configuration
════════════════════════════════════

Storage
───────
  Provider: FileSystem
  Data Path: R:/MockData

Network
───────
  HTTP Port: 5000
  HTTPS Port: 5001
  Hostname: mocksharepoint.local
  Use HTTPS: Yes

Identity Providers
──────────────────
  AcceptAll: Enabled (Priority: 1000)
  NTLM: Disabled
  OAuth2: Disabled
  TrustedCaller: Disabled

Source: Cesivi.Server/appsettings.json

Validate Command

Validate configuration files for errors and warnings:

# Validate both
cesivi-config validate

# Validate SPM only
cesivi-config validate --spm

# Validate WebUI only
cesivi-config validate --webui

Validation Checks: - Configuration file exists and is valid JSON - Storage paths exist and are accessible - Port numbers are valid - Certificate files exist (if configured) - URL formats are correct - Required settings are present

Example Output:

Validating SPM Server Configuration
───────────────────────────────────
OK: Configuration file exists: Cesivi.Server/appsettings.json
OK: Configuration file is valid JSON
OK: DataRootPath exists: R:/MockData
OK: HTTP port: 5000
WARNING: Trusted caller 'webui-001' is enabled but has no certificate thumbprint

Validation passed

Generate Command

Generate sample configuration files:

# Generate development configs (default)
cesivi-config generate

# Generate SPM config only
cesivi-config generate --spm

# Generate WebUI config only
cesivi-config generate --webui

# Generate minimal config
cesivi-config generate --minimal

# Generate production-ready config
cesivi-config generate --production

# Specify output path
cesivi-config generate --spm -o my-cesivi-config.json

Profiles: - Development (default): Full configuration with AcceptAll enabled - Minimal: Only essential settings - Production: Secure defaults, HTTPS enabled, AcceptAll disabled

Project Path Detection

The tool automatically detects project paths:

  1. Checks current directory for Cesivi.Server and Cesivi.WebUI
  2. Checks parent directory
  3. Verifies by looking for .csproj and appsettings.json files

Override with:

cesivi-config --spm-path /custom/path/to/server --webui-path /custom/path/to/webui

Environment Variables

Both SPM Server and WebUI support environment variable overrides:

SPM Server

Variable Config Key
CESIVI_DATA_PATH Cesivi:DataRootPath
CESIVI_LOG_PATH Cesivi:LogPath
CESIVI_HTTP_PORT Cesivi:HttpPort
CESIVI_HTTPS_PORT Cesivi:HttpsPort

WebUI

Variable Config Key
WEBUI_SPM_URL SpmClient:BaseUrl
WEBUI_SPM_TIMEOUT SpmClient:TimeoutSeconds
WEBUI_CERT_PATH SpmClient:TrustCertificatePath
WEBUI_CERT_PASSWORD SpmClient:TrustCertificatePassword
WEBUI_CALLER_ID SpmClient:TrustedCallerId

Common Workflows

Initial Setup

  1. Run cesivi-config configure --spm to set up SPM Server
  2. Run cesivi-config configure --webui to set up WebUI
  3. Run cesivi-config validate to verify configuration

Setting Up Trust

  1. Generate certificates: .\Scripts\New-TrustCertificate.ps1
  2. Configure SPM: cesivi-config configure --spm → Trusted Callers
  3. Configure WebUI: cesivi-config configure --webui → Trust Settings
  4. Validate: cesivi-config validate

Production Deployment

  1. Generate production config: cesivi-config generate --production
  2. Review and customize the generated files
  3. Copy relevant sections to your appsettings.json
  4. Validate: cesivi-config validate

See Also