Chapter 2 — Web Console

Last Updated: 2026-11-30 14:51 Views: 13

The console is a Vue 3 + Naive UI single-page app embedded in the binary, at http://127.0.0.1:9090. It runs in the master, which handles configuration, reloads and certificates; status, metrics and logs come from workers over an internal socket.

2.1 Sign-in and account security

  • Only users declared in users in conf/manager.toml are accepted; there is no wildcard account. A successful sign-in issues a JWT valid for 24 hours.
  • An IP that fails 5 times within 300 seconds is blocked for 600 seconds; after 3 failures a 4-character image captcha is required.
  • TOTP two-factor authentication is supported (SHA1, 6 digits, 30-second period, ±1 step tolerance). Failed logins, blocks and captcha errors go to logs/manager-login.log.
  • allow_cidr restricts source IPs and networks. Enable trust_proxy only behind a trusted reverse proxy; otherwise X-Real-IP can be forged.

The top-right menu changes the password or signs out. Lost authenticator: wxserver --reset-totp -c /etc/wxserver/wxserver.toml; lost password: --reset-password (add --manager-user with multiple users).

2.2 Navigation and dashboard

The left navigation has nine fixed entries:

Page Purpose
Dashboard Totals, active connections, WAF blocks, 5xx, status/site charts, uptime; one-click reload
Sites Create, edit, enable/disable, delete; saves conf/vhost/{name}.toml
Upstreams Backends, weights, up/down, health checks, stickiness; runtime add/remove, persist
Stream Proxy TCP/UDP forwarding, TLS termination, SNI routing, access control
TLS certificates Upload and inspect expiry; ACME issuance, renewal, status
WAF Engines, CRS rules, exclusions, custom rules, IP lists, CC, block logs
Logs Access, error, WAF, stream, login and audit logs
Modules Built-in and external modules with version, description, load state
Settings Seven tabs: global, HTTP, console, performance, modules/security, OpenTelemetry, raw

2.3 Site editor

The site editor has eight tabs: Basic, Reverse Proxy, Static & Other Rules, HTTPS, WAF, Schedule, Access Control and Advanced. Basic covers name, domains, listeners, root, index and error pages. Reverse Proxy sets proxy_pass, request headers, caching, rate limits and Basic authentication. HTTPS selects a certificate from the store and sets protocols, mTLS and ACME. Schedule sets the weekly open windows (timezone dropdown, weekday checkboxes, time pickers); Access Control sets IP/CIDR allow-deny rules and response rate limits for the whole site.

“Batch directories” scans the site-root subdirectories and generates static locations (with WAF disabled) or just disables WAF, in one pass; it suits a site with many independent directories. Saving validates and hot-reloads immediately; on failure the old configuration keeps serving.

2.4 Other pages

The Upstreams page can take backends down, adjust weights and add or remove servers; tick “Persist” to write changes back. The certificate store has “Certificate Store” and “ACME Certificates” tabs. The WAF page lists all CRS rules and excludes false positives by ID. Logs refresh on demand; auto-refresh polls every 3 seconds.

The “Raw configuration” tab edits any include (nested ones too) and preserves comments and layout on save — handy for bulk changes. For unfamiliar keys, check the “Global” tab first.

2.5 Language and theme

The top bar offers 21 UI languages (including Simplified and two Traditional variants), defaults to English and saves the choice locally. The interface is dark-themed; the sidebar shows version and uptime.

2.6 Console security settings (manager.toml details)

These settings live in conf/manager.toml (0600). Saving in “System Settings → Console” hot-reloads them in-process; the new listen address is bind-checked and TLS certificates are validated before saving.

  • TLS enforced: non-loopback listeners must enable TLS or startup fails; tls = { cert = "manager" } (cert store) or tls = { cert_file, key_file }. Plaintext requires explicit allow_http = true; 127.0.0.1/localhost/ [::1] are exempt.
  • Domain binding: a non-empty domain list validates the Host header; mismatches get 421. Supports exact names and *.suffix.
  • Reverse-proxy limits: requests carrying Forwarded, X-Forwarded-*, X-Real-IP or Via are refused (403) by default. Behind a proxy set trust_proxy = true with a non-empty proxy_cidr (an empty list fails startup/reload — fail closed); peers must belong to proxy_cidr. allow_cidr is always judged by the TCP peer, never by spoofable XFF.
  • Private config boundary: manager.toml and acme.toml are readable only by their own services; a [manager]/[acme] block in the main config or any include is an error (even include = ["*.toml"]).
  • Loopback-only listening + strong password + TOTP is the recommended baseline; a leaked console password exposes at most what the worker user can read, never root-only files.

2.7 App templates and site wizard

New sites can pick from 30+ templates (WordPress, Laravel, Symfony, Yii, ThinkPHP, CodeIgniter, Drupal, Joomla, Nextcloud, MediaWiki, phpMyAdmin, Matomo, …). Templates only generate the site locations (rewrites, try_files, PHP FastCGI, static dirs) — they never download code or create databases:

  • GET /api/apps/templates: template metadata, default PHP-FPM address and locations;
  • GET /api/apps/detect?root=/path: detects installed apps by marker files (wp-config.php, artisan, occ, …);
  • Generated configs include the PHP security baseline: hidden files such as .env/.git are 403 (Nextcloud /.well-known/* exempted), upload dirs forbid script execution, ~* ^.*\.php(/|$) case-insensitive + fastcgi_split_path_info, and derived params keep REQUEST_URI original.
← Previous Article Chapter 1 — Introduction & Quick Start Next Article → Chapter 3 — Sites and Routing

Comments

No comments yet