PrintMaster DOCS
GitHub ↗

Configuration Guide

Complete reference for configuring PrintMaster agent and server.

Table of Contents


Configuration Methods

PrintMaster supports multiple configuration methods, applied in this order (later overrides earlier):

  1. Built-in defaults
  2. Configuration file (config.toml)
  3. Environment variables
  4. Database-stored settings (UI changes)
  5. Command-line flags

Configuration File Location

PlatformAgent PathServer Path
WindowsC:\ProgramData\PrintMaster\agent\config.tomlC:\ProgramData\PrintMaster\server\config.toml
Linux/etc/printmaster/agent.toml/etc/printmaster/server.toml
macOS/Library/Application Support/PrintMaster/agent/config.toml/Library/Application Support/PrintMaster/server/config.toml
Docker/var/lib/printmaster/agent/config.toml/var/lib/printmaster/server/config.toml

Or place config.toml in the same directory as the binary.


Agent Configuration

Complete Example

# PrintMaster Agent Configuration

# Asset ID regex pattern for extracting asset tags from device data
asset_id_regex = "\\b\\d{5}\\b"

# Number of concurrent SNMP queries (adjust based on network capacity)
discovery_concurrency = 50

# Enable Epson remote-mode commands (experimental)
epson_remote_mode_enabled = false

[snmp]
  # Default SNMP community string
  community = "public"
  
  # SNMP timeout in milliseconds
  timeout_ms = 2000
  
  # Number of retries for failed SNMP queries
  retries = 1

[web]
  # HTTP port for web UI
  http_port = 8080
  
  # HTTPS port (if TLS enabled)
  https_port = 8443
  
  # Enable TLS/HTTPS
  enable_tls = false
  
  # TLS certificate file (if enable_tls = true)
  # cert_file = "/path/to/cert.pem"
  
  # TLS key file (if enable_tls = true)
  # key_file = "/path/to/key.pem"

[web.auth]
  # Authentication mode: local, server, disabled
  mode = "local"
  
  # Allow admin access from localhost without login
  allow_local_admin = true

[server]
  # Enable server upload mode
  enabled = false
  
  # PrintMaster Server URL
  url = "http://printmaster-server:9090"
  
  # Friendly name for this agent
  agent_name = "Main Office"
  
  # Path to server CA certificate (for self-signed certs)
  ca_path = ""
  
  # How often to upload discovery data (seconds)
  upload_interval_seconds = 300
  
  # How often to send heartbeat (seconds)
  heartbeat_interval_seconds = 60
  
  # Authentication token (if server requires it)
  token = ""

[database]
  # SQLite database path (blank = default location)
  path = ""

[logging]
  # Log level: debug, info, warn, error
  level = "info"

[auto_update]
  # Update mode: inherit, local, disabled
  mode = "inherit"

  [auto_update.local_policy]
    # Days between update checks
    update_check_days = 7
    
    # Version pin strategy: minor, major
    version_pin_strategy = "minor"
    
    # Allow major version upgrades
    allow_major_upgrade = false
    
    # Pin to specific version (blank = latest)
    target_version = ""
    
    # Send telemetry data
    collect_telemetry = true

    [auto_update.local_policy.maintenance_window]
      enabled = false
      timezone = "UTC"
      start_hour = 2
      start_min = 0
      end_hour = 5
      end_min = 0
      days_of_week = ["Sunday"]

    [auto_update.local_policy.rollout_control]
      staggered = true
      jitter_seconds = 300

SNMP Settings

SettingDefaultDescription
communitypublicSNMP v1/v2c community string
timeout_ms2000Query timeout in milliseconds
retries1Retry attempts for failed queries

Tip: If you use a different community string, set it here to avoid manual configuration for each scan.

Web UI Settings

SettingDefaultDescription
http_port8080HTTP port for web interface
https_port8443HTTPS port (when TLS enabled)
enable_tlsfalseEnable HTTPS
cert_file-Path to TLS certificate
key_file-Path to TLS private key

Server Connection Settings

