|
| 1 | +# Web UI |
| 2 | + |
| 3 | +AI Marketplace Monitor includes a built-in web interface for editing your configuration and monitoring activity in real time. The web UI starts automatically when you run the monitor — no extra setup needed. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +The web UI provides: |
| 10 | + |
| 11 | +- **TOML Config Editor** with syntax highlighting, powered by CodeMirror |
| 12 | +- **Add / Edit / Delete** config sections (items, AI backends, users, marketplaces) through guided forms |
| 13 | +- **Live Log Streaming** with filtering by level, item, AI score, and text search |
| 14 | +- **Auto-validation** of your config as you type |
| 15 | + |
| 16 | +## Getting Started |
| 17 | + |
| 18 | +Simply run the monitor: |
| 19 | + |
| 20 | +```bash |
| 21 | +ai-marketplace-monitor |
| 22 | +``` |
| 23 | + |
| 24 | +The web UI is available at [http://127.0.0.1:8467](http://127.0.0.1:8467). A startup banner in the terminal shows the URL: |
| 25 | + |
| 26 | +``` |
| 27 | +╭──────────── Web UI ────────────╮ |
| 28 | +│ 🌐 http://127.0.0.1:8467 │ |
| 29 | +│ │ |
| 30 | +│ No password required │ |
| 31 | +│ (local access only). │ |
| 32 | +╰────────────────────────────────╯ |
| 33 | +``` |
| 34 | + |
| 35 | +On localhost, **no password is required**. Open the URL in your browser and start editing. |
| 36 | + |
| 37 | +## Disabling the Web UI |
| 38 | + |
| 39 | +If you don't need the web UI, disable it with: |
| 40 | + |
| 41 | +```bash |
| 42 | +ai-marketplace-monitor --no-webui |
| 43 | +``` |
| 44 | + |
| 45 | +## Changing the Port |
| 46 | + |
| 47 | +To use a different port: |
| 48 | + |
| 49 | +```bash |
| 50 | +ai-marketplace-monitor --webui-port 9090 |
| 51 | +``` |
| 52 | + |
| 53 | +## Advanced: Remote Access |
| 54 | + |
| 55 | +By default, the web UI only listens on `127.0.0.1` (localhost) and requires no password. To access it from another machine on your network, you need to: |
| 56 | + |
| 57 | +1. **Configure credentials** so the web UI is protected by a login screen. |
| 58 | +2. **Bind to a network interface** so other machines can connect. |
| 59 | +3. **Open a firewall port** if your system has a firewall enabled. |
| 60 | + |
| 61 | +### Step 1: Set up username and password |
| 62 | + |
| 63 | +The web UI uses your marketplace credentials for authentication. Set them in your config file: |
| 64 | + |
| 65 | +```toml |
| 66 | +[marketplace.facebook] |
| 67 | +username = "you@example.com" |
| 68 | +password = "your-password" |
| 69 | +``` |
| 70 | + |
| 71 | +Or use environment variables: |
| 72 | + |
| 73 | +```toml |
| 74 | +[marketplace.facebook] |
| 75 | +username = "${FACEBOOK_USERNAME}" |
| 76 | +password = "${FACEBOOK_PASSWORD}" |
| 77 | +``` |
| 78 | + |
| 79 | +Then set the environment variables in your shell before running the monitor: |
| 80 | + |
| 81 | +```bash |
| 82 | +export FACEBOOK_USERNAME="you@example.com" |
| 83 | +export FACEBOOK_PASSWORD="your-password" |
| 84 | +``` |
| 85 | + |
| 86 | +### Step 2: Bind to a network interface |
| 87 | + |
| 88 | +Use `--webui-host` to listen on all interfaces: |
| 89 | + |
| 90 | +```bash |
| 91 | +ai-marketplace-monitor --webui-host 0.0.0.0 |
| 92 | +``` |
| 93 | + |
| 94 | +The startup banner will show all reachable URLs: |
| 95 | + |
| 96 | +``` |
| 97 | +╭──────────────── Web UI ────────────────╮ |
| 98 | +│ 🌐 http://127.0.0.1:8467 │ |
| 99 | +│ 🌐 http://192.168.1.42:8467 │ |
| 100 | +│ │ |
| 101 | +│ user: you@example.com │ |
| 102 | +│ password: (from marketplace config) │ |
| 103 | +│ │ |
| 104 | +│ ⚠ Bound to non-loopback interface. │ |
| 105 | +│ Consider TLS via a reverse proxy. │ |
| 106 | +╰────────────────────────────────────────╯ |
| 107 | +``` |
| 108 | + |
| 109 | +You can also specify a port: |
| 110 | + |
| 111 | +```bash |
| 112 | +ai-marketplace-monitor --webui-host 0.0.0.0 --webui-port 9090 |
| 113 | +``` |
| 114 | + |
| 115 | +> **Note:** If no credentials are configured, `--webui-host` will refuse to start and display an error. This prevents accidentally exposing an unprotected editor on the network. |
| 116 | +
|
| 117 | +### Step 3: Open a firewall port |
| 118 | + |
| 119 | +If your machine has a firewall, open the web UI port. For example, on Ubuntu with `ufw`: |
| 120 | + |
| 121 | +```bash |
| 122 | +sudo ufw allow 8467/tcp |
| 123 | +``` |
| 124 | + |
| 125 | +On macOS, allow incoming connections through **System Settings > Network > Firewall**. |
| 126 | + |
| 127 | +On Windows, add an inbound rule in **Windows Defender Firewall > Advanced Settings**. |
| 128 | + |
| 129 | +> **Warning:** Exposing the web UI on a network means anyone who can reach the port can attempt to log in. Consider using a reverse proxy (nginx, Caddy, Tailscale) with TLS for encrypted connections, especially over untrusted networks. |
| 130 | +
|
| 131 | +## CLI Options Reference |
| 132 | + |
| 133 | +| Option | Default | Description | |
| 134 | +| ----------------------- | ----------- | --------------------------------------------------- | |
| 135 | +| `--webui / --no-webui` | `--webui` | Enable or disable the web UI | |
| 136 | +| `--webui-host` | `127.0.0.1` | Bind address (requires credentials if not loopback) | |
| 137 | +| `--webui-port` | `8467` | Port for the web UI | |
| 138 | +| `--webui-log-retention` | `2000` | Number of log messages kept in memory | |
0 commit comments