SettingDefaultDescription
enabledfalseEnable server upload mode
url-Server URL (e.g., http://server:9090)
agent_namehostnameFriendly name for this agent
upload_interval_seconds300Full sync interval
heartbeat_interval_seconds60Status ping interval
token-Authentication token
ca_path-CA cert for self-signed server certs

Auto-Update Settings

SettingDefaultDescription
modeinheritinherit, local, or disabled
update_check_days7Days between checks
version_pin_strategyminorminor or major
allow_major_upgradefalseAllow major version jumps

Server Configuration

Complete Example

# PrintMaster Server Configuration

[web]
  # HTTP port
  http_port = 9090
  
  # HTTPS port
  https_port = 9443
  
  # Enable TLS
  enable_tls = false
  
  # Bind address
  bind_address = "0.0.0.0"

[database]
  # Database type: sqlite, postgres
  type = "sqlite"
  
  # SQLite path (if type = sqlite)
  path = "/var/lib/printmaster/server/printmaster.db"
  
  # PostgreSQL connection string (if type = postgres)
  # postgres_url = "postgres://user:pass@host:5432/printmaster"

[logging]
  # Log level: debug, info, warn, error
  level = "info"
  
  # Log file path (blank = stdout only)
  file = "/var/log/printmaster/server/server.log"

[auth]
  # Session timeout in hours
  session_timeout_hours = 24
  
  # Allow registration (multi-tenant mode)
  allow_registration = false

[self_update]
  # Enable server self-update feature
  enabled = true
  
  # Release channel: stable, beta
  channel = "stable"
  
  # Check interval in minutes
  check_interval_minutes = 360

[releases]
  # Max releases to cache
  max_releases = 6
  
  # Poll interval for new releases
  poll_interval_minutes = 240

Database Settings

SQLite (Default):

[database]
type = "sqlite"
path = "/var/lib/printmaster/server/printmaster.db"

PostgreSQL:

[database]
type = "postgres"
postgres_url = "postgres://printmaster:password@localhost:5432/printmaster?sslmode=disable"

Authentication Settings

SettingDefaultDescription
session_timeout_hours24Session expiration time
allow_registrationfalseAllow new user registration

Environment Variables

Both agent and server support environment variable configuration. Variables override config file values.

Common Variables

VariableDescriptionDefault
LOG_LEVELLog level: debug, info, warn, errorinfo
CONFIGPath to config file—
DB_PATHDatabase pathComponent default
PM_DISABLE_SELFUPDATEDisable auto-updatesfalse

Agent Variables

VariableDescriptionDefault
AGENT_CONFIGPath to config file—
AGENT_DB_PATHAgent database path—
WEB_HTTP_PORTHTTP port8080
WEB_HTTPS_PORTHTTPS port8443
WEB_AUTH_MODEAuth mode: local, server, disabledlocal
WEB_ALLOW_LOCAL_ADMINAllow localhost admintrue
SNMP_COMMUNITYSNMP community stringpublic
SNMP_TIMEOUT_MSSNMP timeout (ms)3000
SNMP_RETRIESSNMP retry count2
DISCOVERY_CONCURRENCYConcurrent scans100
SERVER_ENABLEDEnable server modefalse
SERVER_URLCentral server URL—
AGENT_NAMEDisplay nameHostname

Server Variables

VariableDescriptionDefault
SERVER_CONFIGPath to config file—
SERVER_DB_PATHServer database path—
SERVER_HTTP_PORTHTTP port9090
SERVER_HTTPS_PORTHTTPS port9443
BIND_ADDRESSBind address127.0.0.1
BEHIND_PROXYBehind reverse proxyfalse
TRUSTED_PROXIESTrusted proxy CIDRsPrivate ranges
ADMIN_USERInitial admin usernameadmin
ADMIN_PASSWORDInitial admin passwordprintmaster
AUTO_APPROVE_AGENTSAuto-approve agentsfalse
AGENT_TIMEOUT_MINUTESAgent offline timeout5

TLS Variables

VariableDescriptionDefault
TLS_MODEnone, self-signed, acme, manualself-signed
TLS_CERT_PATHCertificate path (manual)—
TLS_KEY_PATHKey path (manual)—
LETSENCRYPT_DOMAINLet’s Encrypt domain—
LETSENCRYPT_EMAILLet’s Encrypt email—
LETSENCRYPT_ACCEPT_TOSAccept ToSfalse

SMTP Variables

VariableDescriptionDefault
SMTP_ENABLEDEnable emailfalse
SMTP_HOSTSMTP server—
SMTP_PORTSMTP port587
SMTP_USERSMTP username—
SMTP_PASSSMTP password—
SMTP_FROMSender address—

Docker Example

environment:
  - ADMIN_PASSWORD=secure-password
  - BIND_ADDRESS=0.0.0.0
  - LOG_LEVEL=info
  - BEHIND_PROXY=true
  - PM_DISABLE_SELFUPDATE=true

systemd Service Example

[Service]
Environment=SERVER_ENABLED=true
Environment=SERVER_URL=https://printmaster.example.com:9443
Environment=AGENT_NAME=office-hq
Environment=LOG_LEVEL=info

Command Line Options

Agent

printmaster-agent [options]

Options:
  -config string
        Path to configuration file
  -port int
        HTTP port (default 8080)
  -data-dir string
        Data directory path
  -log-level string
        Log level: debug, info, warn, error
  -service string
        Service command: install, uninstall, start, stop, run
  -quiet
        Suppress informational output
  -help
        Show help
  -version
        Show version

Server

printmaster-server [options]

Options:
  -config string
        Path to configuration file
  -port int
        HTTP port (default 9090)
  -data-dir string
        Data directory path
  -log-level string
        Log level: debug, info, warn, error
  -help
        Show help
  -version
        Show version

Configuration via Web UI

Most settings can be changed through the web interface:

Agent UI

  • Settings → Discovery: SNMP settings, concurrency
  • Settings → Server: Server connection settings
  • Settings → Updates: Auto-update preferences
  • Devices → IP Ranges: Networks to scan

Server UI

  • Settings → General: Basic server settings
  • Settings → Authentication: User management
  • Settings → Updates: Fleet update policies
  • Settings → Integrations: Webhooks and API

Changes made in the UI are saved to the database and take effect immediately. They override file-based configuration.


Configuration Precedence

When the same setting is configured in multiple places, the last value wins:

  1. Built-in defaults (lowest priority)
  2. Configuration file (config.toml)
  3. Environment variables
  4. Database (UI settings)
  5. Command-line flags (highest priority)

Example: If you set http_port = 8080 in the config file but run with -port 9000, the agent will use port 9000.